Commit graph

6618 commits

Author SHA1 Message Date
Johanna Amann
44b3ece440 Fix coverity error (uninitialized variable) 2016-06-06 13:19:17 -07:00
Daniel Thayer
0cae2ca003 Don't create debug.log immediately upon startup
Instead of creating the debug.log immediately when bro starts,
now it is created only after the debug streams are enabled.
This avoids having an empty log being created when it shouldn't be,
in usages such as "bro -h", "bro -v", or "bro -B help" (and also
when using broctl, which needs to run "bro -v").
2016-06-04 17:16:25 -05:00
Johanna Amann
8c54f91617 Add one more extra include for FreeBSD 2016-06-03 07:14:48 -07:00
Johanna Amann
a91483d4e4 Use ether_ntoa instead of ether_ntoa_r
The latter is thread-safe, but a GNU addition which does not exist on
OS-X. Since the function only is called in the main thread, it should
not matter if it is or is not threadsafe.
2016-06-02 17:17:00 -07:00
Johanna Amann
607b51f3b2 Unbreak header issue on Linux again 2016-06-02 17:05:42 -07:00
Johanna Amann
800eda4796 Fix FreeBSD/OSX compile problem due to headers 2016-06-02 16:38:40 -07:00
Jan Grashoefer
50cf694aae Moved link-layer addresses into endpoints.
The link-layer addresses are now part of the connection endpoints
following the originator-responder-pattern. The addresses are printed
with leading zeros. Additionally link-layer addresses are also extracted
for 802.11 plus RadioTap.
2016-06-02 01:46:26 +02:00
Johanna Amann
e8418ad5b0 Ascii Input: Accept dos/windows newlines.
The ascii reader now accepts \r\n newlines without complaining.
Furthermore, the reader was slightly rewritten in a more c++11-y way,
removing all raw pointers from the class.

Addresses BIT-1198
2016-06-01 11:21:44 -07:00
Robin Sommer
a2423f7d43 Adding missing script file. 2016-05-30 10:58:43 -07:00
Robin Sommer
57aef6d49f Add MAC addresses to connection record.
c$eth_src and c$eth_dst now contain the Ethernet address if available.
A new script protocols/conn/mac-logging.bro adds these to conn.log
when loaded.
2016-05-29 17:18:47 -07:00
Robin Sommer
35686fb93a Fixing Coverity warning.
Addresses CID 1356116.
2016-05-29 11:02:39 -07:00
Robin Sommer
d195f1b047 Fixing FTP cwd getting overlue long.
Now storing them compressed.
2016-05-29 08:52:47 -07:00
Robin Sommer
c74effad42 Clarifying notice documentation.
Closes BIT-1405.
2016-05-27 13:22:24 -07:00
Robin Sommer
476891c14a Changing protocol_{confirmation,violation} events to queue like any
other event.

Addresses BIT-1530.
2016-05-27 13:19:04 -07:00
Seth Hall
2f6e069c00 Add urldecoding for the unofficial %u00AE style of encoding. 2016-05-25 09:35:23 -04:00
Seth Hall
3151a95381 Remove the unescaped_special_char HTTP weird.
This weird points out a lot of benign stuff and it would
be easily reimplemented in a Bro script.  This commit
also makes the minor change to update the reserved and
unreserved characters from a newer from of the URI RFC.
2016-05-25 08:33:30 -04:00
Robin Sommer
53c523fa6f Normalizing test baseline. 2016-05-24 22:16:31 -07:00
Robin Sommer
d86bf15dbf Do not use scientific notations when printing doubles in logs.
Closes BIT-1558.
2016-05-23 16:07:22 -07:00
Robin Sommer
3581ead0d9 Ignoring packets with negative timestamps.
These used to stall Bro. Addresses BIT-1562 and BIT-1443.
2016-05-23 13:22:22 -07:00
Robin Sommer
4f9cb6912a Fix for a table refering to a expire function that's not defined.
I was hoping to report this right at startup through a static check
but turns out we don't have the right machinery in place for that.
That would need to be done after the AST has been finalized, but our
AST traversal code can't iterate over types. So instead I've changed
this so that it's still being reported at runtime but at least
doesn't crash Bro anymore.

