News for hackers. Stuff that matters.
Re:Alert: Backdoor placed in Piwik by maratd on Tuesday November 27, 2012 @09:34AM (#4837248)
> Makes me wonder if you can simply disable to the 'eval' command in php and avoid all these hacks?

I wish.

> Is it ever used by legitimate scripts?

There are edge cases, but I haven't found a need for it in almost a decade of coding. I really wish there was an option to disable it while compiling the PHP binary or using php.ini ...

Keep in mind, removing eval wouldn't have stopped this hack. It would have simply made it more obvious, since they wouldn't be able to encode/compress their injected code.

Re:Alert: Backdoor placed in Piwik by Xylakant on Tuesday November 27, 2012 @11:00AM (#4837488)
There are some legitimate uses. The pear SOAP library used it to generate access classes based on WSDL-Files - don't know if they still do that.

Anyways, disabling eval doesn't buy you much: If you really want to execute code, write it to a file and then require that file. You can plug that one by making all directories you can load code from unwriteable, but then I could just go and call create_user_func() which is eval in disguise.

Re:Alert: Backdoor placed in Piwik by nivla on Tuesday November 27, 2012 @02:28PM (#4838372)
>disabling eval doesn't buy you much: If you really want to execute code, write it to a file and then require that file.

Eval is used by most attackers to avoid detection. A one liner add to the end of a legitimate random php file along with extra padding to push it off the screen will make most users to miss it.

Creating directories and files not only requires appropriate permissions but is also more susceptible to be noticed by a user browsing through them.

Re:Alert: Backdoor placed in Piwik by Xylakant on Wednesday November 28, 2012 @05:39AM (#4841873)
Do you really think anybody would have noticed a "include 'common/footer.php'" at the end of the file? If you have write access to the download tarball, all is lost. Disabling eval on the deploy machine doesn't buy you anything. In general: If you can write to any file in the deployed app, every bet is off - eval or not. Disabling eval helps you in cases where the legitimate code uses eval and can be tricked into passing code snippets of your choice to the call.
Re:Alert: Backdoor placed in Piwik by maratd on Tuesday November 27, 2012 @02:38PM (#4838447)