Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos



Vulnerability Development: Re: shellcoding on gentoo

Re: shellcoding on gentoo

From: DJ Ether <hostmaster_at_ethericmist.net>
Date: Tue, 21 Feb 2006 14:30:29 -0500

Try "mov al,1" instead of "mov eax,1". You'll save 2 bytes and shave off
null opcodes if you plan to inject it into a char buffer.

_e

Borja wrote:

> Hi
>
> Lot of ppl tell me that I did not proper zero the EAX register,so 3
> MSB of eax corrupt trapping the syscall, but Its OK.
> I successfully run the shellcodes on a debian box,but in
> gentoo,allways SEGFAULT.
>
> There is it, a new log:
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
> petalo shellcode # cat 1.asm
> BITS 32
>
> ;exit()
> xor eax,eax
> xor ebx,ebx
> mov eax,1
> int 0x80
>
> petalo shellcode # nasm -g -f elf 1.asm
> petalo shellcode # ld 1.o
> ld: warning: cannot find entry symbol _start; defaulting to
> 00000000080480a0
> petalo shellcode # ./a.out
> Segmentation fault
> petalo shellcode # gdb -q a.out
> Using host libthread_db library "/lib/libthread_db.so.1".
> (gdb) break 1
> Breakpoint 1 at 0x80480a0: file 1.asm, line 1.
> (gdb) r
> Starting program: /root/code/shellcode/a.out
>
> Program terminated with signal SIGSEGV, Segmentation fault.
> The program no longer exists.
> You can't do that without a process to debug.
> (gdb) q
>
> petalo shellcode #
> Linux petalo 2.6.12-gentoo-r6 #9 Sat Dec 24 14:37:56 CET 2005 i686 AMD
> Athlon(tm) XP 1600+ AuthenticAMD GNU/Linux
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> I cant explain why SIGFAULT.
> I did not edit any advanced kernel configurations rather than snd card
> and ethernet.
>
> Thanks in advance.
>
Received on Feb 21 2006

[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]
edgeos