Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So, someone got access to write to arbitrary files on your server. I assume you've cleaned up the exploit that let them in already.</p> <p>The problem is, while the <code>eval(base64_decode</code> stuff is obvious, and has to go, the intruder could have put other stuff in there. Who knows, maybe he deleted a <code>mysql_real_escape_string</code> somewhere, to leave you vulnerable to future SQL injection? Or a <code>htmlspecialchars</code>, leaving you vulnerable to JavaScript injection? Could have done anything. Might not even be PHP; you sure no JavaScript was added? Or embeds?</p> <p>The best way to be sure is to compare to a known-good copy. You do have version control and backups, right?</p> <p>Otherwise, you can indeed use <code>perl -pi -e</code> to do a substitute on that PHP code, though matching it might be difficult, depending. This might work (work on a copy!), and adjust spacing in the regexp as needed:</p> <pre><code>perl -pi -e 's!&lt;\?php eval\(base64_decode\(.*?\)\) \?&gt;!!g' *.php </code></pre> <p>but really, you should review each file by hand, to confirm there are no other exploits present. Even if your last known-good copies are somewhat old, you can review the diffs.</p> <h2>edit:</h2> <p>Ok, so it sounds like you don't want to nuke the whole PHP block, just the eval line:</p> <pre><code>perl -pi -e 's!eval\(base64_decode\(.*?\)\);!!g' *.php </code></pre> <p>You may want to add a <code>\n</code> before the first <code>!</code> if there is additionally a newline to kill, etc. If the base64 actually has newlines in it, then you will need to add <code>s</code> after the <code>g</code>.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload