r/PHPhelp • • Jul 23 '26

Unobsfucating a PHP script

Attackers leveraging the wp2shell exploit added about 22k of obsfucated PHP to index.php on a site I've been asked to have a look at.

Labels and function names are ten random characters and control path is done by jumping to TrQ7yZISyM: etc and there seem to be a lot of (unnecessary?) jumps.

What's the best way to unobsfucate it?

1 Upvotes

31 comments sorted by

View all comments

Show parent comment

1

u/smbarbour Jul 23 '26

Even knowing how it was obfuscated doesn't help in deobfuscation if you don't have a mapping. The only real way to do it is analyzing it from the deepest calls and then assigning names based on what it seems to be doing.

0

u/Evening_Leather5101 Jul 23 '26

if you don't know how it was obfuscated.

Was implying that obviously.

0

u/smbarbour Jul 23 '26

My point is that even if you know how it was obfuscated, there is still no good way to deobfuscate it.

0

u/Evening_Leather5101 Jul 23 '26

You do know what the word "implication" means? Why are you arguing when we agree?

0

u/smbarbour Jul 23 '26

We don't agree, but here...

There is no good way to unobfuscate it if you don't know how it was obfuscated.

FTFY

0

u/[deleted] Jul 23 '26

[removed] — view removed comment

0

u/smbarbour Jul 23 '26

"There is no good way to unobfuscate it if you don't know how it was obfuscated." implies "If you know how it was obfuscated, there is a good way to deobfuscate it." which is false. Hence my comment that even if you know how it was obfuscated, there is still no good way to deobfuscate it.

0

u/[deleted] Jul 23 '26

[removed] — view removed comment

1

u/PHPhelp-ModTeam 9d ago

This post does not follow one or more of the PHPHelp rules and is therefore removed.

0

u/smbarbour Jul 23 '26

I understand that you feel you have correctly implied something, but what you actually wrote was the opposite of that, which I thoroughly explained. I implore you to actually re-read what you wrote.

1

u/[deleted] Jul 24 '26

[removed] — view removed comment

→ More replies