文件隐写(Steganography)
图片类
通用
图种(binwalk、foremost、某压缩软件)
LSB
stegsolve.jar
lsb.py
安装:https://github.com/livz/cloacked-pixel
命令:
(python2) lsb.py extract <stego_file> <out_file> <password>
stegseek
https://github.com/RickdeJager/stegseek
stegseek [stegofile.jpg] [wordlist.txt]
openstego
盲水印(双图)
https://github.com/chishaxie/BlindWaterMark
命令:
python bwm.py decode hui.png hui_with_wm.png wm_from_hui.png
https://github.com/linyacool/blind-watermark
命令:
python decode.py --original ori.png --image res.png --result extract.png
Java盲水印
https://github.com/ww23/BlindWatermark
命令:
java -jar BlindWatermark.jar decode -c img-ec.jpg img-dc.jpg
隐形水印(吾爱破解WaterMark隐形水印工具)
NTFS(某压缩软件、NtfsStreamsEditor)
Our Secret(文档加密)
Steganography
https://www.hyluz.cn/zb_users/upload/2021/02/202102201613815645350310.zip
文件尾标志:
l<9l0kl10n88j:8<
PixelJihad(JS加密)
Steganography.js(JS加密)
https://www.peter-eigenschink.at/projects/steganographyjs/showcase/
DeEgger Embedder
bftools
命令:
bftools decode braincopter 1.png > 1.txt
bftools run 1.txt
png
文件头:
89 50 4E 47 0D 0A 1A 0A 00 00 00 0D 49 48 44 52
文件尾:
00 00 00 00 49 45 4E 44 AE 42 60 82
zsteg
https://github.com/zed-0xff/zsteg
命令:
zsteg -a xxx.png
zsteg -E "[Pattern]" xxx.png > out.xxx
LSB(带密码,弱口令123456)
stegpy
安装:
pip install stegpy
命令:
stegpy xx.webp (-p)
jpg / jpeg
文件头:
FF D8 FF
文件尾:
FF D9
steghide
http://steghide.sourceforge.net/
命令:
steghide extract -sf 1.jpg (需密码 或 空密码)
密码爆破:
stegseek
https://github.com/RickdeJager/stegseek
stegseek [stegofile.jpg] [wordlist.txt]
StegCracker(爆破)
https://github.com/Paradoxis/StegCracker
命令:
stegcracker <file> [<wordlist>]
jsteg
F5
https://github.com/matthewgao/F5-steganography
命令:
java Extract 123456.jpg -p 123456
outguess
https://github.com/crorvick/outguess
命令:
outguess -r file.jpg -k password -t out.txt
JPHS
bmp
zsteg
https://github.com/zed-0xff/zsteg
命令:
zsteg -a xxx.bmp
zsteg -E "[Pattern]" xxx.bmp > out.xxx
wbStego
wbstego43open:http://wbstego.wbailer.com/
stegpy
安装:
pip install stegpy
命令:
stegpy xx.webp (-p)
gif
文件头:
47 49 46 38
(GIF87a
或GIF89a
)分帧(NamoGIF)
时间轴(每一帧间的时间间隔)
identify -format "%s %T \n" 100.gif
stegpy
安装:
pip install stegpy
命令:
stegpy xx.webp (-p)
相同图像比对
webp
stegpy
安装:
pip install stegpy
命令:
stegpy xx.webp (-p)
其他在线工具
音频类
通用
- Audacity(波形、频谱)
- DeEgger Embedder
mp3
mp3stego
https://www.petitcolas.net/steganography/mp3stego/
命令:
decode -X -P pass svega_stego.mp3
MP3 Steno
帧头private_bit
参考:
wav
文件头:
52 49 46 46 EE AD 25 03 57 41 56 45 66 6D 74 20
LSB
Silenteye:
脚本:
SSTV
慢扫描电视(Slow-scan television)是业余无线电爱好者的一种主要图片传输方法,慢扫描电视通过无线电传输和接收单色或彩色静态图片。
工具:
https://github.com/colaclanth/sstv
命令:
sstv -d audio_file.wav -o result.png
手机App - Robot36(音频→图片)
DeepSound
stegpy
安装:
pip install stegpy
命令:
stegpy xx.webp (-p)
mid
Velato
其他在线工具
视频类
压缩包类
zip
文件头:
50 4B 03 04
(PK
)伪加密(某压缩软件)
密码爆破(ARCHPR)
明文攻击工具
bkcrack / rbkcrack
攻击:
1
2
3
4
5
6
7
8rbkcrack -C xxx.zip -c xxx.png -p yyy.png
-C 要攻击的压缩包
-c 要攻击的压缩包里面的文件
-p 刚创建的明文文件名
*部分位置已知明文:
bkcrack -C flag.zip -c flag.txt -p plain.txt -x 16 2d -x 21 2d -x 26 2d -x 31 2d -x 44 7d得到三个key解码:
1
2
3
4
5
6rbkcrack -C xxx.zip -c xxx.png -k be056038 0a143c0c 1ea08ca5 -d xxx.png
-C 要攻击的压缩包
-c 要攻击的压缩包里面的文件
-k 刚生成的三个key
-d 最终还原的文件名
rar
文件头:
52 61 72 21
(Rar!
)参考:https://blog.csdn.net/Claming_D/article/details/105899397
伪加密
查看第24个16进制数后面的数是0还是4,是4表示进行了伪加密,将4改为0就可以解除伪加密(修改对应RarBlock的CRC值)。
爆破工具
hashcat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17获得hash值
rar2john xxx.rar > rar.hash
爆破
hashcat -m 12500 -a 3 $RAR3$*0*a4243df9ba2d6023*b84a539412288864a2d6a9bfdcf2dd97 ?d?d?d?d?d?d -o out.txt
hashcat -m 13000 -a 3 $RAR5$*0*a4243df9ba2d6023*b84a539412288864a2d6a9bfdcf2dd97 ?d?d?d?d?d?d -o out.txt
-m 根据rar类型进行选择,hashcat官方提供的参数有两种,RAR3-hp类型为12500,RAR5类型为13000
-a 3 为掩码方式破解,掩码格式如下
?d?d?d?d?d?d 表示为6位数字
内置的掩码规则有:
?l :表示小写字母
?u :表示大写字母
?d :表示数字
?s :表示特殊字符
?a :表示上面四种的并集
-o out.txt是输出结果
文本类
txt
零宽
whitespace
snow隐写
http://fog.misty.com/perry/ccs/snow/snow/snow.html
snow -C -p password filename
word
解压
word选项-显示-隐藏文字-勾选
解密
提取hash值:
python3 office2john.py 1.docx > hash.txt
hashcat破解:
hashcat -m 9400 --username hash.txt -a 3 ?d?d?d?d?d?d?d?d -o cracked_pass.txt
excel
- 解压
pdf
wbStego4open
密码爆破
- pdfcrack
pyc / pyo
stegosaurus(字节码)
https://github.com/AngelKitty/stegosaurus
命令:
python3 -m stegosaurus main.pyc -x
常用脚本
图片处理
CRC宽高爆破(png)
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
27import binascii
import struct
import sys
fr = open('flag.png','rb').read()
data = bytearray(fr[0x0c:0x1d])
crc32key = eval('0x'+str(binascii.b2a_hex(fr[0x1d:0x21]))[2:-1])
n = 4095
for w in range(n):
width = bytearray(struct.pack('>i', w))
for h in range(n):
height = bytearray(struct.pack('>i', h))
for x in range(4):
data[x+4] = width[x]
data[x+8] = height[x]
crc32result = binascii.crc32(data) & 0xffffffff
if crc32result == crc32key:
print(width,height)
newpic = bytearray(fr)
for x in range(4):
newpic[x+16] = width[x]
newpic[x+20] = height[x]
fw = open('flag2.png','wb')
fw.write(newpic)
fw.close
sys.exit()
快速傅里叶变换(FFT)
1
2
3
4
5
6
7
8
9
10
11
12
13
14import cv2 as cv
import numpy as np
import matplotlib.pyplot as plt
img = cv.imread('FFT.png', 0) #读为灰度图像
f = np.fft.fft2(img) #做频率变换
fshift = np.fft.fftshift(f) #转移像素做幅度谱
s1 = np.log(np.abs(fshift))#取绝对值:将复数变化成实数取对数的目的为了将数据变化到0-255
plt.subplot(121)
plt.imshow(img, 'gray')
plt.title('original')
plt.subplot(122)
plt.imshow(s1,'gray')
plt.title('center')
plt.show()
压缩包处理
遍历zip压缩包
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16import os.path
import zipfile
import re
dir_path='xxxxxxxx'
files= os.listdir(dir_path)
newfiles = files[::-1]
print(newfiles)
setee = []
for file in newfiles: #遍历文件夹
position = dir_path+'\\'+ file #构造绝对路径,"\\",其中一个'\'为转义符
print (position)
z = zipfile.ZipFile(position, 'r')
for filename in z.namelist():
bytes = z.read(filename)
if b'Zmxh' in bytes:
print(filename)
zlib解压字符串
1
2
3
4
5
6import zlib
data = open("zlib_hex_data.txt", 'r', encoding="utf-8").read().replace(" ", "").replace("\n", "").strip()
data_dec = zlib.decompress(bytes.fromhex(data))
print(data_dec[:100])
with open("zlib_data.rar", 'wb') as wf:
wf.write(data_dec)
其他在线工具
wordle 填字:https://www.wsolver.com/
sokudo 数独:https://shudu.gwalker.cn/
virustotal 文件检测:https://www.virustotal.com/gui/home/upload
Tupper自指公式:https://tuppers-formula.ovh/
base-decode 任意base解码:https://basecrack.herokuapp.com/
brainfuck分析:http://pablojorge.github.io/brainfuck/