← back to portfolio
Malware

Qakbot Phishing: Macro Execution and Host Reconnaissance

Category
Malware
Status
Complete
Host
Robert (172.16.17.189)
Method
Email, network & static file analysis
MITRE ATT&CK
T1566 Phishing T1204.002 User Execution T1059.005 Visual Basic T1218.010 Regsvr32 T1059.003 Windows Command Shell T1105 Ingress Tool Transfer T1033 System Owner/User Discovery T1016 Network Configuration Discovery
Executive Summary A Critical alert for suspected Qakbot activity fired on host Robert on 14 July 2023 at 05:32:35 UTC. The trigger was a phishing email, delivered the day before, carrying a 7z archive presented as a presentation. The archive held a macro-enabled Excel workbook, a malicious shortcut (readme.lnk) and a hidden batch script (ad.bat). Shortly after the workbook ran, EXCEL.EXE requested the same .dat file from three different external IP addresses over plain HTTP, while the shortcut launched cmd.exe to run ad.bat — a script that enumerates the user, network, domain and shares, force-terminates two Windows processes and attempts to repair the WebCache database. The behaviour is consistent with Qakbot and an attempt to run malicious code and prepare further compromise. The alert was assessed as a true positive.
Table of Contents
  1. Scenario
  2. Evidence Collected
  3. Timeline
  4. Key Findings
  5. Attack Chain
  6. ad.bat Analysis
  7. Indicators of Compromise
  8. Recommended Actions
  9. Analyst Notes

Scenario

A Critical alert, classified as Data Leakage, fired on workstation Robert (172.16.17.189) on 14 July 2023 at 05:32:35 UTC (08:32:35 +03:00). The first-line analyst had found an email with a suspicious attachment and a ZIP → LNK → BAT execution chain that strongly suggested Qakbot, and escalated the case.

This investigation picks up the escalation: confirm whether the alert is a true positive, trace it back to the delivery email, analyse the attached files, and establish what actually ran on the host.

Evidence Collected

ArtifactValueWhy It Mattered
Phishing emailzirtto@digitalzedi[.]com → robert@letsdefend.io, 2023-07-13 13:39:00, sender IP 201.226.241.213Delivery vector; the gateway action was Allowed
Attachmentform.7zArchive containing the workbook, the shortcut and a hidden script
Workbookform_1484004552-07142023.xls · MD5 f9191123817870609289c3f9f8d4c3c5Macro-enabled workbook; hash for hunting
Macro indicatorsauto_open · hidden sheet content · dynamic formulas · Application.Run · EXEC · regsvr32 -silent ..\Drezd.redAutomatic, concealed execution of payload-related commands
Shortcutreadme.lnk → cmd.exe /c "C:\Users\LetsDefend\Downloads\form\ad.bat"Launches the batch script through cmd.exe
Batch scriptad.bat (hidden)Host, network and domain reconnaissance plus system tampering
Network requestsEXCEL.EXE (PID 4364) → GET /45121.3553172454.dat on 3 hosts, port 80Same payload name requested from three IPs; all permitted by the firewall
WebCache checkAppData\Local\Microsoft\WindowsNo WebCache folder or WebCacheV01.dat found on the evidence left on the endpoint

Timeline

Log-management times are UTC. Sysmon timestamps appear three hours later, which matches the +03:00 offset on the alert.
Time (UTC)EventSource
2023-07-13 13:39:00Phishing email with form.7z delivered; gateway action Allowed (time as recorded in the email)Email security
2023-07-14 05:31:13 – 05:31:19EXCEL.EXE makes normal Microsoft Office connections over HTTPS (officeapps.live.com), with matching DNS lookupsFirewall, Sysmon EID 22
2023-07-14 05:32:00EXCEL.EXE requests /45121.3553172454.dat from 111.90.151.238:80 and 190.14.37.241:80Firewall
2023-07-14 05:32:01EXCEL.EXE requests /45121.3553172454.dat from 84.32.188.11:80Firewall
2023-07-14 05:32:35Alert fires (08:32:35 +03:00)SIEM alert

