Commit graph

6667 commits

Author SHA1 Message Date
Jon Siwek
df60015333 Remove "unmatched_HTTP_reply" weird.
BIT-725 #close
2015-03-20 11:13:50 -05:00
Vlad Grigorescu
f33e26242c SSH: Fix some edge-cases which created BinPAC exceptions 2015-03-19 21:43:07 -04:00
Vlad Grigorescu
e2134d3cb9 SIP: Fix up DPD and the TCP analyzer a bit. 2015-03-19 19:57:05 -04:00
Johanna Amann
c27848fc32 Change the way the input framework deals with values it cannot convert
into BroVals (especially enums)

Not we do not force an internal error anymore. Instead, we raise an
normal error and set an error flag that signals to the top-level
functions that the value could not be converted and should not be
propagated to the Bro core. This sadly makes the already messy code even
more messy - but since errors can happen in deeply nested data
structures, the alternative (catching the error at every possible
location and then trying to clean up there instead of recursively
deleting the data that cannot be used later) is much worse.

Addresses BIT-1199
2015-03-19 14:58:38 -07:00
Jon Siwek
6ebd80a8b4 BIT-849: turn SMTP reporter warnings into weirds.
The new weirds are named "smtp_nested_mail_transaction" and
"smtp_unmatched_end_of_data".

BIT-849 #close
2015-03-19 12:18:37 -05:00
Jon Siwek
8efaae96cd BIT-788: use DNS QR field to better identify flow direction. 2015-03-19 11:53:40 -05:00
Seth Hall
3956df4407 Merge remote-tracking branch 'origin/topic/vladg/rrsig'
* origin/topic/vladg/rrsig:
  DNS: Log the type number for the DNS_RR_unknown_type weird.
2015-03-18 22:51:37 -04:00
Daniel Thayer
eec7f77913 Correct a spelling error 2015-03-18 16:39:06 -05:00
Daniel Thayer
9aa5cdc53a Merge remote-tracking branch 'origin/master' into fastpath 2015-03-18 16:33:32 -05:00
Jon Siwek
981be3b670 BIT-342: add "icmp_sent_payload" event. 2015-03-18 16:16:24 -05:00
Vlad Grigorescu
1ea5463037 Merge remote-tracking branch 'origin/master' into topic/vladg/sip 2015-03-18 15:44:09 -04:00
Johanna Amann
28e6aa9561 Merge remote-tracking branch 'origin/master' into topic/johanna/dtls 2015-03-18 12:25:39 -07:00
Johanna Amann
90bc5add6e Make the plugin structure more... legal. 2015-03-18 11:15:18 -07:00
Vlad Grigorescu
01e5de8234 DNS: Log the type number for the DNS_RR_unknown_type weird. 2015-03-18 13:31:12 -04:00
Vlad Grigorescu
61c94d1809 SSH: Added some more events for SSH2 2015-03-18 12:52:46 -04:00
Aaron Eppert
2088928fb6 A fatal error, especially in DEBUG, should result in a core.
This issue is especially helpful in the case of the Val::CONVERTER error and having:

"fatal error in <no location>: Val::CONVERTER ..."

Nebulous error and sans location, it is extremely hard to figure out the culprit. Thus, if Bro is built DEBUG, fatal should provide a core.

This subtle change prevents having to change FatalErrors to FatalErrorWithCore everywhere.
2015-03-18 11:15:38 -04:00
Aaron Eppert
e3cc7aa48f Seems to fix a case where an entry in the table may be null on insert.
#0  0x0000000000713b87 in Dictionary::Insert (this=0x1339840, new_entry=0xb18a9d0, copy_key=0) at /root/psdev/bro/src/Dict.cc:419
#1  0x00000000007130b0 in Dictionary::Insert (this=0x1339840, key=0xa23f6d0, key_size=36, hash=658668102, val=0x67fde40, copy_key=0) at /root/psdev/bro/src/Dict.cc:158
#2  0x00000000006cb508 in Dictionary::Insert (this=0x1339840, key=0x7ffff4ba81b0, val=0x67fde40) at /root/psdev/bro/src/Dict.h:47

