The code starts with an echo, of an eval (evaluate php code?) of a base64_decode( and then a bunch of str_replaces… and then thousands upon thousands of characters.
The reason for the encoding and string replacing is to bypass antivirus… This works as every transmit can have a new “key” and hence the payload is a new payload… the antivirus doesn’t have a signature to pick out !
Looks like it’s this thing. Seems pretty comprehensive - does pretty much everything. The last hack I had to clean up (from a client’s server previously “managed” by someone else) just slapped a fake Flash upgrade page in /var/www.