forked from sakib-773/TSun-FF-TCP-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.py
More file actions
39 lines (33 loc) · 1.17 KB
/
client.py
File metadata and controls
39 lines (33 loc) · 1.17 KB
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
import socket
import threading
class FF_CLIENT:
def __init__(self, uid, password):
self.uid = uid
self.password = password
self.sock = None
def connect(self, token, ip, port, name, key, iv):
print(f"[+] Connecting to {ip}:{port}")
try:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((ip, int(port)))
self.sock.send(bytes.fromhex(token))
print("[+] Token sent successfully")
except Exception as e:
print(f"[!] Error connecting or sending token: {e}")
def start(self):
if not self.sock:
print("[!] Socket not connected.")
return
print("[+] Client started. Listening for server data...")
def receive():
try:
while True:
data = self.sock.recv(4096)
if not data:
break
print(f"[Server] {data.hex()}")
except Exception as e:
print(f"[!] Receive error: {e}")
thread = threading.Thread(target=receive)
thread.daemon = True
thread.start()