-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetcat.py
More file actions
26 lines (26 loc) · 794 Bytes
/
netcat.py
File metadata and controls
26 lines (26 loc) · 794 Bytes
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
import socket
import random
from threading import Thread
from datetime import datetime
SERVER_HOST = "localhost"
SERVER_PORT = 9001 # server's port
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((SERVER_HOST, SERVER_PORT))
while True:
message = s.recv(1024).decode()
print(message.replace("\n",""))
if message.__contains__("white"):
print("white")
s.sendall(("white").encode())
if message.__contains__("rings"):
print("19")
s.sendall(("19").encode())
if message.__contains__("Guybrush"):
print("threepwood")
s.sendall(("threepwood").encode())
if message.__contains__("armored"):
print("mithril")
s.sendall(("mithril").encode())
if message.__contains__("token"):
break
s.close()