# 1.13 后台口令暴力破解漏洞

## 账户探测

探测存在与否

第一梯队：Top500用户名、手机号

第二梯队：邮箱、员工编号

## 指定口令爆破用户名

1.指定类123456口令爆破用户名

2.正常的top500，top10000帐号；

3.单个字母、两个字母、三个字母、四个字母随机组合的帐号； a) 小工具pydictor值得推荐 python pydictor.py -base L --len 2 3 b) Burp也可以

4.一位数字、二位数字、三位数字、四位数字的随机组合

```python
for n in xrange(10000):
    print str(n).zfill(4)
```

5.厂商名相关帐号 a) 如：facebook、fb\_steven … b) 页面联系邮箱的规则学习及自创建

## 密码爆破

1、top500, top3000,top10000，自定义密码 a) Top系列，几乎安全从业都有自己的弱口令字典，常规就好，太大的字典跑起来也费劲，关键是定制 b) 定制字典，pydictor值得推荐：<https://github.com/LandGrey/pydictor> c) 社工库的使用，指定用户的历史密码，是一种尝试

2、厂商特色口令生成，如baidu\@123 a) 适用于应用管理员类人员以及主机协议类密码 b) 更多定制类字典也可以pydicor c) 使用简单密码和厂商邮箱后缀组合

```python
#coding=utf-8
import sys
key = sys.argv[1]
f = open("%s.txt"%key,"a")
list1 = [123,321,1234,4321,123456,654321,12345678,123456789,1234567890,888,8888,666,6666,163,521,1314,1,11,111,1111,2,222,3,333,5,555,9,999]
list2 = ['#123','#1234','#123456','@123','@1234','@123456','@qq.com','qq.com','@123.com','123.com','@163.com','163.com','126.com','!@#','!@#$','!@#$%^','098']
for j1 in list1:
    pwd1 =  key + str(j1) + '\n'
    f.write(pwd1)
for j2 in list2:
    pwd2 =  key+str(j2)+'\n'
    f.write(pwd2)

for i in range(1980,2016):
    #pwd1 = key + str(i) + '\n'
    pwd3 = '{}{}{}'.format(key,i,'\n')
    f.write(pwd3)


f.close()
print key+' password combination ok!!!'
```

3、加密密码暴力破解 a) 普通编码类，如base64 b) 自定义加密算法（目标系统使用了可猜测的加密算法去加密口令） 可参考浮萍写的基于RSA算法加密口令后爆破脚本： <https://github.com/fupinglee/MyPython/blob/master/web/RSADemo.py> c) Selenium 自动浏览器提交模块（可适用与不明加密算法，模拟正常操作流）

## 防御

a) 阈值的设立 i. 单位时间内超过额定请求次数，封帐号&封IP段时间 ii. 支持逆向思路 b) 密码输入错误次数达到3次后增设验证码 i. 验证码自身的安全性参考下一个问题 c) 自身应用系统的健壮性 i. 强制要求用户注册时满足口令复杂度要求 ii. 定期检索数据库弱口令帐号的存在，可比对top500的密文值


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ninjia.gitbook.io/secskill/web/admin0.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
