Commit graph

3113 commits

Author SHA1 Message Date
Robin Sommer
fb7ba82bab Merge remote-tracking branch 'origin/topic/seth/intel-framework'
* origin/topic/seth/intel-framework: (21 commits)
  Extracting URLs from message bodies over SMTP and sending them to Intel framework.
  Small comment updates in the Intel framework CIF support.
  Intelligence framework documentation first draft.
  Only the manager tries to read files with the input framework now.
  Initial support for Bro's Intel framework with the Collective Intelligence Framework.
  Initial API for Intel framework is complete.
  Fixed an issue with cluster data distribution.
  Updating some intel framework test baselines.
  Reworked cluster intelligence data distribution mechanism and fixed tests.
  Lots more intelligence checking in SMTP traffic.
  Added intelligence check for "Received" path checking and a bit of reshuffling.
  Added sources to the intel log.
  Fixing a problem with intel distribution on clusters.
  Updated intel framework test to include matching.
  Restructuring the scripts that feed data into the intel framework slightly.
  One test for cluster transparency of the intel framework.
  Fixed a cluster support bug.
  Intelligence framework checkpoint
  Major updates to fix the Intel framework API.
  Checkpoint commit.  This is all a huge mess right now. :)
  ...

Closes #914.
2012-11-01 08:21:52 -07:00
Daniel Thayer
48c4487378 Add test cases for the bytestring_to_double BIF 2012-10-25 17:10:51 -05:00
Robin Sommer
9ec2bfe59f Merge remote-tracking branch 'origin/topic/seth/pppoe'
Looks like the code in this function is getting ready for some
refactoring. Leaving that for another time though ...

Closes #909.

* origin/topic/seth/pppoe:
  Adding a test for PPPoE support.
  Adding PPPoE support to Bro.
2012-10-24 16:05:17 -07:00
Robin Sommer
5f5bc53b85 New branch for documentation, with an initial skeleton. 2012-10-24 11:13:02 -07:00
Seth Hall
54084d0744 Adding a test for PPPoE support. 2012-10-24 01:05:01 -04:00
Jon Siwek
46d225cc5b Add parsing rules for IPv4/IPv6 subnet literal constants, addresses #888
This fixes specifying IPv4 subnets in IPv4-mapped-IPv6 format with a
mask length relative to the 128 bits of the mapped IPv6 address.
2012-10-22 15:57:21 -05:00
Seth Hall
1200d04f81 Merge branch 'master' into topic/seth/metrics-merge 2012-10-22 10:06:02 -04:00
Robin Sommer
5716545cfa Merge remote-tracking branch 'origin/topic/seth/strptime'
* origin/topic/seth/strptime:
  Added a BiF to wrap the strptime function.

Closes #904.
2012-10-19 15:13:25 -07:00
Jon Siwek
3e7fb3a659 Add GTP tunnel analyzer memory leak unit test. 2012-10-19 14:17:29 -05:00
Jon Siwek
9edbf3e53c Add GPRS Tunnelling Protocol (GTPv1) decapsulation.
This currently supports automatic decapsulation of GTP-U packets on
UDP port 2152.

The GTPv1 headers for such tunnels can be inspected by handling the
"gtpv1_g_pdu_packet" event, which has a parameter of type "gtpv1_hdr".

Analyzer and test cases are derived from submissions by Carsten Langer.

Addresses #690.
2012-10-19 14:02:35 -05:00
Seth Hall
d157759ff2 Added a BiF to wrap the strptime function. 2012-10-19 02:07:34 -04:00
Jon Siwek
e835a55229 Add IPv6 support to signature header conditions.
- "src-ip" and "dst-ip" conditions can now use IPv6 addresses/subnets.
  They must be written in colon-hexadecimal representation and enclosed
  in square brackets (e.g. [fe80::1]).  Addresses #774.

- "icmp6" is now a valid protocol for use with "ip-proto" and "header"
  conditions.  This allows signatures to be written that can match
  against ICMPv6 payloads.  Addresses #880.

- "ip6" is now a valid protocol for use with the "header" condition.
  (also the "ip-proto" condition, but it results in a no-op in that
  case since signatures apply only to the inner-most IP packet when
  packets are tunneled).  This allows signatures to match specifically
  against IPv6 packets (whereas "ip" only matches against IPv4 packets).

- "ip-proto" conditions can now match against IPv6 packets.  Before,
  IPv6 packets were just silently ignored which meant DPD based on
  signatures did not function for IPv6 -- protocol analyzers would only
  get attached to a connection over IPv6 based on the well-known ports
  set in the "dpd_config" table.
2012-10-17 11:11:51 -05:00
Robin Sommer
5e12a53ae5 Merge remote-tracking branch 'origin/topic/jsiwek/gridftp'
* origin/topic/jsiwek/gridftp:
  Add memory leak unit test for GridFTP.
  Enable GridFTP detection by default.  Track/log SSL client certs.
  Add analyzer for GSI mechanism of GSSAPI FTP AUTH method.
  Add an example of a GridFTP data channel detection script.
2012-10-12 10:43:16 -07:00
Robin Sommer
503412e472 Merge remote-tracking branch 'origin/topic/bernhard/input-end-of-data'
* origin/topic/bernhard/input-end-of-data:
  rename the update_finished event to end_of_data and make it fire in more cases.

Closes #894.
2012-10-12 09:48:58 -07:00
Robin Sommer
b1b1991cc7 Merge remote-tracking branch 'origin/topic/seth/dns-zero-responses-fix'
* origin/topic/seth/dns-zero-responses-fix:
  Fix for DNS log problem when a DNS response is seen with 0 RRs.

Closes #892.
2012-10-12 09:39:18 -07:00
Bernhard Amann
a6d87fcab7 rename the update_finished event to end_of_data and make it fire in
more cases.

It will now not only fire after table-reads have been completed,
but also after the last event of a whole-file-read (or whole-db-read, etc.).

The interface also has been extended a bit to allow readers to
directly fire the event should they so choose. This allows the
event to be fired in direct table-setting/event-sending modes,
which was previously not possible.
2012-10-10 11:51:20 -07:00
Seth Hall
5aa12984ee Merge remote-tracking branch 'origin/master' into topic/seth/intel-framework 2012-10-10 11:22:34 -04:00
Seth Hall
21473b0557 Initial API for Intel framework is complete.
- More inline docs added.

- Removing some debugging code.

- New test for the intel framework data distribution mechanism.
2012-10-10 11:15:34 -04:00
Jon Siwek
6caeb7d7cf Add --with-curl option to ./configure, addresses #877. 2012-10-08 16:27:15 -05:00
Jon Siwek
dedfdf7e11 Add memory leak unit test for GridFTP. 2012-10-08 13:15:47 -05:00
Jon Siwek
e34f6d9e3b Enable GridFTP detection by default. Track/log SSL client certs.
In the *service* field of connection records, GridFTP control channels
are labeled as "gridftp" and data channels as "gridftp-data".

Added *client_subject* and *client_issuer_subject* as &log'd fields to
SSL::Info record.  Also added *client_cert* and *client_cert_chain*
fields to track client cert chain.
2012-10-08 11:38:29 -05:00
Seth Hall
db62369508 Fix for DNS log problem when a DNS response is seen with 0 RRs. 2012-10-05 13:48:49 -04:00
Jon Siwek
d0b249a731 Merge branch 'master' into topic/jsiwek/gridftp 2012-10-05 11:05:01 -05:00
Jon Siwek
49b8c7e390 Add analyzer for GSI mechanism of GSSAPI FTP AUTH method.
GSI authentication involves an encoded TLS/SSL handshake over the FTP
control session.  Decoding the exchanged tokens and passing them to an
SSL analyzer instance allows use of all the familiar script-layer events
in inspecting the handshake (e.g. client/server certificats are
available).  For FTP sessions that attempt GSI authentication, the
service field of the connection record will have both "ftp" and "ssl".

