Commit graph

16 commits

Author SHA1 Message Date
Vlad Grigorescu
1d57cd3727 Fix SSH analyzer bug where is_server in capabilities is wrong.
The ssh_capabilities event includes the capabilities reported
by either the server or the client. The record also includes a field,
is_server, so that scripts can determine which endpoint is reporting
its capabilities. That field was being set incorrectly (it was being
set as is_client rather than is_server, so it needed to be negated).

This simple bug had some larger repercussions. RFC 4253 provides a
method for client and server to agree on algorithms used in the SSH
connection. Bro was calculating these incorrectly. Some of these, such
as the encryption algorithm, are also used to determine whether or not
Bro should attempt to detect successful versus failed
authentications. In some cases, Bro would get this wrong, and make a
guess when it could not correctly determine the authentication outcome.
2018-10-16 10:29:29 -05:00
Vlad Grigorescu
fde88fa717 #120: Pull in PR, and make a couple small cleanup tweaks. 2018-06-02 17:29:01 -05:00
Andrew Woodford
f07fdc255f SSH protocol now assesses the packet length at an earlier stage within binpac. Stops SSH analyzer constantly raising binpac exceptions. Seems to be because a packet continues to go through binpac when empty and only calls the next packet when asked for more data and not on operations. 2017-12-21 16:34:26 +00:00
Johanna Amann
f79b5adc08 Merge remote-tracking branch 'origin/topic/vladg/ssh'
I replaced a few strcmps with either calls to std::str.compare
or with the == operator of BroString.

Also changed two of the input framework tests that did not pass
anymore after the merge. The new SSH analyzer no longer loads the
scripts that let network time run, hence those tests failed because
updates were not propagated from the threads (that took a while
to find.)

* origin/topic/vladg/ssh: (25 commits)
  SSH: Register analyzer for 22/tcp.
  SSH: Add 22/tcp to likely_server_ports
  SSH: Ignore encrypted packets by default.
  SSH: Fix some edge-cases which created BinPAC exceptions
  SSH: Add memleak btest
  SSH: Update baselines
  SSH: Added some more events for SSH2
  SSH: Intel framework integration (PUBKEY_HASH)
  Update baselines for new SSH analyzer.
  Update SSH policy scripts with new events.
  SSH: Add documentation
  Refactoring ssh-protocol.pac:
  SSH: Use the compression_algorithms const in another place.
  Some cleanup and refactoring on SSH main.bro.
  SSH: A bit of code cleanup.
  Move SSH constants to consts.pac
  SSH: Cleanup code style.
  SSH: Fix some memleaks.
  Refactored the SSH analyzer. Added supported for algorithm detection and more key exchange message types.
  Add host key support for SSH1.
  Add support for SSH1
  Move SSH analyzer to new plugin architecture.
  ...

Conflicts:
  scripts/base/protocols/ssh/main.bro
  testing/btest/Baseline/core.print-bpf-filters/output2
  testing/btest/Baseline/plugins.hooks/output

BIT-1344: #merged
2015-03-25 11:04:26 -07:00
Vlad Grigorescu
61c94d1809 SSH: Added some more events for SSH2 2015-03-18 12:52:46 -04: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
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
Vlad Grigorescu
8ca0067363 SSH: A bit of code cleanup. 2015-03-04 13:24:59 -05:00
Vlad Grigorescu
b76f7d9fa7 SSH: Cleanup code style. 2015-03-03 16:22:22 -05:00
Vlad Grigorescu
05ecac2497 Refactored the SSH analyzer. Added supported for algorithm detection and more key exchange message types. 2015-01-13 12:02:31 -05:00
Vlad Grigorescu
245bd07af7 Add host key support for SSH1. 2015-01-06 21:23:18 -06:00
Vlad Grigorescu
5e206ed108 Add support for SSH1 2015-01-06 20:27:20 -06:00
Vlad Grigorescu
3ed6dd5585 A bit of code cleanup. 2014-12-27 17:19:43 -06:00
Vlad Grigorescu
51373b0592 SSH: Misc. updates to the new analyzer. 2014-09-02 00:15:32 -04:00
Vlad Grigorescu
2698fcea8e SSH: Various updates. 2014-04-22 18:26:39 -04:00
Vlad Grigorescu
78b5f6b94b BinPAC SSH analyzer basic functionality. 2014-04-02 23:03:24 -04:00