Skip to content

Instantly share code, notes, and snippets.

@opabravo
Last active February 20, 2023 14:12
Show Gist options
  • Save opabravo/e60588bc8580cef8f06518b6f25f1046 to your computer and use it in GitHub Desktop.
Save opabravo/e60588bc8580cef8f06518b6f25f1046 to your computer and use it in GitHub Desktop.
Enumerate stmp users
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