
ShellShock-Angriffs- und Exploit-Detektor für Bro.
Dieses Skript erkennt die erfolgreiche Ausnutzung der Bash-Sicherheitslücke mit der CVE-Nummer CVE-2014-6271, die den Spitznamen „ShellShock“ trägt. Es ist umfassender als die meisten vorhandenen Erkennungen, da es das Verhalten des angegriffenen Hosts beobachtet, das auf eine erfolgreiche Kompromittierung oder eine tatsächliche Schwachstelle hindeuten könnte.
Wenn ein Host einen Angriff über HTTP empfängt, beobachtet Bro diesen Host daraufhin, ob er entweder einen Dropper-Payload herunterlädt oder einen ICMP-Ping sendet. Es könnten noch viele weitere Mechanismen auftreten, aber dies deckt die meisten der bekannten Reaktionsmechanismen ab. Dieses Skript ist standardmäßig so konfiguriert, dass es nach Dateien mit dem MIME-Typ application/x-executable Ausschau hält, womit der Dropper des hier aufgeführten Angriffs abgedeckt wird:
https://gist.github.com/anonymous/929d622f3b36b00c0be1
Alternativ, falls Angreifer lediglich mit einem Ping-Befehl testen, beobachtet dieses Skript, ob kurz nach Erkennung eines Angriffs ein Ping-Befehl vom Opfer gesendet wird.
Dieses Skript fügt außerdem dem Feld „tags“ im HTTP-Log für alle Anfragen, die wie mögliche Angriffe aussehen, ein Tag hinzu. Der Inhalt des Tags ist: ShellShock::HIT.
Wie dem auch sei, dieses Skript ist clusterfähig und sollte auf Bro-Clustern einwandfrei funktionieren; es kann bedenkenlos im operativen Betrieb eingesetzt werden.
Dieses Skript unterstützt derzeit Bro 2.3, 2.4 und 2.5. Bitte reichen Sie ein Ticket ein, wenn dieses Skript auf einer unterstützten Bro-Version Probleme bereitet.
Dieses Repository enthält einen Beispiel-Packet-Capture, der einen Beispielserver namens exploit.pcap angreift. Hier sind die relevanten Logs, die ausgegeben werden.
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
Es gibt ein paar Konfigurationsvariablen.
## 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;
Diese Werte können verwendet werden, um festzulegen, wie lange ShellShock-Scanner beobachtet werden und wie viele Angriffe erfolgen müssen, bevor sie als Scanner eingestuft werden und eine Notice erstellt wird.
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.