(gdb) print *this
$59 = {_vptr.Dictionary = 0xaf7810, tbl = 0x215b400, num_buckets = 1347, num_entries = 3879, max_num_entries = 4042, den_thresh = 3, thresh_entries = 4041, tbl2 = 0x1afcc9e0,
  num_buckets2 = 2695, num_entries2 = 181, max_num_entries2 = 181, den_thresh2 = 3, thresh_entries2 = 8085, tbl_next_ind = 60, order = 0x133bfb0, delete_func = 0,
  cookies = {<BaseList> = {entry = 0x133d790, chunk_size = 10, max_entries = 10, num_entries = 0}, <No data fields>}}

(gdb) print *tbl
$60 = (DictEntryPList *) 0x0
2015-03-18 00:28:19 -04:00
Johanna Amann
d236643894 Make error message when encountering not existing enums better.
Example:
internal error: Value not 'NoSuch::Notice' for stream 'ignored_notices' is not a valid enum.
Abort trap: 6

Addresses BIT-1199
2015-03-17 13:45:00 -07:00
Vlad Grigorescu
092a78d14b Merge remote-tracking branch 'origin/master' into topic/vladg/ssh 2015-03-17 12:36:30 -04:00
Robin Sommer
e3be3c9e02 Merge remote-tracking branch 'origin/topic/jsiwek/bit-1305'
* origin/topic/jsiwek/bit-1305:
  Deprecate &rotate_interval, &rotate_size, &encrypt, &mergeable.

BIT-1305 #merged
2015-03-17 09:24:13 -07:00
Vlad Grigorescu
370f4f2179 SSH: Add documentation 2015-03-16 13:32:13 -04:00
Pete Nelson
3ef2cd70a4 Add defensive check for localtime_r() call 2015-03-14 16:56:35 -04:00
Seth Hall
ee3e885712 Lots of fixes for file type identification.
- Plain text now identified with BOMs for UTF8,16,32
   (even though 16 and 32 wouldn't get identified as plain text, oh-well)
 - X.509 certificates are now populating files.log with
   the mime type application/pkix-cert.
 - File signatures are split apart into file types
   to help group and organize signatures a bit better.
 - Normalized some FILE_ANALYSIS debug messages.
 - Improved Javascript detection.
 - Improved HTML detection.
 - Removed a bunch of bad signatures.
 - Merged a bunch of signatures that ultimately detected
   the same mime type.
 - Added detection for MS LNK files.
 - Added detection for cross-domain-policy XML files.
 - Added detection for SOAP envelopes.
2015-03-13 22:14:44 -04:00
Jon Siwek
778b37b5d0 Deprecate &rotate_interval, &rotate_size, &encrypt, &mergeable.
Addresses BIT-1305.
2015-03-13 14:54:46 -05:00
Jon Siwek
6fbceb6a98 Identify GRE tunnels as Tunnel::GRE, not Tunnel::IP.
BIT-1311 #close
2015-03-13 13:03:58 -05:00
Jon Siwek
51010eccd4 Add Connection class getter methods for flow labels.
BIT-1309 #close
2015-03-13 13:00:29 -05:00
Johanna Amann
991e4f5dc3 DTLS working.
The only thing that is missing is a signature to detect the protocol (it
has no well-known port).

Reassembly is kind of fidgety - at the moment we only support
re-assembling one simultaneous message per direction (which looking at
our test-traffic might not be a problem). And I am not quite sure if I
got all cases correct...

But - it works :)
2015-03-12 15:46:17 -07:00
Johanna Amann
ba27bb54d4 Implement correct parsing of TLS record fragmentation.
Finally. Our test-case is a >400kb certificate with 10,000 alternative
names. :)
2015-03-11 18:23:08 -07:00
Johanna Amann
47de906612 Make handshake analyzer flow-based. This means we can feed data to it in
chunks, which makes dealing with fragmentation a little bit more
convenient.
2015-03-11 16:17:14 -07:00
Johanna Amann
1ae97e7e62 When setting the SSL analyzer to fail, also stop processing data
that already has been delivered to the analyzer, not just future data.

No testcase because this is hard to reproduce, this was only found due
to mistakenly triggering an error in life traffic at a site...
2015-03-11 15:21:35 -07:00
Johanna Amann
038fbf9b9e First step for a DTLS analyzer.
This commit mostly does a lot of refactoring of the current SSL
analyzer, which is split into several parts.

