0% found this document useful (0 votes)
2 views7 pages

Hello World Shellcode

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views7 pages

Hello World Shellcode

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Hello world shellcode

Hello world shellcode


section .data
string_msg: db ”Hello World”,0xa

section .text
global _start
_start:

mov rax,1
mov rdi,1
mov rsi,string_msg
mov rdx,12
syscall
Hello world shellcode
section .data
string_msg: db ”Hello World”,0xa

section .text
global _start
_start:
We cannot use
mov rax,1 hardcoded addresses
mov rdi,1 of our hello world string
mov rsi,string_msg
mov rdx,12
syscall
JMP CALL POP technique

We use jmp call pop technique which uses stack memory to load the addresse of
our hello world string in our text section using pop instruction

section .text
global _start
_start:

jmp one

shellcode:

pop rsi

1 mov rax,1
mov rdi,1
mov rdx,12
syscall

one:

call shellcode

string_msg: db ”Hello world”,0xa


Stack memory
JMP CALL POP technique

We use jmp call pop technique which uses stack memory to load the addresse of
our hello world string in our text section using pop instruction

section .text
global _start
_start:

jmp one

shellcode:

pop rsi

1 mov rax,1
mov rdi,1
mov rdx,12
syscall

one:
Call stores the
call shellcode
address of
string_msg on string_msg 0xabcd
2 stack before string_msg: db ”Hello world”,0xa
jumping to Stack memory
shellcode
JMP CALL POP technique

We use jmp call pop technique which uses stack memory to load the addresse of
our hello world string in our text section using pop instruction

section .text
global _start
_start:

jmp one

shellcode:

pop rsi

1 mov rax,1
mov rdi,1
mov rdx,12
syscall

one:
Call stores the
call shellcode
3
address of
string_msg on string_msg 0xabcd
2 stack before string_msg: db ”Hello world”,0xa
jumping to Stack memory
shellcode
JMP CALL POP technique

We use jmp call pop technique which uses stack memory to load the addresse of
our hello world string in our text section using pop instruction

section .text
global _start
_start:

jmp one
string_msg address
shellcode: will be stored from
the stack to rsi
using pop
pop rsi
4
1 mov rax,1
mov rdi,1
mov rdx,12
syscall

one:
Call stores the
call shellcode
3
address of
string_msg on string_msg 0xabcd
2 stack before string_msg: db ”Hello world”,0xa
jumping to Stack memory
shellcode

You might also like