Created
January 18, 2018 03:40
-
-
Save wuzhenda/235f652467eb33a9428fc3fea884a240 to your computer and use it in GitHub Desktop.
fake client by python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import socket | |
import time | |
def GetCmd(hexString): | |
hexString = hexString.replace(" ", ""); | |
if ((len(hexString) % 2) != 0): | |
hexString += " "; | |
bits = "" | |
for x in range(0, len(hexString), 2): | |
bits += chr(int(hexString[x:x+2], 16)) | |
return bits; | |
host = 'xxx.yyy.com' | |
port = 10001 | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect((host, port)) | |
str = "7B 7D 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 32 0F 10 0A 4B 4C 00 00 00 00 00 00 00 00 3F 21" | |
convertStr=GetCmd(str) | |
print(convertStr) | |
while True: | |
sock.send(convertStr.encode(encoding='utf_8', errors='strict')) | |
time.sleep(60) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment