Connect with us

Hi, what are you looking for?



Iran-Linked Hackers Use Just-in-Time Creation of Weaponized Attack Docs

Researchers Analyzed How the Iran-linked “OilRig” Hacking Group Tests Malicious Documents Before Use in Attacks

Researchers Analyzed How the Iran-linked “OilRig” Hacking Group Tests Malicious Documents Before Use in Attacks

Palo Alto Networks security researchers analyzed the testing process the Iran-linked cyber-espionage group OilRig has engaged in while preparing August 2018 attacks on a Middle-Eastern government.

The attacks targeted individuals of interest with malicious documents designed to deliver BONDUPDATER, a downloader that features DGA (domain generation algorithm) functionality. The attacks were carried out on August 26 and the threat actor created numerous delivery documents the week before, to test anti-virus detection rates. 

Also tracked as APT34 and believed to have ties to the Iran government, OilRig has been active since at least 2014, mainly targeting financial, government, energy, telecoms and chemical organizations in the Middle East. 

The group is known to be testing delivery documents and the TwoFace webshell, and the actor’s newly observed operational tempo shows once again how adversaries use online public anti-virus scanning tools to determine detection rates and find ways to evade them.

In preparation for an attack carried out on August 26, the actor created numerous test documents and submitted them to anti-virus engines just six days before. A total of three waves of testing were performed, to ensure lower detection rates.

The final test document, Palo Alto Networks security researchers reveal, was created less than 8 hours before the delivery document was created. The final document was then delivered to the intended victim via a spear-phishing email within 20 minutes after its creation. 

Advertisement. Scroll to continue reading.

A total of 11 samples were submitted across several public anti-virus testing sites. Interestingly enough, while the test documents were Microsoft Excel spreadsheets, the delivery document was a Microsoft Word file. 

Some of the changes performed to the test documents resulted in an increase in detection rates, but helped the actor determine what specific contents in the file would cause anti-virus detections, which helped them in the creation of the actual delivery document.

While analyzing the file creation and testing patterns, the researchers observed an average of 33 seconds between the file creation times and the testing time and that the author was not concerned about breaking the macro functionality. 

The author also changed functions to run dropped VBScripts, added sleep functionality to evade sandboxes, and also appears to have a preferred string obfuscation technique (replaces a string with each character in hexadecimal form that are concatenated together).

The analysis, Palo Alto Networks says, revealed a series of similarities between the macros in the Excel and Word documents, which suggests that the OilRig hackers “used the macro from the malicious Excel document as the basis for the malicious Word document.”

The actor used the same string obfuscation technique for both macros. The technique was used to obfuscate the “powershell” and “cmd.exe” strings within the embedded VBScript, as well as the built-in shell function. 

The macro was modified for the creation of the delivery document, with the addition of a function meant to save the obfuscated BONDUPDATER PowerShell script to a file. The author also modified the variable used to store the VBScript and removed from the macro the function that displays a hidden spreadsheet containing the decoy content (which was not needed for the Word document). 

“Comparison between what malware is eventually used in active campaigns versus in-development malware allows us to understand what adaptations and modifications were made to each iteration of malware. Additionally, witnessing specific functionality changes within the malware itself, we attempt to make correlations between the new and old functionality,” the security researchers conclude. 

Related: Iranian Hackers Improve Recently Used Cyber Weapon

Related: Iranian Hackers Use New Trojan in Recent Attacks

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Click to comment

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

Join security experts as they discuss ZTNA’s untapped potential to both reduce cyber risk and empower the business.


Join Microsoft and Finite State for a webinar that will introduce a new strategy for securing the software supply chain.


Expert Insights

Related Content


The changing nature of what we still generally call ransomware will continue through 2023, driven by three primary conditions.


As it evolves, web3 will contain and increase all the security issues of web2 – and perhaps add a few more.


A recently disclosed vBulletin vulnerability, which had a zero-day status for roughly two days last week, was exploited in a hacker attack targeting the...


Luxury retailer Neiman Marcus Group informed some customers last week that their online accounts had been breached by hackers.


Zendesk is informing customers about a data breach that started with an SMS phishing campaign targeting the company’s employees.


Satellite TV giant Dish Network confirmed that a recent outage was the result of a cyberattack and admitted that data was stolen.

Artificial Intelligence

The release of OpenAI’s ChatGPT in late 2022 has demonstrated the potential of AI for both good and bad.


A new study by McAfee and the Center for Strategic and International Studies (CSIS) named a staggering figure as the true annual cost of...