Skip to content

Commit 3b20343

Browse files
andrewchiGitHub Enterprise
authored andcommitted
Merge pull request #604 from network-intelligence/dev
Dev -> trunk for version 2.10.0
2 parents 868137f + b120c11 commit 3b20343

File tree

168 files changed

+1934
-1024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+1934
-1024
lines changed

.github/workflows/build-wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
CIBW_TEST_COMMAND: cd {project} && python mercury_python_test.py
6161

6262
- name: Upload to S3
63-
env:
63+
env:
6464
AWS_ACCESS_KEY_ID: ${{secrets.ACCESS_KEY_ID}}
6565
AWS_SECRET_ACCESS_KEY: ${{secrets.ACCESS_KEY_SECRET}}
6666
AWS_DEFAULT_REGION: us-east-1

COPYING

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ License for src/rapidjson
6666

6767
Tencent is pleased to support the open source community by making
6868
RapidJSON available.
69-
69+
7070
Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
7171
All rights reserved.
7272

@@ -88,8 +88,8 @@ Other dependencies and licenses:
8888
Open Source Software Licensed Under the BSD License:
8989
--------------------------------------------------------------------
9090

91-
The msinttypes r29
92-
Copyright (c) 2006-2013 Alexander Chemeris
91+
The msinttypes r29
92+
Copyright (c) 2006-2013 Alexander Chemeris
9393
All rights reserved.
9494

9595
Redistribution and use in source and binary forms, with or without
@@ -120,7 +120,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
120120
Open Source Software Licensed Under the JSON License:
121121
--------------------------------------------------------------------
122122

123-
json.org
123+
json.org
124124
Copyright (c) 2002 JSON.org
125125
All Rights Reserved.
126126

LICENSE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,3 @@ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
2929
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3030
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
3131
OF THE POSSIBILITY OF SUCH DAMAGE.
32-
33-

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.9.0
1+
2.10.0

doc/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# CHANGELOG for Mercury
22

3+
## VERSION 2.10.0
4+
* Added defensive code around memcpy operations in QUIC reassembly.
5+
* Exempted private IP addresses from Domain Faking check.
6+
* Enhanced protocol matcher and SMTP enhancements to support more commands.
7+
* Fixed compilation of experimental tool intercept.so.
8+
* Integrated STUN classifier into Mercury's analysis path.
9+
* Extended DHCP to report on all message types, not just responses.
10+
* Bugfix: removed user_agent reset code from do_observation struct.
11+
* STUN fingerprints are generated for client requests but not server responses.
12+
13+
314
## VERSION 2.9.0
415
* Added a new configuration option, network-behavioral-detections,
516
which enables behavioral detections without a resources file.

doc/autogen.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ To minimize the amount of C++ code that must be written in order to handle assig
77
The goals of the auto-generation system are:
88

99
* to minimize the amount of tedious and error-prone manual work involved in implementing protocols,
10-
10+
1111
* to provide a uniform programmatic interface and JSON output syntax for different assigned numbers, and
12-
12+
1313
* to have tooling that can be re-run in the future so that new assigned number values can be easily brought into the software
1414
once they are registered with IANA,
15-
15+
1616
* to track assigned numbers that are not registered with IANA, and be able to combine this information with IANA data.
1717

