Insecure FTP passwords lead to injected PHP scripts
Summary
In August 2005 Manuel Schmitt reports that over one weekend, insecure FTP passwords of web hosting customers were once again exploited to upload and misuse PHP scripts. In such cases manitu disables the accounts and scripts, informs the customers and charges for the night-time effort of about an hour. One customer fiercely denied responsibility, although the FTP logs proved the upload and the password was identical to the user name.
What RFC 2577 says about FTP passwords
RFC 2577 of May 1999 summarises the security problems of FTP. Standard FTP transmits all data and control information, including passwords, unencrypted; anyone who can listen in obtains the credentials.
Against guessing attacks, RFC 2577 recommends limiting the number of password attempts: after three to five failures the server should close the control connection with code 421. A password equal to the user name, however, falls at the first attempt.
Why the server stays unharmed and it still gets expensive
According to Manuel Schmitt, the uploaded scripts do not harm the server itself, but they break the terms of use, and blocking, logging and informing customers cost working time, at night too.
Ideas
- An FTP password identical to the user name offers practically no protection.
- Valid credentials make malicious uploads look like normal customer actions in the logs.
- Incident response covers blocking, preserving evidence, informing and cleaning up.
- Plaintext FTP transmits passwords readable to anyone listening in.
- Limited login attempts slow guessing attacks, but not trivial passwords.
Insights
- Weak tenant accounts create operational effort even without a full server compromise.
- Logs clarify the access path, but not automatically how a password was lost.
- Charging for the effort of an incident requires reliable logs as a basis.
Facts
- The attackers uploaded PHP scripts via regular FTP users.
- The host disabled accounts, blocked scripts and informed affected customers.
- In one case described, the password was exactly the FTP user name.
- RFC 2577 recommends closing the FTP connection after three to five failed attempts.
References
- Manuel Schmitt on Hostblogger: original article (German)
- RFC 2577: FTP Security Considerations (1999)
Recommendations
- Disable FTP in favour of SFTP or FTPS and enforce strong credentials.
- Reject passwords that match the user name when they are set.
- Alert on new executable files and unusual upload sources.
Read the original article on Hostblogger
Found a mistake or have something to add? Get in touch.
Links to the original source and the Web Archive open in a new tab.