Commit graph

522 commits

Author SHA1 Message Date
Jon Siwek
b51dd191d7 Refactor IP-in-IP tunnel support.
UDP tunnel support removed for now, to be re-added in specific
analyzers later, but IP-in-IP is now decapsulated recursively
so nested tunnels can be seen and the inner packets get sent
through the IP fragment reassembler if necessary.
2012-04-23 13:15:29 -05:00
Robin Sommer
5350cab371 Merge remote-tracking branch 'origin/topic/icmp6'
* origin/topic/icmp6:
  Fixes for IPv6 truncation and ICMP/ICMP6 analysis.
  Change ICMPv6 checksum calculation to use IP_Hdr wrapper.
  Update IPv6 atomic fragment unit test to filter output of ICMPv6.
  Add more data to icmp events
  More code cleanup
  Add more icmpv6 events, and general code cleanup
  Fix compile failure after merge from master
  Significant edit pass over ICMPv6 code.
  Porting Matti's branch to git.

Closes #808.
2012-04-17 19:02:59 -07:00
Robin Sommer
fe2535b08d Updating baselines for DNS change. 2012-04-16 18:08:16 -07:00
Jon Siwek
51bad73e1e Fixes for IPv6 truncation and ICMP/ICMP6 analysis.
- Add more guards against trying to analyze captured packets with a
  truncated IPv6 static header or extension header chain.

- Add back in the ICMP payload tracking for ICMP "connections".

- Fix 'icmp_context' record construction.  Some field assignments
  were mismatched for ICMP and ICMP6.  Source and destination
  addresses were set incorrectly for context packets that don't
  contain a full IP header.  Some fields for ICMP6 weren't filled out.

- Changed ICMP Time Exceeded packets to raise the 'icmp_time_exceeded'
  event instead of 'icmp_error_message'.

- Add unit tests for truncation and the main types of ICMP/ICMP6
  that have specific events.

- Documentation clarifications.
2012-04-11 16:27:31 -05:00
Robin Sommer
86834c941c Adding missing leak groups to a couple tests.
Also activating leak checking for proxy in basic-cluster test.
2012-04-10 16:14:33 -07:00
Jon Siwek
27ba3118c1 Change ICMPv6 checksum calculation to use IP_Hdr wrapper.
So that src/dst addresses used in pseudo-header are correct when
there's certain extension headers (routing/destination).

Add ICMP/ICMPv6 checksum unit tests.
2012-04-10 11:37:08 -05:00
Jon Siwek
958c6c7cf4 Update IPv6 atomic fragment unit test to filter output of ICMPv6.
Since that's not relevant to test.
2012-04-10 11:09:07 -05:00
Robin Sommer
cccaad63b3 Merge remote-tracking branch 'origin/topic/jsiwek/mobile-ipv6'
* origin/topic/jsiwek/mobile-ipv6:
  Add support for mobile IPv6 Mobility Header (RFC 6275).
  Refactor IP_Hdr routing header handling, add MobileIPv6 Home Address handling.
  Revert TCP checksumming to cache common data, like it did before.
  Revert "Improve handling of IPv6 Routing Type 0 headers."
  Improve handling of IPv6 routing type 0 extension headers.
2012-04-09 17:49:52 -07:00
Jon Siwek
91330f1e1c Add support for mobile IPv6 Mobility Header (RFC 6275).
- Accessible at script-layer through 'mobile_ipv6_message' event.

- All Mobile IPv6 analysis now enabled through --enable-mobile-ipv6
  configure-time option, otherwise the mobility header, routing type 2,
  and Home Address Destination option are ignored.
2012-04-09 14:39:00 -05:00
Jon Siwek
fcd8f9b77e Fix table expiry for values assigned in bro_init() when reading live.
Value assigned in bro_init() to a table with &create_expire
weren't expiring when reading traffic from an interface.  It worked
when reading a pcap file, but I added a test case to show it still
working.
2012-04-06 13:24:27 -05:00
Jon Siwek
29724415c3 Merge branch 'master' into topic/jsiwek/mobile-ipv6
Conflicts:
	src/IP.cc
