Hack The Box(HTB) - CTF Try Out : Don't Panic! Walkthrough
Hack The Box(HTB) - CTF Try Out : Don't Panic! Walkthrough 又是一題僅有檔案的 CTF 檔案下載後一樣僅有一個檔案 一樣是個 ELF 檔案,這一次 strings 沒有任何 HTB 字眼 執行看看,輸入 yes or no 都讓他恐慌 參考這一篇 : https://medium.com/@ranachouchen4/hackthebox-dont-panic-reverse-engineering-writeup-897bcc6cd809 編寫一個 python code 如下 import pexpect import re import string import random # Initial random flag (HTB format + 27 random letters) flag = "HTB{111111111111111111111111111" ansi_escape = re. compile ( r'\x1B\[[0-?]*[ -/]*[@-~]' ) # Regex to extract character from disassembled cmp line cmp_re = re. compile ( r"cmp\s+\$?0x([0-9a-fA-F]+).*%dil" , re.IGNORECASE) for i in range ( 31 ): gdb = pexpect.spawn( "gdb -q ./dontpanic" , encoding= "utf-8" , timeout= 3 ) gdb.expect_exact( "(gdb)" ) gdb.sendline( "b src::check_flag" ) gdb.expect_exact( "(gdb)" ) gdb.sendline( "run" ) gdb.expect( r"Have you got a message for me\?...