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]: Leaving directory `/root/john-1.8.0/src'
3.运行脚本,分析账户、密码文件,只有zhangsan
用户的密码强度足够,没有分析出来。
[root@localhost src]# cd ~/john-1.8.0/run/
[root@localhost run]# ls
ascii.chr digits.chr john john.conf lm_ascii.chr mailer makechr password.lst relbench unafs unique unshadow
[root@localhost run]# ./john /etc/passwd /etc/shadow
Loaded 4 password hashes with 4 different salts (crypt, generic crypt(3) [?/64])
Press 'q' or Ctrl-C to abort, almost any other key for status
000000 (root)
000000 (lisi)
000000 (wangwu)
3g 0:00:09:38 90% 2/3 0.005184g/s 272.3p/s 278.2c/s 278.2C/s christmased..freemaned
Use the "--show" option to display all of the cracked passwords reliably
Session aborted
nmap 端口扫描
定期的端口扫描,可以找出网络中不可控的应用服务,及时关闭不安全的服务,减小安全风险。
常用的扫描类型:
-sS
:TCP SYN
扫描(半开扫描):只向目标发出SYN
数据包,如果收到SYN/ACK
响应包就认为目标端口正在监听,并立即断开连接;否则认为目标端口并未开放。
-sT
:TCP
连接扫描:这是完整的TCP
扫描方式,用来建立一个TCP
连接,如果成功则认为目标端口正在监听服务,否则认为目标端口并未开放。
-sF
:TCP FIN
扫描:开放的端口会忽略这种数据包,关闭的端口会回应RST
数据包。许多防火墙只对SYN
数据包进行简单过滤,而忽略了其他形式的TCP
攻击包。这种类型的扫描可间接检测防火墙的健壮性。
-sU
:UDP
扫描:探测目标主机提供哪些UDP
服务,UDP
扫描的速度会比较慢。
-sP
:ICMP
扫描:类似于ping
检测,快速判断目标主机是否存活,不做其他扫描。
-P0
:跳过ping
检测:这种方式认为所有目标主机时存活的,当对方不响应ICMP
请求时,使用这种方式可以避免无法ping
通而放弃扫描。
常用的选项:
-p
:指定扫描的端口
-n
:禁用反向DNS
解析,加快扫描速度
Demo:
1.