Skip to content

Commit 8fd4aed

Browse files
Add files via upload
1 parent c6b9360 commit 8fd4aed

File tree

6 files changed

+640
-0
lines changed

6 files changed

+640
-0
lines changed
652 Bytes
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
; Program Name: Helloworld_shellcode.nasm
2+
; Author: Kunal Varudkar
3+
4+
; Purpose: Understanding the JMP-CALL-POP technique to dynamically use the memory address for shell coding :)
5+
6+
7+
global _start
8+
9+
10+
section .text
11+
12+
_start:
13+
14+
JMP short call_shellcode
15+
16+
shellcode:
17+
18+
; print code
19+
20+
xor eax, eax ; xor-ing to omit bad character (0x00) in op-code
21+
mov al, 0x4 ; sys call for printf
22+
23+
xor ebx, ebx
24+
mov bl, 0x1 ; stdout=1
25+
26+
pop ecx ; poping the the address of next instruction into ecx
27+
28+
xor edx, edx
29+
mov dl, 27 ; length of message
30+
int 0x80 ; calling interrupt to execute syscall
31+
32+
; exit code
33+
34+
xor eax, eax
35+
mov al, 0x1 ; syscall for exit
36+
int 0x80 ; calling interruptto execute syscall
37+
38+
call_shellcode:
39+
40+
call shellcode
41+
message: db "Hello world in shellcode!!", 0xA
Binary file not shown.

0 commit comments

Comments
 (0)