This repository has been archived by the owner on Apr 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue 1036: securityonion-elsa-extras: add pattern for Bro rfb.log
- Loading branch information
Showing
9 changed files
with
264 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<ruleset name="bro_rfb" id="26020"> | ||
<pattern>bro_rfb</pattern> | ||
<rules> | ||
<rule provider="Security_Onion" class="26020" id="26020"> | ||
<patterns> | ||
<pattern>@ESTRING::|@@ESTRING::|@@ESTRING:i0:|@@ESTRING:i1:|@@ESTRING:i2:|@@ESTRING:i3:|@@ESTRING:s0:|@@ESTRING:s1:|@@ESTRING:s2:|@@ESTRING:s3:|@@ESTRING:s4:|@@ESTRING::|@@ESTRING::|@@ESTRING:s5:|@@ESTRING:i4:|@@ESTRING:i5:@</pattern> | ||
</patterns> | ||
<examples> | ||
<example> | ||
<test_message program='bro_rfb'>1484079685.745596|Cjoynh4xFlb9GzUNv9|192.168.2.115|52353|192.168.2.16|5900|003|889|003|889|Apple Remote Desktop|T|T|\x00\x00\x00\x00\x00\x02\xbf\xfe\xe7\x03\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00MacMini SSD|1920|1080</test_message> | ||
<!-- ts --> | ||
<!-- uid --> | ||
<!-- id.orig_h srcip (already in fields table) --> | ||
<test_value name="i0">192.168.2.115</test_value> | ||
<!-- id.orig_p srcport (already in fields table) --> | ||
<test_value name="i1">52353</test_value> | ||
<!-- id.resp_h dstip (already in fields table) --> | ||
<test_value name="i2">192.168.2.16</test_value> | ||
<!-- id.resp.p dstport (already in fields table) --> | ||
<test_value name="i3">5900</test_value> | ||
<!-- client_major_version --> | ||
<test_value name="s0">003</test_value> | ||
<!-- client_minor_version --> | ||
<test_value name="s1">889</test_value> | ||
<!-- server_major_version --> | ||
<test_value name="s2">003</test_value> | ||
<!-- server_minor_version --> | ||
<test_value name="s3">889</test_value> | ||
<!-- authentication_method --> | ||
<test_value name="s4">Apple Remote Desktop</test_value> | ||
<!-- auth --> | ||
<!-- share_flag --> | ||
<!-- desktop_name --> | ||
<test_value name="s5">\x00\x00\x00\x00\x00\x02\xbf\xfe\xe7\x03\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00MacMini SSD</test_value> | ||
<!-- width --> | ||
<test_value name="i4">1920</test_value> | ||
<!-- height --> | ||
<test_value name="i5">1080</test_value> | ||
</example> | ||
</examples> | ||
</rule> | ||
</rules> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
use syslog; | ||
|
||
/* Create bro_rfb class */ | ||
INSERT IGNORE INTO classes (id, class) VALUES (26020, "BRO_RFB"); | ||
|
||
/* add new integers that don't already exist in fields table */ | ||
INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("width","int", "QSTRING"); | ||
INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("height","int", "QSTRING"); | ||
|
||
/* add new strings that don't already exist in fields table */ | ||
INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("client_major_version","string", "QSTRING"); | ||
INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("client_minor_version","string", "QSTRING"); | ||
INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("server_major_version","string", "QSTRING"); | ||
INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("server_minor_version","string", "QSTRING"); | ||
INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("authentication_method","string", "QSTRING"); | ||
INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("desktop_name","string", "QSTRING"); | ||
|
||
/* integers i0 through i5 are field order 5 through 10 */ | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="srcip"), 5); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="srcport"), 6); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="dstip"), 7); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="dstport"), 8); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="width"), 9); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="height"), 10); | ||
|
||
/* strings s0 through s5 are field order 11 through 16 */ | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="client_major_version"), 11); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="client_minor_version"), 12); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="server_major_version"), 13); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="server_minor_version"), 14); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="authentication_method"), 15); | ||
INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="desktop_name"), 16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
securityonion-elsa-extras (20151011-1ubuntu1securityonion48) trusty; urgency=medium | ||
|
||
* Issue 1036: securityonion-elsa-extras: add pattern for Bro rfb.log | ||
|
||
-- Doug Burks <[email protected]> Tue, 10 Jan 2017 16:26:11 -0500 | ||
|
||
securityonion-elsa-extras (20151011-1ubuntu1securityonion47) trusty; urgency=medium | ||
|
||
* fix bro_ftp pattern | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
135 changes: 135 additions & 0 deletions
135
debian/patches/Issue-1036:-securityonion-elsa-extras:-add-pattern-for-Bro-rfb.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
Description: <short summary of the patch> | ||
TODO: Put a short summary on the line above and replace this paragraph | ||
with a longer explanation of this change. Complete the meta-information | ||
with other relevant fields (see below for details). To make it easier, the | ||
information below has been extracted from the changelog. Adjust it or drop | ||
it. | ||
. | ||
securityonion-elsa-extras (20151011-1ubuntu1securityonion48) trusty; urgency=medium | ||
. | ||
* Issue 1036: securityonion-elsa-extras: add pattern for Bro rfb.log | ||
Author: Doug Burks <[email protected]> | ||
|
||
--- | ||
The information above should follow the Patch Tagging Guidelines, please | ||
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here | ||
are templates for supplementary fields that you might want to add: | ||
|
||
Origin: <vendor|upstream|other>, <url of original patch> | ||
Bug: <url in upstream bugtracker> | ||
Bug-Debian: http://bugs.debian.org/<bugnumber> | ||
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber> | ||
Forwarded: <no|not-needed|url proving that it has been forwarded> | ||
Reviewed-By: <name and email of someone who approved the patch> | ||
Last-Update: <YYYY-MM-DD> | ||
|
||
--- /dev/null | ||
+++ securityonion-elsa-extras-20151011/contrib/parsers/bro_rfb | ||
@@ -0,0 +1,43 @@ | ||
+<ruleset name="bro_rfb" id="26020"> | ||
+ <pattern>bro_rfb</pattern> | ||
+ <rules> | ||
+ <rule provider="Security_Onion" class="26020" id="26020"> | ||
+ <patterns> | ||
+ <pattern>@ESTRING::|@@ESTRING::|@@ESTRING:i0:|@@ESTRING:i1:|@@ESTRING:i2:|@@ESTRING:i3:|@@ESTRING:s0:|@@ESTRING:s1:|@@ESTRING:s2:|@@ESTRING:s3:|@@ESTRING:s4:|@@ESTRING::|@@ESTRING::|@@ESTRING:s5:|@@ESTRING:i4:|@@ESTRING:i5:@</pattern> | ||
+ </patterns> | ||
+ <examples> | ||
+ <example> | ||
+ <test_message program='bro_rfb'>1484079685.745596|Cjoynh4xFlb9GzUNv9|192.168.2.115|52353|192.168.2.16|5900|003|889|003|889|Apple Remote Desktop|T|T|\x00\x00\x00\x00\x00\x02\xbf\xfe\xe7\x03\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00MacMini SSD|1920|1080</test_message> | ||
+ <!-- ts --> | ||
+ <!-- uid --> | ||
+ <!-- id.orig_h srcip (already in fields table) --> | ||
+ <test_value name="i0">192.168.2.115</test_value> | ||
+ <!-- id.orig_p srcport (already in fields table) --> | ||
+ <test_value name="i1">52353</test_value> | ||
+ <!-- id.resp_h dstip (already in fields table) --> | ||
+ <test_value name="i2">192.168.2.16</test_value> | ||
+ <!-- id.resp.p dstport (already in fields table) --> | ||
+ <test_value name="i3">5900</test_value> | ||
+ <!-- client_major_version --> | ||
+ <test_value name="s0">003</test_value> | ||
+ <!-- client_minor_version --> | ||
+ <test_value name="s1">889</test_value> | ||
+ <!-- server_major_version --> | ||
+ <test_value name="s2">003</test_value> | ||
+ <!-- server_minor_version --> | ||
+ <test_value name="s3">889</test_value> | ||
+ <!-- authentication_method --> | ||
+ <test_value name="s4">Apple Remote Desktop</test_value> | ||
+ <!-- auth --> | ||
+ <!-- share_flag --> | ||
+ <!-- desktop_name --> | ||
+ <test_value name="s5">\x00\x00\x00\x00\x00\x02\xbf\xfe\xe7\x03\xe0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00MacMini SSD</test_value> | ||
+ <!-- width --> | ||
+ <test_value name="i4">1920</test_value> | ||
+ <!-- height --> | ||
+ <test_value name="i5">1080</test_value> | ||
+ </example> | ||
+ </examples> | ||
+ </rule> | ||
+ </rules> | ||
+</ruleset> | ||
--- securityonion-elsa-extras-20151011.orig/contrib/securityonion-syslog-ng.conf | ||
+++ securityonion-elsa-extras-20151011/contrib/securityonion-syslog-ng.conf | ||
@@ -59,6 +59,7 @@ source s_bro_pe { file("/nsm/bro/logs/cu | ||
source s_bro_sip { file("/nsm/bro/logs/current/sip.log" flags(no-parse) program_override("bro_sip")); }; | ||
source s_bro_modbus { file("/nsm/bro/logs/current/modbus.log" flags(no-parse) program_override("bro_modbus")); }; | ||
source s_bro_dnp3 { file("/nsm/bro/logs/current/dnp3.log" flags(no-parse) program_override("bro_dnp3")); }; | ||
+source s_bro_rfb { file("/nsm/bro/logs/current/rfb.log" flags(no-parse) program_override("bro_rfb")); }; | ||
|
||
destination d_elsa { program("sh /opt/elsa/contrib/securityonion/contrib/securityonion-elsa-syslog-ng.sh" template(t_db_parsed)); }; | ||
|
||
@@ -90,6 +91,7 @@ log { | ||
source(s_bro_sip); | ||
source(s_bro_modbus); | ||
source(s_bro_dnp3); | ||
+ source(s_bro_rfb); | ||
source(s_ossec); | ||
source(s_network); | ||
source(s_syslog); | ||
--- securityonion-elsa-extras-20151011.orig/contrib/securityonion_parsers_sql.sh | ||
+++ securityonion-elsa-extras-20151011/contrib/securityonion_parsers_sql.sh | ||
@@ -307,3 +307,8 @@ mysql -uroot < $SQL || echo "Error impor | ||
# Additions for Cisco ASA Botnet | ||
SQL="$SQL_DIR/asa_botnet.sql" | ||
mysql -uroot < $SQL || echo "Error importing $SQL." | ||
+ | ||
+# Additions for BRO_RFB class & associated fields | ||
+SQL="$SQL_DIR/bro_rfb.sql" | ||
+mysql -uroot < $SQL || echo "Error importing $SQL." | ||
+ | ||
--- /dev/null | ||
+++ securityonion-elsa-extras-20151011/contrib/sql/bro_rfb.sql | ||
@@ -0,0 +1,32 @@ | ||
+use syslog; | ||
+ | ||
+/* Create bro_rfb class */ | ||
+INSERT IGNORE INTO classes (id, class) VALUES (26020, "BRO_RFB"); | ||
+ | ||
+/* add new integers that don't already exist in fields table */ | ||
+INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("width","int", "QSTRING"); | ||
+INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("height","int", "QSTRING"); | ||
+ | ||
+/* add new strings that don't already exist in fields table */ | ||
+INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("client_major_version","string", "QSTRING"); | ||
+INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("client_minor_version","string", "QSTRING"); | ||
+INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("server_major_version","string", "QSTRING"); | ||
+INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("server_minor_version","string", "QSTRING"); | ||
+INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("authentication_method","string", "QSTRING"); | ||
+INSERT IGNORE INTO fields (field, field_type, pattern_type) VALUES ("desktop_name","string", "QSTRING"); | ||
+ | ||
+/* integers i0 through i5 are field order 5 through 10 */ | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="srcip"), 5); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="srcport"), 6); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="dstip"), 7); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="dstport"), 8); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="width"), 9); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="height"), 10); | ||
+ | ||
+/* strings s0 through s5 are field order 11 through 16 */ | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="client_major_version"), 11); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="client_minor_version"), 12); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="server_major_version"), 13); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="server_minor_version"), 14); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="authentication_method"), 15); | ||
+INSERT IGNORE INTO fields_classes_map (class_id, field_id, field_order) VALUES ((SELECT id FROM classes WHERE class="BRO_RFB"), (SELECT id FROM fields WHERE field="desktop_name"), 16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters