-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.py
51 lines (47 loc) · 1.44 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
#
# By Pulsar
# Github: https://github.com/Woodnet
# Website: https://quantaphysics.000webhostapp.com
# Python-Version: Python 3.8.2
# C L I E N T
#
import os,socket
from cryptography.fernet import Fernet
os.system("cls")
key = input("Key> ")
f = Fernet(key.encode())
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(("localhost",1337))
packet = s.recv(2048)
message = f.decrypt(packet)
print("[SERVER] %s"%(message.decode()))
while True:
ip = input("IP> ")
packet = f.encrypt(ip.encode())
s.send(packet)
print("Gesendet")
packet = s.recv(2048)
message = f.decrypt(packet)
print("[SERVER] %s"%(message.decode()))
packet = s.recv(2048)
complete_info = f.decrypt(packet)
try:
complete_info.decode().find(':')
#print(complete_info.decode())
informations = complete_info.decode().split(':')
ip = informations[0]
hostname = informations[1]
country = informations[2]
state = informations[3]
city = informations[4]
found = True
except:
found = False
if (found == True):
print("\n [IP] %s"%(informations[0]))
print(" [Hostname] %s"%(informations[1]))
print(" [Country] %s"%(informations[2]))
print(" [State] %s"%(informations[3]))
print(" [City] %s \n"%(informations[4]))
else:
print(" [SERVER] %s"%(complete_info.decode()))