2012-04-05 12:05:06 -05:00
Jon Siwek
f3455f843e Merge branch 'master' into fastpath 2012-04-05 11:41:00 -05:00
Jon Siwek
11b15cc290 Refactor IP_Hdr routing header handling, add MobileIPv6 Home Address handling.
Packets that use the Home Address Destination option use that option's
address as the connection's originator.
2012-04-05 10:50:35 -05:00
Robin Sommer
fb0614b5c6 Adding notice_policy.log canonification for external tests.
These was still producing false positives.
2012-04-04 17:46:13 -07:00
Jon Siwek
d8d83f590b Fix handling of IPv6 atomic fragments.
The FragReassembler expire_timer was left uninitialized until after
the first fragment is added, but since the atomic fragment is also
the last, the reassembler thought expire_timer needed to be deleted.
This fix just initializes expire_timer before the first fragment is
added.
2012-04-04 15:27:43 -05:00
Jon Siwek
256c0af98e Merge branch 'master' into topic/robin/log-threads
Conflicts:
	cmake
2012-03-30 12:02:32 -05:00
Jon Siwek
877cc5b235 Merge branch 'topic/jsiwek/routing0' into topic/jsiwek/mobile-ipv6
Conflicts:
	src/net_util.cc
	src/net_util.h
2012-03-29 14:34:39 -05:00
Jon Siwek
3a4d035603 Revert "Improve handling of IPv6 Routing Type 0 headers."
This reverts commit 256cd592a7.

Conflicts:

	src/IP.cc
	src/Sessions.cc
2012-03-29 14:29:33 -05:00
Robin Sommer
de7300f999 Merge remote-tracking branch 'origin/topic/jsiwek/skip-rh0-segleft'
* origin/topic/jsiwek/skip-rh0-segleft:
  Improve handling of IPv6 Routing Type 0 headers.

Closes #804.
2012-03-28 15:12:01 -07:00
Jon Siwek
256cd592a7 Improve handling of IPv6 Routing Type 0 headers.
- For RH0 headers with non-zero segments left, a "routing0_segleft"
  flow_weird event is raised (with a destination indicating the last
  address in the routing header), and an "rh0_segleft" event can also
  be handled if the other contents of the packet header are of interest.
  No further analysis is done as the complexity required to correctly
  identify destination endpoints of connections doesn't seem worth it
  as RH0 has been deprecated by RFC 5095.

- For RH0 headers without any segments left, a "routing0_header"
  flow_weird event is raised, but further analysis still occurs
  as normal.
2012-03-28 13:49:28 -05:00
Jon Siwek
f4101b5265 Improve handling of IPv6 routing type 0 extension headers.
- flow_weird event with name argument value of "routing0_hdr" is raised
  for packets containing an IPv6 routing type 0 header because this
  type of header is now deprecated according to RFC 5095.

- packets with a routing type 0 header and non-zero segments left
  now use the last address in that header in order to associate
  with a connection/flow and for calculating TCP/UDP checksums.

