aboutsummaryrefslogtreecommitdiff
path: root/shellcode
diff options
context:
space:
mode:
authortoni <toni@devlap.local>2014-11-07 16:03:49 +0100
committertoni <toni@devlap.local>2014-11-07 16:03:49 +0100
commiteb11930786ee5a1cc4fc4f23b5cbe66142fd5c8b (patch)
treeae71e3d646a05c6e18e7e553c0d60ff96afeb3dd /shellcode
parent2f1290053b02174f6185d6dade7879cae2705875 (diff)
socket shellcode -> listen
Diffstat (limited to 'shellcode')
-rw-r--r--shellcode/socket.asm11
1 files changed, 10 insertions, 1 deletions
diff --git a/shellcode/socket.asm b/shellcode/socket.asm
index 6a58d75..fe26659 100644
--- a/shellcode/socket.asm
+++ b/shellcode/socket.asm
@@ -14,7 +14,8 @@ int 0x80 ; let the kernel do the stuff
; bind()
mov edx,eax ; move socket descriptor (returned by socket()) to edx
xor eax,eax ; zero out eax again
-push 0x0 ; in_addr = 0
+; sockaddr_in
+push eax ; in_addr = 0
push word 0x11AA ; push tcp port
push word 0x2 ; sa_family -> AF_INET = 0x02
mov ecx,esp ; save stack pointer -> pointer to sockaddr struct
@@ -26,6 +27,14 @@ mov ebx,0x02 ; set socket subcall to 0x03 (bind)
mov al,0x66 ; socketcall syscall
int 0x80 ; let the kernel do the stuff
+; listen()
+xor eax,eax ; zero out eax
+push eax ; backlog
+push edx ; sockfd
+mov ecx,esp ; save stackptr
+mov al,0x66 ; socketcall()
+mov ebx,0x4 ; socketcall 0x4 -> listen()
+int 0x80 ; kernel mode
; exit()
mov al,0x1 ; exit syscall