今天給大家介紹的是一款名叫Sandsifter的x86處理器模糊測(cè)試工具。該工具可以通過(guò)系統(tǒng)生成的機(jī)器碼來(lái)搜索處理器指令集,并通過(guò)監(jiān)控異常數(shù)據(jù)來(lái)審計(jì)x86處理器中的隱藏指令和硬件漏洞。Sandsifter目前已經(jīng)成功識(shí)別出了大部分處理器產(chǎn)品中的隱藏處理器指令,反匯編器、編譯器和模擬器中普遍存在的軟件漏洞,企業(yè)管理程序中的安全缺陷,以及x86芯片中關(guān)鍵的硬件安全漏洞。
由于目前市場(chǎng)上仍存在著大量x86處理器,因此該工具的主要目的就是幫助廣大用戶檢查自己系統(tǒng)中的隱藏指令以及安全漏洞。
大家可以直接運(yùn)行下列命令來(lái)對(duì)自己的處理器進(jìn)行基礎(chǔ)審計(jì):
sudo./sifter.py --unk --dis --len --sync --tick -- -P1 -t
接下來(lái),計(jì)算機(jī)會(huì)自動(dòng)掃描異常指令。在上圖的上半部分中,大家可以查看Sandsifter已測(cè)試的指令信息。圖片的下半部分顯示的是Sandsifter檢測(cè)到的異常情況。整個(gè)搜索過(guò)程大約需要1個(gè)小時(shí)或1天的時(shí)間不等,具體取決于處理器的運(yùn)算速度以及架構(gòu)復(fù)雜程度。掃描完成之后,Sandsifter會(huì)將結(jié)果報(bào)告給用戶:
./summarize.py data/log
一般來(lái)說(shuō),該工具能夠掃描出你處理器中的好幾百萬(wàn)條隱藏指令,不過(guò)工具會(huì)幫你進(jìn)行自動(dòng)分類。在對(duì)異常數(shù)據(jù)進(jìn)行分析和篩選之后,工具會(huì)將每一條指令分配到不同的目錄中:
軟件漏洞;
硬件漏洞;
隱藏指令;
按下“Q”鍵退出后,你可以獲取到文字版的系統(tǒng)掃描結(jié)果:
雖然工具會(huì)對(duì)掃描結(jié)果進(jìn)行自動(dòng)化分類,但是具體的分析仍需要大家人工參與。如果你需要專業(yè)人員幫助你分析數(shù)據(jù)的話,你可以將./data/log文件發(fā)送至xoreaxeaxeax@gmail.com。
代碼構(gòu)建
Sandsifter首先需要安裝Capstone反匯編器:【傳送門】。常用的安裝命令如下:
sudo apt-get install libcapstone3 libcapstone-dev
sudo pip install capstone
Sandsifter構(gòu)建命令:
make
然后運(yùn)行:
sudo ./sifter.py --unk --dis --len --sync --tick -- -P1 -t
Flag
大家可以使用–flag來(lái)給sifter傳遞標(biāo)記值,使用– -f來(lái)給注入器傳遞數(shù)據(jù):
sudo ./sifter.py --unk --dis --len --sync --tick -- -P1 -t
Sifter標(biāo)記:
--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標(biāo)記:
-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:暫停-暫停或繼續(xù)搜索任務(wù);
|