今天給大家介紹的是一款名叫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文件發送至xoreaxeaxeax@gmail.com。
代碼構建
Sandsifter首先需要安裝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
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:暫停-暫停或繼續搜索任務;
|