--- tags: CTF_Writeups, picoCTF, General Skills --- # Static ain't always noise * 解題 題目給了一個執行檔 `static` 與 shell script `ltdis.sh` , 將他們載下來後,因為題目要求看 `static` 中的資料, 因此直接給權限後執行: ```shell $ chmod +x ./static $ ./static ``` 執行後: ``` Oh hai! Wait what? A flag? Yes, it's around here somewhere! ``` 沒有 flag ,題目有說另一個 shell script 會有幫助,先執行該 shell script 看看: ```shell $ chmod +x ./ltdis.sh $ ./ltdis.sh ``` 執行後: ``` Attempting disassembly of ... objdump: 'a.out': No such file objdump: section '.text' mentioned in a -j option, but not found in any input file Disassembly failed! Usage: ltdis.sh <program-file> Bye! ``` 程式輸出表示需要一個程式輸入,所以我們把 `static` 當作參數輸入 shell script: ```shell $ ./ltdis.sh ./static ``` 執行後: ``` Attempting disassembly of ./static ... Disassembly successful! Available at: ./static.ltdis.x86_64.txt Ripping strings from binary with file offsets... Any strings found in ./static have been written to ./static.ltdis.strings.txt with file offset ``` 然後就可以看到產生了兩個檔案 `./static.ltdis.x86_64.txt` 與 `./static.ltdis.strings.txt` ,根據程式輸出訊息,任何找到的字串都在 `./static.ltdis.strings.txt` 中,我們用 grep 命令來找出 flag : ```shell $ grep 'picoCTF' ./static.ltdis.strings.txt ``` 輸出: ``` 1020 picoCTF{d15a5m_t34s3r_f5aeda17} ```