iT邦幫忙

2025 iThome 鐵人賽

DAY 22
0
Security

30 天闖關 picoCTF系列 第 22

[2025鐵人賽Day22]Glory of the Garden

  • 分享至 

  • xImage
  •  

這是今天的題目
https://ithelp.ithome.com.tw/upload/images/20250929/20178623UH7MoBt4c6.png
那首先我們一樣先打確認檔案格式,然後打開圖像
https://ithelp.ithome.com.tw/upload/images/20250929/20178623KACrJy7yJe.png
打開後會看到這是一張花園的圖,但並無特別之處
https://ithelp.ithome.com.tw/upload/images/20250929/20178623vF3fVvtS20.png
接著我用exiftool查看檔案資訊,顯示了這樣的內容

exiftool garden.jpg 
ExifTool Version Number         : 13.10
File Name                       : garden.jpg
Directory                       : .
File Size                       : 2.3 MB
File Modification Date/Time     : 2020:10:26 14:39:31-04:00
File Access Date/Time           : 2025:09:29 02:24:20-04:00
File Inode Change Date/Time     : 2025:09:29 02:23:51-04:00
File Permissions                : -rw-rw-r--
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Resolution Unit                 : inches
X Resolution                    : 72
Y Resolution                    : 72
Profile CMM Type                : Linotronic
Profile Version                 : 2.1.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 1998:02:09 06:49:00
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : Hewlett-Packard
Device Model                    : sRGB
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : Hewlett-Packard
Profile ID                      : 0
Profile Copyright               : Copyright (c) 1998 Hewlett-Packard Company
Profile Description             : sRGB IEC61966-2.1
Media White Point               : 0.95045 1 1.08905
Media Black Point               : 0 0 0
Red Matrix Column               : 0.43607 0.22249 0.01392
Green Matrix Column             : 0.38515 0.71687 0.09708
Blue Matrix Column              : 0.14307 0.06061 0.7141
Device Mfg Desc                 : IEC http://www.iec.ch
Device Model Desc               : IEC 61966-2.1 Default RGB colour space - sRGB
Viewing Cond Desc               : Reference Viewing Condition in IEC61966-2.1
Viewing Cond Illuminant         : 19.6445 20.3718 16.8089
Viewing Cond Surround           : 3.92889 4.07439 3.36179
Viewing Cond Illuminant Type    : D50
Luminance                       : 76.03647 80 87.12462
Measurement Observer            : CIE 1931
Measurement Backing             : 0 0 0
Measurement Geometry            : Unknown
Measurement Flare               : 0.999%
Measurement Illuminant          : D65
Technology                      : Cathode Ray Tube Display
Red Tone Reproduction Curve     : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 2060 bytes, use -b option to extract)
Image Width                     : 2999
Image Height                    : 2249
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Image Size                      : 2999x2249
Megapixels                      : 6.7

但就目前來看,Exif metadata沒直接透露flag或線索。那我們根據提示說的What is a hex editor?推測可能要用到編碼去解答案。
我們用xxd garden.jpg > hex.txt,之後我本來用cat查看裡面內容,發現內容太多於是之接嘗試grep找解答。
https://ithelp.ithome.com.tw/upload/images/20250929/201786230CruMsDObF.png
就解出來了。

心得:
這題一開始看起來只是單純的JPEG圖片,打開也只是普通的花園,exif資訊也沒有特別的地方,這時候就會讓人誤以為是不是題目單純到什麼都沒有。不過從題目裡What is a hex editor?的提示,就可以意識到方向不是在 metadata,而是要直接從檔案位元去找。用xxd把圖片轉成十六進位文字檔,再用grep去找 flag 關鍵字,其實就是最直接也最有效率的方法。

從這題中我學到,在CTF裡遇到檔案型題目時,除了嘗試一般性檢查(像是 file、exiftool、strings、binwalk),還要記得回到最底層的hex檢查,因為很多出題者就是喜歡把答案硬塞在檔案尾部,或直接藏在二進位裡。雖然這次的flag不算難找,但讓我了解到grep搭配十六進位轉換的用法,也讓我更熟悉處理影像檔隱藏訊息的常見套路,而不只是專注在圖片本身的樣子及其meta資訊。


上一篇
[2025鐵人賽Day21]Netcat
系列文
30 天闖關 picoCTF22
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言