1.消息隱藏
image.png
寫入zip文件,轉碼有點惡心
image.png
2.偽加密
自己寫了個腳本查偽加密
# coding='utf-8'
"""
判斷文件是否是偽加密
有兩個加密表示位:
第一個:文件[6:8]
第二個:文件目錄區,504B0102開頭,再也8,9位
第一個:第二個:是否加密
0000:0000:沒有加密
0000:0900:偽加密
0900:0900:真加密
0900:0000:沒有加密
使用方法:python3 is_pe filename.zip
"""
import sys
import os
def is_pe(file):
flag_pe_top = b'PK\x01\x02'
flag_te = b'\t\x00'
flag_ne = b'\x00\x00'
with open(file, 'rb') as f:
text = f.read()
flag_index = text.find(flag_pe_top)
if text[6:8] == flag_ne and text[flag_index+8:flag_index+10] == flag_te:
return 1
elif text[6:8] == flag_te and text[flag_index+8:flag_index+10] == flag_te:
return 0
elif text[6:8] == flag_ne and text[flag_index+8:flag_index+10] == flag_ne:
return -1
elif text[6:8] == flag_te and text[flag_index+8:flag_index+10] == flag_ne:
return -1
else:
return -2
def main():
if len(sys.argv) != 1:
for arg in sys.argv[1:]:
flag = is_pe(arg)
if flag == 1:
print("[+] %s 是偽加密!"%arg)
elif flag == 0:
print("[*] %s 是真加密"%arg)
elif flag == -1:
print("[#] %s 文件無加密"%arg)
else:
print("[-] %s 文件損壞"%arg)
else:
print('help: python3 is_pe file1 file2 file3')
if __name__ == '__main__':
main()
image.png
3.圖片隱藏壓縮包
第一步:分析
root@kali:~/桌面# ls
u5bc6u7801u7eafu6570u5b57u5171u0038u4f4d.png
root@kali:~/桌面# binwalk u5bc6u7801u7eafu6570u5b57u5171u0038u4f4d.png //分析圖片
DECIMAL HEXADECIMAL DESCRIPTION
--------------------------------------------------------------------------------
0 0x0 PNG image, 370 x 370, 1-bit grayscale, non-interlaced
41 0x29 Zlib compressed data, default compression
694 0x2B6 Zip archive data, encrypted at least v2.0 to extract, compressed size: 54990, uncompressed size: 292875, name: C8-E7-D8-E8-E5-88_handshake.cap
56130 0xDB42 End of Zip archive
//有兩個文件,一個圖片一個zip
第二步:使用dd分離
//使用dd分離dd if=文件名 of=分離文件名, skip=開始分離地址,bs=一次讀寫字節數
root@kali:~/桌面# dd if=u5bc6u7801u7eafu6570u5b57u5171u0038u4f4d.png of=u.zip skip=694 bs=1
記錄了55458+0 的讀入
記錄了55458+0 的寫出
55458 bytes (55 kB, 54 KiB) copied, 0.122583 s, 452 kB/s
root@kali:~/桌面# ls
u5bc6u7801u7eafu6570u5b57u5171u0038u4f4d.png u.zip
第二步:使用foremost分離
root@kali:~/桌面# ls
u5bc6u7801u7eafu6570u5b57u5171u0038u4f4d.png
root@kali:~/桌面# foremost u5bc6u7801u7eafu6570u5b57u5171u0038u4f4d.png
Processing: u5bc6u7801u7eafu6570u5b57u5171u0038u4f4d.png
|foundat=C8-E7-D8-E8-E5-88_handshake.capc???-Bp??9?<`=HBQw?.???SDlPeE?he?????%??0`K??J??BQ?
?4
?+???W??OP??;??w ??r?4???????K?A?4?? ???P2?X?????銃?0????G????L??[?L???u|?^9e???*S??tCw/?n?;?}J??)t??????=d?W??????l??????p??6Bc?4?(?'?W?????l ?:%??@/,????(v?g?e??F8?h?k?GAh??Vm???\?m??????`??? 4
*|
root@kali:~/桌面# tree
.
├── output
│ ├── audit.txt
│ ├── png
│ │ └── 00000000.png
│ └── zip
│ └── 00000001.zip
└── u5bc6u7801u7eafu6570u5b57u5171u0038u4f4d.png
3 directories, 4 files
4.ADPR: 爆破/字典/掩碼/明文攻擊
爆破(不推薦)
image.png
字典
image.png
掩碼
image.png
明文攻擊,文件不能太小,要能看到每個文件都有crc32效驗碼
image.png