
Bro용 ShellShock 공격 및 익스플로잇 탐지기.
===========================
이 스크립트는 "ShellShock"이라는 별명으로 알려진 CVE-2014-6271 Bash 취약점의 성공적인 악용을 탐지합니다. 공격을 받은 호스트에서 성공적인 침해나 실제 취약점을 나타낼 수 있는 동작을 관찰한다는 점에서 대부분의 기존 탐지보다 더 포괄적입니다.
HTTP를 통해 공격을 수신하는 호스트가 관찰되면, Bro는 해당 호스트가 드로퍼 페이로드를 다운로드하거나 ICMP 핑을 보내는지 감시합니다. 더 많은 메커니즘이 나타날 수 있지만, 이는 기존에 알려진 대부분의 응답 메커니즘을 포괄합니다. 이 스크립트는 기본적으로 mime 타입 application/x-executable 파일을 감시하도록 구성되어 있으며, 이는 다음 공격에 나열된 드로퍼를 포괄합니다:
https://gist.github.com/anonymous/929d622f3b36b00c0be1
또는 공격자가 핑 명령으로 테스트만 하는 경우, 이 스크립트는 공격이 탐지된 직후 피해자로부터 나오는 핑 명령을 감시합니다.
이 스크립트는 또한 잠재적 공격으로 보이는 모든 요청에 대해 HTTP 로그의 "tags" 필드에 태그를 추가합니다. 태그의 내용은 ShellShock::HIT입니다.
참고로, 이 스크립트는 클러스터를 인식하므로 Bro 클러스터에서도 잘 작동하며 운영 환경에서 실행해도 문제없습니다.
이 스크립트는 현재 Bro 2.3, 2.4 및 2.5를 지원합니다. 지원되는 Bro 버전에서 이 스크립트에 문제가 발생하면 티켓을 등록해 주십시오.
이 저장소에는 exploit.pcap이라는 예제 서버를 공격하는 예제 패킷 캡처가 포함되어 있습니다. 다음은 출력되는 관련 로그입니다.
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
구성 변수는 두 가지가 있습니다.
## 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;
이 값들은 ShellShock 스캔이 관찰되는 기간과, 해당 호스트가 스캐닝 중으로 선언되어 공지가 생성되기 전에 발생해야 하는 공격 횟수를 확장하는 데 사용할 수 있습니다.
Seth Hall <[email protected]>
Stephen Hosom - 완전히 악용되는 패킷 캡처를 제공.
Nick Weaver - ShellShock이 어떻게 악용 가능하고 불가능한지에 대한 귀중한 논의.
Vlad Grigorescu - 끊임없는 기능 요청.
Mike Patterson - 익스플로잇 이후 드로퍼로 셸 스크립트를 감시할 것을 제안.