-
Notifications
You must be signed in to change notification settings - Fork 0
/
nxlmclient.py
executable file
·38 lines (33 loc) · 1.27 KB
/
nxlmclient.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
#!/usr/bin/env python
import socket
TCP_IP = '127.0.0.1'
TCP_PORT = 28000
BUFFER_SIZE = 1024
# recorded message from wireshark, no idea about the format
message=[0x68, 0x1b, 0x31, 0x33, 0x6d, 0x61, 0x78, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x6d, 0x61, 0x78, 0x2d, 0x74, 0x68, 0x69,
0x6e, 0x6b, 0x70, 0x61, 0x64, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x75, 0x67, 0x73, 0x6c, 0x6d, 0x64,
0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x78,
0x2d, 0x74, 0x68, 0x69, 0x6e, 0x6b, 0x70, 0x61,
0x64, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x32, 0x33, 0x33, 0x31, 0x39,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x36,
0x34, 0x5f, 0x6c, 0x73, 0x62, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x0b, 0x0a, 0x37, 0x38, 0x00,
0x31, 0x34, 0x00]
# convert to string
message="".join(map(chr, message))
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.sendall(message)
data = s.recv(BUFFER_SIZE)
s.close()
print ord(data[38])*256+ord(data[39])