- added a set of IPv4/IPv6 TCP/UDP checksum unit tests
2012-03-27 16:05:45 -05:00
Jon Siwek
0ceca706f6 Change routing0_data_to_addrs BIF to return vector of addresses.
Because the order of addresses in type 0 routing headers is
interesting/important.
2012-03-26 14:35:01 -05:00
Robin Sommer
72f098cb59 Adding btest state file to gitignore. 2012-03-23 17:39:27 -07:00
Robin Sommer
02d8c52e6f Merge branch 'topic/jsiwek/ipv6-ext-headers'
* topic/jsiwek/ipv6-ext-headers:
  Cosmetics in preparation for merge.
  Removing remaining comments. Looks fine.
  Refactor script-layer IPv6 ext. header chain (addresses #795)
  Changes to IPv6 ext. header parsing (addresses #795).
  Fix ipv6_ext_headers event and add routing0_data_to_addrs BIF.
  Remove the default "tcp or udp or icmp" filter.
  Merge remote-tracking branch 'origin/topic/jsiwek/ipv6-ext-headers'
  Add unit test for IPv6 fragment reassembly.
  Update PacketFilter/Discarder code for IP version independence.
  Add a few comments to IP.h
  Fix some IPv6 header related bugs.
  Add IPv6 fragment reassembly.
  Add handling for IPv6 extension header chains (addresses #531)

Closes #795.
2012-03-23 17:38:27 -07:00
Jon Siwek
c765f43fe3 Refactor script-layer IPv6 ext. header chain (addresses #795)
This replaces the "ip6_hdr_chain" in the "ip6_hdr" record with a vector of
"ip6_ext_hdr" to make it easier to traverse the chain.
2012-03-21 10:34:38 -05:00
Jon Siwek
1c1d657039 Changes to IPv6 ext. header parsing (addresses #795).
In response to feedback from Robin:

  - rename "ip_hdr" to "ip4_hdr"

  - pkt_hdr$ip6 is now of type "ip6_hdr" instead of "ip6_hdr_chain"

  - "ip6_hdr_chain" no longer contains an "ip6_hdr" field, instead
    it's the other way around, "ip6_hdr" contains an "ip6_hdr_chain"

  - other internal refactoring
2012-03-20 15:50:17 -05:00
Jon Siwek
f11fca588e Merge branch 'master' into topic/jsiwek/ipv6-ext-headers 2012-03-19 14:26:59 -05:00
Jon Siwek
667487cec9 Adapt FreeBSD's inet_ntop implementation for internal use.
So we get consistent text representations of IPv6 addresses across
platforms.
2012-03-19 11:26:31 -05:00
Robin Sommer
d2b59b1cb8 Merge branch 'topic/jsiwek/ipv6-ext-headers' of ssh://git.bro-ids.org/bro into topic/jsiwek/ipv6-ext-headers
Conflicts:
	src/Sessions.cc
2012-03-14 13:50:39 -07:00
Jon Siwek
5312a904ab Fix ipv6_ext_headers event and add routing0_data_to_addrs BIF.
Also add unit tests for ipv6_ext_headers and esp_packet events.
2012-03-14 10:31:08 -05:00
Robin Sommer
9dd63acaa3 Updating baseline.
Is that a platform-specific difference?
2012-03-13 16:10:42 -07:00
Robin Sommer
d8d7dd4d53 Merge remote-tracking branch 'origin/topic/jsiwek/ipv6-literals'
* origin/topic/jsiwek/ipv6-literals:
  Change IPv6 literal constant syntax to require encasing square brackets
2012-03-13 15:33:43 -07:00
Robin Sommer
e83714e178 Merge branch 'master' into topic/jsiwek/ipv6-ext-headers 2012-03-13 15:25:05 -07:00
Robin Sommer
c78a391635 Merge remote-tracking branch 'origin/topic/jsiwek/remove-match'
* origin/topic/jsiwek/remove-match:
  Remove the match expression (addressed #753).
2012-03-13 14:55:40 -07:00
Jon Siwek
bf3f184a01 Change IPv6 literal constant syntax to require encasing square brackets
This is to avoid ambiguity between compressed hex notation and
module namespacing, both which use "::". E.g.: "aaaa::bbbb" could
be an identifier or an IPv6 address, but "[aaaa::bbbb]" is now
clearly the address.

Also added IPv6 mixed notation to allow an IPv4 dotted-decimal
address to be specified in the lower 32-bits.
2012-03-13 13:47:07 -05:00
Jon Siwek
e74cbbf774 Add unit test for IPv6 fragment reassembly. 2012-03-12 15:26:51 -05:00
Robin Sommer
0208dd2844 Merge remote branch 'origin/master' into topic/robin/log-threads 2012-03-08 17:35:58 -08:00
Robin Sommer
83038d78e0 Adding new leak tests involving remote logging. 2012-03-08 17:35:58 -08:00
Jon Siwek
0b32c980bf Update PacketFilter/Discarder code for IP version independence.
The signatures of script-layer functions 'discarder_check_ip',
'discarder_check_tcp', 'discarder_check_udp', and 'discarder_check_icmp'
were changed to use the more general 'pkt_hdr' type as a parameter
instead of individual header types.
2012-03-08 13:12:04 -06:00
Jon Siwek
fef671e4a6 Fix a BRO_PROFILER_FILE/mkstemp portability issue. (addresses #794) 2012-03-02 12:40:25 -06:00
Jon Siwek
ef5e9caaf4 Changes to how script coverage integrates with test suites.
- BRO_PROFILER_FILE now passes .X* templated filenames to mkstemp
  for generating unique coverage state files.  All test suites
  now use this so each Bro instance writes to a unique coverage file.
- Rearranging Makefile targets.  The general rule is that if the
  all/brief target fails out due to a test failure, then the dependent
  coverage target won't run, but can still be invoked directly later.
  (e.g. make brief || make coverage)
2012-03-01 13:00:44 -06:00
Robin Sommer
92ed583ee7 Adding btest group "leaks" to leak tests.
This will make it easier to run just the leak tests.
2012-02-29 17:19:38 -08:00
Robin Sommer
9b83591374 Merge remote-tracking branch 'origin/topic/robin/parallel-btest'
* origin/topic/robin/parallel-btest:
  Updating submodule(s).
  Adding group "comm" to communication tests for parallelizing execution with new btest version.

This is in preparation for the merge with the parallel btest branch.

Conflicts:
	cmake
	testing/btest/istate/pybroccoli.py
	testing/btest/scripts/base/frameworks/control/configuration_update.bro
	testing/btest/scripts/base/frameworks/control/id_value.bro
	testing/btest/scripts/base/frameworks/control/shutdown.bro
	testing/btest/scripts/base/frameworks/metrics/basic-cluster.bro
2012-02-29 17:17:25 -08:00
Robin Sommer
bfeca444db Sorting all output for the external tests.
Let's see how this goes. The script keeps comments at the beginning.
2012-02-29 17:09:38 -08:00
Robin Sommer
36d46efa68 Merge remote-tracking branch 'origin/topic/jsiwek/broccoli-ipv6'
* origin/topic/jsiwek/broccoli-ipv6:
  Update/add tests for broccoli IPv6 addr/subnet support (addresses #448)
2012-02-27 21:15:41 -08:00
Jon Siwek
e07470c7f1 Remove connection compressor (addresses #559). 2012-02-27 11:35:25 -06:00
Robin Sommer
d2b2157454 Fixing merge relict. 2012-02-24 15:52:15 -08:00
Robin Sommer
2eeac54857 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Add to_subnet bif (fixes #782).
  Refactor IPAddr v4 initialization from string. (fixes #775)

Closes #782.
Closes #775.
Closes #784.
2012-02-24 15:26:18 -08:00
Robin Sommer
3323692771 Merge remote-tracking branch 'origin/topic/jsiwek/ipaddr-refactoring'
* origin/topic/jsiwek/ipaddr-refactoring:
  Refactoring various usages of new IPAddr class.

Conflicts:
	src/bro.bif

Closes #784.
2012-02-24 15:21:57 -08:00
Robin Sommer
4ef8607e60 Merge remote-tracking branch 'origin/topic/dnthayer/ftp-ipv6'
* origin/topic/dnthayer/ftp-ipv6:
  Add test case for FTP over IPv4
  Fix IPv6 URLs
  Add a test for FTP over IPv6
  Update FTP EPSV response processing for IPv6
  Fix parsing of FTP EPRT command and EPSV response

Conflicts:
	src/bro.bif

Closes #778.
2012-02-24 15:00:41 -08:00