Last active
February 20, 2023 14:12
-
-
Save opabravo/e60588bc8580cef8f06518b6f25f1046 to your computer and use it in GitHub Desktop.
Enumerate stmp users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import smtplib | |
users_fp = "/usr/share/seclists/Usernames/top-usernames-shortlist.txt" | |
with open(users_fp, "r") as f: | |
for user in f: | |
email = f"{user.strip()}@mail.example.org" | |
try: | |
smtp = smtplib.SMTP("mail.example.org", 25) | |
smtp.ehlo() | |
smtp.mail("[email protected]") | |
resp = smtp.rcpt(email) | |
print(resp) | |
if resp[0] == 250: | |
print(f"Found: {email}") | |
finally: | |
smtp.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment