弱密码检测JR!

1、JR(Joth the Ripper)简介
·一款密码分析工具,支持字典式的暴力破解
·通过对 shadow 文件的口令分析,可以检测密码
·官方网站:http://www.openwall.com/john/
2、安装 JR 工具
(1)tar 包解压
(2)进到解压后的 src 目录下,执行 make clean
(3)进到解压后的 run 目录下,执行命令

===========================================================

示例:扫描虚拟机内所有账号密码排出弱密码?

导入john-1.8.0.tar.gz 包

[root@localhost ~]# ls              //查看是否已经导入好JR
john-1.8.0.tar.gz
[root@localhost ~]# tar -zxf john-1.8.0.tar.gz        //解压JR包
[root@localhost ~]# ls                 //查看是否解压好JR包
john-1.8.0   john-1.8.0.tar.gz

[root@localhost ~]# cd john-1.8.0/src            //进入src
[root@localhost src]# rpm -q gcc gcc-c++        //检测是否安装了gcc gcc-c++编辑器
未安装软件包 gcc 
未安装软件包 gcc-c++
[root@localhost src]# yum -y install gcc gcc-c++         //安装gcc gcc-c++编辑器
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirrors.huaweicloud.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
正在解决依赖关系
--> 正在检查事务
---> 软件包 gcc.x86_64.0.4.8.5-36.el7_6.2 将被 安装
--> 正在处理依赖关系 libgomp = 4.8.5-36.el7_6.2,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
--> 正在处理依赖关系 cpp = 4.8.5-36.el7_6.2,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
--> 正在处理依赖关系 libgcc >= 4.8.5-36.el7_6.2,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
--> 正在处理依赖关系 glibc-devel >= 2.2.90-12,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
---> 软件包 gcc-c++.x86_64.0.4.8.5-36.el7_6.2 将被 安装
--> 正在处理依赖关系 libstdc++-devel = 4.8.5-36.el7_6.2,它被软件包 gcc-c++-4.8.5-36.el7_6.2.x86_64 需要
--> 正在处理依赖关系 libstdc++ = 4.8.5-36.el7_6.2,它被软件包 gcc-c++-4.8.5-36.el7_6.2.x86_64 需要
--> 正在检查事务
---> 软件包 cpp.x86_64.0.4.8.5-36.el7_6.2 将被 安装
---> 软件包 glibc-devel.x86_64.0.2.17-260.el7_6.6 将被 安装
--> 正在处理依赖关系 glibc-headers = 2.17-260.el7_6.6,它被软件包 glibc-devel-2.17-260.el7_6.6.x86_64 需要
--> 正在处理依赖关系 glibc = 2.17-260.el7_6.6,它被软件包 glibc-devel-2.17-260.el7_6.6.x86_64 需要
--> 正在处理依赖关系 glibc-headers,它被软件包 glibc-devel-2.17-260.el7_6.6.x86_64 需要
---> 软件包 libgcc.x86_64.0.4.8.5-36.el7 将被 升级
---> 软件包 libgcc.x86_64.0.4.8.5-36.el7_6.2 将被 更新
---> 软件包 libgomp.x86_64.0.4.8.5-36.el7 将被 升级
---> 软件包 libgomp.x86_64.0.4.8.5-36.el7_6.2 将被 更新
---> 软件包 libstdc++.x86_64.0.4.8.5-36.el7 将被 升级
---> 软件包 libstdc++.x86_64.0.4.8.5-36.el7_6.2 将被 更新
---> 软件包 libstdc++-devel.x86_64.0.4.8.5-36.el7_6.2 将被 安装
--> 正在检查事务
---> 软件包 glibc.x86_64.0.2.17-260.el7 将被 升级
--> 正在处理依赖关系 glibc = 2.17-260.el7,它被软件包 glibc-common-2.17-260.el7.x86_64 需要
---> 软件包 glibc.x86_64.0.2.17-260.el7_6.6 将被 更新
---> 软件包 glibc-headers.x86_64.0.2.17-260.el7_6.6 将被 安装
--> 正在处理依赖关系 kernel-headers >= 2.2.1,它被软件包 glibc-headers-2.17-260.el7_6.6.x86_64 需要
--> 正在处理依赖关系 kernel-headers,它被软件包 glibc-headers-2.17-260.el7_6.6.x86_64 需要
--> 正在检查事务
---> 软件包 glibc-common.x86_64.0.2.17-260.el7 将被 升级
---> 软件包 glibc-common.x86_64.0.2.17-260.el7_6.6 将被 更新
---> 软件包 kernel-headers.x86_64.0.3.10.0-957.27.2.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

================================================================================
Package 架构 版本 源 大小
================================================================================
正在安装:
gcc x86_64 4.8.5-36.el7_6.2 updates 16 M
gcc-c++ x86_64 4.8.5-36.el7_6.2 updates 7.2 M
为依赖而安装:
cpp x86_64 4.8.5-36.el7_6.2 updates 5.9 M
glibc-devel x86_64 2.17-260.el7_6.6 updates 1.1 M
glibc-headers x86_64 2.17-260.el7_6.6 updates 684 k
kernel-headers x86_64 3.10.0-957.27.2.el7 updates 8.0 M
libstdc++-devel x86_64 4.8.5-36.el7_6.2 updates 1.5 M
为依赖而更新:
glibc x86_64 2.17-260.el7_6.6 updates 3.7 M
glibc-common x86_64 2.17-260.el7_6.6 updates 12 M
libgcc x86_64 4.8.5-36.el7_6.2 updates 102 k
libgomp x86_64 4.8.5-36.el7_6.2 updates 158 k
libstdc++ x86_64 4.8.5-36.el7_6.2 updates 305 k

事务概要
================================================================================
安装 2 软件包 (+5 依赖软件包)
升级 ( 5 依赖软件包)

总计:56 M
总下载量:41 M
Downloading packages:
警告:/var/cache/yum/x86_64/7/updates/packages/cpp-4.8.5-36.el7_6.2.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID f4a80eb5: NOKEY
cpp-4.8.5-36.el7_6.2.x86_64.rpm 的公钥尚未安装
(1/7): cpp-4.8.5-36.el7_6.2.x86_64.rpm | 5.9 MB 00:01
(2/7): gcc-c++-4.8.5-36.el7_6.2.x86_64.rpm | 7.2 MB 00:01
(3/7): glibc-devel-2.17-260.el7_6.6.x86_64.rpm | 1.1 MB 00:00
(4/7): glibc-headers-2.17-260.el7_6.6.x86_64.rpm | 684 kB 00:00
(5/7): kernel-headers-3.10.0-957.27.2.el7.x86_64.rpm | 8.0 MB 00:01
(6/7): gcc-4.8.5-36.el7_6.2.x86_64.rpm | 16 MB 00:04
(7/7): libstdc++-devel-4.8.5-36.el7_6.2.x86_64.rpm | 1.5 MB 00:00
--------------------------------------------------------------------------------
总计 8.1 MB/s | 41 MB 00:05
从 file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 检索密钥
导入 GPG key 0xF4A80EB5:
用户ID : "CentOS-7 Key (CentOS 7 Official Signing Key) <[email protected]>"
指纹 : 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
软件包 : centos-release-7-6.1810.2.el7.centos.x86_64 (@anaconda)
来自 : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在更新 : libgcc-4.8.5-36.el7_6.2.x86_64 1/17
正在更新 : glibc-common-2.17-260.el7_6.6.x86_64 2/17
正在更新 : glibc-2.17-260.el7_6.6.x86_64 3/17
正在更新 : libstdc++-4.8.5-36.el7_6.2.x86_64 4/17
正在安装 : libstdc++-devel-4.8.5-36.el7_6.2.x86_64 5/17
正在更新 : libgomp-4.8.5-36.el7_6.2.x86_64 6/17
正在安装 : cpp-4.8.5-36.el7_6.2.x86_64 7/17
正在安装 : kernel-headers-3.10.0-957.27.2.el7.x86_64 8/17
正在安装 : glibc-headers-2.17-260.el7_6.6.x86_64 9/17
正在安装 : glibc-devel-2.17-260.el7_6.6.x86_64 10/17
正在安装 : gcc-4.8.5-36.el7_6.2.x86_64 11/17
正在安装 : gcc-c++-4.8.5-36.el7_6.2.x86_64 12/17
清理 : libstdc++-4.8.5-36.el7.x86_64 13/17
清理 : libgomp-4.8.5-36.el7.x86_64 14/17
清理 : glibc-common-2.17-260.el7.x86_64 15/17
清理 : glibc-2.17-260.el7.x86_64 16/17
清理 : libgcc-4.8.5-36.el7.x86_64 17/17
验证中 : glibc-devel-2.17-260.el7_6.6.x86_64 1/17
验证中 : gcc-c++-4.8.5-36.el7_6.2.x86_64 2/17
验证中 : kernel-headers-3.10.0-957.27.2.el7.x86_64 3/17
验证中 : libgcc-4.8.5-36.el7_6.2.x86_64 4/17
验证中 : libgomp-4.8.5-36.el7_6.2.x86_64 5/17
验证中 : glibc-2.17-260.el7_6.6.x86_64 6/17
验证中 : cpp-4.8.5-36.el7_6.2.x86_64 7/17
验证中 : gcc-4.8.5-36.el7_6.2.x86_64 8/17
验证中 : glibc-headers-2.17-260.el7_6.6.x86_64 9/17
验证中 : libstdc++-devel-4.8.5-36.el7_6.2.x86_64 10/17
验证中 : glibc-common-2.17-260.el7_6.6.x86_64 11/17
验证中 : libstdc++-4.8.5-36.el7_6.2.x86_64 12/17
验证中 : glibc-common-2.17-260.el7.x86_64 13/17
验证中 : libgomp-4.8.5-36.el7.x86_64 14/17
验证中 : glibc-2.17-260.el7.x86_64 15/17
验证中 : libstdc++-4.8.5-36.el7.x86_64 16/17
验证中 : libgcc-4.8.5-36.el7.x86_64 17/17

已安装:
gcc.x86_64 0:4.8.5-36.el7_6.2 gcc-c++.x86_64 0:4.8.5-36.el7_6.2

作为依赖被安装:
cpp.x86_64 0:4.8.5-36.el7_6.2
glibc-devel.x86_64 0:2.17-260.el7_6.6
glibc-headers.x86_64 0:2.17-260.el7_6.6
kernel-headers.x86_64 0:3.10.0-957.27.2.el7
libstdc++-devel.x86_64 0:4.8.5-36.el7_6.2

作为依赖被升级:
glibc.x86_64 0:2.17-260.el7_6.6 glibc-common.x86_64 0:2.17-260.el7_6.6
libgcc.x86_64 0:4.8.5-36.el7_6.2 libgomp.x86_64 0:4.8.5-36.el7_6.2
libstdc++.x86_64 0:4.8.5-36.el7_6.2

完毕!

[root@localhost src]# make          //编译

[root@localhost src]# cd ../run       //进入run
[root@localhost run]# cp /etc/shadow ./shadow.txt       //复制./shadow.txt 到/etc/shadow下
[root@localhost run]# ls
ascii.chr     john.conf       mailer       password.lst  shadow.txt
digits.chr   lm_ascii.chr   makechr   relbench
[root@localhost run]# cd ../
[root@localhost john-1.8.0]# ls
doc  README  run   src
[root@localhost john-1.8.0]# cd
[root@localhost ~]# ls
john-1.8.0 john-1.8.0.tar.gz
[root@localhost ~]# cd john-1.8.0/
[root@localhost john-1.8.0]# ls
doc README run src
[root@localhost john-1.8.0]# cd src
[root@localhost src]# make clean linux-x86-64
rm -f ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/john.bin ../run/john.com ../run/unshadow.com ../run/unafs.com ../run/unique.com ../run/john.exe ../run/unshadow.exe ../run/unafs.exe ../run/unique.exe
rm -f ../run/john.exe john-macosx-* *.o *.bak core
rm -f detect bench generic.h arch.h tmp.s
cp /dev/null Makefile.dep
ln -sf x86-64.h arch.h
make ../run/john ../run/unshadow ../run/unafs ../run/unique \
JOHN_OBJS="DES_fmt.o DES_std.o DES_bs.o DES_bs_b.o BSDI_fmt.o MD5_fmt.o MD5_std.o BF_fmt.o BF_std.o AFS_fmt.o LM_fmt.o trip_fmt.o dummy.o batch.o bench.o charset.o common.o compiler.o config.o cracker.o crc32.o external.o formats.o getopt.o idle.o inc.o john.o list.o loader.o logger.o math.o memory.o misc.o options.o params.o path.o recovery.o rpp.o rules.o signals.o single.o status.o tty.o wordlist.o unshadow.o unafs.o unique.o c3_fmt.o x86-64.o" \
CFLAGS="-c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT" \
LDFLAGS="-s -lcrypt"
make[1]: 进入目录“/root/john-1.8.0/src”
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops DES_fmt.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops DES_std.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops DES_bs.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -Os -funroll-loops -finline-functions DES_bs_b.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops BSDI_fmt.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops MD5_fmt.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops MD5_std.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops BF_fmt.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops BF_std.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops AFS_fmt.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops LM_fmt.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops trip_fmt.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops dummy.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops batch.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops bench.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops charset.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops common.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops compiler.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops config.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops cracker.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops crc32.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops external.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops formats.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops getopt.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops idle.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops inc.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops john.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops list.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops loader.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops logger.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops math.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops memory.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops misc.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops options.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops params.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops path.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops recovery.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops rpp.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops rules.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops signals.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops single.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops status.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops tty.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops wordlist.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops unshadow.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops unafs.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops unique.c
gcc -c -Wall -Wdeclaration-after-statement -O2 -fomit-frame-pointer -DHAVE_CRYPT -funroll-loops c3_fmt.c
gcc -c x86-64.S
gcc DES_fmt.o DES_std.o DES_bs.o DES_bs_b.o BSDI_fmt.o MD5_fmt.o MD5_std.o BF_fmt.o BF_std.o AFS_fmt.o LM_fmt.o trip_fmt.o dummy.o batch.o bench.o charset.o common.o compiler.o config.o cracker.o crc32.o external.o formats.o getopt.o idle.o inc.o john.o list.o loader.o logger.o math.o memory.o misc.o options.o params.o path.o recovery.o rpp.o rules.o signals.o single.o status.o tty.o wordlist.o unshadow.o unafs.o unique.o c3_fmt.o x86-64.o -s -lcrypt -o ../run/john
rm -f ../run/unshadow
ln -s john ../run/unshadow
rm -f ../run/unafs
ln -s john ../run/unafs
rm -f ../run/unique
ln -s john ../run/unique
make[1]: 离开目录“/root/john-1.8.0/src”
[root@localhost src]# cd ../run
[root@localhost run]# ls
ascii.chr     john  lm_ascii.chr makechr   relbench  unafs  unshadow
digits.chr   john.conf  mailer   password.lst  shadow.txt  unique
[root@localhost run]# cp /etc/shadow ./shadow.txt
cp:是否覆盖"./shadow.txt"? y
[root@localhost run]# ./john shadow.txt
Loaded 3 password hashes with 3 different salts (crypt, generic crypt(3) [?/64])
Press 'q' or Ctrl-C to abort, almost any other key for status
123123 (roomx)
123123 (root)

0g 0:00:20:52 3/3 0g/s 242.7p/s 242.7c/s 242.7C/s 020867..022465
0g 0:00:20:54 3/3 0g/s 242.7p/s 242.7c/s 242.7C/s 033289..036936
Session aborted

猜你喜欢

转载自www.cnblogs.com/cxm123123form/p/11330910.html
今日推荐