Malicious PHP script hides bad stuff inside 'white-space'

Posted by   Virus Bulletin on   Jun 9, 2011

Spaces and tabs used to encode into binary.

Researchers at Kaspersky have discovered a malicious PHP script that uses an inventive way to obfuscate its malicious behaviour.

The script, found on a Polish online store, dynamically adds some remotely linked malicious code into the website's HTML. What is probably more interesting is the way the malware's authors went about obfuscating the script's behaviour.

Apart from an unusual way of using comments - which may initially suggest the code itself is commented out - the code contains what looks like a large amount of white-space. However, upon further inspection, the white-space consists of a mix of spaces and tabs. The script decodes this into a binary string of ones (tabs) and zeroes (spaces), which is then converted to decimal values and then finally into ASCII characters containing the actual bad code.

Malware authors regularly use this kind of obfuscation. At the recent VB Seminar, TrustDefender's Alex Shipp explained this is done to frustrate malware researchers: the extra time they have to spend de-obfuscating the malware to stop its malicious behaviour means the malware can stay undetected for a longer period of time, thus increasing the chances of it being used for its malicious intentions.

More at Kaspersky's SecureList blog here.

Posted on 09 June 2011 by Virus Bulletin



Latest posts:

VB2019 paper: APT cases exploiting vulnerabilities in region-specific software

At VB2019, JPCERT/CC's Shusei Tomonaga and Tomoaki Tani presented a paper on attacks that exploit vulnerabilities in software used only in Japan, using malware that is unique to Japan. Today we publish both their paper and the recording of their…

New paper: Detection of vulnerabilities in web applications by validating parameter integrity and data flow graphs

In a follow-up to a paper presented at VB2019, Prismo Systems researchers Abhishek Singh and Ramesh Mani detail algorithms that can be used to detect SQL injection in stored procedures, persistent cross-site scripting (XSS), and server‑side request…

VB2020 programme announced

VB is pleased to reveal the details of an interesting and diverse programme for VB2020, the 30th Virus Bulletin International Conference.

VB2019 paper: Cyber espionage in the Middle East: unravelling OSX.WindTail

At VB2019 in London, Jamf's Patrick Wardle analysed the WindTail macOS malware used by the WindShift APT group, active in the Middle East. Today we publish both Patrick's paper and the recording of his presentation.

VB2019 paper: 2,000 reactions to a malware attack – accidental study

At VB2019 cybercrime journalist and researcher Adam Haertlé presented an analysis of almost 2000 unsolicited responses sent by victims of a malicious email campaign. Today we publish both his paper and the recording of his presentation.

We have placed cookies on your device in order to improve the functionality of this site, as outlined in our cookies policy. However, you may delete and block all cookies from this site and your use of the site will be unaffected. By continuing to browse this site, you are agreeing to Virus Bulletin's use of data as outlined in our privacy policy.