需求:已知下面的字符串是通过RANDOM随机数变量md5sum后,再截取一部分连续字符串的结果,请破解这些字符串对应的使用md5sum处理前的RANDOM对应的数字?
21029299
00205d1c
a3da1677
1f6d12dd
890684b
解答:
#!/bin/bash ############################################################## # File Name: pojie.sh # Version: V1.0 # Author: ZhangHongLiang # Organization: # Created Time : 2017-12-09 12:45:32 # Description: ############################################################## cha(){ printf "他的原密码为:" grep "$mi" $pass_DB|awk '{printf $1}' echo "" } pass_DB=/tmp/passDB.pass pass_finger=/root/md5finger.txt read -p "请输入密文: " mi if [ ! -f $pass_DB ];then echo "创建破解文件库中请稍等" for((i=0;i<=32767;i++));do p_n=`echo $i |md5sum` echo "$i $p_n" >>$pass_DB done echo "【OK】" md5sum $pass_DB >$pass_finger cha else md5sum -c $pass_finger &>/dev/null if [ $? != 0 ];then echo "$pass_DB出错请重新执行该脚本修复" rm -f $pass_DB else cha fi fi