The handshake protocol is completely taken out of the SSL analyzer and
was refactored into its own analyzer (called tls-handshake-analyzer).
This will also (finally) make it possible to deal with TLS record
fragmentation.

Apart from that, the parts of the SSL analyzer that are common to DTLS
were split into their own pac files. Both the SSL analyzer and the (very
basic, mostly nonfunctional) DTLS analyzer use their own pac files and
those shared pac files.

All SSL tests still pass after refactoring so I hope I did not break
anything too badly.

At the moment, we have two different modules in one directory and I
guess the way I am doing this might be an abuse of the system. It seems
to work though...
2015-03-11 15:07:13 -07:00
Vlad Grigorescu
82c4037929 Refactoring ssh-protocol.pac:
- Simplify and unify some types
  - Fix parsing of the key exchange messages, so we can transition
  - states properly again.
2015-03-11 11:58:31 -04:00
Johanna Amann
31795e7600 When setting the SSL analyzer to fail, also stop processing data
that already has been delivered to the analyzer, not just future data.

No testcase because this is hard to reproduce, this was only found due
to mistakenly triggering an error in life traffic at a site...
2015-03-10 14:29:40 -07:00
Jon Siwek
cb5902d1ad Fix broker data stores in absence of --enable-debug.
Oops, put too much inside the assert() macro, so the registering of data
stores got preprocessed out of optimized builds.
2015-03-10 13:27:13 -05:00
Vlad Grigorescu
d9b4693240 Some cleanup and refactoring on SSH main.bro.
Specifically, an overhaul of how the algorithm negotiation is
calculated, to simplify a lot of the code.
2015-03-09 16:04:35 -04:00
Jon Siwek
867c4379ea Fix a format specifier. 2015-03-09 13:16:49 -05:00
Jon Siwek
2f626fa602 Fix build warnings, clarify broker requirements, update submodule. 2015-03-06 11:07:58 -06:00
Jon Siwek
9e53722b57 Rename comm/ directories to broker/ 2015-03-05 17:02:25 -06:00
Jon Siwek
fa08083a92 Rename broker-related namespaces.
c++ namespace "comm" -> bro_broker
script module "Comm" -> BrokerComm
script module "Store" -> BrokerStore
2015-03-05 16:20:51 -06:00
Seth Hall
371cf10c86 Improved transition into SSL/TLS from RDP. 2015-03-05 16:57:58 -05:00
Seth Hall
ffdf2a46d7 Fixes tests in RDP branch.
- Re-enable MySQL.  It had accidentally been disabled.
2015-03-05 16:08:18 -05:00
Johanna Amann
ec91641569 Merge branch 'topic/seth/rdp' of ssh://git.bro.org/bro into topic/seth/rdp 2015-03-05 13:00:41 -08:00
Johanna Amann
9441dc68ec add a special case to the X509 code that deals with RDP certificates.
Basically, at least some rdp certificates specify a completely invalid
and nonsensical value for theyr key type. OpenSSL does not like this and
refuses to parse the key in this case. With this change, we detect this
case and special-case it, hinting to OpenSSL what kind of key we have.
This gives us additional information that we would not have otherwhise
in the log file (like key length and the exponent).
2015-03-05 12:59:03 -08:00
Jon Siwek
25a4d0ebed Improve remote logging via broker.
Only send fields with the &log attribute.
2015-03-05 14:07:06 -06:00
Seth Hall
4737b235b6 Merge remote-tracking branch 'origin/master' into topic/seth/rdp 2015-03-05 14:38:34 -05:00
Seth Hall
276e072e6e A few more changes to handling encryption in RDP. 2015-03-05 13:38:54 -05:00
Jon Siwek
69693663eb Disable a stream's remote logging via broker if it fails.
If there's something invalid about the stream like trying to log an
unsupported data type, don't keep trying to send remote logs.
2015-03-05 11:53:50 -06:00
Seth Hall
b92a68e2bd Adds some comments and fixes a broxygen warning. 2015-03-05 11:37:37 -05:00
Seth Hall
6909d0de87 Fixes another optional part of an RDP unit. 2015-03-05 03:02:19 -05:00
Seth Hall
374ac42814 Support RDP negotiation requests optionally and support zero length cookies. 2015-03-05 02:48:21 -05:00