Jump to content
Gonzalez

Simple hello world Asm shellcode

Recommended Posts

Posted

[SECTION .text]

global _start

_start:
jmp short ender
starter:

xor eax, eax
xor ebx, ebx
xor edx, edx

inc ebx
mov al,4
pop ecx ; eax = 4, ebx = 1, edx = len, ecx = pop
mov dl, len
int 0×80

xor eax, eax
inc eax ; Quit the shellcode.
int 0×80

ender:
call starter
db “hello shellcoder =)”,0×0a ; Call the message.
len equ $-ender ; Sh0ck - shock@k.st

[root@shock Desktop]# $ file=hello; od -An -j96 -N$(($(echo 0x$(readelf -t $file 2>&1 | awk ‘/.text/ {getline; print $4}’)))) -w$(($(echo 0x$(readelf -t $file 2>&1 | awk ‘/.text/ {getline; print $4}’)))) -tx1 $file | sed -e ’s| |\\x|g

\xeb\x13\x31\xc0\x31\xdb\x31\xd2\x43\xb0\x04\x59\xb2\x19\xcd\x80\x31\xc0\x40\xcd\x80\xe8\xe8\xff\xff\xff\x68\x65\x6c\x6c\x6f\x20\x73\x68\x65\x6c\x6c\x63\x6f\x64\x65\x72\x20\x3d\x29\x0a

[root@shock Desktop]# $ file=hello; echo $(($(echo 0x$(readelf -t $file 2>&1 | awk ‘/.text/ {getline; print $4}’))))

46 Bytes.

Enjoy =)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...