Closes BIT-1597.
2016-05-23 12:48:34 -07:00
Robin Sommer
0fa9590902 Updating submodule(s).
[nomail]
2016-05-23 08:26:52 -07:00
Robin Sommer
50945a6359 Fixing a few Coverity warnings. 2016-05-23 08:25:11 -07:00
Robin Sommer
85213e6b55 Merge remote-tracking branch 'origin/topic/johanna/fix-analyzer-addition'
* origin/topic/johanna/fix-analyzer-addition:
  DTLS: Use magix constant from rfc5389 for stun detection.
  DTLS: Fix binpac bug with DTLSv1.2 client hellos
  Forgot to remove debug output.
  DTLS: Fix interaction with STUN
  Fix the way that child analyzers are added.

BIT-1604 #merged
2016-05-18 07:41:18 -07:00
Johanna Amann
e6b680ab09 DTLS: Use magix constant from rfc5389 for stun detection. 2016-05-17 17:08:20 -07:00
Johanna Amann
9b2c81e00a DTLS: Fix binpac bug with DTLSv1.2 client hellos 2016-05-17 16:58:30 -07:00
Johanna Amann
74d0493289 Forgot to remove debug output. 2016-05-17 16:39:44 -07:00
Johanna Amann
39bdc397a0 DTLS: Fix interaction with STUN
Now the DTLS analyzer cleanly skips all STUN messages; no warnings
should be logged to dpd.log and parsing should work flawlessly with
intermixed STUN messages.
2016-05-17 16:36:46 -07:00
Robin Sommer
b1c0306e4a Updating submodule(s).
[nomail]
2016-05-17 16:26:45 -07:00
Robin Sommer
573b542646 Updating submodule(s).
[nomail]
2016-05-17 16:23:47 -07:00
Robin Sommer
554e334a3b Merge remote-tracking branch 'origin/topic/johanna/bit1602'
* origin/topic/johanna/bit1602:
  Fix duplication of new_connection_contents event

BIT-1602 #merged
2016-05-17 16:17:23 -07:00
Robin Sommer
4b830b0a39 Merge remote-tracking branch 'origin/topic/johanna/x-anonymoustls'
* origin/topic/johanna/x-anonymoustls:
  SMTP: Support SSL upgrade via X-ANONYMOUSTLS

BIT-1603 #merged
2016-05-17 16:15:01 -07:00
Johanna Amann
bc868d72a1 Fix the way that child analyzers are added.
Bro contains functionality to add child analyzers delayed, so that an
just added analyzer does not influence the list of current analyzers
(which, in some combinations of mostly UDP and traffic replay by PIA can
lead to duplicate packets sent to the analyzer).

Sadly, this feature was broken sometime in the past, leading to the
aforementioned duplicate packets. Re-enabling this also necessitated
some changes in the analyzer manager, which immediately timed out all
connections when that feature was re-enabled.

There currently is no testcase (this is a bit hard to trigger); however,
I will add one with a later fix for DTLS.
2016-05-17 16:13:33 -07:00
Robin Sommer
e2dee49fc1 Fixing control frameworks net_stats and peer_status commands.
Turns out the code implementing them went missing with the recent
merge of the stats changes.

For peer status, I removed most of the numbers that the code used to
return because (1) we don't have access to that data anymore, and (2)
even in 2.4 the numbers returned already didn't make sense (because
they were global values, not per peer). We could consider just
removing the peer_status command at all.
2016-05-17 16:11:22 -07:00
Robin Sommer
7c1aab0ce5 Updating submodule(s).
[nomail]
2016-05-17 14:31:16 -07:00
Johanna Amann
8539f8f96b SMTP: Support SSL upgrade via X-ANONYMOUSTLS
This seems to be a non-standardized microsoft extension that, besides
having a different name, works pretty much the same as StartTLS. We just
treat it as such.

