NewStarCTF 公开赛 - week4hash

看题目 考点是hash算法

直接拖入ida 看啥逻辑

image-20230225200637257

跟入4113F2

image-20230225200713660

打开MSDN去查看这个模块 看是什么hash

贴网站 https://learn.microsoft.com/en-us/windows/win32/seccrypto/alg-id

image-20230225200800012

欧克 是sha1

image-20230225201037576

image-20230225201150603

以一行00 + 00 00 00 分开了

放入Sublime整理一下

1
2
3
4
5
6
7
text = ['A2F17ED1C6A8BC31769CDF654DF4B8A937042CB6', '0CA8A2EDB0C1D34A432A5A4464E0D6ABD847C831',
'C359D69F3F08BB920F2C3B51133205533462093E', 'CC5C3FE6E7356A26A134CFF5633349F597C40A9D',
'4AC4BB3F27F245BA9178651AA5CDEDCBB2862E2A', 'A01E33F4DCDB6BA1AE9F34A97CF8F6DEEEDF1A8D',
'D3AF70912A8C1B22CFDECE071BA36BC4662B58FA', '9395EAB195D25B676D7D07075D3838A9AC19DF21',
'FDB43C5EF76ECDA0C1661D6D199B5BFAC1DB538A', 'DA8E9997A010BE78B20108CE79FEC1FB9C63D8DC',
'809DA627F1AD01D65864C376E3179B62D9D74261', '8F61EE21AC7579626934E0FFB6A62B3D4A82EEC4',
'E2A954758FDB61F869998E9788B7B7E48480B832', 'B8E3349B97532B27AA62B8718B68240179158144']

然后兴高采烈找个在线解密网站

贴一下 网站 还是很好用的 免费

https://md5.cn/

哎 妹解出来

image-20230225201508946

哥们菜菜 就去找了个暴破脚本

改一改 跑一下

贴exp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import hashlib
import itertools

text = ['A2F17ED1C6A8BC31769CDF654DF4B8A937042CB6', '0CA8A2EDB0C1D34A432A5A4464E0D6ABD847C831',
'C359D69F3F08BB920F2C3B51133205533462093E', 'CC5C3FE6E7356A26A134CFF5633349F597C40A9D',
'4AC4BB3F27F245BA9178651AA5CDEDCBB2862E2A', 'A01E33F4DCDB6BA1AE9F34A97CF8F6DEEEDF1A8D',
'D3AF70912A8C1B22CFDECE071BA36BC4662B58FA', '9395EAB195D25B676D7D07075D3838A9AC19DF21',
'FDB43C5EF76ECDA0C1661D6D199B5BFAC1DB538A', 'DA8E9997A010BE78B20108CE79FEC1FB9C63D8DC',
'809DA627F1AD01D65864C376E3179B62D9D74261', '8F61EE21AC7579626934E0FFB6A62B3D4A82EEC4',
'E2A954758FDB61F869998E9788B7B7E48480B832', 'B8E3349B97532B27AA62B8718B68240179158144']

# print(hashlib.sha1('fla'.encode()).hexdigest())

for i in range(len(text)):
print(len(text[i]))

modle = list(itertools.product(
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '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', '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', '{', '}', '_', '!', '@', '|'],
repeat=3))

i = -1
flag = ''

for k in range(len(text)):
while True:
i += 1
# print(modle[i])
str = ''.join(modle[i])

if hashlib.sha1(str.encode()).hexdigest() in text[k].lower():
print('correct: ', str)
# input()
flag += str
break
else:
print('[-]:' + str)
i = -1
print(flag)

``

提交一下 过啦

Orz Orz

(又偷到一招) bushi 又学到一招

总结

学到了 个 暴破脚本

然后贴一下itertools 是啥模块

image-20230225202228811

好的 本期结束

感谢观看

Orz