LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-17-2018, 12:24 PM   #16
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled

Quote:
Originally Posted by l0f4r0 View Post
It's definitely obfuscated but I cannot find the encoding algorithm...
Maybe it's defined in another php page which could import that hbindy.php so I like cantab suggestion.
I think it's been obfuscated twice.
 
Old 12-17-2018, 12:46 PM   #17
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,475

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Quote:
Originally Posted by Habitual View Post
I think it's been obfuscated twice.
Nope, it hasn't. As I said previously it creates a function and then executes the function whenever the script is called.

The function looks like an uploader rather than being directly malicious.

My main thought is that part of the strings tell php to use some form of different encoding rather than normal "english"

Last edited by TenTenths; 12-17-2018 at 12:47 PM.
 
Old 12-17-2018, 01:38 PM   #18
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Could it possibly be embedded pre-compiled PHP bytecode?

https://www.thefreecountry.com/compilers/php.shtml
 
Old 12-17-2018, 04:28 PM   #19
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Rep: Reputation: 290Reputation: 290Reputation: 290
Voila: https://www.unphp.net/decode/f9730be...f424193c5c129/

Last edited by l0f4r0; 12-17-2018 at 04:31 PM.
 
1 members found this post helpful.
Old 12-17-2018, 05:18 PM   #20
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
https://www.reddit.com/r/Wordpress/c..._functions_to/
Quote:
This code is basically a backdoor to run arbitrary PHP code.

The code is passed to this in the form of a cookie sent by the browser. The cookie's data is encrypted (well, obfuscated) using a combination of base64 encoding and a relatively simple xor data mutator.

The cookie consists of a key and a value, the key is the key to decrypt the value, the value ends up being serialized data containing the malicious code to be executed and a password to ensure that the code came from the attacker. The md5 hash of the password is "9f5276b9083cb9d3b4c1217fa504e2aa", the password itself is unknown (it wasn't in any of the online lookup tables I tried).

So yes, this is malicious and not part of any legitimate code.
 
Old 12-18-2018, 01:53 AM   #21
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
thanks to everyone who helped understand & decode that.
i'm flabbergasted.

a question: is all of it valid syntax or is it deliberately sprinkled with gibberish, in a way that the PHP interpreter can skip over it (like a shell script won't necessarily fail if there's some errors in it)?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: PHP Vendor Zend Acquired by Rogue Wave LXer Syndicated Linux News 0 10-06-2015 05:51 PM
Rogue script forensics help NetSaint Linux - Security 3 03-05-2008 12:11 PM
rogue files won't delete mrmike Linux - Newbie 3 05-06-2004 11:55 PM
Sniffing out rogue DHCP servers sewer_monkey Linux - Networking 0 10-17-2003 10:18 PM
Should I set up a "rogue" Linux Machine at Work? -G- Linux - General 8 10-15-2003 09:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration