Re:Hacking Stephen Fry's Twitter Account
by alain94040 on Monday December 28, 2009 @02:57PM
(#1019255)
Can anyone explain the injection part? I didn't understand how getting the passwd file helped in any way with injecting a php error, and why code got executed in the end.
[ Parent
| on HN ]
The passwd file didn't help, it just showed him that he could retrieve arbitrary files via an open/improperly escaped PHP include().
His injected worked by causing an error to be written to a log, and then reading that log back through the PHP include. The error that was logged contained an arbitrary string (the HTTP request, with the malicious PHP code), which was executed by the server.