3

I'm not even hopeful that this is possible. I'm looking for the string "base64_decode" in PHP files (yes this is to clean up a site that has been hacked). The problem is that this hacker has "hidden" the string like so:

'ba'.'se'.(32*2).'_d'.'eco'.'de'
or
'b'.'as'.'e6'.'4_d'.'ec'.'ode';

And a few other ways.

Therefore I would like to search for the string "decode" or "base" ignoring all the characters in between each letter. I understand this would be very CPU intensive (especially when you have a few hundred MB of files to go through (yes, he hide the code in other files like a GIF image).

Is that even possible?

I know about Sucuri for online website, but if you have other suggestion of tools to scan the files and discover other hacks I'm interested.

1 Answer 1

1
(?:b[^a-zA-Z]*?a[^a-zA-Z]*?s[^a-zA-Z]*?e)|(?:d[^a-zA-Z]*?e[^a-zA-Z]*?c[^a-zA-Z]*?o[^a-zA-Z]*?d[^a-zA-Z]*?e)

You can try this.See demo.

https://regex101.com/r/pG1kU1/17

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.