-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSMTP_client.py
38 lines (30 loc) · 1.03 KB
/
SMTP_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
#!/usr/bin/python3
# Script to communicate with an SMTP service / server
import socket
import os
from colorama import Fore, Style
path = os.getcwd()
print("++ SMTP Client by iTryZz ++\n")
server = input(f"SMTPY({Fore.RED + path + Style.RESET_ALL}) SMTP server IP: ")
port = 25
command = input(f"SMTPY({Fore.RED + path + Style.RESET_ALL}) SMTP Command: ")
print(f"{server}\n{port}\n{command}\n(I will not catch any of your spelling errors, or incorrect commands)\n")
partial_cmd = []
partial_cmd.append(command)
partial_cmd.append('\r\n')
full_command = ''.join(partial_cmd)
# Init socket and send command
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((server, port))
s.send("WhAtCha DoInG?".encode())
serviceBanner = s.recv(1024).decode('utf-8')
print("Service Banner: " + serviceBanner)
s.send(full_command.encode('utf-8'))
s.close()
except Exception as e:
print(str(e))
print(f"Thanks for using {Fore.GREEN}SMTPY")
exit(1)
else:
print(f"Thanks for using {Fore.GREEN}SMTPY")