One additional change is an FTP server's acceptance of an AUTH request
no longer causes analysis of the connection to cease (because further
analysis likely wasn't possible).  This decision can be made more
dynamically at the script-layer (plus there's now the fact that further
analysis can be done at least on the GSSAPI AUTH method).
2012-10-05 10:43:23 -05:00
Seth Hall
73f2fd8e3a Updating some intel framework test baselines. 2012-10-03 16:25:18 -04:00
Seth Hall
bf9651b323 Reworked cluster intelligence data distribution mechanism and fixed tests.
- Intel data distribution on clusters is now pushed in whole
  by the manager when a worker connects.  Additions after that point
  are managed by the normal single-item distribution mechanism already
  built into the intelligence framework.

- The manager maintains the complete "minimal" data store that the
  workers use to do their matching so that full "minimal" data
  distribution is very easy.

- Tests are cleaned up and work.
2012-10-03 16:25:02 -04:00
Jon Siwek
2ac6fab5fc Merge branch 'master' into topic/jsiwek/gridftp 2012-10-02 16:39:34 -05:00
Jon Siwek
5f3af9e9eb Add new Tunnel::delay_teredo_confirmation option, default to true.
This option indicates that the Teredo analyzer should wait until
it sees both sides of a connection using a valid Teredo encapsulation
before issuing a protocol_confirmation.  Previous behavior confirmed
on the first instance of a valid encapsulation, which could result
in more false positives (and e.g. bogus entries in known-services.log).

Addresses #890.
2012-10-02 15:13:38 -05:00
Seth Hall
6750b0f7b9 Merge remote-tracking branch 'origin/master' into topic/seth/metrics-updates
Conflicts:
	testing/btest/Baseline/scripts.base.frameworks.metrics.basic-cluster/manager-1.metrics.log
	testing/btest/Baseline/scripts.base.frameworks.metrics.basic/metrics.log
	testing/btest/Baseline/scripts.base.frameworks.metrics.cluster-intermediate-update/manager-1.notice.log
	testing/btest/Baseline/scripts.base.frameworks.metrics.notice/notice.log
	testing/btest/scripts/base/frameworks/metrics/basic-cluster.bro
2012-10-01 16:23:06 -04:00
Bernhard Amann
4cbf4e3caf Small but important fix for the input framework. BroStrings were constructed
without a final \0 - which means that strings read by the input framework are
unusable by basically all internal functions (like to_count).

the basic test now also checks this.

Thanks at Sheharbano for noticing this.
2012-10-01 13:04:40 -07:00
Jon Siwek
68aead024a Add an example of a GridFTP data channel detection script.
It relies on the heuristics of GridFTP data channels commonly default to
SSL mutual authentication with a NULL bulk cipher and that they usually
transfer large datasets (default threshold of script is 1 GB).  The
script also defaults to skip_further_processing() after detection to try
to save cycles analyzing the large, benign connection.

Also added a script in base/protocols/conn/polling that generalizes the
process of polling a connection for interesting features.  The GridFTP
data channel detection script depends on it to monitor bytes
transferred.
2012-10-01 12:32:24 -05:00
Seth Hall
38f0b7927c Updated intel framework test to include matching. 2012-09-28 14:52:05 -04:00
Seth Hall
2366b21787 One test for cluster transparency of the intel framework. 2012-09-28 13:25:06 -04:00
Seth Hall
51249d0984 Merge remote-tracking branch 'origin/master' into topic/seth/intel-framework 2012-09-28 09:27:52 -04:00
Jon Siwek
d6f671494e Reliability adjustments to istate tests with network communication. 2012-09-26 12:14:11 -05:00
Daniel Thayer
f7e55509a4 Uncomment some previously-broken tests
Uncommented some tests that previously would cause Bro to exit
with an error.
2012-09-25 16:05:23 -05:00
Jon Siwek
1044762dfa Serialize language.when unit test with the "comm" group.
Since it now loads the listen script.
2012-09-25 14:53:51 -05:00
Daniel Thayer
101ba67203 Fix race condition in language/when.bro test 2012-09-24 18:20:42 -05:00
Robin Sommer
832539f548 Merge remote-tracking branch 'origin/topic/dnthayer/language-tests'
* origin/topic/dnthayer/language-tests:
  Update language tests for recent bug fixes
  Add more language tests
  Add more language tests
  Add more language tests
  Update language tests
  Add more language tests
  Add tests of the Bro scripting language
2012-09-23 08:44:34 -07:00
Jon Siwek
392b99b2fa Fix construction of ip6_ah (Authentication Header) record values.
Authentication Headers with a Payload Len field set to zero would cause
a crash due to invalid memory allocation because the previous code
assumed Payload Len would always be great enough to contain all
mandatory fields of the header.  This changes it so the length of
the header is explicitly checked before attempting to extract fields
located past the minimum length (8 bytes) of an Authentication Header.

Crashes due to this are only possible when handling script-layer events
ipv6_ext_headers, new_packet, esp_packet, or teredo_*.  Or also when
implementing one of the discarder_check_* family of functions.
Otherwise, Bro correctly parses past such a header.
2012-09-18 16:52:12 -05:00
Jon Siwek
292bf61ae8 Unit test reliability adjustment.
Sometimes manager node was shutting everything down before others had
a chance to generate output.  It now waits for all nodes to fully
connect with each other.
2012-09-13 12:59:40 -05:00
Jon Siwek
bd84ff2c20 Adjusting some unit tests that do cluster communication.
Added explicit synchronization and termination points to make the
tests more reliable and exit earlier in most cases.
2012-09-07 16:25:07 -05:00
Daniel Thayer
2dca037384 Merge remote-tracking branch 'origin/master' into topic/dnthayer/language-tests 2012-09-07 10:52:21 -05:00
Daniel Thayer
84ec139fd9 Update language tests for recent bug fixes 2012-09-07 10:48:13 -05:00
Jon Siwek
a10093b620 Add sleeps to configuration_update test for better reliability.
Not the greatest solution, but makes the 3 bro processes more likely to
run sequentially so that the controller2 process doesn't happen to be
scheduled before the controller process.  In that case, the controllee
gets the shutdown request before the configuration update.  FreeBSD
especially seemed to schedule them the unintended way frequently.
2012-09-05 16:20:34 -05:00
Daniel Thayer
d5bf5eb38c Add more language tests 2012-09-04 17:39:00 -05:00
Daniel Thayer
76420e4b61 Add more language tests 2012-09-02 12:55:31 -05:00
Daniel Thayer
05ad3f95af Add more language tests
Added more tests and fixed a broken test.
2012-08-31 14:05:02 -05:00
Seth Hall
78401262d0 Merge remote-tracking branch 'origin/master' into topic/seth/intel-framework 2012-08-30 11:36:34 -04:00
Robin Sommer
a48963f82b Merge remote-tracking branch 'origin/master' into topic/robin/modbus-merge
* origin/master:
  Two fixes.
  Updating CHANGES and VERSION.
  Updating CHANGES and VERSION.
  Remove automatic use of gperftools on non-Linux systems.
  Set VERSION to 2.1-rc3 so that we don't get confused.
  Fix uninitialized value for 'is_partial' in TCP analyzer.
  parse 64-bit consts correctly.
  on 32-bit machines only unsigned long longs are 64-bits long. Not just unsigned longs...
2012-08-29 18:01:31 -07:00