一个windows下的ddos样本

一个windows下的ddos样本。

加载器

程序运行之后会在临时目录释放出一个256_res.tmp的文件

 

之后将该文件移动至system32目录下,以rasmedia.dll命名。

 

删除原文件。

 

加载开始释放的dll文件,并调用该dll导出的install函数。

 

Rasmedia.dll

函数install会将将该dll注册成一个服务WinHelp32。

 

具体如下

 

服务运行之后会有两个线程开启。

一个线程用于和远端服务器进行通信。

一个线程会将自身拷贝到内存中,当发现映像文件被删除,会将自己再次拷贝。

该函数用于实现循环写保护。

 

另一个线程用于和远端的服务器进行通信,其交互的主要过程在函数StartAddress中。

函数一开始会解密出其中的远端服务器地址fabao.309420.com:7002,其对应的ip为61.147.107.79。为江苏省扬州的一个ip地址。

 

之后获取当前系统信息,加密之后发送至远端服务器。

 

加密算法还原如下:

 

发送的数据包如下一共96字节。

 

之后接受远端服务器的控制包。

该数据结构如下:

 

command为远端的控制指令。

accack为数据包长度,同时也作为攻击的判断符。

target_url为攻击的目标url。

port为攻击目标的端口。

attack_message为定制攻击数据载荷。

其中接受的command如下所示,其中包含远程执行命令,下载文件等操作,但是可以发现主要功能还是以ddos为主。

 

可以看见此处0x41000001,0x32000004,0x32000001,0x31000005为复合式指令,肉鸡收到该命令后会对目标进行多种类型的ddos攻击,其余的ddos指令各自对应一种ddos攻击。

此处为接收到的返回包。一共为228个字节,此时的数据为加密状态。

 

通过以下函数实现解密,可以发现解密数据的开始即为32000020,此处为一个ddos,命令。该命令的攻击目标

 

继续解密之后的target_url字段可以发现返回的是一个攻击目标的字段,该处为http://code.moquta.com

 

在提供的ddos攻击策略中有多重攻击模式,此处以32000020举例,该ddos通过http get请求实现攻击,该请求包在代码中已经写好模板,具体如下:只需要填写target,host和refere即可。

 

可以看到该模式选择由v1偏移208的端口字段指定端口,默认为80。

 

可以看到此处我们的返回包该偏移为0x50(多一个0是解密脚本的原因)。

 

此处即为发送的攻击包。

 

各种方式的攻击包

其中rand是一个随机数生成器。

0x31000001

fun_createthread_sockrandipsend

send_package{

gerneration with 5byte 8 times

}

length:40

one turn 100 time

0x31000002

fun_createthread_sockheapsendto

package{

+2 cout(start with 0)

+6 0

+8 tickcount

}encrypt_by_sub_10005480

length = 4096

one turn 65534 package

0x41000001

fun_createthread_sockrandtentimesendto

send_package{

buf(generation by rand(97,122))

}

length 30

one turn 1000 package

count % 10 sleep

 

0x31000005

fun_createthread_sockrandsend

send_package{

buf((byte)generation by rand(0,255)<<16)

}

length 1024

one turn all the time

 

fun_createthread_sockconnect1

send_package{

connect

}

one ture one package

then sleep

 

fun_createthread_sockconnect2

send_package{

connect

}

one turn 200 package connect and close

 

0x37000001

fun_createthread_sockendcontainsend

send_package{

buf(command_package[212,228])

}

length 16

one turn all the time

0x33000001

fun_creathethread_sockrandwithcountsend

send_package{

buf(#%d<<<<<I@C<<<<<%s! count,generation with rand(65,122))

}

length rand(20,120)

one turn 6500

0x31000003

fun_callback_sockrandthousandtimesendto

send_package{

buf((int)(generation with rand(97,122)<<16)*512*4)

}

length:2048

one turn 1000 time

 

0x32000004

fun_createthread_socksend_withoutref_httpone

send_package{

80

'GET %s?=%d HTTP/1.1'

'User-Agent: Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www'

'.baidu.com/search/spider.html)'

'Host: %s'

'Cache-Control: no-cache'

'Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www.baidu.com/s'

'earch/spider.html)

 

GET %s?=%d HTTP/1.1'

'User-Agent: Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www'

'.baidu.com/search/spider.html)'

'Host: %s:%d'

'Cache-Control: no-cache'

}

Length:buff

one turn all the time

 

0x32000001

fun_createthread_socksend_withoutref_httptwo

send_package{

80

'GET / HTTP/1.1'

'Host: %s'

'User-Agent: Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www'

'.baidu.com/search/spider.html)'

'Cache-Control: no-cache'

'Connection: Close'

for other port

'GET / HTTP/1.1'

'Host: %s:%d'

'User-Agent: Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www'

'.baidu.com/search/spider.html)'

'Cache-Control: no-cache'

'Connection: Close'

}without_referer

length:buff

one turn all the time

 

0x32000001

fun_createthread_socksend_onlyhost_http

send_package{

80

'GET / HTTP/1.1'

'Host: %s'

for other port

'GET / HTTP/1.1'

'Host: %s:%d'

}

length:buf

one turn all the time

 

0x36000001

fun_createthread_socksend_withref_httpone

send_package{

80

'GET %s HTTP/1.1'

'Host: %s'

'User-Agent: Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www'

'.baidu.com/search/spider.html)'

'Cache-Control: no-store, must-revalidate'

'Referer: http://%s'

'Connection: Close'

for other port

'GET %s HTTP/1.1'

'Host: %s:%d'

'User-Agent: Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www'

'.baidu.com/search/spider.html)'

'Cache-Control: no-store, must-revalidate'

'Referer: http://%s'

'Connection: Close'

}

Length:buff

one turn all the time

 

0x32000002

fun_createthread_socksend_withref_httptwo

send_package{

80

'GET %s HTTP/1.1'

'Host: %s'

'User-Agent: Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www'

'.baidu.com/search/spider.html)'

'Cache-Control: no-store, must-revalidate'

'Referer: http://%s'

'Connection: Close'

for other port

'GET %s HTTP/1.1'

'Host: %s:%d'

'User-Agent: Mozilla/5.0 (compatible; Baiduspider/2.0; +http://www'

'.baidu.com/search/spider.html)'

'Cache-Control: no-store, must-revalidate'

'Referer: http://%s'

'Connection: Close'

}

length:buf

one turn all the time

posted @ 2016-05-01 18:41  goabout2  阅读(1048)  评论(0编辑  收藏  举报