forked from unmarshal/linux32-syscall-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.py
executable file
·59 lines (42 loc) · 1.17 KB
/
client.py
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
#!/usr/bin/python
import socket,sys
class syscall_request:
r_eax = "\x00\x00\x00\x00"
r_ebx = "\x00\x00\x00\x00"
r_ecx = "\x00\x00\x00\x00"
r_edx = "\x00\x00\x00\x00"
r_esi = "\x00\x00\x00\x00"
r_edi = "\x00\x00\x00\x00"
stack = ""
request = ""
def eax(self, val):
self.r_eax = val
def ebx(self, val):
self.r_ebx = val
def ecx(self, val):
self.r_ecx = val
def edx(self, val):
self.r_edx = val
def esi(self, val):
self.r_esi = val
def edi(self, val):
self.r_edi = val
def push(self, val):
self.stack = self.stack + val
def get_complete(self):
self.request = self.r_eax + \
self.r_ebx + \
self.r_ecx + \
self.r_edx + \
self.r_esi + \
self.r_edi + \
self.stack
return self.request
if __name__ == "__main__":
sockfd = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sockfd.connect(("127.0.0.1", 6666))
syscall = syscall_request()
syscall.eax("\x41\x42\x43\x44")
request = syscall.get_complete()
sockfd.send(len(request))
sockfd.close();