這是今天的題目
那首先我們一樣先打確認檔案格式,然後打開圖像
打開後會看到這是一張花園的圖,但並無特別之處
接著我用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找解答。
就解出來了。
心得:
這題一開始看起來只是單純的JPEG圖片,打開也只是普通的花園,exif資訊也沒有特別的地方,這時候就會讓人誤以為是不是題目單純到什麼都沒有。不過從題目裡What is a hex editor?的提示,就可以意識到方向不是在 metadata,而是要直接從檔案位元去找。用xxd把圖片轉成十六進位文字檔,再用grep去找 flag 關鍵字,其實就是最直接也最有效率的方法。
從這題中我學到,在CTF裡遇到檔案型題目時,除了嘗試一般性檢查(像是 file、exiftool、strings、binwalk),還要記得回到最底層的hex檢查,因為很多出題者就是喜歡把答案硬塞在檔案尾部,或直接藏在二進位裡。雖然這次的flag不算難找,但讓我了解到grep搭配十六進位轉換的用法,也讓我更熟悉處理影像檔隱藏訊息的常見套路,而不只是專注在圖片本身的樣子及其meta資訊。