cat flag
使用01打開flag.png,發現圖片尾部有padding的數據。D0 CF 11 E0 A1 B1 1A E1為office2007以前版本的文件頭。將其另存為flag.doc,打開發現提示需要密碼。(可以注意到:D0CF11E0非常類似DOCFILE)
使用john的office2john.py 提取hash
D:\CTF\john-1.9.0-jumbo-1-win64\run>python2 office2john.py ../flag.doc > ../hash.txt
D:\CTF\john-1.9.0-jumbo-1-win64\run>type ..\hash.txt
flag.doc:$office$*2010*100000*128*16*56a209e2d6300f6c765382cfdac80401*01850b38c7e363baa5fbffd3029893da*a7a9e3fab3761e9a446ddf0741653b9ab0c01a13fa49269e05c35abf902ffd34
準備使用john使用5-6位數字爆破hash.在john.conf中添加配置:
[Incremental:Digits56]
File = $JOHN/digits.chr
MinLen = 5
MaxLen = 6
CharCount = 10
爆破得到密碼19631:
D:\CTF\john-1.9.0-jumbo-1-win64\run>john --incremental:digits56 ..\hash.txt
Loaded 1 password hash (Office, 2007/2010/2013 [SHA1 256/256 AVX2 8x / SHA512 256/256 AVX2 4x AES])
19631 (flag.doc)
Use the "--show" option to display all of the cracked passwords reliably
Session completed
flag.doc使用密碼打開,報文件損壞。改成flag.ppt,順利打開。最后一頁PPT圖片下面的文本框全選后改字體顏色,發現flag{dfe0dbf036a1963169da486f6a16800b618c4}
deep
這題就是內存存儲數據的大小端存儲問題。
大端(存儲)模式:是指數據的低位保存在內存的高地址中,而數據的高位保存在內存的低地址中;(相反)
小端(存儲)模式:是指數據的低位保存在內存的低地址中,而數據的高位保存在內存的高地址中。(相同)
with open('hint.txt','r') as f:d_list = f.readlines()
str1=''
for d in d_list:d = d.strip()str1 += chr(int(d) &0xff)str1 += chr( (int(d) &0xffff) >> 8)str1 += chr( (int(d) &0xffffff) >> 16)str1 += chr(int(d) >> 24)
print(str1)
#e073511f87443541a6b93d1b6e5253e0
本題就是小端存儲。
如果搞不清楚大小端,可以在C++ Shell進行在線調試,無非就是字符前后的問題