Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
56aade032e | ||
|
|
ab53497a40 | ||
|
|
b0a340cbc6 | ||
|
|
c42b046d87 | ||
|
|
80368772bd | ||
|
|
2086058d00 | ||
|
|
a151276db8 | ||
|
|
fe043d3af5 | ||
|
|
9f27cd56b0 | ||
|
|
3e6cadbb76 | ||
|
|
6d00a9e0bd | ||
|
|
eea9956430 | ||
|
|
b2a8b48386 | ||
|
|
3477560639 | ||
|
|
464269e5ed | ||
|
|
a3d3856c80 | ||
|
|
9fc724de5a | ||
|
|
29c5cc39fb | ||
|
|
5849863ef9 | ||
|
|
5e8c1ebbb7 | ||
|
|
496b284c98 | ||
|
|
c4274a4aec | ||
|
|
f5c2f9280c | ||
|
|
f95bdaf625 | ||
|
|
edb8165ab9 | ||
|
|
bc44334599 | ||
|
|
02f52207be | ||
|
|
1b98bec0ab | ||
|
|
de24206adc | ||
|
|
97014c53f3 | ||
|
|
ccc5a20710 | ||
|
|
470eaa6ff3 | ||
|
|
29be01ef3a | ||
|
|
ebb9ebd2a0 | ||
|
|
1f7c57deff | ||
|
|
a944514dde | ||
|
|
5a5e01a9e2 | ||
|
|
663df7e475 | ||
|
|
9c83f0f3c5 | ||
|
|
cb15d2b328 | ||
|
|
2c551afbd7 | ||
|
|
1735931f67 | ||
|
|
8f91b8ba72 | ||
|
|
560280e6f0 | ||
|
|
3de76812d9 | ||
|
|
5fafe8374a | ||
|
|
e9d5e72fb5 | ||
|
|
22821241e2 | ||
|
|
fa67166fcc | ||
|
|
b8972d1b38 | ||
|
|
d8de8eba36 | ||
|
|
9854aed408 | ||
|
|
ad6bfbad4d | ||
|
|
fb0a73c0c7 | ||
|
|
3c4b12e061 | ||
|
|
390dc1d155 | ||
|
|
de289f1305 | ||
|
|
dbff2fbadd | ||
|
|
5704e4c142 | ||
|
|
2edbe3c11f | ||
|
|
88d4a25cb3 | ||
|
|
48a7f6d487 | ||
|
|
8c7071e040 | ||
|
|
79931b2ec7 | ||
|
|
9dc433f709 | ||
|
|
9f7ef72332 | ||
|
|
6004e55d7b | ||
|
|
eacc2b8e32 | ||
|
|
fc7b070030 | ||
|
|
63f349319f | ||
|
|
ada4fe4aa8 | ||
|
|
946c3dba0f | ||
|
|
57562b3dfe | ||
|
|
e0afc16aa2 | ||
|
|
c882120afd | ||
|
|
3e4ab39b52 | ||
|
|
b9f63458e6 | ||
|
|
81e1ea545c | ||
|
|
a387072872 | ||
|
|
2a8d0d1fe4 | ||
|
|
557bbcfc5a | ||
|
|
197a9a6cfc | ||
|
|
e49fe32f77 | ||
|
|
b2a1bf413b | ||
|
|
02e7e3c23b | ||
|
|
afb5c3e6ba | ||
|
|
6e6f1e4489 | ||
|
|
2b65a4e05e | ||
|
|
4231f48059 | ||
|
|
388d01a345 | ||
|
|
b5e8d86def | ||
|
|
cd41ab7c8f | ||
|
|
07872b3527 | ||
|
|
6d3446b114 | ||
|
|
52b562c328 | ||
|
|
aa5dd25392 | ||
|
|
9e73d61fb0 | ||
|
|
41a5ba1b65 | ||
|
|
db9f6ec1b4 | ||
|
|
175981a422 | ||
|
|
f30479b4a4 | ||
|
|
a16cd9634f | ||
|
|
15d58db2f9 | ||
|
|
55f885f3ed | ||
|
|
de16fd35aa | ||
|
|
ca5ffc4988 | ||
|
|
2ed2e5dc7e | ||
|
|
550f3e5b9d | ||
|
|
e674a8ae37 | ||
|
|
24cc949f14 | ||
|
|
c521595383 | ||
|
|
29242cbcb6 | ||
|
|
9c0caa5362 | ||
|
|
c1b6aa9483 | ||
|
|
9a34d870e9 | ||
|
|
df0dd76ed2 | ||
|
|
35fdbc8148 | ||
|
|
223a6fb9f7 | ||
|
|
3d0c36cf22 | ||
|
|
01622c4c63 | ||
|
|
2d153fba45 | ||
|
|
6c84ce85e4 | ||
|
|
8c4ece941e | ||
|
|
3bb6bf628d | ||
|
|
1fecf69359 | ||
|
|
cd76bacd4a | ||
|
|
1796a1d814 | ||
|
|
e4dcec560e | ||
|
|
c4fb2a590e | ||
|
|
3c0021d603 | ||
|
|
fba926d6a4 | ||
|
|
199c86e3df | ||
|
|
37c88b129f | ||
|
|
cca585053e | ||
|
|
131d53896f | ||
|
|
3fa9416981 | ||
|
|
de59eb8237 | ||
|
|
66a8010ef7 | ||
|
|
c83e0b3c8d | ||
|
|
503aac70bc | ||
|
|
f3a74d97d8 | ||
|
|
fbf30d1aad | ||
|
|
a27538b764 | ||
|
|
ac7a3669da | ||
|
|
39f9b8cadf | ||
|
|
b7b9577254 | ||
|
|
1f345b311f | ||
|
|
83de3e4716 | ||
|
|
b250f9d86c | ||
|
|
c6201284d7 | ||
|
|
644ad34962 | ||
|
|
d6701e8979 | ||
|
|
3db6413ab0 | ||
|
|
50ee6768b7 | ||
|
|
d27fb1e73e | ||
|
|
817a7c616d | ||
|
|
5d5b46e514 | ||
|
|
03d217eae6 | ||
|
|
c960bb50f0 | ||
|
|
aef8e53b7d | ||
|
|
1d0bc7c350 | ||
|
|
a7c2734b38 | ||
|
|
174cd739db | ||
|
|
48d00eae35 | ||
|
|
0f07ad35be | ||
|
|
a966d37a21 | ||
|
|
ec1981c20c | ||
|
|
de020b1747 | ||
|
|
9ce4d40d14 | ||
|
|
7571f48392 | ||
|
|
b4f5243716 | ||
|
|
eea3c448de | ||
|
|
973950d881 | ||
|
|
4f584f78a0 | ||
|
|
4bb81f7609 | ||
|
|
678dd61866 | ||
|
|
f44413e039 | ||
|
|
1b3de449a1 | ||
|
|
37f918322c | ||
|
|
e5063f9883 | ||
|
|
0a47f745cc | ||
|
|
01028ee779 | ||
|
|
378b0c5953 | ||
|
|
95c1daa851 | ||
|
|
b7c1030804 | ||
|
|
b9cb391756 | ||
|
|
7578d02de9 | ||
|
|
bd29fa46ba | ||
|
|
2372063d25 | ||
|
|
8f410b751f | ||
|
|
f684d44aa7 | ||
|
|
981a72cd80 | ||
|
|
f7907976c9 | ||
|
|
fe28d55801 | ||
|
|
79653f99e0 | ||
|
|
ef99eb674e | ||
|
|
a329730d24 | ||
|
|
8bfb1712d8 | ||
|
|
0c8bc9f055 | ||
|
|
e135c1c5e3 | ||
|
|
30730e95e5 | ||
|
|
93a80a1c4b | ||
|
|
93d65ed650 | ||
|
|
ac0d7ccb7e | ||
|
|
a53f476585 | ||
|
|
82c83ef75e | ||
|
|
4a843709fa | ||
|
|
780cbf5f76 | ||
|
|
743d046f6f | ||
|
|
5915bc8828 | ||
|
|
540848c254 | ||
|
|
59a9bdeb55 | ||
|
|
2e25c36396 | ||
|
|
523360001e | ||
|
|
120e01566a | ||
|
|
1d4e27c473 | ||
|
|
c0732eda45 | ||
|
|
346e274a1b | ||
|
|
10f283b467 | ||
|
|
9fb11c909e | ||
|
|
bcf7f1713c | ||
|
|
ac24b35b1f | ||
|
|
c3c73e7bff | ||
|
|
63fe4b4306 | ||
|
|
154d6a5069 | ||
|
|
b3e722e5a8 | ||
|
|
26aafd931c | ||
|
|
013212c67c | ||
|
|
2a596c79e6 | ||
|
|
8b6a00f84b | ||
|
|
d54d5083b3 | ||
|
|
8402bd68ad | ||
|
|
ed4f106a0d | ||
|
|
405a52ed65 | ||
|
|
df2e11ef51 | ||
|
|
bb83899985 | ||
|
|
95e16872fa | ||
|
|
172e698bb8 | ||
|
|
d8d525fff2 | ||
|
|
ab3a678ad4 | ||
|
|
b190dab6bc | ||
|
|
86a3e4c8c3 | ||
|
|
e6b332aa4a | ||
|
|
523f22b942 | ||
|
|
a25b2a7e37 | ||
|
|
40d7354dd7 | ||
|
|
9d040f6317 | ||
|
|
52005e88ed | ||
|
|
ce6f11840d | ||
|
|
e85d6d7db7 | ||
|
|
00eb2393f4 | ||
|
|
d66aa49787 | ||
|
|
a9204eb936 | ||
|
|
e1edb08f06 | ||
|
|
5702c6fb08 | ||
|
|
c72660d7d3 | ||
|
|
b472a49271 | ||
|
|
ac1113b9ac | ||
|
|
be1ac1b430 | ||
|
|
b80218a0e4 | ||
|
|
842e0a3648 | ||
|
|
7c19de4904 | ||
|
|
ae2bedce3a | ||
|
|
407155755d | ||
|
|
9c235796af | ||
|
|
cba2d12051 | ||
|
|
b4cb14ec19 | ||
|
|
df599e5eff | ||
|
|
1fcd03a6b6 | ||
|
|
2edfaeba4a | ||
|
|
997dce0f04 | ||
|
|
dfe6557e18 | ||
|
|
510517126a | ||
|
|
9b95876973 | ||
|
|
f8076e3a58 | ||
|
|
ff4e010501 | ||
|
|
d254ae54f3 | ||
|
|
feaa1df1ed | ||
|
|
056e742304 | ||
|
|
2636c07571 | ||
|
|
a31e79fc3c | ||
|
|
15042870f9 | ||
|
|
105f661e46 | ||
|
|
a1c3d05a74 | ||
|
|
814f9cd21e |
@@ -0,0 +1,43 @@
|
||||
name: MSBuild
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
pull_request:
|
||||
branches:
|
||||
- dev
|
||||
types: [opened, synchronize, reopened]
|
||||
release:
|
||||
types: [created]
|
||||
jobs:
|
||||
test:
|
||||
name: MSBuild
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Add msbuild to PATH
|
||||
uses: microsoft/setup-msbuild@v1.1
|
||||
|
||||
- name: Download NuGet packages
|
||||
run: msbuild windows/nDPI.sln -t:restore -p:RestorePackagesConfig=true
|
||||
|
||||
- name: Build libnDPI only (debug)
|
||||
run: msbuild windows/nDPI.sln -t:rebuild -property:Configuration=Debug
|
||||
|
||||
- name: Download Npcap
|
||||
run: Invoke-WebRequest -Uri 'https://npcap.com/dist/npcap-1.71.exe' -OutFile 'C:\npcap-1.71.exe'
|
||||
|
||||
- name: Install Npcap
|
||||
run: C:\npcap-1.71.exe /S /winpcap_mode=yes
|
||||
|
||||
- name: Build ndpiReader (debug)
|
||||
run: msbuild windows/nDPI.sln -t:rebuild -property:Configuration=Debug-ndpiReader
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-artifacts
|
||||
path: windows/bin
|
||||
retention-days: 14
|
||||
+137
-83
@@ -13,8 +13,10 @@ jobs:
|
||||
coverage:
|
||||
name: Coverage (ubuntu-latest)
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CFLAGS: -Werror
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install Ubuntu Prerequisites
|
||||
@@ -25,7 +27,7 @@ jobs:
|
||||
sudo apt-get install libpcre3-dev libmaxminddb-dev lcov
|
||||
sudo apt-get install wdiff colordiff
|
||||
- name: Configure
|
||||
run: env CC=gcc CFLAGS='-Werror' ./autogen.sh --enable-option-checking=fatal --enable-debug-messages --enable-code-coverage --with-pcre --with-maxminddb --enable-tls-sigs
|
||||
run: ./autogen.sh --enable-option-checking=fatal --enable-debug-messages --enable-code-coverage --with-pcre --with-maxminddb --enable-tls-sigs
|
||||
- name: Build
|
||||
run: make all
|
||||
- name: Test
|
||||
@@ -36,7 +38,7 @@ jobs:
|
||||
mkdir -vp coverage_report/ndpi_coverage_report
|
||||
lcov --directory . --capture --output-file lcov.info
|
||||
genhtml -o coverage_report/ndpi_coverage_report lcov.info
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ndpi-coverage-report
|
||||
path: coverage_report
|
||||
@@ -45,12 +47,14 @@ jobs:
|
||||
python-bindings:
|
||||
name: Python Bindings (ubuntu-latest)
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
CFLAGS: -Werror
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python 3.9
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.9"
|
||||
- name: Install Ubuntu Prerequisites
|
||||
@@ -59,7 +63,7 @@ jobs:
|
||||
sudo apt-get install autoconf automake libtool pkg-config gettext libjson-c-dev flex bison libpcap-dev
|
||||
- name: Build nDPI library
|
||||
run: |
|
||||
env CC=gcc CFLAGS='-Werror' ./autogen.sh
|
||||
./autogen.sh
|
||||
make
|
||||
sudo make install
|
||||
- name: Generate Python bindings
|
||||
@@ -78,11 +82,11 @@ jobs:
|
||||
name: Documentation (ubuntu-latest)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Python 3.9
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.9"
|
||||
- name: Install Ubuntu Prerequisites
|
||||
@@ -99,7 +103,7 @@ jobs:
|
||||
make doc
|
||||
mkdir -vp doc/_build/ndpi-documentation-upload/ndpi-documentation
|
||||
mv -v doc/_build/html doc/_build/ndpi-documentation-upload/ndpi-documentation/html
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ndpi-documentation
|
||||
path: doc/_build/ndpi-documentation-upload
|
||||
@@ -108,16 +112,21 @@ jobs:
|
||||
performance:
|
||||
name: Performance (ubuntu-latest)
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
CFLAGS: -Werror
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install Ubuntu Prerequisites
|
||||
run: |
|
||||
sudo add-apt-repository ppa:longsleep/golang-backports
|
||||
sudo apt-get update
|
||||
sudo apt-get install libunwind-dev
|
||||
sudo apt-get install autoconf automake libtool pkg-config gettext flex bison libpcap-dev
|
||||
sudo apt-get install golang-1.16-go libgoogle-perftools-dev graphviz
|
||||
env GO111MODULE=on go install github.com/google/pprof@latest
|
||||
go install github.com/google/pprof@latest
|
||||
sudo ln -s ${HOME}/go/bin/pprof /usr/bin/pprof
|
||||
pprof -h
|
||||
- name: Configure nDPI library
|
||||
@@ -132,7 +141,7 @@ jobs:
|
||||
mkdir ndpi-performance-upload
|
||||
mv -v tests/result/cpu_profile.png ndpi-performance-upload/cpu_profile.png
|
||||
mv -v tests/result/heap_profile.png ndpi-performance-upload/heap_profile.png
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ndpi-performance
|
||||
path: ndpi-performance-upload
|
||||
@@ -142,7 +151,7 @@ jobs:
|
||||
name: Test Utils (ubuntu-latest)
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install Ubuntu Prerequisites
|
||||
@@ -162,109 +171,148 @@ jobs:
|
||||
git diff-index --quiet HEAD -- || true
|
||||
|
||||
test:
|
||||
name: ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.gcrypt }} ${{ matrix.compiler }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} ${{ matrix.msan }}
|
||||
name: ${{ matrix.os }} ${{ matrix.arch }} ${{ matrix.gcrypt }} ${{ matrix.compiler }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} ${{ matrix.msan }} ${{ matrix.nBPF }} ${{matrix.lto_gold_linker}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
CC: ${{ matrix.compiler }}
|
||||
CFLAGS: -Werror
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
os: ["ubuntu-latest", "ubuntu-18.04", "macOS-latest", "macos-11", "windows-latest"]
|
||||
os: ["ubuntu-latest", "ubuntu-22.04", "macOS-latest", "macos-12", "windows-latest"]
|
||||
arch: ["x86_64"]
|
||||
gcrypt: ["--with-local-libgcrypt", ""]
|
||||
compiler: ["default-cc"]
|
||||
compiler: ["cc"]
|
||||
ar: ["ar"]
|
||||
ranlib: ["ranlib"]
|
||||
pcre: [""]
|
||||
maxminddb: [""]
|
||||
msan: [""]
|
||||
nBPF: [""]
|
||||
lto_gold_linker: [""]
|
||||
include:
|
||||
- compiler: "gcc-7"
|
||||
- compiler: "gcc-7" # "Oldest" gcc easily available
|
||||
os: ubuntu-20.04
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
nBPF: ""
|
||||
- compiler: "gcc-12" # "Newest" gcc easily available
|
||||
os: ubuntu-22.04
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
nBPF: ""
|
||||
lto_gold_linker: "--with-lto-and-gold-linker"
|
||||
- compiler: "clang-7" # "Oldest" clang easily available
|
||||
os: ubuntu-20.04
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
nBPF: ""
|
||||
- compiler: "clang-14" # "Newest" clang easily available
|
||||
ar: "llvm-ar-14"
|
||||
ranlib: "llvm-ranlib-14"
|
||||
os: ubuntu-22.04
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
nBPF: ""
|
||||
lto_gold_linker: "--with-lto-and-gold-linker"
|
||||
- compiler: "cc"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "gcc-10"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "clang-7"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "clang-12"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "default-cc"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "default-cc"
|
||||
nBPF: ""
|
||||
- compiler: "cc"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-thread-sanitizer"
|
||||
- compiler: "default-cc"
|
||||
os: ubuntu-18.04
|
||||
nBPF: ""
|
||||
- compiler: "cc"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "default-cc"
|
||||
nBPF: "nBPF"
|
||||
- compiler: "clang-14"
|
||||
os: ubuntu-22.04
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-memory-sanitizer"
|
||||
nBPF: ""
|
||||
- compiler: "cc"
|
||||
os: ubuntu-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
nBPF: ""
|
||||
- compiler: "cc"
|
||||
os: macOS-latest
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "" # Disable sanitizer on macos
|
||||
- compiler: "default-cc"
|
||||
os: macos-11
|
||||
nBPF: ""
|
||||
- compiler: "cc"
|
||||
os: macos-12
|
||||
arch: "x86_64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "" # Disable sanitizer on macos
|
||||
- compiler: "default-cc"
|
||||
nBPF: ""
|
||||
- compiler: "cc"
|
||||
os: ubuntu-latest
|
||||
arch: "arm64"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "" # Disable sanitizer on arm64
|
||||
- compiler: "default-cc"
|
||||
nBPF: ""
|
||||
- compiler: "cc"
|
||||
os: ubuntu-latest
|
||||
arch: "armhf"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: "--with-sanitizer"
|
||||
- compiler: "default-cc"
|
||||
nBPF: ""
|
||||
- compiler: "cc"
|
||||
os: ubuntu-latest
|
||||
arch: "s390x"
|
||||
gcrypt: ""
|
||||
pcre: "--with-pcre"
|
||||
maxminddb: "--with-maxminddb"
|
||||
msan: ""
|
||||
nBPF: ""
|
||||
steps:
|
||||
- name: Setup multiarch/qemu-user-static
|
||||
if: startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
docker run --rm --privileged multiarch/qemu-user-static:register --reset
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- name: Install Ubuntu Prerequisites
|
||||
@@ -287,22 +335,26 @@ jobs:
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.maxminddb, '--with-maxminddb')
|
||||
run: |
|
||||
sudo apt-get install libmaxminddb-dev
|
||||
- name: Setup Ubuntu specified compiler (gcc)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'gcc')
|
||||
- name: Install Ubuntu Prerequisites (nBPF)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.nBPF, 'nBPF')
|
||||
run: |
|
||||
git clone https://github.com/ntop/PF_RING.git ../PF_RING
|
||||
cd ../PF_RING/userland/nbpf
|
||||
./configure
|
||||
make
|
||||
cd -
|
||||
- name: Setup Ubuntu specified compiler
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && ! startsWith(matrix.compiler, 'cc')
|
||||
run: |
|
||||
sudo apt-get install ${{ matrix.compiler }}
|
||||
- name: Setup Ubuntu specified compiler (clang)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'clang')
|
||||
run: |
|
||||
sudo apt-get install ${{ matrix.compiler }}
|
||||
- name: Install Windows prerequisites
|
||||
- name: Install Windows msys2 prerequisites
|
||||
if: startsWith(matrix.os, 'windows')
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: MINGW64
|
||||
update: true
|
||||
install: git mingw-w64-x86_64-toolchain automake1.16 automake-wrapper autoconf libtool make mingw-w64-x86_64-json-c mingw-w64-x86_64-crt-git mingw-w64-x86_64-pcre mingw-w64-x86_64-libpcap
|
||||
- name: Setup Windows prerequisites (libgcrypt)
|
||||
- name: Setup Windows msys2 prerequisites (libgcrypt)
|
||||
if: startsWith(matrix.os, 'windows') && startsWith(matrix.gcrypt, '--with-local-libgcrypt')
|
||||
run: |
|
||||
msys2 -c 'git clone --branch libgpg-error-1.42 https://github.com/gpg/libgpg-error'
|
||||
@@ -321,6 +373,9 @@ jobs:
|
||||
msys2 -c 'make install'
|
||||
msys2 -c 'cd ..'
|
||||
msys2 -c 'rm -rf libgcrypt/'
|
||||
env:
|
||||
CC:
|
||||
CFLAGS:
|
||||
- name: Installing MacOS prerequisites
|
||||
if: startsWith(matrix.os, 'macOS') && startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
@@ -338,36 +393,32 @@ jobs:
|
||||
run: |
|
||||
brew install libmaxminddb
|
||||
- name: Configure nDPI on Ubuntu
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'default-cc')
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64')
|
||||
run: |
|
||||
env CC=gcc CFLAGS='-Werror' ./autogen.sh --enable-option-checking=fatal --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} --enable-tls-sigs
|
||||
AR=${{ matrix.ar }} RANLIB=${{ matrix.ranlib }} ./autogen.sh --enable-option-checking=fatal --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} --enable-tls-sigs ${{matrix.lto_gold_linker}}
|
||||
- name: Configure nDPI on MacOS
|
||||
if: startsWith(matrix.os, 'macOS') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'default-cc')
|
||||
if: startsWith(matrix.os, 'macOS') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'cc')
|
||||
run: |
|
||||
env CC=clang CFLAGS='-Werror' ./autogen.sh --enable-option-checking=fatal --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} --enable-tls-sigs
|
||||
- name: Configure nDPI on Windows
|
||||
if: startsWith(matrix.os, 'windows') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'default-cc')
|
||||
./autogen.sh --enable-option-checking=fatal --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} --enable-tls-sigs
|
||||
- name: Configure nDPI on Windows msys2
|
||||
if: startsWith(matrix.os, 'windows') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'cc')
|
||||
run: |
|
||||
msys2 -c 'env CFLAGS=\"-Werror\" ./autogen.sh --enable-option-checking=fatal --enable-debug-messages --enable-tls-sigs --disable-npcap ${{ matrix.gcrypt }}'
|
||||
- name: Build nDPI on Windows
|
||||
if: startsWith(matrix.os, 'windows') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'default-cc')
|
||||
msys2 -c './autogen.sh --enable-option-checking=fatal --enable-debug-messages --enable-tls-sigs --disable-npcap ${{ matrix.gcrypt }}'
|
||||
- name: Build nDPI on Windows msys2
|
||||
if: startsWith(matrix.os, 'windows') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'cc')
|
||||
run: |
|
||||
msys2 -c 'make all'
|
||||
msys2 -c 'ldd ./example/ndpiReader.exe'
|
||||
- name: Configure nDPI with specified GCC version on Ubuntu
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'gcc')
|
||||
run: |
|
||||
env CC=${{ matrix.compiler }} CFLAGS='-Werror' ./autogen.sh --enable-option-checking=fatal --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} --enable-tls-sigs
|
||||
- name: Configure nDPI with specified CLANG on Ubuntu
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && startsWith(matrix.compiler, 'clang')
|
||||
run: |
|
||||
env CC=${{ matrix.compiler }} CFLAGS='-Werror' ./autogen.sh --enable-option-checking=fatal --enable-debug-messages ${{ matrix.gcrypt }} ${{ matrix.msan }} ${{ matrix.pcre }} ${{ matrix.maxminddb }} --enable-tls-sigs
|
||||
- name: Build nDPI
|
||||
if: startsWith(matrix.arch, 'x86_64') && !startsWith(matrix.os, 'windows')
|
||||
run: |
|
||||
make all
|
||||
make -C example ndpiSimpleIntegration
|
||||
make -C rrdtool
|
||||
- name: Print nDPI long help
|
||||
if: startsWith(matrix.arch, 'x86_64') && !startsWith(matrix.os, 'windows')
|
||||
run: |
|
||||
./example/ndpiReader -H
|
||||
- name: Install nDPI
|
||||
if: startsWith(matrix.arch, 'x86_64') && !startsWith(matrix.os, 'windows')
|
||||
run: |
|
||||
@@ -378,7 +429,8 @@ jobs:
|
||||
run: |
|
||||
./tests/do.sh
|
||||
- name: Test nDPI [UNIT]
|
||||
if: startsWith(matrix.arch, 'x86_64') && !startsWith(matrix.os, 'windows')
|
||||
#Some issues with masan + json-c. Disable the test as workaround
|
||||
if: startsWith(matrix.arch, 'x86_64') && !startsWith(matrix.os, 'windows') && !startsWith(matrix.msan, '--with-memory-sanitizer')
|
||||
run: |
|
||||
./tests/do-unit.sh
|
||||
- name: Test nDPI [DGA]
|
||||
@@ -403,11 +455,13 @@ jobs:
|
||||
make dist
|
||||
./utils/verify_dist_tarball.sh
|
||||
- name: Build nDPI [Mingw-w64] (runs only on ubuntu jobs)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64')
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'x86_64') && !startsWith(matrix.nBPF, 'nBPF')
|
||||
run: |
|
||||
make distclean
|
||||
env CFLAGS='-Werror' ./autogen.sh --enable-option-checking=fatal --enable-debug-messages --enable-tls-sigs --host=x86_64-w64-mingw32
|
||||
./autogen.sh --enable-option-checking=fatal --enable-debug-messages --enable-tls-sigs --host=x86_64-w64-mingw32
|
||||
make all
|
||||
env:
|
||||
CC:
|
||||
- name: Display qemu specified architecture (arm64 - little endian)
|
||||
if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.arch, 'arm64')
|
||||
uses: docker://multiarch/ubuntu-core:arm64-bionic
|
||||
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
|
||||
with:
|
||||
oss-fuzz-project-name: 'ndpi'
|
||||
fuzz-seconds: 600
|
||||
fuzz-seconds: 1600
|
||||
dry-run: false
|
||||
sanitizer: ${{ matrix.sanitizer }}
|
||||
- name: Check Crash (fails when a crash is detected)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'dev' ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ 'dev' ]
|
||||
schedule:
|
||||
- cron: '25 19 * * 2'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GO111MODULE: on
|
||||
CFLAGS: -Werror
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'cpp', 'python', 'ruby' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Install Ubuntu Prerequisites
|
||||
run: |
|
||||
sudo add-apt-repository ppa:longsleep/golang-backports
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libunwind-dev
|
||||
sudo apt-get install autoconf automake libtool pkg-config gettext flex bison libpcap-dev
|
||||
sudo apt-get install golang-1.16-go libgoogle-perftools-dev graphviz
|
||||
go install github.com/google/pprof@latest
|
||||
sudo ln -s ${HOME}/go/bin/pprof /usr/bin/pprof
|
||||
pprof -h
|
||||
- name: Configure nDPI library
|
||||
run: |
|
||||
./autogen.sh --enable-gprof --enable-option-checking=fatal --with-pcre --with-maxminddb --enable-tls-sigs --enable-debug-messages
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
|
||||
- name: Build nDPI library
|
||||
run: |
|
||||
make
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
+100
-56
@@ -1,8 +1,34 @@
|
||||
*.[o]
|
||||
*.db
|
||||
*.db-*
|
||||
*.dll
|
||||
*.ilk
|
||||
*.in
|
||||
*.ipch
|
||||
*.ko
|
||||
*.la
|
||||
*.lo
|
||||
*.log
|
||||
*.obj
|
||||
*.opendb
|
||||
*.pdb
|
||||
*.recipe
|
||||
*.suo
|
||||
*.swp
|
||||
*.tlog
|
||||
*.user
|
||||
*o.cmd
|
||||
*o.cmd
|
||||
*~
|
||||
.autotools
|
||||
.cproject
|
||||
.dirstamp
|
||||
.libs
|
||||
.project
|
||||
.settings
|
||||
/Makefile
|
||||
/aclocal.m4
|
||||
/autom4te.cache/
|
||||
.autotools
|
||||
compile
|
||||
/compile
|
||||
/config.guess
|
||||
/config.h
|
||||
@@ -12,71 +38,89 @@ compile
|
||||
/config.sub
|
||||
/configure
|
||||
/configure.tmp
|
||||
.cproject
|
||||
/depcomp
|
||||
.dirstamp
|
||||
/doc/Doxyfile.cfg
|
||||
/example/.deps/
|
||||
/example/Makefile
|
||||
/example/ndpiReader
|
||||
/example/Makefile.dpdk
|
||||
/example/build
|
||||
/example/libndpiReader.a
|
||||
/example/ndpiReader
|
||||
/example/ndpiReader.exe
|
||||
/example/ndpiSimpleIntegration
|
||||
*.in
|
||||
/install-sh
|
||||
*.ko
|
||||
*.la
|
||||
/libndpi.pc
|
||||
.libs
|
||||
/libtool
|
||||
*.lo
|
||||
/ltmain.sh
|
||||
/m4/libtool.m4
|
||||
/m4/lt~obsolete.m4
|
||||
/m4/ltoptions.m4
|
||||
/m4/ltsugar.m4
|
||||
/m4/ltversion.m4
|
||||
/Makefile
|
||||
/missing
|
||||
*.[o]
|
||||
*.obj
|
||||
*o.cmd
|
||||
*o.cmd
|
||||
.project
|
||||
.settings
|
||||
/src/include/Makefile
|
||||
/src/include/ndpi_config.h
|
||||
/src/include/ndpi_api.h
|
||||
/src/include/ndpi_define.h
|
||||
/src/lib/.deps/
|
||||
/src/lib/Makefile
|
||||
/src/lib/protocols/.deps/
|
||||
/src/lib/third_party/src/.deps/
|
||||
stamp-h1
|
||||
*.swp
|
||||
/test-driver
|
||||
/tests/Makefile
|
||||
/fuzz/.deps/
|
||||
/fuzz/Makefile
|
||||
/fuzz/fuzz_ndpi_reader
|
||||
/fuzz/fuzz_ndpi_reader_with_main
|
||||
/fuzz/fuzz_process_packet
|
||||
/fuzz/fuzz_process_packet_with_main
|
||||
/tests/dga/Makefile
|
||||
/tests/do.sh
|
||||
/tests/unit/Makefile
|
||||
/example/libndpiReader.a
|
||||
/example/ndpiReader.exe
|
||||
/src/lib/libndpi.a
|
||||
/src/lib/libndpi.so*
|
||||
/src/lib/libndpi
|
||||
/src/lib/libndpi-4.1.0.dll
|
||||
/src/lib/libndpi.4
|
||||
/tests/dga/dga_evaluate
|
||||
/tests/unit/unit
|
||||
/tags
|
||||
/fuzz/fuzz_ndpi_reader_alloc_fail
|
||||
/fuzz/fuzz_quic_get_crypto_data
|
||||
/fuzz/fuzz_alg_bins
|
||||
/fuzz/fuzz_alg_hll
|
||||
/fuzz/fuzz_alg_hw_rsi_outliers_da
|
||||
/fuzz/fuzz_alg_jitter
|
||||
/fuzz/fuzz_alg_ses_des
|
||||
/fuzz/fuzz_config
|
||||
/fuzz/fuzz_community_id
|
||||
/fuzz/fuzz_serialization
|
||||
/fuzz/fuzz_ds_patricia
|
||||
/fuzz/fuzz_ds_libcache
|
||||
/fuzz/fuzz_ds_tree
|
||||
/fuzz/fuzz_ds_ahocorasick
|
||||
/fuzz/fuzz_ndpi_reader_alloc_fail_seed_corpus.zip
|
||||
/fuzz/fuzz_ndpi_reader_seed_corpus.zip
|
||||
/fuzz/fuzz_quic_get_crypto_data_seed_corpus.zip
|
||||
/fuzz/fuzz_config_seed_corpus.zip
|
||||
/fuzz/fuzz_community_id_seed_corpus.zip
|
||||
/fuzz/fuzz_serialization_seed_corpus.zip
|
||||
/fuzz/fuzz_alg_ses_des_seed_corpus.zip
|
||||
/fuzz/fuzz_alg_bins_seed_corpus.zip
|
||||
/fuzz/fuzz_alg_hll_seed_corpus.zip
|
||||
/fuzz/fuzz_alg_jitter_seed_corpus.zip
|
||||
/fuzz/fuzz_alg_hw_rsi_outliers_da_seed_corpus.zip
|
||||
/fuzz/fuzz_ds_patricia_seed_corpus.zip
|
||||
/fuzz/fuzz_ds_libcache_seed_corpus.zip
|
||||
/fuzz/fuzz_ds_tree_seed_corpus.zip
|
||||
/fuzz/fuzz_ds_ahocorasick_seed_corpus.zip
|
||||
/fuzz/fuzz_*.dict
|
||||
/influxdb/Makefile
|
||||
/install-sh
|
||||
/libndpi.pc
|
||||
/libtool
|
||||
/ltmain.sh
|
||||
/m4/libtool.m4
|
||||
/m4/ltoptions.m4
|
||||
/m4/ltsugar.m4
|
||||
/m4/ltversion.m4
|
||||
/m4/lt~obsolete.m4
|
||||
/missing
|
||||
/rrdtool/Makefile
|
||||
/rrdtool/rrd_anomaly
|
||||
/rrdtool/rrd_similarity
|
||||
/src/include/Makefile
|
||||
/src/include/ndpi_config.h
|
||||
/src/include/ndpi_define.h
|
||||
/src/lib/.deps/
|
||||
/src/lib/Makefile
|
||||
/src/lib/libndpi
|
||||
/src/lib/libndpi-*.dll
|
||||
/src/lib/libndpi.4
|
||||
/src/lib/libndpi.a
|
||||
/src/lib/libndpi.so*
|
||||
/src/lib/protocols/.deps/
|
||||
/src/lib/third_party/src/.deps/
|
||||
/tags
|
||||
/test-driver
|
||||
/tests/Makefile
|
||||
/tests/dga/Makefile
|
||||
/tests/dga/dga_evaluate
|
||||
/tests/dga/dga_evaluate.exe
|
||||
/tests/do.sh
|
||||
/tests/performance/Makefile
|
||||
/influxdb/Makefile
|
||||
/doc/Doxyfile.cfg
|
||||
/tests/unit/Makefile
|
||||
/tests/unit/unit
|
||||
compile
|
||||
stamp-h1
|
||||
/windows/packages/pthreads.2.9.1.4
|
||||
/windows/packages/pthreads.redist.2.9.1.4
|
||||
/windows/bin/x64_Debug-ndpiReader/ndpiReader.exe
|
||||
/windows/obj/nDPI_Debug-ndpiReader_x64/nDPI.vcxproj.FileListAbsolute.txt
|
||||
|
||||
+203
@@ -1,5 +1,208 @@
|
||||
# CHANGELOG
|
||||
|
||||
#### nDPI 4.6 (Feb 2023)
|
||||
|
||||
## New Features
|
||||
|
||||
- New support for custom BPF protocol definition using nBPF (see example/protos.txt)
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
- Add protocol detection for:
|
||||
- Activision
|
||||
- AliCloud server access
|
||||
- AVAST
|
||||
- CryNetwork
|
||||
- Discord
|
||||
- EDNS
|
||||
- Elasticsearch
|
||||
- FastCGI
|
||||
- Kismet
|
||||
- Line App and Line Voip valls
|
||||
- Meraki Cloud
|
||||
- Munin
|
||||
- NATPMP
|
||||
- Syncthing
|
||||
- TP-LINK Smart Home
|
||||
- TUYA LAN
|
||||
- SoftEther VPN
|
||||
- Tailscale
|
||||
- TiVoConnect
|
||||
|
||||
## Improvements
|
||||
|
||||
- Improve protocol detection for:
|
||||
- Anydesk
|
||||
- Bittorrent (fix confidence, detection over TCP)
|
||||
- DNS, add ability to decode DNS PTR records used for reverse address resolution
|
||||
- DTLS (handle certificate fragments)
|
||||
- Facebook Voip calls
|
||||
- FastCGI (dissect PARAMS)
|
||||
- FortiClient (update default ports)
|
||||
- Zoom
|
||||
- Add Zoom screen share detection
|
||||
- Add detection of Zoom peer-to-peer flows in STUN
|
||||
- Hangout/Duo Voip calls detection, optimize lookups in the protocol tree
|
||||
- HTTP
|
||||
- Handling of HTTP-Proxy and HTTP-Connect
|
||||
- HTTP subclassification
|
||||
- Check for empty/missing user-agent in HTTP
|
||||
- IRC (credentials check)
|
||||
- Jabber/XMPP
|
||||
- Kerberos (support for Krb-Error messages)
|
||||
- LDAP
|
||||
- MGCP
|
||||
- MONGODB (avoid false positives)
|
||||
- Postgres
|
||||
- POP3
|
||||
- QUIC (support for 0-RTT packets received before the initial)
|
||||
- Snapchat Voip calls
|
||||
- SIP
|
||||
- SNMP
|
||||
- SMB (support for messages split into multiple TCP segments)
|
||||
- SMTP (support for X-ANONYMOUSTLS command)
|
||||
- STUN
|
||||
- SKYPE (improve detection over UDP, remove detection over TCP)
|
||||
- Teamspeak3 (License/Weblist detection)
|
||||
- Threema Messenger
|
||||
- TINC (avoid processing SYN packets)
|
||||
- TLS
|
||||
- improve reassembler
|
||||
- handling of ALPN(s) and subclassification
|
||||
- ignore invalid Content Type values
|
||||
- WindowsUpdate
|
||||
- Add flow risk:
|
||||
- NDPI_HTTP_OBSOLETE_SERVER
|
||||
- NDPI_MINOR_ISSUES (generic/relevant information about issues found on traffic)
|
||||
- NDPI_HTTP_OBSOLETE_SERVER (Apache and nginx are supported)
|
||||
- NDPI_PERIODIC_FLOW (reserved bit to be used by apps based on nDPI)
|
||||
- NDPI_TCP_ISSUES
|
||||
- Improve detection of WebShell and PHP code in HTTP URLs that is reported via flow risk
|
||||
- Improve DGA detection
|
||||
- Improve AES-NI check
|
||||
- Improve nDPI JSON serialization
|
||||
- Improve export/print of L4 protocol information
|
||||
- Improve connection refused detection
|
||||
- Add statistics for Patricia tree, Ahocarasick automa, LRU cache
|
||||
- Add a generic (optional and configurable) expiration logic in LRU caches
|
||||
- Add RTP stream type in flow metadata
|
||||
- LRU cache is now IPv6 aware
|
||||
|
||||
## Tools
|
||||
|
||||
- ndpiReader
|
||||
- Add support for Linux Cooked Capture v2
|
||||
- Fix packet dissection (CAPWAP and TSO)
|
||||
- Fix Discarded bytes statistics
|
||||
|
||||
## Fixes
|
||||
|
||||
- Fix classification by-port
|
||||
- Fix exclusion of DTLS protocol
|
||||
- Fix undefined-behaviour in ahocorasick callback
|
||||
- Fix infinite loop when a custom rule has port 65535
|
||||
- Fix undefined-behavior when setting empty user-agent
|
||||
- Fix infinite loop in DNS dissector (due to an integer overflow)
|
||||
- Fix JSON export of IPv6 addresses
|
||||
- Fix memory corruptions in Bittorrent, HTTP, SoftEther, Florensia, QUIC, IRC, TFTP dissectors
|
||||
- Fix stop of extra dissection in HTTP, Bittorrent, Kerberos
|
||||
- Fix signed integer overflow in ASN1/BER dissector
|
||||
- Fix char/uchar bug in ahocorasick
|
||||
- Fix endianess in IP-Port lookup
|
||||
- Fix FastCGI memory allocation issue
|
||||
- Fix metadata extraction in NAT-PMP
|
||||
- Fix invalid unidirectional traffic alert for unidirectional protocols (e.g. sFlow)
|
||||
|
||||
## Misc
|
||||
|
||||
- Support for Rocky Linux 9
|
||||
- Enhance fuzzers to test nDPI configurations, memory allocation failures, serialization/deserialization, algorithms and data structures
|
||||
- GitHub Actions: update to Node.js 16
|
||||
- Size of LRU caches is now configurable
|
||||
|
||||
#### nDPI 4.4 (July 2022)
|
||||
|
||||
## New Features
|
||||
- Add risk information that describes why a specific risk was triggered also providing metadata
|
||||
- Added API call ndpi_check_flow_risk_exceptions() for handling risk exceptions
|
||||
- Split protocols in: network (e.g. TLS) and application protocols (e.g. Google)
|
||||
- Extended confidence level with two new values (NDPI_CONFIDENCE_DPI_PARTIAL and NDPI_CONFIDENCE_DPI_PARTIAL_CACHE)
|
||||
- Added ndpi_get_flow_error_code() API call
|
||||
|
||||
## New Supported Protocols and Services
|
||||
- Add protocol detection for:
|
||||
- UltraSurf
|
||||
- i3D
|
||||
- RiotGames
|
||||
- TSAN
|
||||
- TunnelBear VPN
|
||||
- collectd
|
||||
- PIM (Protocol Indipendent Multicast)
|
||||
- Pragmatic General Multicast (PGM)
|
||||
- RSH
|
||||
- GoTo products (mainly GoToMeeting)
|
||||
- Dazn
|
||||
- MPEG-DASH
|
||||
- Agora Software Defined Real-time Network (SD-RTN)
|
||||
- Toca Boca
|
||||
- VXLAN
|
||||
- MDNS/LLMNR
|
||||
|
||||
## Improvements
|
||||
- Improve protocol detection for:
|
||||
- SMTP/SMTPS now supports STARTTLS
|
||||
- OCSP
|
||||
- TargusDataspeed
|
||||
- Usenet
|
||||
- DTLS (added support for old versions)
|
||||
- TFTP
|
||||
- SOAP via HTTP
|
||||
- GenshinImpact
|
||||
- IPSec/ISAKMP
|
||||
- DNS
|
||||
- syslog
|
||||
- DHCP (various bug fixes and improvements)
|
||||
- NATS
|
||||
- Viber
|
||||
- Xiaomi
|
||||
- Raknet
|
||||
- gnutella
|
||||
- Kerberos
|
||||
- QUIC (Added support for v2drft 01)
|
||||
- SSDP
|
||||
- SNMP
|
||||
- Improved DGA detection
|
||||
- Improved AES-NI check
|
||||
- Add flow risk:
|
||||
- NDPI_PUNYCODE_IDN
|
||||
- NDPI_ERROR_CODE_DETECTED
|
||||
- NDPI_HTTP_CRAWLER_BOT
|
||||
- NDPI_ANONYMOUS_SUBSCRIBER
|
||||
- NDPI_UNIDIRECTIONAL_TRAFFIC
|
||||
|
||||
## Changes
|
||||
- Added support for 64 bit bins
|
||||
- Added Cloudflare WARP detection patterns
|
||||
- Renamed Z39.50 -> Z3950
|
||||
- Replaced nDPI's internal hashmap with uthash
|
||||
- Reimplemented 1kxun application protoco
|
||||
- Renamed SkypeCall to Skype_TeamsCall
|
||||
- Updated Python Bindings
|
||||
- Unless --with-libgcrypt is used, nDPI now uses its internal gcrypt implementation
|
||||
|
||||
## Fixes
|
||||
- Fixes for some protocol classification families
|
||||
- Fixed default protocol ports for email protocols
|
||||
- Various memory and overflow fixes
|
||||
- Disabled various risks for specific protocols (e.g. disable missing ALPN for CiscoVPN)
|
||||
- Fix TZSP decapsulation
|
||||
|
||||
## Misc
|
||||
- Update ASN/IPs lists
|
||||
- Improved code profiling
|
||||
- Use Doxygen to generate the API documentation
|
||||
- Added Edgecast and Cachefly CDNs.
|
||||
|
||||
#### nDPI 4.2 (Feb 2022)
|
||||
|
||||
## New Features
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ EXTRA_DIST = README.md README.fuzzer.md CHANGELOG.md CONTRIBUTING.md \
|
||||
python/DEV_GUIDE.md python/dev_requirements.txt python/ndpi_example.py python/ndpi/__init__.py \
|
||||
python/ndpi/ndpi_build.py python/ndpi/ndpi.py python/README.md \
|
||||
python/requirements.txt python/setup.py python/tests.py \
|
||||
sonar-project.properties .github .ci-ignore lgtm.yml
|
||||
sonar-project.properties .github .ci-ignore
|
||||
|
||||
|
||||
.PHONY: doc doc-view
|
||||
|
||||
+3
-3
@@ -13,11 +13,11 @@
|
||||
## Testing nDPI with ClusterFuzz Artifacts
|
||||
- Download the artifact (example clusterfuzz-testcase-fuzz_process_packet-4992218834796544)
|
||||
- Run nDPI against the artifact
|
||||
- Example: ./fuzz/fuzz_process_packet_with_main clusterfuzz-testcase-fuzz_process_packet-4992218834796544
|
||||
- Example: ./fuzz/fuzz_process_packet clusterfuzz-testcase-fuzz_process_packet-4992218834796544
|
||||
|
||||
The output is the error report
|
||||
```
|
||||
./fuzz/fuzz_process_packet_with_main /tmp/clusterfuzz-testcase-fuzz_process_packet-4992218834796544
|
||||
./fuzz/fuzz_process_packet /tmp/clusterfuzz-testcase-fuzz_process_packet-4992218834796544
|
||||
AddressSanitizer:DEADLYSIGNAL
|
||||
=================================================================
|
||||
==11590==ERROR: AddressSanitizer: SEGV on unknown address 0x61a100000087 (pc 0x00000056e6a4 bp 0x7ffd624fa170 sp 0x7ffd624fa090 T0)
|
||||
@@ -33,7 +33,7 @@ The output is the error report
|
||||
#8 0x4c709b in LLVMFuzzerTestOneInput /home/deri/nDPI/fuzz/fuzz_process_packet.c:30:3
|
||||
#9 0x4c7640 in main /home/deri/nDPI/fuzz/fuzz_process_packet.c:90:17
|
||||
#10 0x7f888e5dabf6 in __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:310
|
||||
#11 0x41c399 in _start (/home/deri/nDPI/fuzz/fuzz_process_packet_with_main+0x41c399)
|
||||
#11 0x41c399 in _start (/home/deri/nDPI/fuzz/fuzz_process_packet+0x41c399)
|
||||
|
||||
AddressSanitizer can not provide additional info.
|
||||
SUMMARY: AddressSanitizer: SEGV /home/deri/nDPI/src/lib/protocols/quic.c:203:12 in quic_len
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
![ntop][ntopng_logo] ![ntop][ntop_logo]
|
||||
# nDPI
|
||||
|
||||
[](https://github.com/ntop/nDPI/actions?query=workflow%3ABuild)
|
||||
[](https://lgtm.com/projects/g/ntop/nDPI/context:cpp)
|
||||
[](https://lgtm.com/projects/g/ntop/nDPI/alerts)
|
||||
[](https://github.com/ntop/nDPI/actions?query=workflow%3ABuild)
|
||||
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:ndpi)
|
||||
|
||||
## What is nDPI ?
|
||||
@@ -48,8 +46,18 @@ Remember to use `gmake` and not `make` on FreeBSD
|
||||
On MacOS:
|
||||
- brew install coreutils gcc git gettext flex bison libtool autoconf automake pkg-config libpcap json-c pcre2 libmaxminddb rrdtool
|
||||
|
||||
On Windows (assuming [MSYS2](https://www.msys2.org/) already installed):
|
||||
- msys2 -c "pacman --noconfirm -S --needed --overwrite '\*' git mingw-w64-x86\_64-toolchain automake1.16 automake-wrapper autoconf libtool make mingw-w64-x86\_64-json-c mingw-w64-x86\_64-crt-git mingw-w64-x86\_64-pcre mingw-w64-x86\_64-libpcap"
|
||||
On Windows:
|
||||
|
||||
There are three supported ways to build nDPI:
|
||||
|
||||
1. MSYS2 (assuming [MSYS2](https://www.msys2.org/) already installed):
|
||||
- msys2 -c "pacman --noconfirm -S --needed --overwrite '\*' git mingw-w64-x86\_64-toolchain automake1.16 automake-wrapper autoconf libtool make mingw-w64-x86\_64-json-c mingw-w64-x86\_64-crt-git mingw-w64-x86\_64-pcre mingw-w64-x86\_64-libpcap"
|
||||
|
||||
2. Mingw-w64
|
||||
|
||||
3. Visual Studio (see `windows/nDPI.sln`)
|
||||
|
||||
Note: All Windows versions require [npcap](https://npcap.com/#download) with WinPcap compatibility mode enabled.
|
||||
|
||||
### How To Build The Documentation
|
||||
|
||||
@@ -70,9 +78,10 @@ The entire procedure of adding new protocols in detail:
|
||||
4. Add a new entry for the search function for the new protocol in: `src/include/ndpi_protocols.h`
|
||||
5. Choose (do not change anything) a selection bitmask from: `src/include/ndpi_define.h`
|
||||
6. Set protocol default ports in `ndpi_init_protocol_defaults` in: `src/lib/ndpi_main.c`
|
||||
7. `./autogen.sh`
|
||||
8. `make`
|
||||
9. `make check`
|
||||
7. Be sure to have nBPF support, cloning `PF_RING` in the same directory where you cloned `nDPI`: `git clone https://github.com/ntop/PF_RING/ && cd PF_RING/userland/nbpf && ./configure && make`
|
||||
8. From the `nDPI` root directory, `./autogen.sh --with-pcre` (nBPF and PCRE are usually optional, but they are needed to run/update *all* the unit tests)
|
||||
9. `make`
|
||||
10. `make check`
|
||||
|
||||
### How to use nDPI to Block Selected Traffic
|
||||
|
||||
@@ -82,6 +91,11 @@ You can use nDPI to selectively block selected Internet traffic by embedding it
|
||||
|
||||
- Deri, Luca, et al. [nDPI: Open-source high-speed deep packet inspection](http://luca.ntop.org/nDPI.pdf) 2014 International Wireless Communications and Mobile Computing Conference (IWCMC). IEEE, 2014.
|
||||
|
||||
### Videos and Presentations
|
||||
|
||||
- [Using nDPI for Monitoring and Security](https://archive.fosdem.org/2021/schedule/event/nemondpi/)
|
||||
- [Network Traffic Classification for Cybersecurity and Monitoring](https://fosdem.org/2022/schedule/event/using_ndpi_to_efficiently_classify_network_traffic/)
|
||||
|
||||
### nDPI-Related Projects
|
||||
|
||||
- [nfstream](https://github.com/aouinizied/nfstream)
|
||||
|
||||
+67
-23
@@ -1,4 +1,4 @@
|
||||
AC_INIT([libndpi],[4.3.0])
|
||||
AC_INIT([libndpi],[4.6.0])
|
||||
|
||||
AC_CONFIG_AUX_DIR([.])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
@@ -13,40 +13,66 @@ AS_IF([test "${with_only_libndpi+set}" = set],[
|
||||
EXTRA_TARGETS=""
|
||||
])
|
||||
|
||||
PWD=`pwd`
|
||||
|
||||
|
||||
AC_ARG_WITH(sanitizer, AS_HELP_STRING([--with-sanitizer], [Build with support for address, undefined and leak sanitizer]))
|
||||
AC_ARG_WITH(thread-sanitizer, AS_HELP_STRING([--with-thread-sanitizer], [Build with support for thread sanitizer]))
|
||||
AC_ARG_WITH(memory-sanitizer, AS_HELP_STRING([--with-memory-sanitizer], [Build with support for memory sanitizer]))
|
||||
AC_ARG_ENABLE(fuzztargets, AS_HELP_STRING([--enable-fuzztargets], [Enable fuzz targets]),[enable_fuzztargets=$enableval],[enable_fuzztargets=no])
|
||||
AC_ARG_ENABLE(gprof, AS_HELP_STRING([--enable-gprof], [Enable CPU/HEAP profiling with gperftools]),[enable_gprof=$enableval],[enable_gprof=no])
|
||||
AC_ARG_ENABLE(code-coverage, AS_HELP_STRING([--enable-code-coverage], [Generate Code Coverage report]))
|
||||
AC_ARG_WITH(local-libgcrypt, AS_HELP_STRING([--with-local-libgcrypt], [Build with libgcrypt (if present) instead of the enclosed gcrypt light]))
|
||||
AC_ARG_ENABLE(tls-sigs, AS_HELP_STRING([--enable-tls-sigs], [Enable TLS Client signature algorithm dissection. Rarely used, but requires significantly more memory.]))
|
||||
AC_ARG_ENABLE(npcap, AS_HELP_STRING([--disable-npcap], [msys2 only: Disable linkage against the wpcap/npcap import library in windows/WpdPack/Lib.]))
|
||||
AC_ARG_WITH(nbpf-path, AS_HELP_STRING([--with-nbpf-path], [nBPF library custom path; default: ${PWD}/../PF_RING/userland/nbpf]),[NBPF_HOME=$withval],[NBPF_HOME=${PWD}/../PF_RING/userland/nbpf])
|
||||
AC_ARG_WITH(lto-and-gold-linker, AS_HELP_STRING([--with-lto-and-gold-linker], [Build with LTO and Gold linker])])
|
||||
|
||||
AS_IF([test "x$enable_fuzztargets" = "xyes"], [BUILD_FUZZTARGETS=1], [BUILD_FUZZTARGETS=0])
|
||||
AS_IF([test "x$enable_fuzztargets" = "xyes"], [
|
||||
BUILD_FUZZTARGETS=1
|
||||
NDPI_CFLAGS="${NDPI_CFLAGS} -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
|
||||
], [BUILD_FUZZTARGETS=0])
|
||||
AM_CONDITIONAL([BUILD_FUZZTARGETS], [test "x$enable_fuzztargets" = "xyes"])
|
||||
|
||||
AS_IF([test "${with_sanitizer+set}" = set -a "${with_thread_sanitizer+set}" = set],[
|
||||
AC_MSG_ERROR([Configure options `--with-sanitizer' and `--with_thread_sanitizer' can not used at the same time.])
|
||||
])
|
||||
AS_IF([test "${with_sanitizer+set}" = set -o "${with_thread_sanitizer+set}" = set],[
|
||||
CFLAGS="${CFLAGS} -O0 -g3"
|
||||
AS_IF([test "${with_sanitizer+set}" = set -a "${with_memory_sanitizer+set}" = set],[
|
||||
AC_MSG_ERROR([Configure options `--with-sanitizer' and `--with_memory_sanitizer' can not used at the same time.])
|
||||
])
|
||||
AS_IF([test "${with_thread_sanitizer+set}" = set -a "${with_memory_sanitizer+set}" = set],[
|
||||
AC_MSG_ERROR([Configure options `--with_thread_sanitizer' and `--with_memory_sanitizer' can not used at the same time.])
|
||||
])
|
||||
AS_IF([test "${with_sanitizer+set}" = set -o "${with_thread_sanitizer+set}" = set -o "${with_memory_sanitizer+set}" = set],[
|
||||
NDPI_CFLAGS="${NDPI_CFLAGS} -O0 -g3"
|
||||
],[
|
||||
CFLAGS="${CFLAGS} -g"
|
||||
dnl> Oss-fuzz doesn't really like any optimizaton flags don't set by itself
|
||||
AS_IF([test "x$enable_fuzztargets" != "xyes"], [NDPI_CFLAGS="${NDPI_CFLAGS} -O2"])
|
||||
])
|
||||
AS_IF([test "${with_sanitizer+set}" = set -o "${with_thread_sanitizer+set}" = set -o "${with_memory_sanitizer+set}" = set],[
|
||||
AS_IF([test "x$enable_gprof" = "xyes"], [
|
||||
AC_MSG_ERROR([Configure options `--with-sanitizer' / `--with_thread_sanitizer' / `--with_memory_sanitizer' can not used together with `--enable-gprof'.])
|
||||
])
|
||||
])
|
||||
|
||||
AS_IF([test "${with_sanitizer+set}" = set],[
|
||||
CFLAGS="${CFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer"
|
||||
LDFLAGS="${LDFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak"
|
||||
NDPI_CFLAGS="${NDPI_CFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak -fno-omit-frame-pointer"
|
||||
NDPI_LDFLAGS="${NDPI_LDFLAGS} -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -fsanitize=leak"
|
||||
])
|
||||
|
||||
AS_IF([test "${with_thread_sanitizer+set}" = set],[
|
||||
CFLAGS="${CFLAGS} -fsanitize=thread -fno-omit-frame-pointer"
|
||||
LDFLAGS="${LDFLAGS} -fsanitize=thread"
|
||||
NDPI_CFLAGS="${NDPI_CFLAGS} -fsanitize=thread -fno-omit-frame-pointer"
|
||||
NDPI_LDFLAGS="${NDPI_LDFLAGS} -fsanitize=thread"
|
||||
])
|
||||
|
||||
AS_IF([test "${with_memory_sanitizer+set}" = set],[
|
||||
NDPI_CFLAGS="${NDPI_CFLAGS} -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer"
|
||||
NDPI_LDFLAGS="${NDPI_LDFLAGS} -fsanitize=memory"
|
||||
])
|
||||
|
||||
AS_IF([test "x${enable_code_coverage}" = "xyes"],[
|
||||
CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
|
||||
LDFLAGS="${LDFLAGS} --coverage"
|
||||
NDPI_CFLAGS="${NDPI_CFLAGS} -fprofile-arcs -ftest-coverage"
|
||||
NDPI_LDFLAGS="${NDPI_LDFLAGS} --coverage"
|
||||
])
|
||||
|
||||
AS_IF([test "${enable_npcap+set}" = set],[DISABLE_NPCAP=1],[DISABLE_NPCAP=0])
|
||||
@@ -95,7 +121,7 @@ if test -d ".git" || test -r ".git"; then
|
||||
|
||||
A=`git log src/include/ndpi_typedefs.h|wc -l`
|
||||
B=`git log src/include/ndpi_protocol_ids.h|wc -l`
|
||||
C=`git log src/include/ndpi_api.h.in|wc -l`
|
||||
C=`git log src/include/ndpi_api.h|wc -l`
|
||||
NDPI_API_VERSION=$((A+B+C))
|
||||
else
|
||||
GIT_RELEASE="${PACKAGE_VERSION}"
|
||||
@@ -144,7 +170,12 @@ AS_IF([test "x${enable_tls_sigs}" = "xyes"],[
|
||||
HANDLE_TLS_SIGS=""
|
||||
])
|
||||
|
||||
CFLAGS="-W -Wall -Wno-unused-parameter -Wno-unused-function -Wno-address-of-packed-member ${CFLAGS}"
|
||||
NDPI_CFLAGS="-W -Wall -Wno-unused-parameter -Wno-unused-function -Wno-address-of-packed-member ${NDPI_CFLAGS}"
|
||||
|
||||
AS_IF([test "${with_lto_and_gold_linker+set}" = set], [
|
||||
NDPI_CFLAGS="${NDPI_CFLAGS} -flto -fuse-ld=gold -Wno-unused-command-line-argument"
|
||||
NDPI_LDFLAGS="${NDPI_LDFLAGS} ${NDPI_CFLAGS}"
|
||||
])
|
||||
|
||||
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h math.h float.h])
|
||||
AC_CHECK_LIB([m], [sqrt], [], [LIBM="-lm"])
|
||||
@@ -155,6 +186,7 @@ if test "x$ac_cv_lib_rrd_rrd_fetch_r" = xyes; then :
|
||||
EXTRA_TARGETS="$EXTRA_TARGETS rrdtool"
|
||||
fi
|
||||
|
||||
ADDITIONAL_INCS=
|
||||
ADDITIONAL_LIBS="$LIBM"
|
||||
PCAP_HOME=$HOME/PF_RING/userland
|
||||
|
||||
@@ -179,17 +211,25 @@ fi
|
||||
|
||||
MACHINE=`uname -m`
|
||||
|
||||
CUSTOM_NDPI=
|
||||
NBPF_ENABLED=0
|
||||
AC_MSG_CHECKING([PF_RING nBPF ($NBPF_HOME)])
|
||||
LIBNBPF=${NBPF_HOME}/libnbpf.a
|
||||
if test -f ${LIBNBPF}; then :
|
||||
ADDITIONAL_LIBS="${ADDITIONAL_LIBS} ${LIBNBPF}"
|
||||
ADDITIONAL_INCS="${ADDITIONAL_INCS} -I${NBPF_HOME}"
|
||||
AC_DEFINE_UNQUOTED(HAVE_NBPF, "1", [PF_RING nBPF is present])
|
||||
AC_MSG_RESULT(yes)
|
||||
NBPF_ENABLED=1
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
CUSTOM_NDPI=
|
||||
if test -d ../nDPI-custom; then :
|
||||
CUSTOM_NDPI="-DCUSTOM_NDPI_PROTOCOLS"
|
||||
AC_MSG_RESULT([Compiling with custom nDPI protocols])
|
||||
fi
|
||||
|
||||
if test -d ../ndpi-pro; then :
|
||||
with_maxminddb=1
|
||||
fi
|
||||
|
||||
case "$host" in
|
||||
*-*-mingw32*|*-*-msys)
|
||||
PCAP_INC=""
|
||||
@@ -197,16 +237,16 @@ case "$host" in
|
||||
case "$host" in
|
||||
x86_64-*)
|
||||
BUILD_MINGW_X64=1
|
||||
LDFLAGS="${LDFLAGS} -L/mingw64/lib"
|
||||
NDPI_LDFLAGS="${NDPI_LDFLAGS} -L/mingw64/lib"
|
||||
;;
|
||||
i686-*)
|
||||
LDFLAGS="${LDFLAGS} -L/mingw32/lib"
|
||||
NDPI_LDFLAGS="${NDPI_LDFLAGS} -L/mingw32/lib"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([Unsupported MingW cross compiler.])
|
||||
;;
|
||||
esac
|
||||
CFLAGS="-D__USE_MINGW_ANSI_STDIO -D__STDC_FORMAT_MACROS ${CFLAGS}"
|
||||
NDPI_CFLAGS="-D__USE_MINGW_ANSI_STDIO -D__STDC_FORMAT_MACROS ${NDPI_CFLAGS}"
|
||||
LIBS="${LIBS} -lws2_32"
|
||||
BUILD_MINGW=1
|
||||
EXE_SUFFIX=".exe"
|
||||
@@ -287,7 +327,7 @@ AS_IF([test "x$enable_gprof" = "xyes"], [
|
||||
])
|
||||
GPROF_ENABLED=1
|
||||
GPROF_LIBS="-ltcmalloc_and_profiler"
|
||||
GPROF_CFLAGS="${pkg_cv_PROFILER_CFLAGS} ${pkg_cv_TCMALLOC_CFLAGS}"
|
||||
GPROF_CFLAGS="-g3 -fvisibility=default -fno-omit-frame-pointer ${pkg_cv_PROFILER_CFLAGS} ${pkg_cv_TCMALLOC_CFLAGS}"
|
||||
])
|
||||
|
||||
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
||||
@@ -333,7 +373,7 @@ dnl> ADDITIONAL_LIBS="${ADDITIONAL_LIBS} -lcurl"
|
||||
dnl> AC_DEFINE_UNQUOTED(HAVE_CURL, 1, [curl is present])
|
||||
dnl> fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile tests/unit/Makefile tests/performance/Makefile tests/dga/Makefile rrdtool/Makefile influxdb/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile fuzz/Makefile src/include/ndpi_api.h doc/Doxyfile.cfg])
|
||||
AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile tests/unit/Makefile tests/performance/Makefile tests/dga/Makefile rrdtool/Makefile influxdb/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile fuzz/Makefile doc/Doxyfile.cfg])
|
||||
AC_CONFIG_FILES([tests/do.sh], [chmod +x tests/do.sh])
|
||||
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
|
||||
AC_SUBST(GIT_RELEASE)
|
||||
@@ -344,6 +384,7 @@ AC_SUBST(NDPI_VERSION_SHORT)
|
||||
AC_SUBST(PCAP_INC)
|
||||
AC_SUBST(PCAP_LIB)
|
||||
AC_SUBST(LIBRRD)
|
||||
AC_SUBST(ADDITIONAL_INCS)
|
||||
AC_SUBST(ADDITIONAL_LIBS)
|
||||
AC_SUBST(DL_LIB)
|
||||
AC_SUBST(DPDK_TARGET)
|
||||
@@ -361,7 +402,10 @@ AC_SUBST(GPROF_LIBS)
|
||||
AC_SUBST(GPROF_ENABLED)
|
||||
AC_SUBST(USE_HOST_LIBGCRYPT)
|
||||
AC_SUBST(PCRE_ENABLED)
|
||||
AC_SUBST(NBPF_ENABLED)
|
||||
AC_SUBST(HANDLE_TLS_SIGS)
|
||||
AC_SUBST(DISABLE_NPCAP)
|
||||
AC_SUBST(EXE_SUFFIX)
|
||||
AC_SUBST(NDPI_CFLAGS)
|
||||
AC_SUBST(NDPI_LDFLAGS)
|
||||
AC_OUTPUT
|
||||
|
||||
+26
-2
@@ -213,7 +213,7 @@ This risk is triggered when a TLS fatal alert is detected in the TLS flow. See `
|
||||
|
||||
NDPI_SUSPICIOUS_ENTROPY
|
||||
=======================
|
||||
This risk is used to detect suspicious data carried in ICMP packets whose entropy (used to measure how data is distributed, hence to indirectly guess the type of data carried on) is suspicious and thus that it can indicate a data leak.
|
||||
This risk is used to detect suspicious data carried in ICMP packets whose entropy (used to measure how data is distributed, hence to indirectly guess the type of data carried on) is suspicious and thus that it can indicate a data leak. Suspicious values indicate random entropy or entropy that is similar to encrypted traffic. In the latter case, this can be a suspicious data exfiltration symptom.
|
||||
|
||||
.. _Risk 036:
|
||||
|
||||
@@ -281,7 +281,31 @@ Example: the flow is generated by an iCloud-private-relay exit node.
|
||||
|
||||
.. _Risk 046:
|
||||
|
||||
NDPI_UNIDIRECTIONAL_TRAFFIC_SUBSCRIBER
|
||||
NDPI_UNIDIRECTIONAL_TRAFFIC
|
||||
===================================
|
||||
The risk is set whenever the flow has unidirectional traffic (typically no traffic on the server to client direction). THis
|
||||
risk is not triggered for multicast/broadcast destinations.
|
||||
|
||||
.. _Risk 047:
|
||||
|
||||
NDPI_HTTP_OBSOLETE_SERVER
|
||||
===================================
|
||||
This risk is generated whenever a HTTP server uses an obsolete HTTP server version.
|
||||
|
||||
.. _Risk 048:
|
||||
|
||||
NDPI_PERIODIC_FLOW
|
||||
==================
|
||||
This risk is generated whenever a flow is observed at a specific periodic pace (e.g. every 10 seconds).
|
||||
|
||||
.. _Risk 049:
|
||||
|
||||
NDPI_MINOR_ISSUES
|
||||
=================
|
||||
Minor packet/flow issues (e.g. DNS traffic with zero TTL) have been detected.
|
||||
|
||||
.. _Risk 050:
|
||||
|
||||
NDPI_TCP_ISSUES
|
||||
===============
|
||||
Relevant TCP connection issues such as connection refused, scan, or probe attempt.
|
||||
|
||||
+2
-1
@@ -27,7 +27,8 @@ nDPI is an open source DPI (Deep Packet Inspection) toolkit for traffic analysis
|
||||
nEdge <https://www.ntop.org/guides/nedge/>
|
||||
nScrub <https://www.ntop.org/guides/nscrub/>
|
||||
nBox <https://www.ntop.org/guides/nbox/>
|
||||
|
||||
nTap <https://www.ntop.org/guides/ntap/>
|
||||
|
||||
.. Indices and tables
|
||||
.. ==================
|
||||
..
|
||||
|
||||
+3
-3
@@ -9,8 +9,8 @@ SRCHOME=../src
|
||||
ifneq ($(OS),Windows_NT)
|
||||
CFLAGS+=-fPIC -DPIC
|
||||
endif
|
||||
CFLAGS+=-I$(SRCHOME)/include @PCAP_INC@ @CFLAGS@ @GPROF_CFLAGS@
|
||||
LDFLAGS=@LDFLAGS@
|
||||
CFLAGS+=-I$(SRCHOME)/include @NDPI_CFLAGS@ @PCAP_INC@ @GPROF_CFLAGS@
|
||||
LDFLAGS+=@NDPI_LDFLAGS@
|
||||
LIBNDPI=$(SRCHOME)/lib/libndpi.a
|
||||
LIBS=$(LIBNDPI) @PCAP_LIB@ @ADDITIONAL_LIBS@ @LIBS@ @GPROF_LIBS@
|
||||
HEADERS=reader_util.h $(SRCHOME)/include/ndpi_api.h \
|
||||
@@ -79,7 +79,7 @@ cppcheck:
|
||||
cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I$(SRCHOME)/include *.c
|
||||
|
||||
clean:
|
||||
/bin/rm -f *.o ndpiReader ndpiSimpleIntegration ndpiReader$(EXE_SUFFIX) ndpiSimpleIntegration$(EXE_SUFFIX) ndpiReader.dpdk
|
||||
/bin/rm -f *.o ndpiReader ndpiSimpleIntegration ndpiReader$(EXE_SUFFIX) ndpiSimpleIntegration$(EXE_SUFFIX) ndpiReader.dpdk libndpiReader.a
|
||||
/bin/rm -f .*.dpdk.cmd .*.o.cmd *.dpdk.map .*.o.d
|
||||
/bin/rm -f _install _postbuild _postinstall _preinstall
|
||||
/bin/rm -rf build
|
||||
|
||||
+437
-326
File diff suppressed because it is too large
Load Diff
@@ -137,7 +137,7 @@ struct nDPI_workflow {
|
||||
struct nDPI_reader_thread {
|
||||
struct nDPI_workflow * workflow;
|
||||
pthread_t thread_id;
|
||||
int array_index;
|
||||
uint32_t array_index;
|
||||
};
|
||||
|
||||
static struct nDPI_reader_thread reader_threads[MAX_READER_THREADS] = {};
|
||||
@@ -549,7 +549,7 @@ static void ndpi_process_packet(uint8_t * const args,
|
||||
uint16_t l4_len = 0;
|
||||
|
||||
uint16_t type;
|
||||
int thread_index = INITIAL_THREAD_HASH; // generated with `dd if=/dev/random bs=1024 count=1 |& hd'
|
||||
uint32_t thread_index = INITIAL_THREAD_HASH; // generated with `dd if=/dev/random bs=1024 count=1 |& hd'
|
||||
|
||||
if (reader_thread == NULL) {
|
||||
return;
|
||||
@@ -884,7 +884,7 @@ static void ndpi_process_packet(uint8_t * const args,
|
||||
flow_to_process->detected_l7_protocol =
|
||||
ndpi_detection_process_packet(workflow->ndpi_struct, flow_to_process->ndpi_flow,
|
||||
ip != NULL ? (uint8_t *)ip : (uint8_t *)ip6,
|
||||
ip_size, time_ms);
|
||||
ip_size, time_ms, NULL);
|
||||
|
||||
if (ndpi_is_protocol_detected(workflow->ndpi_struct,
|
||||
flow_to_process->detected_l7_protocol) != 0 &&
|
||||
@@ -943,7 +943,7 @@ static void ndpi_process_packet(uint8_t * const args,
|
||||
{
|
||||
uint8_t unknown_tls_version = 0;
|
||||
char buf_ver[16];
|
||||
printf("[%8llu, %d, %4d][TLS-CLIENT-HELLO] version: %s | sni: %s | alpn: %s\n",
|
||||
printf("[%8llu, %d, %4d][TLS-CLIENT-HELLO] version: %s | sni: %s | (advertised) ALPNs: %s\n",
|
||||
workflow->packets_captured,
|
||||
reader_thread->array_index,
|
||||
flow_to_process->flow_id,
|
||||
@@ -951,12 +951,12 @@ static void ndpi_process_packet(uint8_t * const args,
|
||||
flow_to_process->ndpi_flow->protos.tls_quic.ssl_version,
|
||||
&unknown_tls_version),
|
||||
flow_to_process->ndpi_flow->host_server_name,
|
||||
(flow_to_process->ndpi_flow->protos.tls_quic.alpn != NULL ?
|
||||
flow_to_process->ndpi_flow->protos.tls_quic.alpn : "-"));
|
||||
(flow_to_process->ndpi_flow->protos.tls_quic.advertised_alpns != NULL ?
|
||||
flow_to_process->ndpi_flow->protos.tls_quic.advertised_alpns : "-"));
|
||||
flow_to_process->tls_client_hello_seen = 1;
|
||||
}
|
||||
if (flow_to_process->tls_server_hello_seen == 0 &&
|
||||
flow_to_process->ndpi_flow->l4.tcp.tls.certificate_processed != 0)
|
||||
flow_to_process->ndpi_flow->tls_quic.certificate_processed != 0)
|
||||
{
|
||||
uint8_t unknown_tls_version = 0;
|
||||
char buf_ver[16];
|
||||
|
||||
+13
-1
@@ -5,6 +5,17 @@ tcp:81,tcp:8181@HTTP
|
||||
udp:5061-5062@SIP
|
||||
tcp:860,udp:860,tcp:3260,udp:3260@iSCSI
|
||||
tcp:3000@ntop
|
||||
tcp:9002@Elasticsearch
|
||||
tcp:5601@Kibana
|
||||
tcp:65535@TestProto
|
||||
|
||||
#
|
||||
# nBPF filters (https://github.com/ntop/PF_RING/tree/dev/userland/nbpf))
|
||||
#
|
||||
# NOTE: they are evaluated in the same order they are defined !
|
||||
#
|
||||
nbpf:"host 192.168.1.1 and port 80"@HomeRouter
|
||||
|
||||
|
||||
# Subprotocols
|
||||
# Format:
|
||||
@@ -50,7 +61,8 @@ ip:54.80.47.130@AmazonPrime
|
||||
# For IPs, the flow risk is put in AND (source IP mask OR destination IP mask)
|
||||
# For Flows with a hostname (e.g. TLS) the risk is also put in AND with the host_risk_mask
|
||||
#ip_risk_mask:192.168.1.0/24=0
|
||||
#ip_risk_mask:10.196.157.228=0
|
||||
ip_risk_mask:10.10.120.0/24=0
|
||||
ip_risk_mask:10.196.157.228=0
|
||||
host_risk_mask:".home"=0
|
||||
|
||||
|
||||
|
||||
+195
-74
@@ -78,7 +78,12 @@ extern u_int8_t max_num_udp_dissected_pkts /* 24 */, max_num_tcp_dissected_pkts
|
||||
static u_int32_t flow_id = 0;
|
||||
|
||||
u_int8_t enable_doh_dot_detection = 0;
|
||||
u_int8_t enable_ja3_plus = 0;
|
||||
extern ndpi_init_prefs init_prefs;
|
||||
|
||||
extern int malloc_size_stats;
|
||||
extern struct ndpi_bin malloc_bins;
|
||||
extern int max_malloc_bins;
|
||||
extern int enable_malloc_bins;
|
||||
|
||||
/* ****************************************************** */
|
||||
|
||||
@@ -309,6 +314,17 @@ void ndpi_free_flow_info_half(struct ndpi_flow_info *flow) {
|
||||
|
||||
extern u_int32_t current_ndpi_memory, max_ndpi_memory;
|
||||
|
||||
static u_int32_t __slot_malloc_bins(u_int64_t v)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* 0-2,3-4,5-8,9-16,17-32,33-64,65-128,129-256,257-512,513-1024,1025-2048,2049-4096,4097-8192,8193- */
|
||||
for(i=0; i < max_malloc_bins - 1; i++)
|
||||
if((1ULL << (i + 1)) >= v)
|
||||
return i;
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ndpi_malloc wrapper function
|
||||
*/
|
||||
@@ -318,6 +334,9 @@ static void *ndpi_malloc_wrapper(size_t size) {
|
||||
if(current_ndpi_memory > max_ndpi_memory)
|
||||
max_ndpi_memory = current_ndpi_memory;
|
||||
|
||||
if(enable_malloc_bins && malloc_size_stats)
|
||||
ndpi_inc_bin(&malloc_bins, __slot_malloc_bins(size), 1);
|
||||
|
||||
return(malloc(size)); /* Don't change to ndpi_malloc !!!!! */
|
||||
}
|
||||
|
||||
@@ -354,56 +373,73 @@ static uint16_t ndpi_get_proto_id(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
static NDPI_PROTOCOL_BITMASK debug_bitmask;
|
||||
static char _proto_delim[] = " \t,:;";
|
||||
static int parse_debug_proto(struct ndpi_detection_module_struct *ndpi_mod, char *str) {
|
||||
int parse_proto_name_list(char *str, NDPI_PROTOCOL_BITMASK *bitmask, int inverted_logic) {
|
||||
char *n;
|
||||
uint16_t proto;
|
||||
char op=1;
|
||||
char op;
|
||||
struct ndpi_detection_module_struct *module;
|
||||
NDPI_PROTOCOL_BITMASK all;
|
||||
|
||||
if(!inverted_logic)
|
||||
op = 1; /* Default action: add to the bitmask */
|
||||
else
|
||||
op = 0; /* Default action: remove from the bitmask */
|
||||
/* Use a temporary module with all protocols enabled */
|
||||
module = ndpi_init_detection_module(0);
|
||||
if(!module)
|
||||
return 1;
|
||||
NDPI_BITMASK_SET_ALL(all);
|
||||
ndpi_set_protocol_detection_bitmask2(module, &all);
|
||||
ndpi_finalize_initialization(module);
|
||||
|
||||
for(n = strtok(str,_proto_delim); n && *n; n = strtok(NULL,_proto_delim)) {
|
||||
if(*n == '-') {
|
||||
op = 0;
|
||||
op = !inverted_logic ? 0 : 1;
|
||||
n++;
|
||||
} else if(*n == '+') {
|
||||
op = 1;
|
||||
op = !inverted_logic ? 1 : 0;
|
||||
n++;
|
||||
}
|
||||
if(!strcmp(n,"all")) {
|
||||
if(op)
|
||||
NDPI_BITMASK_SET_ALL(debug_bitmask);
|
||||
NDPI_BITMASK_SET_ALL(*bitmask);
|
||||
else
|
||||
NDPI_BITMASK_RESET(debug_bitmask);
|
||||
NDPI_BITMASK_RESET(*bitmask);
|
||||
continue;
|
||||
}
|
||||
proto = ndpi_get_proto_id(ndpi_mod, n);
|
||||
proto = ndpi_get_proto_id(module, n);
|
||||
if(proto == NDPI_PROTOCOL_UNKNOWN && strcmp(n,"unknown") && strcmp(n,"0")) {
|
||||
fprintf(stderr,"Invalid protocol %s\n",n);
|
||||
ndpi_exit_detection_module(module);
|
||||
return 1;
|
||||
}
|
||||
if(op)
|
||||
NDPI_BITMASK_ADD(debug_bitmask,proto);
|
||||
NDPI_BITMASK_ADD(*bitmask,proto);
|
||||
else
|
||||
NDPI_BITMASK_DEL(debug_bitmask,proto);
|
||||
NDPI_BITMASK_DEL(*bitmask,proto);
|
||||
}
|
||||
ndpi_exit_detection_module(module);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
|
||||
extern char *_debug_protocols;
|
||||
static int _debug_protocols_ok = 0;
|
||||
|
||||
struct ndpi_workflow* ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs,
|
||||
pcap_t * pcap_handle, int do_init_flows_root,
|
||||
ndpi_serialization_format serialization_format) {
|
||||
struct ndpi_detection_module_struct * module;
|
||||
struct ndpi_workflow * workflow;
|
||||
static NDPI_PROTOCOL_BITMASK debug_bitmask;
|
||||
static int _debug_protocols_ok = 0;
|
||||
|
||||
set_ndpi_malloc(ndpi_malloc_wrapper), set_ndpi_free(free_wrapper);
|
||||
set_ndpi_flow_malloc(NULL), set_ndpi_flow_free(NULL);
|
||||
|
||||
/* TODO: just needed here to init ndpi ndpi_malloc wrapper */
|
||||
module = ndpi_init_detection_module(enable_ja3_plus ? ndpi_enable_ja3_plus : ndpi_no_prefs);
|
||||
module = ndpi_init_detection_module(init_prefs);
|
||||
|
||||
if(module == NULL) {
|
||||
LOG(NDPI_LOG_ERROR, "global structure initialization failed\n");
|
||||
@@ -424,7 +460,8 @@ struct ndpi_workflow* ndpi_workflow_init(const struct ndpi_workflow_prefs * pref
|
||||
ndpi_set_log_level(module, nDPI_LogLevel);
|
||||
|
||||
if(_debug_protocols != NULL && ! _debug_protocols_ok) {
|
||||
if(parse_debug_proto(module,_debug_protocols))
|
||||
NDPI_BITMASK_RESET(debug_bitmask);
|
||||
if(parse_proto_name_list(_debug_protocols, &debug_bitmask, 0))
|
||||
exit(-1);
|
||||
_debug_protocols_ok = 1;
|
||||
}
|
||||
@@ -434,13 +471,7 @@ struct ndpi_workflow* ndpi_workflow_init(const struct ndpi_workflow_prefs * pref
|
||||
if(do_init_flows_root)
|
||||
workflow->ndpi_flows_root = ndpi_calloc(workflow->prefs.num_roots, sizeof(void *));
|
||||
|
||||
if (serialization_format != ndpi_serialization_format_unknown &&
|
||||
ndpi_init_serializer(&workflow->ndpi_serializer,
|
||||
serialization_format) != 0)
|
||||
{
|
||||
LOG(NDPI_LOG_ERROR, "serializer initialization failed\n");
|
||||
exit(-1);
|
||||
}
|
||||
workflow->ndpi_serialization_format = serialization_format;
|
||||
|
||||
return workflow;
|
||||
}
|
||||
@@ -486,9 +517,14 @@ static void ndpi_free_flow_tls_data(struct ndpi_flow_info *flow) {
|
||||
flow->ssh_tls.server_names = NULL;
|
||||
}
|
||||
|
||||
if(flow->ssh_tls.tls_alpn) {
|
||||
ndpi_free(flow->ssh_tls.tls_alpn);
|
||||
flow->ssh_tls.tls_alpn = NULL;
|
||||
if(flow->ssh_tls.advertised_alpns) {
|
||||
ndpi_free(flow->ssh_tls.advertised_alpns);
|
||||
flow->ssh_tls.advertised_alpns = NULL;
|
||||
}
|
||||
|
||||
if(flow->ssh_tls.negotiated_alpn) {
|
||||
ndpi_free(flow->ssh_tls.negotiated_alpn);
|
||||
flow->ssh_tls.negotiated_alpn = NULL;
|
||||
}
|
||||
|
||||
if(flow->ssh_tls.tls_supported_versions) {
|
||||
@@ -532,6 +568,7 @@ static void ndpi_free_flow_data_analysis(struct ndpi_flow_info *flow) {
|
||||
void ndpi_flow_info_free_data(struct ndpi_flow_info *flow) {
|
||||
|
||||
ndpi_free_flow_info_half(flow);
|
||||
ndpi_term_serializer(&flow->ndpi_flow_serializer);
|
||||
ndpi_free_flow_data_analysis(flow);
|
||||
ndpi_free_flow_tls_data(flow);
|
||||
|
||||
@@ -542,7 +579,8 @@ void ndpi_flow_info_free_data(struct ndpi_flow_info *flow) {
|
||||
ndpi_free_bin(&flow->payload_len_bin);
|
||||
#endif
|
||||
|
||||
if(flow->risk_str) ndpi_free(flow->risk_str);
|
||||
if(flow->risk_str) ndpi_free(flow->risk_str);
|
||||
if(flow->flow_payload) ndpi_free(flow->flow_payload);
|
||||
}
|
||||
|
||||
/* ***************************************************** */
|
||||
@@ -550,8 +588,6 @@ void ndpi_flow_info_free_data(struct ndpi_flow_info *flow) {
|
||||
void ndpi_workflow_free(struct ndpi_workflow * workflow) {
|
||||
u_int i;
|
||||
|
||||
ndpi_term_serializer(&workflow->ndpi_serializer);
|
||||
|
||||
for(i=0; i<workflow->prefs.num_roots; i++)
|
||||
ndpi_tdestroy(workflow->ndpi_flows_root[i], ndpi_flow_info_freer);
|
||||
|
||||
@@ -840,7 +876,10 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
||||
struct ndpi_flow_info *newflow = (struct ndpi_flow_info*)ndpi_malloc(sizeof(struct ndpi_flow_info));
|
||||
|
||||
if(newflow == NULL) {
|
||||
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Avoid too much logging while fuzzing */
|
||||
LOG(NDPI_LOG_ERROR, "[NDPI] %s(1): not enough memory\n", __FUNCTION__);
|
||||
#endif
|
||||
return(NULL);
|
||||
} else
|
||||
workflow->num_allocated_flows++;
|
||||
@@ -881,18 +920,33 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
||||
}
|
||||
|
||||
if((newflow->ndpi_flow = ndpi_flow_malloc(SIZEOF_FLOW_STRUCT)) == NULL) {
|
||||
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Avoid too much logging while fuzzing */
|
||||
LOG(NDPI_LOG_ERROR, "[NDPI] %s(2): not enough memory\n", __FUNCTION__);
|
||||
#ifdef DIRECTION_BINS
|
||||
ndpi_free_bin(&newflow->payload_len_bin_src2dst), ndpi_free_bin(&newflow->payload_len_bin_dst2src);
|
||||
#else
|
||||
ndpi_free_bin(&newflow->payload_len_bin);
|
||||
#endif
|
||||
ndpi_flow_info_free_data(newflow);
|
||||
ndpi_free(newflow);
|
||||
return(NULL);
|
||||
} else
|
||||
memset(newflow->ndpi_flow, 0, SIZEOF_FLOW_STRUCT);
|
||||
|
||||
ndpi_tsearch(newflow, &workflow->ndpi_flows_root[idx], ndpi_workflow_node_cmp); /* Add */
|
||||
if (workflow->ndpi_serialization_format != ndpi_serialization_format_unknown)
|
||||
{
|
||||
if (ndpi_init_serializer(&newflow->ndpi_flow_serializer,
|
||||
workflow->ndpi_serialization_format) != 0)
|
||||
{
|
||||
LOG(NDPI_LOG_ERROR, "ndpi serializer init failed\n");
|
||||
ndpi_flow_info_free_data(newflow);
|
||||
ndpi_free(newflow);
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if(ndpi_tsearch(newflow, &workflow->ndpi_flows_root[idx], ndpi_workflow_node_cmp) == NULL) { /* Add */
|
||||
ndpi_flow_info_free_data(newflow);
|
||||
ndpi_free(newflow);
|
||||
return(NULL);
|
||||
}
|
||||
workflow->stats.ndpi_flow_count++;
|
||||
if(*proto == IPPROTO_TCP)
|
||||
workflow->stats.flow_count[0]++;
|
||||
@@ -1050,6 +1104,7 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
flow->risk_str = ndpi_strdup(s);
|
||||
|
||||
flow->confidence = flow->ndpi_flow->confidence;
|
||||
flow->num_dissector_calls = flow->ndpi_flow->num_dissector_calls;
|
||||
|
||||
ndpi_snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s",
|
||||
flow->ndpi_flow->host_server_name);
|
||||
@@ -1070,15 +1125,58 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
|
||||
if(flow->ndpi_flow->protos.bittorrent.hash[0] != '\0') {
|
||||
flow->bittorent_hash = ndpi_malloc(sizeof(flow->ndpi_flow->protos.bittorrent.hash) * 2 + 1);
|
||||
for(i=0, j = 0; i < sizeof(flow->ndpi_flow->protos.bittorrent.hash); i++) {
|
||||
sprintf(&flow->bittorent_hash[j], "%02x",
|
||||
flow->ndpi_flow->protos.bittorrent.hash[i]);
|
||||
if(flow->bittorent_hash) {
|
||||
for(i=0, j = 0; i < sizeof(flow->ndpi_flow->protos.bittorrent.hash); i++) {
|
||||
sprintf(&flow->bittorent_hash[j], "%02x",
|
||||
flow->ndpi_flow->protos.bittorrent.hash[i]);
|
||||
|
||||
j += 2;
|
||||
j += 2;
|
||||
}
|
||||
flow->bittorent_hash[j] = '\0';
|
||||
}
|
||||
flow->bittorent_hash[j] = '\0';
|
||||
}
|
||||
}
|
||||
/* TIVOCONNECT */
|
||||
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_TIVOCONNECT)) {
|
||||
flow->info_type = INFO_TIVOCONNECT;
|
||||
ndpi_snprintf(flow->tivoconnect.identity_uuid, sizeof(flow->tivoconnect.identity_uuid),
|
||||
"%s", flow->ndpi_flow->protos.tivoconnect.identity_uuid);
|
||||
ndpi_snprintf(flow->tivoconnect.machine, sizeof(flow->tivoconnect.machine),
|
||||
"%s", flow->ndpi_flow->protos.tivoconnect.machine);
|
||||
ndpi_snprintf(flow->tivoconnect.platform, sizeof(flow->tivoconnect.platform),
|
||||
"%s", flow->ndpi_flow->protos.tivoconnect.platform);
|
||||
ndpi_snprintf(flow->tivoconnect.services, sizeof(flow->tivoconnect.services),
|
||||
"%s", flow->ndpi_flow->protos.tivoconnect.services);
|
||||
}
|
||||
/* SOFTETHER */
|
||||
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_SOFTETHER) && !is_ndpi_proto(flow, NDPI_PROTOCOL_HTTP)) {
|
||||
flow->info_type = INFO_SOFTETHER;
|
||||
ndpi_snprintf(flow->softether.ip, sizeof(flow->softether.ip), "%s",
|
||||
flow->ndpi_flow->protos.softether.ip);
|
||||
ndpi_snprintf(flow->softether.port, sizeof(flow->softether.port), "%s",
|
||||
flow->ndpi_flow->protos.softether.port);
|
||||
ndpi_snprintf(flow->softether.hostname, sizeof(flow->softether.hostname), "%s",
|
||||
flow->ndpi_flow->protos.softether.hostname);
|
||||
ndpi_snprintf(flow->softether.fqdn, sizeof(flow->softether.fqdn), "%s",
|
||||
flow->ndpi_flow->protos.softether.fqdn);
|
||||
}
|
||||
/* NATPMP */
|
||||
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_NATPMP)) {
|
||||
flow->info_type = INFO_NATPMP;
|
||||
flow->natpmp.result_code = flow->ndpi_flow->protos.natpmp.result_code;
|
||||
flow->natpmp.internal_port = flow->ndpi_flow->protos.natpmp.internal_port;
|
||||
flow->natpmp.external_port = flow->ndpi_flow->protos.natpmp.external_port;
|
||||
inet_ntop(AF_INET, &flow->ndpi_flow->protos.natpmp.external_address.ipv4, &flow->natpmp.ip[0], sizeof(flow->natpmp.ip));
|
||||
}
|
||||
/* DISCORD */
|
||||
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_DISCORD) &&
|
||||
!is_ndpi_proto(flow, NDPI_PROTOCOL_TLS) &&
|
||||
!is_ndpi_proto(flow, NDPI_PROTOCOL_DTLS) &&
|
||||
flow->ndpi_flow->protos.discord.client_ip[0] != '\0') {
|
||||
flow->info_type = INFO_GENERIC;
|
||||
ndpi_snprintf(flow->info, sizeof(flow->info), "Client IP: %s",
|
||||
flow->ndpi_flow->protos.discord.client_ip);
|
||||
}
|
||||
/* DNS */
|
||||
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_DNS)) {
|
||||
if(flow->ndpi_flow->protos.dns.rsp_type == 0x1)
|
||||
@@ -1139,17 +1237,23 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
"%s", flow->ndpi_flow->protos.kerberos.username);
|
||||
}
|
||||
/* HTTP */
|
||||
else if((flow->detected_protocol.master_protocol == NDPI_PROTOCOL_HTTP)
|
||||
|| is_ndpi_proto(flow, NDPI_PROTOCOL_HTTP)) {
|
||||
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_HTTP)
|
||||
|| is_ndpi_proto(flow, NDPI_PROTOCOL_HTTP_PROXY)
|
||||
|| is_ndpi_proto(flow, NDPI_PROTOCOL_HTTP_CONNECT)) {
|
||||
if(flow->ndpi_flow->http.url != NULL) {
|
||||
ndpi_snprintf(flow->http.url, sizeof(flow->http.url), "%s", flow->ndpi_flow->http.url);
|
||||
flow->http.response_status_code = flow->ndpi_flow->http.response_status_code;
|
||||
ndpi_snprintf(flow->http.content_type, sizeof(flow->http.content_type), "%s", flow->ndpi_flow->http.content_type ? flow->ndpi_flow->http.content_type : "");
|
||||
ndpi_snprintf(flow->http.server, sizeof(flow->http.server), "%s", flow->ndpi_flow->http.server ? flow->ndpi_flow->http.server : "");
|
||||
ndpi_snprintf(flow->http.request_content_type, sizeof(flow->http.request_content_type), "%s", flow->ndpi_flow->http.request_content_type ? flow->ndpi_flow->http.request_content_type : "");
|
||||
}
|
||||
}
|
||||
/* RTP */
|
||||
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_RTP)) {
|
||||
flow->info_type = INFO_RTP;
|
||||
flow->rtp.stream_type = flow->ndpi_flow->protos.rtp.stream_type;
|
||||
/* COLLECTD */
|
||||
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_COLLECTD)) {
|
||||
} else if(is_ndpi_proto(flow, NDPI_PROTOCOL_COLLECTD)) {
|
||||
flow->info_type = INFO_GENERIC;
|
||||
if(flow->ndpi_flow->protos.collectd.client_username[0] != '\0')
|
||||
ndpi_snprintf(flow->info, sizeof(flow->info), "Username: %s",
|
||||
@@ -1178,6 +1282,7 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
|| is_ndpi_proto(flow, NDPI_PROTOCOL_MAIL_SMTPS)
|
||||
|| is_ndpi_proto(flow, NDPI_PROTOCOL_MAIL_IMAPS)
|
||||
|| is_ndpi_proto(flow, NDPI_PROTOCOL_MAIL_POPS)
|
||||
|| is_ndpi_proto(flow, NDPI_PROTOCOL_FTPS)
|
||||
|| ((is_quic = is_ndpi_proto(flow, NDPI_PROTOCOL_QUIC)))
|
||||
) {
|
||||
flow->ssh_tls.ssl_version = flow->ndpi_flow->protos.tls_quic.ssl_version;
|
||||
@@ -1194,7 +1299,7 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
flow->ssh_tls.server_unsafe_cipher = flow->ndpi_flow->protos.tls_quic.server_unsafe_cipher;
|
||||
flow->ssh_tls.server_cipher = flow->ndpi_flow->protos.tls_quic.server_cipher;
|
||||
|
||||
if(flow->ndpi_flow->l4.tcp.tls.fingerprint_set) {
|
||||
if(flow->ndpi_flow->protos.tls_quic.fingerprint_set) {
|
||||
memcpy(flow->ssh_tls.sha1_cert_fingerprint,
|
||||
flow->ndpi_flow->protos.tls_quic.sha1_certificate_fingerprint, 20);
|
||||
flow->ssh_tls.sha1_cert_fingerprint_set = 1;
|
||||
@@ -1202,11 +1307,6 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
|
||||
flow->ssh_tls.browser_heuristics = flow->ndpi_flow->protos.tls_quic.browser_heuristics;
|
||||
|
||||
if(flow->ndpi_flow->protos.tls_quic.alpn) {
|
||||
if((flow->ssh_tls.tls_alpn = ndpi_strdup(flow->ndpi_flow->protos.tls_quic.alpn)) != NULL)
|
||||
correct_csv_data_field(flow->ssh_tls.tls_alpn);
|
||||
}
|
||||
|
||||
if(flow->ndpi_flow->protos.tls_quic.issuerDN)
|
||||
flow->ssh_tls.tls_issuerDN = strdup(flow->ndpi_flow->protos.tls_quic.issuerDN);
|
||||
|
||||
@@ -1218,28 +1318,19 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
flow->ssh_tls.encrypted_sni.cipher_suite = flow->ndpi_flow->protos.tls_quic.encrypted_sni.cipher_suite;
|
||||
}
|
||||
|
||||
if(flow->ssh_tls.tls_supported_versions) {
|
||||
if(flow->ndpi_flow->protos.tls_quic.tls_supported_versions) {
|
||||
if((flow->ssh_tls.tls_supported_versions = ndpi_strdup(flow->ndpi_flow->protos.tls_quic.tls_supported_versions)) != NULL)
|
||||
correct_csv_data_field(flow->ssh_tls.tls_supported_versions);
|
||||
}
|
||||
|
||||
if(flow->ndpi_flow->protos.tls_quic.alpn
|
||||
&& flow->ndpi_flow->protos.tls_quic.tls_supported_versions) {
|
||||
correct_csv_data_field(flow->ndpi_flow->protos.tls_quic.alpn);
|
||||
correct_csv_data_field(flow->ndpi_flow->protos.tls_quic.tls_supported_versions);
|
||||
if(flow->ndpi_flow->protos.tls_quic.advertised_alpns) {
|
||||
if((flow->ssh_tls.advertised_alpns = ndpi_strdup(flow->ndpi_flow->protos.tls_quic.advertised_alpns)) != NULL)
|
||||
correct_csv_data_field(flow->ssh_tls.advertised_alpns);
|
||||
}
|
||||
|
||||
flow->info_type = INFO_TLS_QUIC_ALPN_VERSION;
|
||||
ndpi_snprintf(flow->tls_quic.alpn, sizeof(flow->tls_quic.alpn), "%s",
|
||||
flow->ndpi_flow->protos.tls_quic.alpn);
|
||||
ndpi_snprintf(flow->tls_quic.tls_supported_versions,
|
||||
sizeof(flow->tls_quic.tls_supported_versions),
|
||||
"%s", flow->ndpi_flow->protos.tls_quic.tls_supported_versions);
|
||||
} else if(flow->ndpi_flow->protos.tls_quic.alpn) {
|
||||
correct_csv_data_field(flow->ndpi_flow->protos.tls_quic.alpn);
|
||||
|
||||
flow->info_type = INFO_TLS_QUIC_ALPN_ONLY;
|
||||
ndpi_snprintf(flow->tls_quic.alpn, sizeof(flow->tls_quic.alpn), "%s",
|
||||
flow->ndpi_flow->protos.tls_quic.alpn);
|
||||
if(flow->ndpi_flow->protos.tls_quic.negotiated_alpn) {
|
||||
if((flow->ssh_tls.negotiated_alpn = ndpi_strdup(flow->ndpi_flow->protos.tls_quic.negotiated_alpn)) != NULL)
|
||||
correct_csv_data_field(flow->ssh_tls.negotiated_alpn);
|
||||
}
|
||||
|
||||
if(enable_doh_dot_detection) {
|
||||
@@ -1259,14 +1350,27 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
||||
sizeof(flow->http.user_agent),
|
||||
"%s", (flow->ndpi_flow->http.user_agent ? flow->ndpi_flow->http.user_agent : ""));
|
||||
|
||||
if(flow->detection_completed && (!flow->check_extra_packets)) {
|
||||
if(is_ndpi_proto(flow, NDPI_PROTOCOL_UNKNOWN)) {
|
||||
if(workflow->__flow_giveup_callback != NULL)
|
||||
workflow->__flow_giveup_callback(workflow, flow, workflow->__flow_giveup_udata);
|
||||
} else {
|
||||
if(workflow->__flow_detected_callback != NULL)
|
||||
workflow->__flow_detected_callback(workflow, flow, workflow->__flow_detected_udata);
|
||||
if (workflow->ndpi_serialization_format != ndpi_serialization_format_unknown)
|
||||
{
|
||||
if (ndpi_flow2json(workflow->ndpi_struct, flow->ndpi_flow,
|
||||
flow->ip_version, flow->protocol,
|
||||
flow->src_ip, flow->dst_ip,
|
||||
&flow->src_ip6, &flow->dst_ip6,
|
||||
flow->src_port, flow->dst_port,
|
||||
flow->detected_protocol,
|
||||
&flow->ndpi_flow_serializer) != 0)
|
||||
{
|
||||
LOG(NDPI_LOG_ERROR, "flow2json failed\n");
|
||||
exit(-1);
|
||||
}
|
||||
ndpi_serialize_string_uint32(&flow->ndpi_flow_serializer, "detection_completed", flow->detection_completed);
|
||||
ndpi_serialize_string_uint32(&flow->ndpi_flow_serializer, "check_extra_packets", flow->check_extra_packets);
|
||||
}
|
||||
|
||||
if(flow->detection_completed && (!flow->check_extra_packets)) {
|
||||
|
||||
flow->flow_payload = flow->ndpi_flow->flow_payload, flow->flow_payload_len = flow->ndpi_flow->flow_payload_len;
|
||||
flow->ndpi_flow->flow_payload = NULL; /* We'll free the memory */
|
||||
|
||||
ndpi_free_flow_info_half(flow);
|
||||
}
|
||||
@@ -1361,7 +1465,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
||||
flow = get_ndpi_flow_info(workflow, IPVERSION, vlan_id,
|
||||
tunnel_type, iph, NULL,
|
||||
ip_offset, ipsize,
|
||||
ntohs(iph->tot_len) - (iph->ihl * 4),
|
||||
ntohs(iph->tot_len) ? (ntohs(iph->tot_len) - (iph->ihl * 4)) : ipsize - (iph->ihl * 4) /* TSO */,
|
||||
iph->ihl * 4,
|
||||
&tcph, &udph, &sport, &dport,
|
||||
&proto,
|
||||
@@ -1537,11 +1641,13 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
||||
flow->has_human_readeable_strings = 0;
|
||||
}
|
||||
} else { // flow is NULL
|
||||
workflow->stats.total_discarded_bytes++;
|
||||
workflow->stats.total_discarded_bytes += header->len;
|
||||
return(nproto);
|
||||
}
|
||||
|
||||
if(!flow->detection_completed) {
|
||||
struct ndpi_flow_input_info input_info;
|
||||
|
||||
u_int enough_packets =
|
||||
(((proto == IPPROTO_UDP) && ((flow->src2dst_packets + flow->dst2src_packets) > max_num_udp_dissected_pkts))
|
||||
|| ((proto == IPPROTO_TCP) && ((flow->src2dst_packets + flow->dst2src_packets) > max_num_tcp_dissected_pkts))) ? 1 : 0;
|
||||
@@ -1557,10 +1663,16 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
||||
else
|
||||
workflow->stats.dpi_packet_count[2]++;
|
||||
|
||||
memset(&input_info, '\0', sizeof(input_info)); /* To be sure to set to "unknown" any fields */
|
||||
/* Set here any information (easily) available; in this trivial example we don't have any */
|
||||
input_info.in_pkt_dir = NDPI_IN_PKT_DIR_UNKNOWN;
|
||||
input_info.seen_flow_beginning = NDPI_FLOW_BEGINNING_UNKNOWN;
|
||||
malloc_size_stats = 1;
|
||||
flow->detected_protocol = ndpi_detection_process_packet(workflow->ndpi_struct, ndpi_flow,
|
||||
iph ? (uint8_t *)iph : (uint8_t *)iph6,
|
||||
ipsize, time_ms);
|
||||
ipsize, time_ms, &input_info);
|
||||
|
||||
enough_packets |= ndpi_flow->fail_with_unknown;
|
||||
if(enough_packets || (flow->detected_protocol.app_protocol != NDPI_PROTOCOL_UNKNOWN)) {
|
||||
if((!enough_packets)
|
||||
&& ndpi_extra_dissection_possible(workflow->ndpi_struct, ndpi_flow))
|
||||
@@ -1586,6 +1698,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
||||
process_ndpi_collected_info(workflow, flow);
|
||||
}
|
||||
}
|
||||
malloc_size_stats = 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -1624,6 +1737,7 @@ int ndpi_is_datalink_supported(int datalink_type) {
|
||||
case DLT_IEEE802_11_RADIO:
|
||||
case DLT_RAW:
|
||||
case DLT_PPI:
|
||||
case LINKTYPE_LINUX_SLL2:
|
||||
return 1;
|
||||
default:
|
||||
return 0;
|
||||
@@ -1789,6 +1903,12 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
||||
ip_offset = 16 + eth_offset;
|
||||
break;
|
||||
|
||||
/* Linux Cooked Capture v2 - 276 */
|
||||
case LINKTYPE_LINUX_SLL2:
|
||||
type = (packet[eth_offset+10] << 8) + packet[eth_offset+11];
|
||||
ip_offset = 20 + eth_offset;
|
||||
break;
|
||||
|
||||
/* Radiotap link-layer - 127 */
|
||||
case DLT_IEEE802_11_RADIO:
|
||||
radiotap = (struct ndpi_radiotap_header *) &packet[eth_offset];
|
||||
@@ -2108,7 +2228,8 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
||||
|
||||
offset += msg_len;
|
||||
|
||||
if((offset + 32 < header->caplen)) {
|
||||
if((offset + 32 < header->caplen) &&
|
||||
(packet[offset + 1] == 0x08)) {
|
||||
/* IEEE 802.11 Data */
|
||||
offset += 24;
|
||||
/* LLC header is 8 bytes */
|
||||
|
||||
+46
-29
@@ -162,9 +162,11 @@ enum info_type {
|
||||
INFO_INVALID = 0,
|
||||
INFO_GENERIC,
|
||||
INFO_KERBEROS,
|
||||
INFO_SOFTETHER,
|
||||
INFO_TIVOCONNECT,
|
||||
INFO_FTP_IMAP_POP_SMTP,
|
||||
INFO_TLS_QUIC_ALPN_VERSION,
|
||||
INFO_TLS_QUIC_ALPN_ONLY,
|
||||
INFO_NATPMP,
|
||||
INFO_RTP
|
||||
};
|
||||
|
||||
// flow tracking
|
||||
@@ -181,7 +183,7 @@ typedef struct ndpi_flow_info {
|
||||
u_int16_t vlan_id;
|
||||
ndpi_packet_tunnel tunnel_type;
|
||||
struct ndpi_flow_struct *ndpi_flow;
|
||||
char src_name[48], dst_name[48];
|
||||
char src_name[INET6_ADDRSTRLEN], dst_name[INET6_ADDRSTRLEN];
|
||||
u_int8_t ip_version;
|
||||
u_int32_t cwr_count, src2dst_cwr_count, dst2src_cwr_count;
|
||||
u_int32_t ece_count, src2dst_ece_count, dst2src_ece_count;
|
||||
@@ -203,6 +205,7 @@ typedef struct ndpi_flow_info {
|
||||
// result only, not used for flow identification
|
||||
ndpi_protocol detected_protocol;
|
||||
ndpi_confidence_t confidence;
|
||||
u_int16_t num_dissector_calls;
|
||||
|
||||
// Flow data analysis
|
||||
pkt_timeval src2dst_last_pkt_time, dst2src_last_pkt_time, flow_last_pkt_time;
|
||||
@@ -212,10 +215,6 @@ typedef struct ndpi_flow_info {
|
||||
enum info_type info_type;
|
||||
union {
|
||||
char info[256];
|
||||
struct {
|
||||
char alpn[128];
|
||||
char tls_supported_versions[128];
|
||||
} tls_quic;
|
||||
struct {
|
||||
unsigned char auth_failed;
|
||||
char username[127];
|
||||
@@ -226,8 +225,28 @@ typedef struct ndpi_flow_info {
|
||||
char hostname[85];
|
||||
char username[86];
|
||||
} kerberos;
|
||||
struct {
|
||||
char ip[16];
|
||||
char port[6];
|
||||
char hostname[48];
|
||||
char fqdn[48];
|
||||
} softether;
|
||||
struct {
|
||||
char identity_uuid[36];
|
||||
char machine[48];
|
||||
char platform[32];
|
||||
char services[48];
|
||||
} tivoconnect;
|
||||
struct {
|
||||
uint16_t result_code;
|
||||
uint16_t internal_port;
|
||||
uint16_t external_port;
|
||||
char ip[16];
|
||||
} natpmp;
|
||||
};
|
||||
|
||||
ndpi_serializer ndpi_flow_serializer;
|
||||
|
||||
char flow_extra_info[16];
|
||||
char host_server_name[80]; /* Hostname/SNI */
|
||||
char *bittorent_hash;
|
||||
@@ -239,7 +258,7 @@ typedef struct ndpi_flow_info {
|
||||
u_int16_t ssl_version;
|
||||
char server_info[64],
|
||||
client_hassh[33], server_hassh[33], *server_names,
|
||||
*tls_alpn, *tls_supported_versions,
|
||||
*advertised_alpns, *negotiated_alpn, *tls_supported_versions,
|
||||
*tls_issuerDN, *tls_subjectDN,
|
||||
ja3_client[33], ja3_server[33],
|
||||
sha1_cert_fingerprint[20];
|
||||
@@ -257,7 +276,11 @@ typedef struct ndpi_flow_info {
|
||||
} ssh_tls;
|
||||
|
||||
struct {
|
||||
char url[256], request_content_type[64], content_type[64], user_agent[256];
|
||||
enum ndpi_rtp_stream_type stream_type;
|
||||
} rtp;
|
||||
|
||||
struct {
|
||||
char url[256], request_content_type[64], content_type[64], user_agent[256], server[128];
|
||||
u_int response_status_code;
|
||||
} http;
|
||||
|
||||
@@ -276,6 +299,10 @@ typedef struct ndpi_flow_info {
|
||||
#else
|
||||
struct ndpi_bin payload_len_bin;
|
||||
#endif
|
||||
|
||||
/* Flow payload */
|
||||
u_int16_t flow_payload_len;
|
||||
char *flow_payload;
|
||||
} ndpi_flow_info_t;
|
||||
|
||||
|
||||
@@ -296,6 +323,11 @@ typedef struct ndpi_stats {
|
||||
u_int16_t max_packet_len;
|
||||
u_int64_t dpi_packet_count[3];
|
||||
u_int64_t flow_confidence[NDPI_CONFIDENCE_MAX];
|
||||
u_int64_t num_dissector_calls;
|
||||
|
||||
struct ndpi_lru_cache_stats lru_stats[NDPI_LRUCACHE_MAX];
|
||||
struct ndpi_automa_stats automa_stats[NDPI_AUTOMA_MAX];
|
||||
struct ndpi_patricia_tree_stats patricia_stats[NDPI_PTREE_MAX];
|
||||
} ndpi_stats_t;
|
||||
|
||||
|
||||
@@ -321,11 +353,6 @@ typedef struct ndpi_workflow {
|
||||
struct ndpi_workflow_prefs prefs;
|
||||
struct ndpi_stats stats;
|
||||
|
||||
ndpi_workflow_callback_ptr __flow_detected_callback;
|
||||
void * __flow_detected_udata;
|
||||
ndpi_workflow_callback_ptr __flow_giveup_callback;
|
||||
void * __flow_giveup_udata;
|
||||
|
||||
/* outside referencies */
|
||||
pcap_t *pcap_handle;
|
||||
|
||||
@@ -335,7 +362,7 @@ typedef struct ndpi_workflow {
|
||||
u_int32_t num_allocated_flows;
|
||||
|
||||
/* CSV,TLV,JSON serialization interface */
|
||||
ndpi_serializer ndpi_serializer;
|
||||
ndpi_serialization_format ndpi_serialization_format;
|
||||
} ndpi_workflow_t;
|
||||
|
||||
|
||||
@@ -362,20 +389,6 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
||||
|
||||
int ndpi_is_datalink_supported(int datalink_type);
|
||||
|
||||
/* flow callbacks for complete detected flow
|
||||
(ndpi_flow_info will be freed right after) */
|
||||
static inline void ndpi_workflow_set_flow_detected_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
|
||||
workflow->__flow_detected_callback = callback;
|
||||
workflow->__flow_detected_udata = udata;
|
||||
}
|
||||
|
||||
/* flow callbacks for sufficient detected flow
|
||||
(ndpi_flow_info will be freed right after) */
|
||||
static inline void ndpi_workflow_set_flow_giveup_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
|
||||
workflow->__flow_giveup_callback = callback;
|
||||
workflow->__flow_giveup_udata = udata;
|
||||
}
|
||||
|
||||
/* compare two nodes in workflow */
|
||||
int ndpi_workflow_node_cmp(const void *a, const void *b);
|
||||
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow);
|
||||
@@ -397,4 +410,8 @@ extern int nDPI_LogLevel;
|
||||
#define LOG(...) {}
|
||||
#endif
|
||||
|
||||
#ifndef LINKTYPE_LINUX_SLL2
|
||||
#define LINKTYPE_LINUX_SLL2 276
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
+324
-30
@@ -1,52 +1,346 @@
|
||||
bin_PROGRAMS = fuzz_process_packet fuzz_process_packet_with_main fuzz_ndpi_reader fuzz_ndpi_reader_with_main
|
||||
bin_PROGRAMS = fuzz_process_packet fuzz_ndpi_reader fuzz_ndpi_reader_alloc_fail fuzz_quic_get_crypto_data fuzz_config fuzz_community_id fuzz_serialization
|
||||
#Alghoritms
|
||||
bin_PROGRAMS += fuzz_alg_bins fuzz_alg_hll fuzz_alg_hw_rsi_outliers_da fuzz_alg_jitter fuzz_alg_ses_des
|
||||
#Data structures
|
||||
bin_PROGRAMS += fuzz_ds_patricia fuzz_ds_ahocorasick fuzz_ds_libcache fuzz_ds_tree
|
||||
|
||||
fuzz_process_packet_SOURCES = fuzz_process_packet.c
|
||||
fuzz_process_packet_CFLAGS =
|
||||
fuzz_process_packet_LDADD = ../src/lib/libndpi.a
|
||||
fuzz_process_packet_LDFLAGS = $(ADDITIONAL_LIBS) $(LIBS)
|
||||
fuzz_process_packet_SOURCES = fuzz_process_packet.c fuzz_common_code.c
|
||||
fuzz_process_packet_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS)
|
||||
fuzz_process_packet_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_process_packet_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_process_packet_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_process_packet_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_process_packet_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_process_packet_LDFLAGS) $(LDFLAGS) -o $@
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_process_packet_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_process_packet_with_main_SOURCES = fuzz_process_packet.c
|
||||
fuzz_process_packet_with_main_CFLAGS = -DBUILD_MAIN
|
||||
fuzz_process_packet_with_main_LDADD = ../src/lib/libndpi.a
|
||||
fuzz_process_packet_with_main_LDFLAGS = $(ADDITIONAL_LIBS) $(LIBS)
|
||||
# force usage of CXX for linker
|
||||
fuzz_process_packet_with_main_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_process_packet_with_main_LDFLAGS) $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_ndpi_reader_SOURCES = fuzz_ndpi_reader.c
|
||||
fuzz_ndpi_reader_CFLAGS = -I../example/
|
||||
fuzz_ndpi_reader_LDADD = ../example/libndpiReader.a ../src/lib/libndpi.a
|
||||
fuzz_ndpi_reader_LDFLAGS = $(PCAP_LIB) $(ADDITIONAL_LIBS) $(LIBS)
|
||||
fuzz_ndpi_reader_SOURCES = fuzz_ndpi_reader.c ../example/reader_util.c
|
||||
fuzz_ndpi_reader_CFLAGS = -I../example/ @NDPI_CFLAGS@ $(CXXFLAGS)
|
||||
fuzz_ndpi_reader_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_ndpi_reader_LDFLAGS = $(PCAP_LIB) $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_ndpi_reader_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ndpi_reader_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_ndpi_reader_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ndpi_reader_LDFLAGS) $(LDFLAGS) -o $@
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ndpi_reader_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_ndpi_reader_with_main_SOURCES = fuzz_ndpi_reader.c
|
||||
fuzz_ndpi_reader_with_main_CFLAGS = -I../example/ -DBUILD_MAIN
|
||||
fuzz_ndpi_reader_with_main_LDADD = ../src/lib/libndpi.a
|
||||
fuzz_ndpi_reader_with_main_LDFLAGS = ../example/libndpiReader.a $(PCAP_LIB) $(ADDITIONAL_LIBS) $(LIBS)
|
||||
fuzz_ndpi_reader_alloc_fail_SOURCES = fuzz_ndpi_reader.c fuzz_common_code.c ../example/reader_util.c
|
||||
fuzz_ndpi_reader_alloc_fail_CFLAGS = -I../example/ @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -DENABLE_MEM_ALLOC_FAILURES
|
||||
fuzz_ndpi_reader_alloc_fail_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_ndpi_reader_alloc_fail_LDFLAGS = $(PCAP_LIB) $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_ndpi_reader_alloc_fail_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ndpi_reader_alloc_fail_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_ndpi_reader_with_main_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ndpi_reader_with_main_LDFLAGS) $(LDFLAGS) -o $@
|
||||
fuzz_ndpi_reader_alloc_fail_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ndpi_reader_alloc_fail_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_quic_get_crypto_data_SOURCES = fuzz_quic_get_crypto_data.c fuzz_common_code.c
|
||||
fuzz_quic_get_crypto_data_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS)
|
||||
fuzz_quic_get_crypto_data_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_quic_get_crypto_data_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_quic_get_crypto_data_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_quic_get_crypto_data_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_quic_get_crypto_data_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_quic_get_crypto_data_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_config_SOURCES = fuzz_config.cpp fuzz_common_code.c
|
||||
fuzz_config_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_config_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_config_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_config_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_config_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_config_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_config_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_config_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_config_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_community_id_SOURCES = fuzz_community_id.cpp fuzz_common_code.c
|
||||
fuzz_community_id_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_community_id_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_community_id_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_community_id_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_community_id_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_community_id_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_community_id_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_community_id_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_community_id_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_serialization_SOURCES = fuzz_serialization.cpp fuzz_common_code.c
|
||||
fuzz_serialization_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_serialization_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_serialization_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_serialization_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_serialization_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_serialization_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_serialization_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_serialization_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_serialization_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_alg_bins_SOURCES = fuzz_alg_bins.cpp fuzz_common_code.c
|
||||
fuzz_alg_bins_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_bins_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_bins_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_alg_bins_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_alg_bins_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_bins_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_bins_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_alg_bins_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_alg_bins_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_alg_hll_SOURCES = fuzz_alg_hll.cpp fuzz_common_code.c
|
||||
fuzz_alg_hll_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_hll_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_hll_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_alg_hll_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_alg_hll_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_hll_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_hll_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_alg_hll_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_alg_hll_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_alg_hw_rsi_outliers_da_SOURCES = fuzz_alg_hw_rsi_outliers_da.cpp fuzz_common_code.c
|
||||
fuzz_alg_hw_rsi_outliers_da_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_hw_rsi_outliers_da_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_hw_rsi_outliers_da_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_alg_hw_rsi_outliers_da_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_alg_hw_rsi_outliers_da_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_hw_rsi_outliers_da_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_hw_rsi_outliers_da_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_alg_hw_rsi_outliers_da_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_alg_hw_rsi_outliers_da_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_alg_jitter_SOURCES = fuzz_alg_jitter.cpp fuzz_common_code.c
|
||||
fuzz_alg_jitter_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_jitter_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_jitter_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_alg_jitter_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_alg_jitter_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_jitter_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_jitter_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_alg_jitter_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_alg_jitter_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_alg_ses_des_SOURCES = fuzz_alg_ses_des.cpp fuzz_common_code.c
|
||||
fuzz_alg_ses_des_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_ses_des_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_alg_ses_des_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_alg_ses_des_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_alg_ses_des_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_ses_des_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_alg_ses_des_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_alg_ses_des_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_alg_ses_des_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_ds_patricia_SOURCES = fuzz_ds_patricia.cpp fuzz_common_code.c
|
||||
fuzz_ds_patricia_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_ds_patricia_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_ds_patricia_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_ds_patricia_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_ds_patricia_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ds_patricia_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ds_patricia_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_ds_patricia_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ds_patricia_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_ds_ahocorasick_SOURCES = fuzz_ds_ahocorasick.cpp fuzz_common_code.c
|
||||
fuzz_ds_ahocorasick_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_ds_ahocorasick_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_ds_ahocorasick_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_ds_ahocorasick_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_ds_ahocorasick_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ds_ahocorasick_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ds_ahocorasick_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_ds_ahocorasick_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ds_ahocorasick_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_ds_libcache_SOURCES = fuzz_ds_libcache.cpp fuzz_common_code.c
|
||||
fuzz_ds_libcache_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_ds_libcache_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_ds_libcache_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_ds_libcache_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_ds_libcache_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ds_libcache_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ds_libcache_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_ds_libcache_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ds_libcache_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
fuzz_ds_tree_SOURCES = fuzz_ds_tree.cpp fuzz_common_code.c
|
||||
fuzz_ds_tree_CXXFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_ds_tree_CFLAGS = @NDPI_CFLAGS@ $(CXXFLAGS) -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
fuzz_ds_tree_LDADD = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||
fuzz_ds_tree_LDFLAGS = $(LIBS)
|
||||
if HAS_FUZZLDFLAGS
|
||||
fuzz_ds_tree_CXXFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ds_tree_CFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
fuzz_ds_tree_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||
endif
|
||||
# force usage of CXX for linker
|
||||
fuzz_ds_tree_LINK=$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CXX) @NDPI_CFLAGS@ $(AM_CXXFLAGS) $(CXXFLAGS) \
|
||||
$(fuzz_ds_tree_LDFLAGS) @NDPI_LDFLAGS@ $(LDFLAGS) -o $@
|
||||
|
||||
|
||||
# required for Google oss-fuzz
|
||||
# see https://github.com/google/oss-fuzz/tree/master/projects/ndpi
|
||||
testpcaps := $(wildcard ../tests/pcap/*.pcap*)
|
||||
|
||||
fuzz_ndpi_reader_seed_corpus.zip: $(testpcaps)
|
||||
zip -r fuzz_ndpi_reader_seed_corpus.zip $(testpcaps)
|
||||
zip -j fuzz_ndpi_reader_seed_corpus.zip $(testpcaps)
|
||||
|
||||
fuzz_ndpi_reader_alloc_fail_seed_corpus.zip: $(testpcaps)
|
||||
zip -j fuzz_ndpi_reader_alloc_fail_seed_corpus.zip $(testpcaps)
|
||||
|
||||
files_corpus_fuzz_quic_get_crypto_data := $(wildcard corpus/fuzz_quic_get_crypto_data/*)
|
||||
|
||||
fuzz_quic_get_crypto_data_seed_corpus.zip: $(files_corpus_fuzz_quic_get_crypto_data)
|
||||
zip -j fuzz_quic_get_crypto_data_seed_corpus.zip $(files_corpus_fuzz_quic_get_crypto_data)
|
||||
|
||||
files_corpus_fuzz_config := $(wildcard corpus/fuzz_config/*)
|
||||
|
||||
fuzz_config_seed_corpus.zip: $(files_corpus_fuzz_config)
|
||||
zip -j fuzz_config_seed_corpus.zip $(files_corpus_fuzz_config)
|
||||
|
||||
files_corpus_fuzz_serialization := $(wildcard corpus/fuzz_serialization/*)
|
||||
|
||||
fuzz_serialization_seed_corpus.zip: $(files_corpus_fuzz_serialization)
|
||||
zip -j fuzz_serialization_seed_corpus.zip $(files_corpus_fuzz_serialization)
|
||||
|
||||
files_corpus_fuzz_community_id := $(wildcard corpus/fuzz_community_id/*)
|
||||
|
||||
fuzz_community_id_seed_corpus.zip: $(files_corpus_fuzz_community_id)
|
||||
zip -j fuzz_community_id_seed_corpus.zip $(files_corpus_fuzz_community_id)
|
||||
|
||||
files_corpus_fuzz_ds_patricia := $(wildcard corpus/fuzz_ds_patricia/*)
|
||||
|
||||
fuzz_ds_patricia_seed_corpus.zip: $(files_corpus_fuzz_ds_patricia)
|
||||
zip -j fuzz_ds_patricia_seed_corpus.zip $(files_corpus_fuzz_ds_patricia)
|
||||
|
||||
files_corpus_fuzz_ds_ahocorasick := $(wildcard corpus/fuzz_ds_ahocorasick/*)
|
||||
|
||||
fuzz_ds_ahocorasick_seed_corpus.zip: $(files_corpus_fuzz_ds_ahocorasick)
|
||||
zip -j fuzz_ds_ahocorasick_seed_corpus.zip $(files_corpus_fuzz_ds_ahocorasick)
|
||||
|
||||
files_corpus_fuzz_alg_ses_des := $(wildcard corpus/fuzz_alg_ses_des/*)
|
||||
|
||||
fuzz_alg_ses_des_seed_corpus.zip: $(files_corpus_fuzz_alg_ses_des)
|
||||
zip -j fuzz_alg_ses_des_seed_corpus.zip $(files_corpus_fuzz_alg_ses_des)
|
||||
|
||||
files_corpus_fuzz_alg_hw_rsi_outliers_da := $(wildcard corpus/fuzz_alg_hw_rsi_outliers_da/*)
|
||||
|
||||
fuzz_alg_hw_rsi_outliers_da_seed_corpus.zip: $(files_corpus_fuzz_alg_hw_rsi_outliers_da)
|
||||
zip -j fuzz_alg_hw_rsi_outliers_da_seed_corpus.zip $(files_corpus_fuzz_alg_hw_rsi_outliers_da)
|
||||
|
||||
files_corpus_fuzz_alg_bins := $(wildcard corpus/fuzz_alg_bins/*)
|
||||
|
||||
fuzz_alg_bins_seed_corpus.zip: $(files_corpus_fuzz_alg_bins)
|
||||
zip -j fuzz_alg_bins_seed_corpus.zip $(files_corpus_fuzz_alg_bins)
|
||||
|
||||
files_corpus_fuzz_alg_hll := $(wildcard corpus/fuzz_alg_hll/*)
|
||||
|
||||
fuzz_alg_hll_seed_corpus.zip: $(files_corpus_fuzz_alg_hll)
|
||||
zip -j fuzz_alg_hll_seed_corpus.zip $(files_corpus_fuzz_alg_hll)
|
||||
|
||||
files_corpus_fuzz_alg_jitter := $(wildcard corpus/fuzz_alg_jitter/*)
|
||||
|
||||
fuzz_alg_jitter_seed_corpus.zip: $(files_corpus_fuzz_alg_jitter)
|
||||
zip -j fuzz_alg_jitter_seed_corpus.zip $(files_corpus_fuzz_alg_jitter)
|
||||
|
||||
files_corpus_fuzz_ds_libcache := $(wildcard corpus/fuzz_ds_libcache/*)
|
||||
|
||||
fuzz_ds_libcache_seed_corpus.zip: $(files_corpus_fuzz_ds_libcache)
|
||||
zip -j fuzz_ds_libcache_seed_corpus.zip $(files_corpus_fuzz_ds_libcache)
|
||||
|
||||
files_corpus_fuzz_ds_tree := $(wildcard corpus/fuzz_ds_tree/*)
|
||||
|
||||
fuzz_ds_tree_seed_corpus.zip: $(files_corpus_fuzz_ds_tree)
|
||||
zip -j fuzz_ds_tree_seed_corpus.zip $(files_corpus_fuzz_ds_tree)
|
||||
|
||||
corpus: fuzz_ndpi_reader_seed_corpus.zip fuzz_ndpi_reader_alloc_fail_seed_corpus.zip fuzz_quic_get_crypto_data_seed_corpus.zip fuzz_config_seed_corpus.zip fuzz_ds_patricia_seed_corpus.zip fuzz_ds_ahocorasick_seed_corpus.zip fuzz_alg_ses_des_seed_corpus.zip fuzz_alg_hw_rsi_outliers_da_seed_corpus.zip fuzz_alg_bins_seed_corpus.zip fuzz_alg_hll_seed_corpus.zip fuzz_alg_jitter_seed_corpus.zip fuzz_ds_libcache_seed_corpus.zip fuzz_community_id_seed_corpus.zip fuzz_ds_tree_seed_corpus.zip fuzz_serialization_seed_corpus.zip
|
||||
|
||||
#Create dictionaries exactly as expected by oss-fuzz.
|
||||
#This way, if we need to change/update/add something,
|
||||
#we don't need to update scripts in oss-fuzz repository
|
||||
dictionaries:
|
||||
cp dictionary.dict fuzz_ndpi_reader.dict
|
||||
cp dictionary.dict fuzz_ndpi_reader_alloc_fail.dict
|
||||
cp dictionary.dict fuzz_process_packet.dict
|
||||
|
||||
distdir:
|
||||
find . -type d | xargs -I'{}' mkdir -p '$(distdir)/{}'
|
||||
find . -type f -name '*.c' \
|
||||
-o -name '*.am' \
|
||||
-o -name '*.h' \
|
||||
-o -name '*.cpp' \
|
||||
-o -name '*.dict' \
|
||||
-o -path './corpus/fuzz_quic_get_crypto_data/*' \
|
||||
-o -path './corpus/fuzz_config/*' \
|
||||
-o -path './corpus/fuzz_serialization/*' \
|
||||
-o -path './corpus/fuzz_community_id/*' \
|
||||
-o -path './corpus/fuzz_alg_ses_des/*' \
|
||||
-o -path './corpus/fuzz_alg_bins/*' \
|
||||
-o -path './corpus/fuzz_alg_hll/*' \
|
||||
-o -path './corpus/fuzz_alg_jitter/*' \
|
||||
-o -path './corpus/fuzz_alg_hw_rsi_outliers_da/*' \
|
||||
-o -path './corpus/fuzz_ds_ahocorasick/*' \
|
||||
-o -path './corpus/fuzz_ds_libcache/*' \
|
||||
-o -path './corpus/fuzz_ds_tree/*' \
|
||||
-o -path './corpus/fuzz_ds_patricia/*' | xargs -I'{}' cp -r '{}' '$(distdir)/{}'
|
||||
|
||||
all: corpus dictionaries
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user