
Rilevatore di attacchi ed exploit ShellShock per Bro.
Questo script rileva lo sfruttamento riuscito della vulnerabilità di Bash con CVE-2014-6271 soprannominata "ShellShock". È più completo della maggior parte dei rilevamenti in circolazione, perché osserva il comportamento dell'host attaccato che potrebbe indicare una compromissione riuscita o un'effettiva vulnerabilità.
Se un host risulta ricevere un attacco via HTTP, Bro osserverà se quell'host scarica un payload dropper o invia un ping ICMP. Potrebbero comparire molti altri meccanismi, ma questo copre la maggior parte dei meccanismi di risposta noti. Questo script è configurato di default per osservare i file di tipo MIME application/x-executable, che coprirebbe il dropper elencato nell'attacco qui:
https://gist.github.com/anonymous/929d622f3b36b00c0be1
In alternativa, se gli attaccanti stanno solo testando con un comando ping, questo script osserverà un comando ping dalla vittima poco dopo il rilevamento di un attacco.
Questo script aggiungerà anche un tag al campo "tags" nel log HTTP per tutte le richieste che sembrano possibili attacchi. Il contenuto del tag è: ShellShock::HIT.
Per quel che vale, questo script è cluster-aware e dovrebbe funzionare senza problemi sui cluster Bro e dovrebbe essere ok da eseguire in produzione.
Questo script supporta attualmente Bro 2.3, 2.4 e 2.5. Apri un ticket se questo script ti dà problemi su una qualsiasi versione supportata di Bro.
Questo repository include una cattura di pacchetti di esempio che sfrutta un server di esempio chiamato exploit.pcap. Ecco i log pertinenti che vengono generati.
notice.log
#separator \x09
#set_separator ,
#empty_field (empty)
#unset_field -
#path notice
#open 2014-09-26-10-47-02
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p fuid file_mime_type file_desc proto note msg sub src dst p peer_descr actions suppress_for dropped remote_location.country_code remote_location.region remote_location.city remote_location.latitude remote_location.longitude
#types time string addr port addr port string string string enum enum string string addr addr port count string set[enum] interval bool string string string double double
1411666207.583791 - - - - - - - - - ShellShock::Scanner 10.246.50.2 sent at least 1 CVE-2014-6271 exploit attempts in 0m0s. Used payload: "() { :;}; /bin/ping -c1 10.246.50.2" :: against sample victim hosts: 10.246.50.6 10.246.50.2 - - - bro Notice::ACTION_LOG 3600.00000-
1411666207.588581 - - - - - - - - - ShellShock::Exploit High likelihood of successful CVE-2014-6271 exploitation against 10.246.50.6. Attack over HTTP and sent a ping to 10.246.50.2 within 0.000 seconds of an attack. Attack over HTTP and sent a ping to 10.246.50.2 within 0.000 seconds of an attack. 10.246.50.6 - - - bro Notice::ACTION_LOG 3600.000000 F - - - - -
http.log
#separator \x09
#set_separator ,
#empty_field (empty)
#unset_field -
#path http
#open 2014-09-26-10-47-02
#fields ts uid id.orig_h id.orig_p id.resp_h id.resp_p trans_depth method host uri referrer user_agent request_body_len response_body_len status_code status_msg info_code info_msg filename tags username password proxied orig_fuids orig_mime_types resp_fuids resp_mime_types
#types time string addr port addr port count string string string string string count count count string count string string set[enum] string string set[string] vector[string] vector[string] vector[string] vector[string]
1411666207.583791 CC7s232GDnmtxZUly5 10.246.50.2 43616 10.246.50.6 80 1 GET 10.246.50.6 /exploitable.cgi - () { :;}; /bin/ping -c1 10.246.50.2 0 615 500 Internal Server Error - - - ShellShock::HIT - - - - - FgVgjb1GU12ixSuugc text/html
#close 2014-09-26-10-47-02
bro-pkg refresh
bro-pkg install corelight/bro-shellshock
Ci sono un paio di variabili di configurazione.
## The number of apparent attacks a host must send for it to be
## detected as ShellShock::Scanner.
const ShellShock::scan_threshold = 10 &redef;
## The period over which scanner detection is performed.
const ShellShock::scan_detection_period = 10min &redef;
Queste possono essere usate per estendere per quanto tempo vengono osservati gli scanner ShellShock e il numero di attacchi che devono verificarsi prima che vengano dichiarati in scansione e venga creata una notifica.
Seth Hall <[email protected]>
Stephen Hosom - Provided a fully exploiting packet capture.
Nick Weaver - Valuable discussion on how shellshock is and isn't exploitable.
Vlad Grigorescu - Feature request after feature request.
Mike Patterson - Suggesting to watch for shellscripts as a post-exploit dropper.