-
Notifications
You must be signed in to change notification settings - Fork 0
/
sender.py
42 lines (37 loc) · 962 Bytes
/
sender.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
import telnetlib
def print_logo(logo=''):
LOGO_DAFAULT = """\033[93m
/\ /\\
/ \\'._ (\_/) _.'/ \\
/_.''._'--('.')--'_.''._\\
| \_ / `;=/ " \=;` \ _/ |
\/ `\__|`\___/`|__/` \/
` \(/|\)/ `
" ` "
DAW_Start_By_VLDZ
\033[0m
"""
if logo != '':
print(logo)
else:
print(LOGO_DAFAULT)
print_logo()
port = int(input('\n PORT:'))
ip_1 = str(input(' Host_1 IP: '))
node_1 = telnetlib.Telnet(ip_1, port)
ip_2 = str(input(' Host_2 IP: '))
node_2 = telnetlib.Telnet(ip_2, port)
while True:
symbol = str(input('==> '))
if symbol == 's':
node_1.write(b's\r\n')
node_2.write(b's\r\n')
elif symbol == 'n':
node_1.write(b'n\r\n')
node_2.write(b'n\r\n')
elif symbol == 'b':
node_1.write(b'b\r\n')
node_2.write(b'b\r\n')
else:
node_1.write(bytes(str.encode(symbol)))
node_2.write(bytes(str.encode(symbol)))