Skip to content

Instantly share code, notes, and snippets.

@Deesen
Last active November 25, 2016 17:09
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Deesen/be019ffe9e5cbdbf30810dbae7025c44 to your computer and use it in GitHub Desktop.
Save Deesen/be019ffe9e5cbdbf30810dbae7025c44 to your computer and use it in GitHub Desktop.
Moved to https://github.com/extras-evolution/evocheck
@voklee
Copy link

voklee commented Nov 18, 2016

Seems great i go test this on one of the hacked sites.

@qlworx
Copy link

qlworx commented Nov 18, 2016

Great idea! Tested on my compromised server, but gives a 404.

--> Oops. Renamed to evohacked.php, works like a charm now.

@Deesen
Copy link
Author

Deesen commented Nov 19, 2016

Improved it quite a lot, now it supports RegEx etc. New screenshots at modxcms/evolution#937 (comment)

@Deesen
Copy link
Author

Deesen commented Nov 20, 2016

Last screenshots at modxcms/evolution#937 (comment)

@Jako
Copy link

Jako commented Nov 24, 2016

Nice Idea, i have improved the search term a bit:

$search_term = $this->search_term ? $this->search_term : '(base64_decode\h*\(|eval\h*\(|system\h*\(|shell_exec\h*\(|<\?php[^\n]{200,}|\$GLOBALS\[\$GLOBALS\[|;\h*\$GLOBALS|\$GLOBALS\h*;)';
  • It looks only for method calls (base64_decode, eval, system, shell_exec).
  • Initial <?php lines with long code (PHP code is hidden in normal text editors without auto line break - finds MODX cache files too).
  • Some $GLOBALS usages not occurring in normal code.

Maybe the code could query a MODX manager account and password instead of having an own password there.

  • \h looks for horizontal spaces (available since PHP 5.2.2).

@Deesen
Copy link
Author

Deesen commented Nov 25, 2016

Thank you Jako, exactly what we needed. We moved the tool to https://github.com/extras-evolution/evocheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment