前言
记录今天看到群友问到一道题
![图片[1],哈希表爆破MD5,网络安全爱好者中心-神域博客网](https://img.godyu.com/2023/12/20231210130110511.png?imageView2/0/format/webp/q/75)
![图片[2],哈希表爆破MD5,网络安全爱好者中心-神域博客网](https://img.godyu.com/2023/12/20231210130128274.png?imageView2/0/format/webp/q/75)
看下题目
![图片[3],哈希表爆破MD5,网络安全爱好者中心-神域博客网](https://img.godyu.com/2023/12/20231210130210448.png?imageView2/0/format/webp/q/75)
- 明文:flag{P7?Y0OG?0XPC?ZPK}
密文:9e86????007f??9a38???449a?0ea7cf
一眼看出来是MD5加密
MD5严格来说不能算加密 只能暴力爆破
脚本暴力破解缺失字符 关于MD5一些加解密等方法需要系统的去学习一下 如果猛地一出 让新手都不会
所以解决的办法最好是:先从网上找相似的题+题型+找代码+AI改代码
具体代码如下:
import hashlib
#flag{P7?Y0OG?0XPC?ZPK}
s1 = "flag{P7"
s2 = "Y0OG"
s3 = "0XPC"
s4 = "ZPK}"
chars = ['0','1','2','3','4','5','6','7','8','9','0','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
for i in chars:
for j in chars:
for k in chars:
flag = s1 + i + s2 + j + s3 + k + s4
pre = hashlib.md5() # create an instance of md5 class
pre.update(flag.encode()) # encode the flag as bytes and update the hash object
md5 = str(pre.hexdigest()) # get the hexadecimal digest of the hash
#9e86????007f??9a38???449a?0ea7cf
if ('9e86' and '9a38' and '0ea7cf') in md5 :
print( md5)
print (flag)
结尾
希望包括我在内的记住这个题型
![图片[4],哈希表爆破MD5,网络安全爱好者中心-神域博客网](https://img.godyu.com/2023/12/20231210130813560.png?imageView2/0/format/webp/q/75)
![图片[5],哈希表爆破MD5,网络安全爱好者中心-神域博客网](https://img.godyu.com/2023/12/20231210130746528.png?imageView2/0/format/webp/q/75)
THE END
- 最新
- 最热
只看作者