Skip to content
KitploitKITPLOIT
HerramientasBlog
Enviar
HerramientasBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

··Feeds·Contacto·Privacidad·© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
log4j-log4shell-playground — Un campo de pruebas para investigar las mitigaciones de la vulnerabilidad Log4Shell (CVE-2021-44228) | Kitploit
Herramientas/GitHubGitHub/rgl/log4j-log4shell-playground
Análisis de VulnerabilidadesExplotaciónExplotación de Aplicaciones WebPruebas de PenetraciónAprendizaje y EducaciónLabs y Práctica
GitHubrgl/log4j-log4shell-playground

log4j-log4shell-playground

Un campo de pruebas para investigar las mitigaciones de la vulnerabilidad Log4Shell (CVE-2021-44228)

Ver Repositorio
1hace 4 añosAún no revisado

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →
Compartir

Acerca de

Un campo de pruebas para experimentar con las mitigaciones de la vulnerabilidad crítica log4j (también conocida como Log4Shell) (CVE-2021-44228).

Este problema en particular reside en la función JndiLookup y en la capacidad de log4j de interpretar TODOS los argumentos de una llamada de registro.

Uno esperaría que solo interpretara el mensaje de formato (el primer argumento de una llamada de registro), por ejemplo, el Hello {} en log.info("Hello {}", "${jndi:ldap://127.0.0.1:8081}"), pero los interpreta todos.

Las mitigaciones impedirán que log4j active las búsquedas jndi, pero aún permiten otras búsquedas como ${java:version}.

NB: Desde log4j 2.16.0 (LOG4J2-3211; diff) el mensaje de formato ya no se interpreta.

Esta vulnerabilidad se puede activar remotamente cuando la aplicación objetivo registra cualquier dato proporcionado por el usuario, por ejemplo, de estos encabezados HTTP comunes:

  • Accept
  • Cookie
  • Location
  • Origin
  • Referer
  • User-Agent
  • X-Api-Version
  • X-Forwarded-For
  • X-Forwarded-Host
  • X-Requested-With
  • Probar (Ubuntu 20.04)

    Compilar:

    root@kitploit:~
    sudo apt-get install -y openjdk-11-jdk-headless
    wget https://archive.apache.org/dist/logging/log4j/2.10.0/apache-log4j-2.10.0-bin.tar.gz
    wget https://archive.apache.org/dist/logging/log4j/2.16.0/apache-log4j-2.16.0-bin.tar.gz
    tar xf apache-log4j-2.10.0-bin.tar.gz
    tar xf apache-log4j-2.16.0-bin.tar.gz
    javac -Werror -cp apache-log4j-2.10.0-bin/log4j-api-2.10.0.jar Server.java
    

    Prueba una versión vulnerable de log4j:

    root@kitploit:~
    java \
        -cp apache-log4j-2.10.0-bin/log4j-api-2.10.0.jar:apache-log4j-2.10.0-bin/log4j-core-2.10.0.jar:. \
        Server
    curl -H 'X-Api-Version:${jndi:ldap://127.0.0.1:8081}' http://localhost:8080
    curl -H 'X-Api-Version:${java:version}' http://localhost:8080
    

    Prueba eliminando la clase JndiLookup de la mitigación del classpath:

    root@kitploit:~
    cp apache-log4j-2.10.0-bin/log4j-core-2.10.0.jar log4j-core-2.10.0-without-jndi-lookup.jar
    zip -q -d log4j-core-2.10.0-without-jndi-lookup.jar org/apache/logging/log4j/core/lookup/JndiLookup.class
    java \
        -cp apache-log4j-2.10.0-bin/log4j-api-2.10.0.jar:log4j-core-2.10.0-without-jndi-lookup.jar:. \
        Server
    curl -H 'X-Api-Version:${jndi:ldap://127.0.0.1:8081}' http://localhost:8080
    curl -H 'X-Api-Version:${java:version}' http://localhost:8080
    

    Prueba la mitigación de variable de entorno:

    NB Desde el 2021-12-15 (alrededor de la fecha de lanzamiento de log4j 2.16.0 / CVE-2021-45046) esto ya no se recomienda.

    root@kitploit:~
    LOG4J_FORMAT_MSG_NO_LOOKUPS=true \
        java \
        -cp apache-log4j-2.10.0-bin/log4j-api-2.10.0.jar:apache-log4j-2.10.0-bin/log4j-core-2.10.0.jar:. \
        Server
    curl -H 'X-Api-Version:${jndi:ldap://127.0.0.1:8081}' http://localhost:8080
    curl -H 'X-Api-Version:${java:version}' http://localhost:8080
    

    Prueba una versión no vulnerable de log4j:

    root@kitploit:~
    java \
        -cp apache-log4j-2.16.0-bin/log4j-api-2.16.0.jar:apache-log4j-2.16.0-bin/log4j-core-2.16.0.jar:. \
        Server
    curl -H 'X-Api-Version:${jndi:ldap://127.0.0.1:8081}' http://localhost:8080
    curl -H 'X-Api-Version:${java:version}' http://localhost:8080
    

    Prueba grype para ver si detecta la vulnerabilidad:

    root@kitploit:~
    wget https://github.com/anchore/grype/releases/download/v0.27.2/grype_0.27.2_linux_amd64.tar.gz
    tar xf grype_0.27.2_linux_amd64.tar.gz grype
    ./grype dir:.
    

    Prueba trivy para ver si detecta la vulnerabilidad:

    root@kitploit:~
    wget https://github.com/aquasecurity/trivy/releases/download/v0.21.2/trivy_0.21.2_Linux-64bit.tar.gz
    tar xf trivy_0.21.2_Linux-64bit.tar.gz trivy
    ./trivy fs --security-checks vuln .
    

    Referencias

    • https://www.lunasec.io/docs/blog/log4j-zero-day-mitigation-guide/
    • https://blog.cloudflare.com/inside-the-log4j2-vulnerability-cve-2021-44228/
    • https://logging.apache.org/log4j/2.x/security.html
    • https://logging.apache.org/log4j/2.x/manual/lookups.html#JndiLookup
    Descargar herramienta