Sandsifter:一款專門針對X86處理器的模糊測試工具
前言
今天給大家介紹的是一款名叫Sandsifter的x86處理器模糊測試工具。該工具可以通過系統生成的機器碼來搜尋處理器指令集,並通過監控異常資料來審計x86處理器中的隱藏指令和硬體漏洞。Sandsifter目前已經成功識別出了大部分處理器產品中的隱藏處理器指令,反彙編器、編譯器和模擬器中普遍存在的軟體漏洞,企業管理程式中的安全缺陷,以及x86晶片中關鍵的硬體安全漏洞。
由於目前市場上仍存在著大量x86處理器,因此該工具的主要目的就是幫助廣大使用者檢查自己系統中的隱藏指令以及安全漏洞。
大家可以直接執行下列命令來對自己的處理器進行基礎審計:
sudo./sifter.py --unk --dis --len --sync --tick -- -P1 -t
接下來,計算機會自動掃描異常指令。在上圖的上半部分中,大家可以檢視Sandsifter已測試的指令資訊。圖片的下半部分顯示的是Sandsifter檢測到的異常情況。整個搜尋過程大約需要1個小時或1天的時間不等,具體取決於處理器的運算速度以及架構複雜程度。掃描完成之後,Sandsifter會將結果報告給使用者:
./summarize.py data/log
一般來說,該工具能夠掃描出你處理器中的好幾百萬條隱藏指令,不過工具會幫你進行自動分類。在對異常資料進行分析和篩選之後,工具會將每一條指令分配到不同的目錄中:
軟體漏洞;
硬體漏洞;
隱藏指令;
按下“Q”鍵退出後,你可以獲取到文字版的系統掃描結果:
雖然工具會對掃描結果進行自動化分類,但是具體的分析仍需要大家人工參與。如果你需要專業人員幫助你分析資料的話,你可以將./data/log檔案傳送至[email protected]。
程式碼構建
Sandsifter首先需要安裝 ofollow" rel="nofollow,noindex" target="_blank">Capstone 反彙編器:【 傳送門 】。常用的安裝命令如下:
sudo apt-get install libcapstone3 libcapstone-dev sudo pip install capstone
Sandsifter構建命令:
make
然後執行:
sudo ./sifter.py --unk --dis --len --sync --tick -- -P1 -t
Flag
大家可以使用–flag來給sifter傳遞標記值,使用– -f來給注入器傳遞資料:
sudo ./sifter.py --unk --dis --len --sync --tick -- -P1 -t
Sifter標記:
--len search for length differences in allinstructions (instructions that executed differently than the disassemblerexpected, or did not exist when the disassembler expected them to --dis search for length differences in validinstructions (instructions that executed differently than the disassemblerexpected) --unk search for unknown instructions (instructionsthat the disassembler doesn't know about but successfully execute) --ill the inverse of --unk, search for invaliddisassemblies (instructions that do not successfully execute but that thedisassembler acknowledges) --tick periodically write the current instruction todisk --save save search progress on exit --resume resume search from last saved state --sync write search results to disk as they are found --low-mem do not store results in memory
Injector標記:
-b
-b
mode: brute force
-r
mode: randomized fuzzing
-t
mode: tunneled fuzzing
-d
mode: externally directed fuzzing
-R
raw output mode
-T
text output mode
-x
write periodic progress to stderr
-0
allow null dereference (requires sudo)
-D
allow duplicate prefixes
-N
no nx bit support
-sseed
in random search, seed value
-Bbrute_depth
in brute search, maximum search depth
-Pmax_prefix
maximum number of prefixes to search
-iinstruction
instruction at which to start search(inclusive)
-einstruction
instruction at which to end search (exclusive)
-ccore
core on which to perform search
-Xblacklist
blacklist the specified instruction
-jjobs
number of simultaneous jobs to run
-lrange_bytes
number of base instruction bytes in each subrange
快捷鍵
M:模式-修改搜尋模式; Q:退出-退出Sifter; P:暫停-暫停或繼續搜尋任務;
參考資料
1. https://www.youtube.com/watch?v=KrksBdWcZgQ
2. https://github.com/xoreaxeaxeax/sandsifter/blob/master/references/domas_breaking_the_x86_isa_wp.pdf
3. https://github.com/xoreaxeaxeax/sandsifter/blob/master/references/domas_breaking_the_x86_isa.pdf
* 參考來源: kitploit ,FB小編Alpha_h4ck編譯,轉載請註明來自FreeBuf.COM