1818
We used the following approach. Each assigned number is represented by a single C++ class, which is generated from one or more CSV files, using the `csv` utility. A Makefile controls the downloading of CSV files from IANA files, and the running of `csv`, to create a single C++ header-only library that includes all of the assigned number classes for a particular protocol. The `wget` utility is used for downloading files. The resulting protocol library header file is written into the `src/tables/` subdirectory; it must be manually copied into the `src/libmerc` subdirectory to be used in mercury. Any protocol library used in mercury must be copied into that directory and committed into the mercury git repo, so that it doesn’t need to be auto-generated for each build.
@@ -63,7 +63,7 @@ Value,Name,Reference
6363
0x03-0xff,Unassigned,
6464
```
6565

66-
As with the IANA conventions, the cells in the first line describes the data in their columns. The last cell in the other lines are empty, which is acceptable, although each line must have the same number of cells.
66+
As with the IANA conventions, the cells in the first line describes the data in their columns. The last cell in the other lines are empty, which is acceptable, although each line must have the same number of cells.
6767

6868
Let's run `csv` on that file, from the `src/tables` directory, and write the output into `example.h`:
6969

@@ -133,11 +133,11 @@ As implemented, the `csv` utility provides minimal error reporting. Users deser
133133

134134
When working with additional protocols, it may be necessary to tweak the code to handle slightly different CSV file conventions.
135135

136-
One important limitation of the current system is that ranges (such as 0x03-0xff) are not handled. A future version could add provide the information about what range a number is in through the `get_name()`member function, or a new member function.
136+
One important limitation of the current system is that ranges (such as 0x03-0xff) are not handled. A future version could add provide the information about what range a number is in through the `get_name()`member function, or a new member function.
137137

138-
Additional information about a number could be provided through additional member functions. The RFC numbers associated with most IANA registrations could be used to determine the year that a protocol option was standardized, and this information could be provided through a member function. The range of years associated with the assigned numbers in a protocol message give a strong indication of the year that the implementation was completed. Another useful bit of information is the RFC reference itself, which could be provided as a URL to facilitate quick lookups.
138+
Additional information about a number could be provided through additional member functions. The RFC numbers associated with most IANA registrations could be used to determine the year that a protocol option was standardized, and this information could be provided through a member function. The range of years associated with the assigned numbers in a protocol message give a strong indication of the year that the implementation was completed. Another useful bit of information is the RFC reference itself, which could be provided as a URL to facilitate quick lookups.
139139

140-
There are well-known addresses that are managed by IANA, which could be handled as assigned numbers.
140+
There are well-known addresses that are managed by IANA, which could be handled as assigned numbers.
141141

142142
Well-known ports could also be handled as assigned numbers, though implementations often use nonstandard destination ports, and IANA registrations should be taken with a grain of salt.
143143

doc/fdc.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33

44

5-
This note documents the data formats used in the Mercury Fingerprint and Destination Context (FDC). The FDC is encoded using the Concise Binary Object Representation ([CBOR](https://datatracker.ietf.org/doc/html/rfc8949)), an IETF standard data format that is extensible, consice, and trivially mappable to the common JavaScript Object Notation ([JSON](https://datatracker.ietf.org/doc/html/rfc8259)). The formats are formally defined using the Concise Data Definition Language ([CDDL](https://datatracker.ietf.org/doc/html/rfc8610)), an IETF standard notational convention for unamiguously expressing CBOR and JSON data formats.
5+
This note documents the data formats used in the Mercury Fingerprint and Destination Context (FDC). The FDC is encoded using the Concise Binary Object Representation ([CBOR](https://datatracker.ietf.org/doc/html/rfc8949)), an IETF standard data format that is extensible, consice, and trivially mappable to the common JavaScript Object Notation ([JSON](https://datatracker.ietf.org/doc/html/rfc8259)). The formats are formally defined using the Concise Data Definition Language ([CDDL](https://datatracker.ietf.org/doc/html/rfc8610)), an IETF standard notational convention for unamiguously expressing CBOR and JSON data formats.
66

77
A Fingerprint and Destination Context (FDC) object contains a Network Protocol Fingerprint ([NPF](https://github.com/cisco/mercury/blob/main/doc/npf.md)) and other data features, all of which are metadata observed in a single network session. An NPF fingerprint is a set of data features formed by selecting and normalizing some elements of a protocol message, so that they are correlated with the sending application or library implementation. A fingerprint by itself sometimes uniquely identifies an application, but often does not. In the latter case, the other data features are valuable for indentifying the sending application.
88

9-
- An NPF fingerprint in CBOR encoding, as defined in the [NPF CDDL specification](https://github.com/cisco/mercury/blob/main/doc/npf.cddl).
9+
- An NPF fingerprint in CBOR encoding, as defined in the [NPF CDDL specification](https://github.com/cisco/mercury/blob/main/doc/npf.cddl).
1010
- The server name, which corresponds to the TLS or QUIC Server Name field or the HTTP Host field.
1111
- The destination IP address, as a string containing a textual representation.
1212
- The destination port number, as an unsigned integer less than 64,535.
1313
- The user agent as a string, which corresponds to the value of the User-Agent header for HTTP, the value of the SOFTWARE attribute for STUN, and the concatenation of the Protocol and Comment strings for SSH.
14-
- Optionally, an unsigned integer corresponding to the truncation code, which indicates whether reassembly was required in order to obtain a complete fingerprint, and whether or not the fingerprint was truncated due to a missing packet. Its values are
14+
- Optionally, an unsigned integer corresponding to the truncation code, which indicates whether reassembly was required in order to obtain a complete fingerprint, and whether or not the fingerprint was truncated due to a missing packet. Its values are
1515
- none = 0,
1616
- reassembled = 1
1717
- truncated = 2
@@ -35,5 +35,4 @@ fdc = [
3535
]
3636
```
3737

38-
39-
38+

doc/intercept.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The interceptor library provides deep visibility into the communication of the p
77
To build interceptor:
88

99
1. Check out the mercury using git.
10-
10+
1111
2. Install prerequisites as needed. On Debian/Ubuntu:
1212

1313
$ sudo apt install libssl-dev libnss3-dev libgnutls28-dev
@@ -52,14 +52,13 @@ The test program [test_intercept.sh](../test/test_intercept.sh) shows how the li
5252

5353
Function interception is currently implemented for these libraries (listed with their Debian/Ubuntu package names):
5454

55-
* openssl (libssl-dev)
56-
* NSS (libnss3-dev)
57-
* GNUtls (libgnutls28-dev)
58-
55+
* openssl (libssl-dev)
56+
* NSS (libnss3-dev)
57+
* GNUtls (libgnutls28-dev)
58+
5959

6060

6161

6262
## Disclaimer
6363

6464
The interceptor library is experimental, and will continue to evolve. Please do not use it in mission-critical environments. Feedback is welcome; please send to [[email protected].]([email protected]).
65-

doc/libmerc_config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ analysis_context_get_process_info(c, &probable_process, &probability_score);
5151
bool probable_process_is_malware = 0;
5252
double probability_malware = 0.0;
5353
analysis_context_get_malware_info(analysis_ctx, &probable_process_is_malware, &probability_malware);
54-
54+
5555
const struct os_information *os_info = NULL;
5656
size_t os_info_len = 0;
5757
analysis_context_get_os_info(analysis_ctx, &os_info, &os_info_len);

doc/npf.cddl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,3 @@ ipv6_flow_key = [
9696
dst_port: uint,
9797
protocol: uint
9898
]
99-

0 commit comments

Comments
 (0)