Linux系统安全--弱口令检测 John the Ripper

1、下载 John the Ripper 

[root@VM_0_11_centos Jone]# rm -rf *.tar.gz
[root@VM_0_11_centos Jone]# wget http://www.openwall.com/john/j/john-1.8.0.tar.gz
--2020-01-14 09:50:54--  http://www.openwall.com/john/j/john-1.8.0.tar.gz
Resolving www.openwall.com (www.openwall.com)... 195.42.179.202
Connecting to www.openwall.com (www.openwall.com)|195.42.179.202|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://www.openwall.com/john/j/john-1.8.0.tar.gz [following]
--2020-01-14 09:50:55--  https://www.openwall.com/john/j/john-1.8.0.tar.gz
Connecting to www.openwall.com (www.openwall.com)|195.42.179.202|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5450412 (5.2M) [application/octet-stream]
Saving to: ‘john-1.8.0.tar.gz’

100%[================================================================================================================================>] 5,450,412   19.2KB/s   in 4m 28s 

2020-01-14 09:55:24 (19.9 KB/s) - ‘john-1.8.0.tar.gz’ saved [5450412/5450412]

[root@VM_0_11_centos Jone]# ll

2、解压缩并进行编译

[root@VM_0_11_centos Jone]# tar -xzf john-1.8.0.tar.gz 
[root@VM_0_11_centos Jone]# cd john-1.8.0/
[root@VM_0_11_centos john-1.8.0]# ll
total 12
drwxr-xr-x 2 root root 4096 Jan 14 09:56 doc
lrwxrwxrwx 1 root root   10 May 29  2013 README -> doc/README
drwxr-xr-x 2 root root 4096 Jan 14 09:56 run
drwxr-xr-x 2 root root 4096 Jan 14 09:56 src
[root@VM_0_11_centos john-1.8.0]# cd src/
[root@VM_0_11_centos src]# make
[root@VM_0_11_centos src]# make linux-x86-64


[root@VM_0_11_centos run]# ll
total 7564
-rw------- 1 root root 5720262 May 29  2013 ascii.chr
-rw------- 1 root root  465097 May 29  2013 digits.chr
-rwxr-xr-x 1 root root  283144 Jan 14 09:59 john
-rw------- 1 root root   33613 May 29  2013 john.conf
-rw------- 1 root root 1184244 May 29  2013 lm_ascii.chr
-rwx------ 1 root root    1432 May 29  2013 mailer
-rwx------ 1 root root     842 May 29  2013 makechr
-rw------- 1 root root   26325 May 29  2013 password.lst
-rwx------ 1 root root    4782 May 29  2013 relbench
lrwxrwxrwx 1 root root       4 Jan 14 09:59 unafs -> john
lrwxrwxrwx 1 root root       4 Jan 14 09:59 unique -> john
lrwxrwxrwx 1 root root       4 Jan 14 09:59 unshadow -> john
[root@VM_0_11_centos run]# 

3、检测弱口令 

复制shadow文件
[root@VM_0_11_centos run]# cp /etc/shadow /home/shadow.txt
[root@VM_0_11_centos run]# ll /home | grep shadow
---------- 1 root root  824 Jan 14 10:02 shadow.txt
[root@VM_0_11_centos run]# 

执行检测

[root@VM_0_11_centos run]# ./john /home/shadow.txt 
Loaded 2 password hashes with 2 different salts (md5crypt [MD5 32/64 X2])
Press 'q' or Ctrl-C to abort, almost any other key for status
0g 0:00:00:49 3/3 0g/s 6413p/s 12709c/s 12709C/s bhado..bhads
0g 0:00:00:50 3/3 0g/s 6407p/s 12700c/s 12700C/s marcia1..marciah
0g 0:00:00:51 3/3 0g/s 6406p/s 12701c/s 12701C/s 135255..135256
0g 0:00:00:52 3/3 0g/s 6410p/s 12710c/s 12710C/s mcko23..mcko21
0g 0:00:00:53 3/3 0g/s 6411p/s 12715c/s 12715C/s blumb1..blumsy
0g 0:00:00:54 3/3 0g/s 6412p/s 12718c/s 12718C/s 191372..191337
0g 0:00:00:55 3/3 0g/s 6415p/s 12727c/s 12727C/s mclyn2..mclymj
0g 0:00:00:56 3/3 0g/s 6415p/s 12728c/s 12728C/s boyo26..boyol1
0g 0:00:00:57 3/3 0g/s 6411p/s 12721c/s 12721C/s asild..asic1
0g 0:00:00:58 3/3 0g/s 6409p/s 12719c/s 12719C/s cammang..cammany
0g 0:00:00:59 3/3 0g/s 6409p/s 12722c/s 12722C/s cutcher..cutches
0g 0:00:01:00 3/3 0g/s 6405p/s 12714c/s 12714C/s stoppan..stoppay
0g 0:00:01:01 3/3 0g/s 6400p/s 12707c/s 12707C/s 19325..19323
0g 0:00:01:02 3/3 0g/s 6398p/s 12705c/s 12705C/s 148555..148556
0g 0:00:01:03 3/3 0g/s 6398p/s 12704c/s 12704C/s mymiku..mymik1
0g 0:00:01:04 3/3 0g/s 6398p/s 12707c/s 12707C/s abdayo..abday1
0g 0:00:01:05 3/3 0g/s 6398p/s 12708c/s 12708C/s jhynn1..jhynns
0g 0:00:01:06 3/3 0g/s 6398p/s 12709c/s 12709C/s chubok..chuble
0g 0:00:01:07 3/3 0g/s 6394p/s 12702c/s 12702C/s curnit..curnic
0g 0:00:01:10 3/3 0g/s 6397p/s 12711c/s 12711C/s clsa23..clsa21
Session aborted
[root@VM_0_11_centos run]# ./john --show /home/shadow.txt 
0 password hashes cracked, 2 left
[root@VM_0_11_centos run]# 

 

你可能感兴趣的:(Linux专栏)