Skip to content

0xAJ2K/execve-asm-IA-32

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

COMPILE ASM

Build ASM file, you'll need to do this before getting shellcode.

nasm -f elf32 -o execve.o execve.asm
ld -o execve execve.0

COMPILE C

gcc -m32 -g -fno-stack-protector -z execstack -o exec-shellcode shellcode.c -w

GET SHELLCODE

objdump -d ./execve|grep '[0-9a-f]:'|grep -v 'file'|cut -f2 -d:|cut -f1-6 -d' '|tr -s ' '|tr '\t' ' '|sed 's/ $//g'|sed 's/ /\\x/g'|paste -d '' -s |sed 's/^/"/'|sed 's/$/"/g'

EXAMPLE SHELLCODE

Will execute ifconfig, assuming it is present in /sbin/

\x31\xc0\x50\x68\x6e\x66\x69\x67\x68\x69\x66\x63\x6f\x68\x62\x69\x6e\x2f\x68\x2f\x2f\x2f\x73\x89\xe3\x50\x53\x89\xe1\x31\xd2\xb0\x0b\xcd\x80

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published