Macro Pack – Automatize Obfuscation and Generation of Malicious Office Documents

Malware delivery trends change every day. For the last few years, we have observed various hacker groups like ( APT12 to Turla ) uses various techniques to deliver malware on the system or network.

One of the best technique hackers groups used is to write malicious code and obfuscate it and embed with Office documents and deliver to the victim through Social engineering ( Spearphishing Attachment ).

Lack of user awareness results with (Compromising the system to lateral movement in the network). Let’s check out the tool Macro pack to do some automation in embedding malicious code into Office Documents.

Here we have used Kali Linux(Attacker Machine) and Victim Machine (Windows 10)

You can Download the Macro Pack from GitHub.

Attacker Machine:-

  • Metasploit is a very good tool to understand the attack logic and infect Word or Excel documents with malicious Metasploit payloads.
  • Let me generate the malicious VBA code with Msfvenom.
  • Here I have crafted a payload for VBA which can be embedded into Office Document and once a victim opens a malicious DOCX file, reverse connection should connect back to attacker machine to access and control victim workstation on port 443.

Generation of Weaponized Document:

-f = input-file=INPUT_FILE_PATH A VBA macro file or file containing params

-o = obfuscate Same as ‘–obfuscate-form –obfuscate-names –obfuscate-strings

-G = generate=OUTPUT_FILE_PATH.

  • Most anti-virus programs can easily read the attacker’s raw code and block, so I used -o parameter to obfuscate malicious VBA payload.
  • Decoding the obfuscated code is quite challenging for most Anti-virus vendors.
  • Now your Weaponized document is ready to fly!

Starting Metasploit:

  • As soon as the victim clicks the malicious document “hikeletter.docx”, Attacker should get full access to the victim workstation.

Attacker Accessing Victim Workstation:

  • Victim compromised and full access to the system obtained! Shell! Shell! Shell!
  • According to below MITRE ATT&CK Matrix, an attacker can do lateral movement to the exfiltration of data.

Virus Total Analysis:

  • I have uploaded this file to Virus total and found detection for 29/60. Other vendors say this document as clean or undetected category.

File-less malware’s are challenging and evolving faster. Windows utility ( Powershell) is abused in later stages to run an executable on the system local storage or run the code into memory itself.

Implement best endpoint solutions, Email Security products to block unsolicited emails or files. Spread awareness to employees with internal phishing exercises.

Happy Hacking!

You can follow us on LinkedinTwitterFacebook for daily Cybersecurity and hacking news updates


Recent Posts

Alert! Palo Alto RCE Zero-day Vulnerability Actively Exploited in the Wild

In a recent security bulletin, Palo Alto Networks disclosed a critical vulnerability in its GlobalProtect Gateway, identified as CVE-2024-3400. This…

2 days ago

6-year-old Lighttpd Flaw Impacts Intel And Lenovo Servers

The software supply chain is filled with various challenges, such as untracked security vulnerabilities in open-source components and inconsistent update…

2 days ago

Hackers Employ Deepfake Technology To Impersonate as LastPass CEO

A LastPass employee recently became the target of an attempted fraud involving sophisticated audio deepfake technology. This incident underscores the…

2 days ago

Sisence Data Breach, CISA Urges To Reset Login Credentials

In response to a recent data breach at Sisense, a provider of data analytics services, the U.S. Cybersecurity and Infrastructure…

2 days ago

DuckDuckGo Launches Privacy Pro: 3-in-1 service With VPN

DuckDuckGo has launched Privacy Pro, a new subscription service that promises to enhance user privacy across the web. This innovative…

2 days ago

Cyber Attack Surge by 28%:Education Sector at High Risk

In Q1 2024, Check Point Research (CPR) witnessed a notable increase in the average number of cyber attacks per organization…

2 days ago