Overview
This week, the Sonicwall Capture Labs threat research team analyzed a new Golang malware sample. It uses multiple geographic checks and publicly available packages to screenshot the system before installing a root certificate to the Windows registry for HTTPS communications to the C2. There is currently no malware family affiliated, but the IP and URL addresses have been used by AgentTesla, GuLoader, PureLog Stealer and others.
Technical Analysis
The sample is detected as a Golang 64-bit executable with a WinAuth certificate. The timestamp has been tampered with, as it shows a creation date of December 31, 1969.
Figure 1: Sample detection with Detect It Easy
The certificate listed is issued from ‘RUNNINGWITHSCISSORS LTD’ but does not have an issuer signatory.
Figure 2: There is no signer, email or creation date with this certificate
Looking at the sample, one section included is non-standard, .symtab; this section is associated with ELF/Linux files and should not be on a Windows executable.
Figure 3: This is a Linux file-type section and would not be accessed by normal means
Because of the way Golang compiles binaries, the program had to have the gopcln table reconstructed in order to see the inner workings of the file.
Figure 4: Malware functions in cleartext
Once done, there are several items of note. Newly renamed functions list out the primary methods of . The strings show a pattern that looks to be used to send system information to the attacker – this is confirmed later. This pattern contains information for a system UUID, remote IP, username, hostname, Windows version, process ID, process name and architecture.
Figure 5: There is an ASCII pattern for information that may be sent to the attacker
Next, the packages reveal that the author is using public GitHub applications from the following repositories to generate and save screenshots:
Figure 6: These GitHub packages are public and are not malicious on their own
During runtime, the malware will start by querying main system information using process injection via VirtualAlloc and running WMIC. The following two commands are run first:
- ‘SELECT UUID FROM Win32_ComputerSystemProduct’
- C:WindowsSystem32conhost.exe C:Windowssystem32conhost.exe 0xffffffff -ForceV1
Next, these registry keys are queried for the Windows version and hostname:
- HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersion
- HKEY_LOCAL_MACHINESYSTEMControlSet001ServicesTcpipParameters
When attempting to control/open WMIC, the sample looked in the following locations, as well as trying to find a file with an unusual name:
- C:UsersuserDesktop
- C:Program Files (x86)Common FilesOracleJavajavapath
- C:Windows
C:Windowssystem32 - C:WindowsWbem
Figure 7: Sample of locations WMIC is searched for along with an unusual file
Once WMIC has been launched, both the main executable and WMIC will load, or attempt to load, the following DLLs:
Apphelp.dll
Cryptbase.dll
Winmm.dll
Powrprof.dll
Umpdc.dll
Userenv.dll
Profapi.dll
Netapi32.dll
Wkscli.dll
Netutils.dll
Samcli.dll
Samlib.dll
Iphlpapi.dll
Dhcpcsvc6.dll
Dhcpcsvc.dll
Dnsapi.dll
Mswsock.dll
Rasadhlp.dll
Fwpuclnt.dll
Msasn1.dll
Cryptsp.dll
Rsaenh.dll
Gpapi.dll
Framedynos.dll
Sspicli.dll
Kernel.appcore.dll
Wbemcomm.dll
Msxml6.dll
Urlmon.dll
Iertutil.dll
Srvcli.dll
Uxtheme.dll
Vcruntime140.dll
Vcruntime140_1.dll
Amsi.dll
Vbscript.dll
sxs.dll
The majority of these were not used during testing, which means that they may be used after initial contact is made with the C2 for further data collection or additional malware utilities.
Figure 8: Sample listing of DLLs searched for by the trojan
When the sample reaches out on the network, it attempts to get an IP using ‘ip-api.com/json’ and to make initial contact with the C2 at ‘https://daily-mashriq[.]org/goyxdrkhjilchyigflztv’ using a ping.
Once those steps are complete, the malware installs a new root certificate by overriding data in the following registry key using ‘CertGetCertificateChain’:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftSystemCertificatesROOTCertificates3F728A35DE52B2C8994A4FB101A03B95E87B06C8
Figure 9: Previous data being overwritten by the new certificate
Although the main functions go into detail about screenshots, there are also API calls in memory for tracking other Windows events. These are monitored with SetWindowsHookExW and TrackMouseEvent. Screenshots are created using the GitHub packages previously mentioned.
Figures 10, 11: Code showing that the ‘kbinani’ takes the screenshot, then ‘fogleman’ saves it.
Network connection to ‘daily-mashriq[.]org’ is attempted with the previously discovered pattern containing information encoded with chacha20 and sent using User-Agent “AGCYRNRWWWFZZSWWFWDYDCVDN”:
Figure 12: Encoded information sent to the C2
However, after the initial message has attempted to POST, subsequent messages only include the UID and are sent every seven seconds.
Figure 13: Repeated POSTS only contain the UID
The following ports are also bound for listening: 49708-49711, 49720-49730, and 49733-49750.
As of this writing, it appears that the domain has been blocked by (CHECK THIS).
SonicWall Protections
SonicWall Capture Labs provides protection against this threat via the following signature:
- MalAgent.Go.Trojan
IOCs
- 8f4cf379ee2bef6b60fec792d36895dce3929bf26d0533fbb1fdb41988df7301
- https://daily-mashriq.org/goyxdrkhjilchyigflztv
- http://ip-api.com/json/
MITRE TTP :
- Execution: Command and Scripting Interpreter (T1059) – The malware uses process injection via VirtualAlloc and runs WMIC commands to gather system information.
- Persistence: Registry Run Keys / Startup Folder (T1547.001) – The malware establishes an autorun registry key for persistence.
- Defense Evasion: Masquerading (T1036) – The malware renames legitimate programs like KeyScrambler.exe and uses a screensaver executable for initial infection.
- Defense Evasion: DLL Side-Loading (T1574.002) – The malware sideloads a malicious DLL (KeyScramblerIE.dll) using a signed binary from QFX Software Corporation.
- Credential Access: OS Credential Dumping (T1003) – The malware attempts to extract system UUID and other sensitive information using WMIC commands.
- Discovery: System Network Configuration Discovery (T1016) – The malware queries registry keys for the Windows version and hostname.
- Command and Control: Application Layer Protocol (T1071) – The malware communicates with its C2 server over HTTPS and uses a custom User-Agent string for HTTP requests.
- Command and Control: Web Service (T1102) – The malware uses a domain (daily-mashriq[.]org) for C2 communication.
- Exfiltration: Exfiltration Over C2 Channel (T1041) – The malware sends encoded system information to the C2 server using HTTP POST requests.
- Exfiltration: Data Encrypted (T1022) – The malware uses chacha20 encryption to encode the data before exfiltration.
Source: https://blog.sonicwall.com/en-us/2024/03/new-golang-trojan-installs-certificate-for-comms-evasion/