I tested this against provided traffic and it works; I do not have
traffic I can share for a testcase.
2016-05-17 11:07:30 -07:00
Johanna Amann
d091e9ca89 Fix duplication of new_connection_contents event
Addresses BIT-1602
2016-05-17 10:32:13 -07:00
Johanna Amann
4851cbc7cc Merge remote-tracking branch 'origin/topic/dnthayer/ticket1601'
* origin/topic/dnthayer/ticket1601:
  Fix some failing plugin tests on OS X 10.11

BIT-1601 #merged
2016-05-16 20:11:20 -07:00
Johanna Amann
8f6cdbb489 Fix test failing when we use &> instead of 2>
On the shell of a few systems, that apparently masks the return code.

(Namely - Debian and FreeBSD)
2016-05-13 07:44:30 -07:00
Daniel Thayer
a4e5591e18 Fix some failing plugin tests on OS X 10.11
By default, OS X 10.11 does not include openssl headers.
Since building a Bro plugin #includes Bro headers, which #include openssl
headers, we need to tell cmake to find these so that the compiler
can use them.
2016-05-12 15:58:09 -05:00
Johanna Amann
49ca47895d Merge remote-tracking branch 'origin/topic/dnthayer/ticket1595'
* origin/topic/dnthayer/ticket1595:
  Fix a bug in receiving remote logs via broker

BIT-1595 #merged
2016-05-12 08:06:42 -07:00
Johanna Amann
8fb78125a5 Merge remote-tracking branch 'origin/topic/dnthayer/ticket1587'
* origin/topic/dnthayer/ticket1587:
  Fix Bro and unit tests when broker is not enabled

BIT-1587 #merged
2016-05-12 07:58:19 -07:00
Johanna Amann
5f50733276 Merge branch 'topic/jgras/event-vars' of https://github.com/J-Gras/bro 2016-05-12 07:40:44 -07:00
Johanna Amann
5baeb4790d Updating submodule
[nomail]
2016-05-11 11:25:39 -07:00
Jan Grashoefer
65607239c9 Added interpreter error for local event variables.
Scheduling a local event variable resulted in a global lookup instead of
evaluating the local variable. To prevent misunderstandings, this will
trigger an error now.
2016-05-11 12:26:11 +02:00
Daniel Thayer
7e3991d879 Fix a bug in receiving remote logs via broker
When receiving a remote log via broker, there was a bug that would
prevent a log from being written if the log record contained a field
without the &log attribute that was followed by a field with the &log
attribute.

Updated a test case to catch this error.
2016-05-10 15:37:50 -05:00
Daniel Thayer
d91dd8d9a8 Fix Bro and unit tests when broker is not enabled
When Bro was compiled with broker disabled, then some Bro scripts
were referencing functions and types that were not defined.  Fixed
by adding @ifdefs to several scripts.  Removed one @ifdef because
it was causing several unit tests to fail.

Also fixed the @TEST-REQUIRES check in tests that rely on broker so
that such tests are skipped when broker is disabled.
2016-05-10 06:24:35 -05:00
Robin Sommer
90223fe428 Updating submodule(s).
[nomail]
2016-05-09 09:45:21 -07:00
Robin Sommer
b23ed77819 Updating submodule(s).
[nomail]
2016-05-07 12:24:20 -07:00
Robin Sommer
2e12d01eee Merge branch 'master' of git.bro.org:bro 2016-05-07 11:51:41 -07:00
Robin Sommer
00d94f1bbc Merge remote-tracking branch 'origin/topic/seth/stats-improvement'
(Cleaned up some code a little bit.)

* origin/topic/seth/stats-improvement:
  Fixing tests for stats improvements
  Rename the reporting interval variable for stats.
  Removing more broken functionality due to changed stats apis.
  Removing some references to resource_usage()
  Removing Broker stats, it was broken and incomplete.
  Fixing default stats collection interval to every 5 minutes.
  Add DNS stats to the stats.log
  Small stats script tweaks and beginning broker stats.
  Continued stats cleanup and extension.
  More stats collection extensions.
  More stats improvements
  Slight change to Mach API for collecting memory usage.
  Fixing some small mistakes.
  Updating the cmake submodule for the stats updates.
  Fix memory usage collection on Mac OS X.
  Cleaned up stats collection.

BIT-1581 #merged
2016-05-07 11:51:35 -07:00