Key Findings

Attack Chain

Delivery
Phishing email from zirtto@digitalzedi[.]com with form.7z attached, allowed through the gateway.
Execution (workbook)
The workbook macro runs on open, conceals its content and calls payload-related commands, including regsvr32.
Payload Retrieval
EXCEL.EXE requests 45121.3553172454.dat from three external IPs over HTTP port 80.
Execution (shortcut)
readme.lnk starts cmd.exe /c, which runs the hidden ad.bat from the extracted folder.
Discovery
ad.bat enumerates user, environment, ARP, network configuration, domain controller, shares, routes, connections and local groups.
System Tampering
taskhostw.exe and dllhost.exe are force-terminated, then esentutl is run against the WebCache database.

ad.bat Analysis

The batch script is the reconnaissance and preparation stage. Every command below ran from the extracted form folder through the shortcut’s cmd.exe.

CommandPurpose
whoami /allCurrent user, group memberships and privileges
cmd /c setEnvironment variables
arp -aHosts the machine has recently talked to on the local network
ipconfig /allNetwork adapter and DNS configuration
net view /allOther systems and shares visible on the network
nslookup -querytype=ALL -timeout=10 _ldap.tcp.dc._msdc.letsdefendLocates the domain controllers through DNS
net shareShares exposed by this machine
route printRouting table
netstat -naoActive connections and owning process IDs
net localgroupLocal groups
taskkill /IM taskhostw.exe /IM dllhost.exe /FForce-terminates two Windows processes
esentutl.exe /r V01 /l"C:\Users\LetsDefend\AppData\Local\Microsoft\Windows\WebCache" /s"…WebCache" /d"…WebCache"Attempts recovery of the ESE database V01 using the WebCache directories
Inference, not log-confirmed Terminating taskhostw.exe before running esentutl on the WebCache directories suggests an attempt to make the browser database readable. This is read from the commands themselves; no log confirms the intent or the result.

Indicators of Compromise

TypeValueContext
IP (HTTP)111.90.151.238Requested for 45121.3553172454.dat
IP (HTTP)190.14.37.241Requested for 45121.3553172454.dat
IP (HTTP)84.32.188.11Requested for 45121.3553172454.dat
IP (email)201.226.241.213Phishing email sender IP
Emailzirtto@digitalzedi[.]comPhishing sender
SubjectQuestions Creating Delivery Using Open APIsPhishing email
Fileform.7zEmail attachment
Fileform_1484004552-07142023.xlsMacro-enabled workbook
MD5f9191123817870609289c3f9f8d4c3c5form_1484004552-07142023.xls
Filereadme.lnkLaunches cmd.exe /c ad.bat
MD5c868ee195d4ae11ee09c9ea0ec5f4a6dreadme.lnk
File (hidden)ad.batReconnaissance / WebCache script
MD5d868a643d42e435700806d981f597b97ad.bat
Payload name45121.3553172454.datRequested by EXCEL.EXE

Recommended Actions

These are recommendations from the investigation, not findings.

Analyst Notes

Started from the alert and the L1 note, then pivoted to the delivery email to establish how the files reached the host.
Filtered log management on the host IP: normal Office traffic first, then plain-HTTP requests from EXCEL.EXE to three unrelated hosts, all permitted.
Requesting one payload name from three IPs right after the Microsoft connections is typical of a macro working through fallback servers.
Reconciled time zones before building the timeline: log-management times are UTC, Sysmon is three hours later, which matches the alert’s +03:00 offset.
Parsed readme.lnk to confirm it runs cmd.exe /c against ad.bat, and read the strings extracted from the workbook to confirm the macro indicators.
Checked AppData\Local\Microsoft\Windows, the path the script targets, for WebCache data and found none on the evidence left on the endpoint.
The evidence timestamps the workbook’s network activity and the alert, but does not separately timestamp the cmd.exe and ad.bat run, so the order of the two execution paths is not established.