Advertisement
Guest User

Untitled

a guest
Jan 7th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. import base64, random, smtplib, time, re, getpass, os, string
  2.  
  3.  
  4. def check_isemail():
  5. global credentials
  6. if ".com" in credentials[0]:
  7. print("\n")
  8. else:
  9. print("Invalid email.")
  10. ask_login()
  11.  
  12.  
  13. def verify_user():
  14. global accepted_user
  15. global accepted_pass
  16. accepted_user = b"bWludGVk"
  17. accepted_pass = b"bWVudGhvbGFkbWlu"
  18. decoded_user = base64.b64decode(accepted_user.decode('utf-8'))
  19. decoded_pass = base64.b64decode(accepted_pass.decode('utf-8'))
  20. username = input("U: ")
  21. if username == decoded_user.decode('utf-8'):
  22. password = input("P: ")
  23. if password == decoded_pass.decode('utf-8'):
  24. print("\nLogin verified.\n")
  25. else:
  26. print("Wrong credentials, did you forget your credentials?")
  27. forgot = input("")
  28. if forgot == "yes":
  29. forgot_password()
  30. else:
  31. verify_user()
  32.  
  33.  
  34. def forgot_password():
  35. global accepted_user
  36. global accepted_pass
  37. numbers = "123456789(_+!&^%£"
  38. alphabet = "ABCEDFGHIJKLMNOPQRSTUVWXYZ"
  39. characters = alphabet + string.ascii_lowercase + numbers + string.ascii_uppercase
  40. rstring = "".join(random.choice(characters) for x in range(random.randint(9, 13)))
  41. filename = (str(rstring) + ".key")
  42. file = open(str(filename), "w+")
  43. file.write("User: " + accepted_user.decode('utf-8') + "\nPassword:" + accepted_pass.decode('utf-8') + "\n\nKey: Base64" + "\nDecode using: https://www.base64decode.org/")
  44.  
  45.  
  46. def show_info():
  47. version = 2.0
  48. print("mSpammer - by Nathan Townsend")
  49. print("The tool is currently running version:", str(version))
  50.  
  51.  
  52. def load_variables():
  53. global smtp_server
  54. global port
  55. global d1
  56. global d2
  57.  
  58. smtp_server = 'smtp.gmail.com'
  59. port = 587
  60. d1 = 0.25
  61. d2 = 0.60
  62.  
  63.  
  64. def ask_login():
  65. global credentials
  66. print("\nFormat: 'americanjesus1929:slayer1'")
  67. ask_user = input("Enter credentials: ")
  68. credentials = ask_user.split(":")
  69. check_isemail()
  70.  
  71.  
  72. def hash_password():
  73. global credentials
  74. global hashed_pass
  75. hashed_pass = base64.b64encode(credentials[1].encode('utf-8'))
  76. hashed_pass = hashed_pass.decode('utf-8')
  77.  
  78.  
  79. def dehash_password():
  80. global hashed_pass
  81. global dehashed_pass
  82. dehashed_pass = base64.b64decode(hashed_pass)
  83. dehashed_pass = dehashed_pass.decode('utf-8')
  84.  
  85.  
  86. def send_email():
  87.  
  88. # Retrieve SMTP details
  89. global smtp_server
  90. global port
  91.  
  92. # Retrieve delays to bypass limit
  93. global d1
  94. global d2
  95.  
  96. # Retrieve user data
  97. global credentials
  98. global dehashed_pass
  99.  
  100. # Ask user for email data
  101. receiver = input('Receiver of spam: ')
  102. subject = input('Subject of email: ')
  103. body = input('Email body: ')
  104. amount = input("Amount to send: ")
  105.  
  106. try:
  107. # Attempt connection to SMTP server + port
  108. server = smtplib.SMTP(smtp_server, port)
  109. server.ehlo()
  110.  
  111. # Start connection and login to server
  112. server.starttls()
  113. server.login(credentials[0], dehashed_pass)
  114.  
  115. print('Sending ' + str(amount) + ' emails to ' + receiver)
  116.  
  117. for i in range(1, int(amount) + 1):
  118. message = 'From: ' + credentials[0] + '\nSubject: ' + subject + '\n' + body
  119. time.sleep(random.uniform(d1, d2))
  120. server.sendmail(credentials[0], receiver, message)
  121. print("[ID: " + str(i) + "]" + "\tEmail sent. ")
  122.  
  123. else:
  124. print("\nFinished sending emails.")
  125.  
  126. except smtplib.SMTPRecipientsRefused:
  127. print("Recipient refused. Invalid email address?")
  128. main()
  129.  
  130. except smtplib.SMTPAuthenticationError:
  131. print("Unable to authenticate with server. Ensure the details are correct.")
  132. main()
  133.  
  134. except smtplib.SMTPServerDisconnected:
  135. print("Server disconnected for an unknown reason.")
  136. main()
  137.  
  138. except smtplib.SMTPConnectError:
  139. print("Unable to connect to server.")
  140. main()
  141.  
  142.  
  143. def main():
  144. verify_user()
  145. show_info()
  146. ask_login()
  147. hash_password()
  148. dehash_password()
  149. load_variables()
  150. send_email()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement