
كاشف هجمات واستغلالات ShellShock لـ Bro.
يكتشف هذا السكريبت الاستغلال الناجح لثغرة Bash المعروفة باسم "ShellShock" والمسجلة برقم CVE-2014-6271. وهو أكثر شمولاً من معظم أدوات الكشف المتداولة، إذ يراقب سلوك المضيف المُهاجَم بحثًا عن مؤشرات قد تدل على تعرضه للاختراق بنجاح أو على وجود ثغرة فعلية.
إذا لُوحظ أن أحد المضيفين يتلقى هجومًا عبر HTTP، فسيراقب Bro ذلك المضيف لمعرفة ما إذا كان سيحمّل حمولة dropper أو يرسل ping عبر ICMP. قد تظهر آليات أخرى كثيرة، لكن هذا يغطي معظم آليات الاستجابة المعروفة حاليًا. هذا السكريبت مُهيأ افتراضيًا لمراقبة الملفات من نوع MIME application/x-executable، وهو ما يغطي الـ dropper المذكور في الهجوم هنا:
https://gist.github.com/anonymous/929d622f3b36b00c0be1
بدلاً من ذلك، إذا كان المهاجمون يكتفون بالاختبار عبر أمر ping، فسيراقب هذا السكريبت أي أمر ping يصدر من الضحية بعد اكتشاف الهجوم بفترة وجيزة.
سيضيف هذا السكريبت أيضًا وسمًا إلى حقل "tags" في سجل HTTP لأي طلبات قد تكون هجمات محتملة. محتوى الوسم هو: ShellShock::HIT.
ومهما يكن الأمر، فإن هذا السكريبت مراعي لتكوين العناقيد (cluster-aware)، ويعمل بشكل جيد على عناقيد Bro، وهو مناسب للتشغيل في بيئات الإنتاج.
يدعم هذا السكريبت حاليًا الإصدارات Bro 2.3 و2.4 و2.5. يُرجى فتح تذكرة (ticket) إذا كان هذا السكريبت يسبب لك مشكلة على أي إصدار مدعوم من Bro.
يحتوي هذا المستودع على ملف التقاط حزم (packet capture) يوضح استغلال خادم تجريبي باسم 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، ولتحديد عدد الهجمات التي يجب أن تُرسَل قبل اعتبار المُهاجِم مُصدرًا للفحص وإنشاء إشعار (Notice) بشأنه.
Seth Hall <[email protected]>
Stephen Hosom - قدّم ملف التقاط حزم يستغل الثغرة بشكل كامل.
Nick Weaver - نقاش قيّم حول كيفية قابلية shellshock للاستغلال وعدمها.
Vlad Grigorescu - طلب ميزة تلو الأخرى.
Mike Patterson - اقترح مراقبة السكريبتات الصدفية (shellscripts) باعتبارها dropper يُستخدم بعد الاستغلال.