r/PHPhelp • u/SnapSnapGrinGrin • 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?
0
Upvotes
View all comments
Show parent comment
2
u/obstreperous_troll Jul 24 '26
It affected enough to get a remote shell, after which any files could be affected without leaving a trace. Local privilege escalations are common enough that you can assume the system has a rootkit on it. Don't try to be surgical with remediating this: reimage the server and reinstall everything. Your servers should be cattle, not pets.