渗透测试--密码本生成

        渗透测试的时候密码爆破是常用的攻击手段,但目前互联网上的密码本大多为通用型弱密码密码本。在我们进行针对性渗透的时候,很有必要构建一个自定义密码本。本篇文章就是针对自定义密码本生成的专题。

工具

Crunch

        Crunch是一个基于掩码,来生成密码的密码本生成工具,对于同类型密码的生成非常好用。通常而言,这种方式生成的密码都非常的巨大。

安装方法

KALI自带

使用方法

crunch <minimum length> <maximum length> <charset> -t <pattern> -o <output file>
crunch 17 17 -t ILFREIGHT201%@@@@ -o wordlist

“-t” 选项用于指定生成密码的模式。模式可以包含以下符号:

  • “@” 表示小写字母
  • “,”(逗号)表示大写字母
  • “%” 表示数字
  • “^” 表示符号

CUPP 

安装方法

KALI自带

 使用方法

        CUPP是一个基于个人敏感信息,生成的密码本。这种方式生成的密码本,通常不大。

cmundy2@htb[/htb]$ python3 cupp.py -i

[+] Insert the information about the victim to make a dictionary
[+] If you don't know all the info, just hit enter when asked! ;)

> First Name: roger
> Surname: penrose
> Nickname:      
> Birthdate (DDMMYYYY): 11051972

> Partners) name: beth
> Partners) nickname:
> Partners) birthdate (DDMMYYYY):

> Child's name: john
> Child's nickname: johnny
> Child's birthdate (DDMMYYYY):

> Pet's name: tommy
> Company name: INLANE FREIGHT

> Do you want to add some key words about the victim? Y/[N]: Y
> Please enter the words, separated by comma. [i.e. hacker,juice,black], spaces will be removed: sysadmin,linux,86391512
> Do you want to add special chars at the end of words? Y/[N]:
> Do you want to add some random numbers at the end of words? Y/[N]:
> Leet mode? (i.e. leet = 1337) Y/[N]:

[+] Now making a dictionary...
[+] Sorting list and removing duplicates...
[+] Saving dictionary to roger.txt, counting 2419 words.
[+] Now load your pistolero with roger.txt and shoot! Good luck!

Kwprocessor

Kwprocessor是一款密码破解工具,是专门针对键盘映射生成密码本的工具。日常中我们很可能发现这种密码1qazXSW@。看看这个密码在键盘上的映射,相信细心的朋友已经发现了。这是有规律可循的,而Kwprocessor则是专门针对这种在键盘上“游走”的密码而生成的工具。

安装方法

git clone https://github.com/hashcat/kwprocessor
cd kwprocessor
make

使用方法

kwp -s 1 basechars/full.base keymaps/en-us.keymap  routes/2-to-10-max-3-direction-changes.route

Princeprocessor

Princeprocessor是一款专门针对排列组合的密码生成工具。比如你发现某个公司存在很多块状的密码。例如:

ydx@123

ydx@server

server@ydx2024

我们可以把他看做这些块

ydx

@

server

2024

然后Princeprocessor会排列组合所有的可能!所以上述的密码将被我们探测到。

安装方法

wget https://github.com/hashcat/princeprocessor/releases/download/v0.22/princeprocessor-0.22.7z
7z x princeprocessor-0.22.7z
cd princeprocessor-0.22
./pp64.bin -h

使用方法 

显示组合数量
./pp64.bin --keyspace < words
输出文件 
./pp64.bin -o wordlist.txt < words
字符长度限制
./pp64.bin --pw-min=10 --pw-max=25 -o wordlist.txt < words
确定元素个数

 可以指定最后生成的密码本,每个密码至少包含几个块

./pp64.bin --elem-cnt-min=3 -o wordlist.txt < words

CeWL

CeWL 是另一种可以用于创建自定义单词列表的工具。它通过爬取和抓取网站的内容,生成出该网站上的单词列表。这种单词列表非常有效,因为人们往往会使用与其撰写或操作内容相关的密码。例如,一个写作关于自然、野生动物等主题的博主,可能会设置与这些主题相关的密码。这是人类的自然倾向,因为这样的密码容易记住。企业通常会使用与其品牌和行业特定词汇相关的密码。例如,某个网络公司的用户的密码中可能包含类似“router”(路由器)、“switch”(交换机)、“server”(服务器)等词汇。这些词汇可以在公司网站上的博客、客户推荐和产品描述中找到。 

使用方法

cewl -d <depth to spider> -m <minimum word length> -w <output wordlist> <url of website>

 爬取5个页面深度,并且只包含长度大于8的词

cewl -d 5 -m 8 -e http://inlanefreight.com/blog -w wordlist.txt

 maskprocessor

Hashcat-utils存储库包含许多可用于更高级密码破解的实用程序。例如,工具maskprocessor可用于使用给定掩码创建单词表。此工具的详细用法可在此处找到。

使用方法

 /mp64.bin Welcome?s
Welcome 

hashcat使用规则生成密码本

使用规则

详细规则非常多,可以在此处查看here。常用规则如下:

 使用方法

自定义rule库生成密码

echo 'c so0 si1 se3 ss5 sa@ $2 $0 $1 $9' > rule.txt
echo 'password_ilfreight' > test.txt
hashcat -r rule.txt test.txt --stdout

'''
P@55w0rd_1lfr31ght2019
'''
开源rule库

 rule也不必要完全由我们自己生成,目前有很多大佬已经写好规则,我们自己使用即可。还有各种公开规则库,例如nsa-rulesHob0Rules《How to Hack Like a Legend》一书中介绍的corporate.rule

ls -l /usr/share/hashcat/rules/

hashcat使用掩码混合生成密码本

hashcat -a 6 -m 0 rockyou-75.txt '?d?s' --stdout

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值