Compare commits
326
Commits
3.0
...
3.2-stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6735bb35c6 | ||
|
|
17d80419d9 | ||
|
|
60e3ac6b39 | ||
|
|
cd4f8051dd | ||
|
|
e4512dbcb9 | ||
|
|
7b2f89ef25 | ||
|
|
15bb7ae433 | ||
|
|
a50169a7b3 | ||
|
|
dd80ec869a | ||
|
|
1714d7aa52 | ||
|
|
90e08b3568 | ||
|
|
080e23e30e | ||
|
|
edce5a8c1f | ||
|
|
c8ccf33f07 | ||
|
|
ee979ac14a | ||
|
|
3eb9907dd7 | ||
|
|
fdf8dd724f | ||
|
|
37121a9b58 | ||
|
|
bbaf9147b6 | ||
|
|
9796fdc0e9 | ||
|
|
e0a058af67 | ||
|
|
80e9826040 | ||
|
|
bf7dcd63c3 | ||
|
|
b287dccecf | ||
|
|
cb34c6b233 | ||
|
|
fd94270507 | ||
|
|
03cf975c07 | ||
|
|
428661c00b | ||
|
|
5c52c00ea4 | ||
|
|
f89f25c118 | ||
|
|
d4ae8a5f16 | ||
|
|
7234f36949 | ||
|
|
2efc09a20e | ||
|
|
3fa61a394b | ||
|
|
582a01303f | ||
|
|
97fb50e837 | ||
|
|
a3da5604a3 | ||
|
|
af6c86de28 | ||
|
|
34984f1aec | ||
|
|
83bbb4cb69 | ||
|
|
ff4f32ff48 | ||
|
|
33d761a55a | ||
|
|
2bd89be3e2 | ||
|
|
5cad39f0e8 | ||
|
|
3be263aafc | ||
|
|
452ba1f339 | ||
|
|
ec15089208 | ||
|
|
af661bd652 | ||
|
|
4613515635 | ||
|
|
2009361b89 | ||
|
|
f027ab1ae7 | ||
|
|
fa26c62b0c | ||
|
|
0faba29351 | ||
|
|
2701cc9491 | ||
|
|
88fc9232ff | ||
|
|
0703ab5ac5 | ||
|
|
418ea234ae | ||
|
|
3e99b73635 | ||
|
|
6dbe81588f | ||
|
|
2b6a639192 | ||
|
|
9e87645022 | ||
|
|
626fcf1418 | ||
|
|
5b11c2ffc5 | ||
|
|
8486eb08ea | ||
|
|
ce4f4fbe2f | ||
|
|
3422574c17 | ||
|
|
b3138d5e3e | ||
|
|
0bf2ca56a8 | ||
|
|
b97360d931 | ||
|
|
579dd7dff9 | ||
|
|
ff89a14b49 | ||
|
|
b5b2260f2e | ||
|
|
39b1ad3087 | ||
|
|
c68ea3067b | ||
|
|
4e538b1e4d | ||
|
|
5c8c2d843a | ||
|
|
ea957687e1 | ||
|
|
c84ed5a712 | ||
|
|
ab2a011cf9 | ||
|
|
d86d632fe6 | ||
|
|
87d228f78e | ||
|
|
a7a4bf32d3 | ||
|
|
e20c4acbde | ||
|
|
daf15e70bf | ||
|
|
daa1171593 | ||
|
|
dc5fecfc92 | ||
|
|
79e1ec9f50 | ||
|
|
902a1c7b4c | ||
|
|
5b88867084 | ||
|
|
4749e61bdb | ||
|
|
4f230943cf | ||
|
|
6186e1ab01 | ||
|
|
9fe8bf018a | ||
|
|
e082134a0d | ||
|
|
cedbf3b636 | ||
|
|
5f6fd8d2a5 | ||
|
|
cbb755666e | ||
|
|
1d024ece7a | ||
|
|
77db14fd7a | ||
|
|
5a40f9b7fd | ||
|
|
931f51bd77 | ||
|
|
283588a37b | ||
|
|
812505b56b | ||
|
|
98d9f524f9 | ||
|
|
0023a96f80 | ||
|
|
9f7b1c84f2 | ||
|
|
e1047b324b | ||
|
|
10738a0ca3 | ||
|
|
fe312ffbe1 | ||
|
|
24f2cd6fc1 | ||
|
|
cbabbd5865 | ||
|
|
da5208ee68 | ||
|
|
bccf1c433a | ||
|
|
cc7593fe5a | ||
|
|
5571ce114d | ||
|
|
4dd887e516 | ||
|
|
a3e06da2a8 | ||
|
|
dc21079851 | ||
|
|
5987ec6014 | ||
|
|
757b0c602f | ||
|
|
498b346219 | ||
|
|
3e66bbc5bc | ||
|
|
3ba7667887 | ||
|
|
fd943d6000 | ||
|
|
691778df33 | ||
|
|
81c3f5813c | ||
|
|
fdf402d027 | ||
|
|
f0014a5a24 | ||
|
|
53a5be3399 | ||
|
|
f389969c0b | ||
|
|
dc02afa3ea | ||
|
|
d1fb41a161 | ||
|
|
ef16591f3f | ||
|
|
29dd45838d | ||
|
|
798bb6e2e1 | ||
|
|
2332cbfefe | ||
|
|
a58a135758 | ||
|
|
634457615c | ||
|
|
cb825766ea | ||
|
|
8b01056b21 | ||
|
|
f6c7a33177 | ||
|
|
daae1cc9b1 | ||
|
|
499c80535b | ||
|
|
9fb3a57a71 | ||
|
|
257ec7cc5f | ||
|
|
73c7ccdb65 | ||
|
|
cffb11fbc9 | ||
|
|
23421b47d9 | ||
|
|
1cab9fe838 | ||
|
|
27ea04c08e | ||
|
|
5c225b8a2e | ||
|
|
4961241c62 | ||
|
|
843204299c | ||
|
|
09cd95d54a | ||
|
|
1d3bef41a4 | ||
|
|
e21fe5d594 | ||
|
|
9133955219 | ||
|
|
acb74905a5 | ||
|
|
ed3fff554a | ||
|
|
7ebe6a0c82 | ||
|
|
87333aa68c | ||
|
|
e593319ba0 | ||
|
|
812a3e7099 | ||
|
|
1097f5488d | ||
|
|
b90410e335 | ||
|
|
deed27cbef | ||
|
|
ea001b439a | ||
|
|
14e5adc7c2 | ||
|
|
81012b3201 | ||
|
|
406aa12468 | ||
|
|
2c2bb11c9b | ||
|
|
1bd63d68a5 | ||
|
|
bf5e9b7b0b | ||
|
|
7fe9dddf65 | ||
|
|
6d7f3976f3 | ||
|
|
65d526d8f6 | ||
|
|
56eeb965bf | ||
|
|
c4d476cc58 | ||
|
|
23b0b8625d | ||
|
|
558983c99c | ||
|
|
c8d6f2845f | ||
|
|
1a115cac5a | ||
|
|
11401edfe7 | ||
|
|
239842b821 | ||
|
|
606ff10ecf | ||
|
|
d37b69ce9c | ||
|
|
226a9abf22 | ||
|
|
f26096ee4c | ||
|
|
2b3ef7e762 | ||
|
|
d62526f9ed | ||
|
|
e66d7216b8 | ||
|
|
fbc59c5f81 | ||
|
|
32dc9e3225 | ||
|
|
b4468239b9 | ||
|
|
95c1282ef4 | ||
|
|
a7b0457753 | ||
|
|
7da7ae622b | ||
|
|
a95cfcc989 | ||
|
|
a65c959940 | ||
|
|
d328c3bccc | ||
|
|
8368568443 | ||
|
|
c223bb1f10 | ||
|
|
c7efd0892f | ||
|
|
ae9429408b | ||
|
|
0ce56d5714 | ||
|
|
509cfcb556 | ||
|
|
3b203d57e9 | ||
|
|
68d66b780c | ||
|
|
f94d6cca7d | ||
|
|
382217887b | ||
|
|
537c11a985 | ||
|
|
bdc0719e76 | ||
|
|
fc82cdfa4a | ||
|
|
e98b994a39 | ||
|
|
a58c838c4c | ||
|
|
f91f2c57ef | ||
|
|
68b7986d9b | ||
|
|
ead0325deb | ||
|
|
0b819badd2 | ||
|
|
3754e6dd12 | ||
|
|
da029607a0 | ||
|
|
803dc6ff77 | ||
|
|
65a629304c | ||
|
|
51cfdfb0d8 | ||
|
|
53108c9ff1 | ||
|
|
82a186e096 | ||
|
|
e467fe9aa6 | ||
|
|
7a1940e1f7 | ||
|
|
6b7c56c909 | ||
|
|
470d30ac23 | ||
|
|
7e87bfd039 | ||
|
|
ab9ccf9eb9 | ||
|
|
15ec013af8 | ||
|
|
748f10c0d6 | ||
|
|
8181d63a95 | ||
|
|
d0e7e69552 | ||
|
|
0558d641f2 | ||
|
|
ac46a4dd58 | ||
|
|
fb56b042c0 | ||
|
|
6298ecc271 | ||
|
|
a26fe08aa6 | ||
|
|
5b2c0f68fe | ||
|
|
e695dd6ead | ||
|
|
953571e3d8 | ||
|
|
01455c3188 | ||
|
|
a5210af823 | ||
|
|
9e42b525ec | ||
|
|
02d69b72f5 | ||
|
|
c998e2e9ef | ||
|
|
a3a85106a1 | ||
|
|
75302a10bd | ||
|
|
2ab0433aca | ||
|
|
e272db0f7f | ||
|
|
3580765ba3 | ||
|
|
cb79d89f83 | ||
|
|
2e178d0f05 | ||
|
|
edf0b171e2 | ||
|
|
148506ede8 | ||
|
|
c0a08d9ca2 | ||
|
|
4802987178 | ||
|
|
1cd7cf9990 | ||
|
|
4830755fac | ||
|
|
124545e1ed | ||
|
|
af01e61c89 | ||
|
|
9400a3b9ef | ||
|
|
6e314ea6d7 | ||
|
|
dfd962a8bc | ||
|
|
cfcbfe1e8f | ||
|
|
0e54f87b18 | ||
|
|
9f5e5b90e5 | ||
|
|
d619ba0857 | ||
|
|
fbea243e56 | ||
|
|
d062386656 | ||
|
|
d2f04f5bdf | ||
|
|
42c8d3ac27 | ||
|
|
d53563ab46 | ||
|
|
3d5f0ee315 | ||
|
|
ecdb7cdc55 | ||
|
|
fd38b752c4 | ||
|
|
64804a2a24 | ||
|
|
b603cb4530 | ||
|
|
8f2c7c0638 | ||
|
|
044ba7697a | ||
|
|
e6bd64b3ea | ||
|
|
56db916833 | ||
|
|
12cf0c4763 | ||
|
|
0a92e0f532 | ||
|
|
e6f9177fdb | ||
|
|
c3f6a4a57a | ||
|
|
653c209253 | ||
|
|
0974075fa0 | ||
|
|
53e1ee3475 | ||
|
|
46affea055 | ||
|
|
0ffe5cf1ff | ||
|
|
d023f9bf2d | ||
|
|
b2832cee8e | ||
|
|
960aa77b6d | ||
|
|
58daa5ed7d | ||
|
|
437e8bd706 | ||
|
|
1a5c7daaf6 | ||
|
|
c1ba4764b5 | ||
|
|
7cb3cb7353 | ||
|
|
604abaf81c | ||
|
|
8b157bb13f | ||
|
|
a8c71dcd20 | ||
|
|
363a8f6282 | ||
|
|
5b314cf1c3 | ||
|
|
02783bd7c6 | ||
|
|
d5c918d258 | ||
|
|
6b044335cd | ||
|
|
cbe20d3740 | ||
|
|
21bc84e837 | ||
|
|
203359ed7f | ||
|
|
24a26a2e94 | ||
|
|
0a7521060a | ||
|
|
6b5a9aa992 | ||
|
|
2dfdaa4d70 | ||
|
|
f2504494fe | ||
|
|
256858d2e5 | ||
|
|
10873bfe35 | ||
|
|
e939f1c1d1 | ||
|
|
b2c8cb655c | ||
|
|
4bdbf02c2d | ||
|
|
f83b2a0940 | ||
|
|
76ec74cbf1 | ||
|
|
8ae5da1472 |
@@ -0,0 +1,17 @@
|
|||||||
|
version: 3.1.{build}
|
||||||
|
branches:
|
||||||
|
only:
|
||||||
|
- dev
|
||||||
|
environment:
|
||||||
|
matrix:
|
||||||
|
- COMPILER: mingw
|
||||||
|
MINGW_DIR: c:\msys64\mingw32
|
||||||
|
|
||||||
|
before_build:
|
||||||
|
- set Path=%MINGW_DIR%\bin;%Path%
|
||||||
|
|
||||||
|
build_script:
|
||||||
|
- set Path=%MINGW_DIR%\bin;c:\msys64\usr\bin;
|
||||||
|
- bash autogen.sh
|
||||||
|
- cd src/lib
|
||||||
|
- make
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
*.sh -crlf
|
||||||
|
*.ac -crlf
|
||||||
|
*.am -crlf
|
||||||
+84
-1
@@ -7,6 +7,7 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc
|
compiler: gcc
|
||||||
|
dist: bionic
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
@@ -15,12 +16,55 @@ matrix:
|
|||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang
|
||||||
|
dist: bionic
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- libpcap-dev
|
- libpcap-dev
|
||||||
- autogen
|
- autogen
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: gcc
|
||||||
|
dist: bionic
|
||||||
|
arch: arm64
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libpcap-dev
|
||||||
|
- autogen
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
compiler: clang
|
||||||
|
dist: bionic
|
||||||
|
arch: arm64
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- libpcap-dev
|
||||||
|
- autogen
|
||||||
|
|
||||||
|
# Targets below have been disabled as we have no way
|
||||||
|
# to debug on tsuch platforms at the moment
|
||||||
|
# - os: linux
|
||||||
|
# compiler: gcc
|
||||||
|
# dist: bionic
|
||||||
|
# arch: s390x
|
||||||
|
# addons:
|
||||||
|
# apt:
|
||||||
|
# packages:
|
||||||
|
# - libpcap-dev
|
||||||
|
# - autogen
|
||||||
|
#
|
||||||
|
# - os: linux
|
||||||
|
# compiler: clang
|
||||||
|
# dist: bionic
|
||||||
|
# arch: s390x
|
||||||
|
# addons:
|
||||||
|
# apt:
|
||||||
|
# packages:
|
||||||
|
# - libpcap-dev
|
||||||
|
# - autogen
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc-8
|
compiler: gcc-8
|
||||||
addons:
|
addons:
|
||||||
@@ -75,6 +119,45 @@ matrix:
|
|||||||
env:
|
env:
|
||||||
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
|
- MATRIX_EVAL="CC=clang-7 && CXX=clang++-7"
|
||||||
|
|
||||||
|
- name: fuzza
|
||||||
|
env: CXXFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link" CFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=address -fsanitize=fuzzer-no-link" LDFLAGS="-g -fsanitize=address" QA_FUZZ=asan CC=clang-7 && CXX=clang++-7 ASAN_SYMBOLIZER_PATH=/usr/local/clang-7.0.0/bin/llvm-symbolizer
|
||||||
|
os: linux
|
||||||
|
compiler: clang-7
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-7
|
||||||
|
packages:
|
||||||
|
- clang-7
|
||||||
|
- libpcap-dev
|
||||||
|
- autogen
|
||||||
|
- name: fuzzm
|
||||||
|
env: CXXFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize=fuzzer-no-link" CFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=memory -fsanitize=fuzzer-no-link" LDFLAGS="-g -fsanitize=memory" QA_FUZZ=msan CC=clang-7 && CXX=clang++-7 MSAN_SYMBOLIZER_PATH=/usr/local/clang-7.0.0/bin/llvm-symbolizer
|
||||||
|
os: linux
|
||||||
|
compiler: clang-7
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-7
|
||||||
|
packages:
|
||||||
|
- clang-7
|
||||||
|
- libpcap-dev
|
||||||
|
- autogen
|
||||||
|
- name: fuzzu
|
||||||
|
env: CXXFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined -fsanitize=fuzzer-no-link" CFLAGS="-g -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -fsanitize=undefined -fno-sanitize-recover=undefined,integer -fsanitize=fuzzer-no-link" LDFLAGS="-g -fsanitize=undefined" QA_FUZZ=ubsan CC=clang-7 && CXX=clang++-7
|
||||||
|
os: linux
|
||||||
|
compiler: clang-7
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
sources:
|
||||||
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-trusty-7
|
||||||
|
packages:
|
||||||
|
- clang-7
|
||||||
|
- libpcap-dev
|
||||||
|
- autogen
|
||||||
|
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
@@ -85,7 +168,7 @@ before_script:
|
|||||||
# - lcov --directory . --zerocounters
|
# - lcov --directory . --zerocounters
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- ./configure
|
- if [ -n "$QA_FUZZ" ]; then ./configure --enable-fuzztargets ; else ./configure ; fi
|
||||||
- make
|
- make
|
||||||
|
|
||||||
#after_script:
|
#after_script:
|
||||||
|
|||||||
+90
-5
@@ -1,5 +1,91 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
#### nDPI 3.2 (February 2020)
|
||||||
|
|
||||||
|
## New Features
|
||||||
|
* New API calls
|
||||||
|
* Protocol detection: ndpi_is_protocol_detected
|
||||||
|
* Categories: ndpi_load_categories_file / ndpi_load_category
|
||||||
|
* JSON/TLV serialization: ndpi_serialize_string_boolean / ndpi_serialize_uint32_boolean
|
||||||
|
* Patricia tree: ndpi_load_ipv4_ptree
|
||||||
|
* Module initialization: ndpi_init_detection_module / ndpi_finalize_initalization
|
||||||
|
* Base64 encoding: ndpi_base64_encode
|
||||||
|
* JSON exprot: ndpi_flow2json
|
||||||
|
* Print protocol: ndpi_get_l4_proto_name / ndpi_get_l4_proto_info
|
||||||
|
* Libfuzz integration
|
||||||
|
* Implemented Community ID hash (API call ndpi_flowv6_flow_hash and ndpi_flowv4_flow_hash)
|
||||||
|
* Detection of RCE in HTTP GET requests via PCRE
|
||||||
|
* Integration of the libinjection library to detect SQL injections and XSS type attacks in HTTP requests
|
||||||
|
|
||||||
|
## New Supported Protocols and Services
|
||||||
|
* TLS
|
||||||
|
* Added ALPN support
|
||||||
|
* Added export of supported version in TLS header
|
||||||
|
* Added Telnet dissector with metadata extraction
|
||||||
|
* Added Zabbix dissector
|
||||||
|
* Added POP3/IMAP metadata extraction
|
||||||
|
* Added FTP user/password extraction
|
||||||
|
* Added NetBIOS metadata extraction
|
||||||
|
* Added Kerberos metadata extraction
|
||||||
|
* Implemented SQL Injection and XSS attack detection
|
||||||
|
* Host-based detection improvements and changes
|
||||||
|
* Added Microsoft range
|
||||||
|
* Added twitch.tv website
|
||||||
|
* Added brasilbandalarga.com.br and .eaqbr.com.br as EAQ
|
||||||
|
* Added 20.180.0.0/14, 20.184.0.0/13 range as Skype
|
||||||
|
* Added 52.84.0.0/14 range as Amazon
|
||||||
|
* Added ^pastebin.com
|
||||||
|
* Changed 13.64.0.0/11 range from Skype to Microsoft
|
||||||
|
* Refreshed Whatsapp server list, added *whatsapp-*.fbcdn.net IPs
|
||||||
|
* Added public DNSoverHTTPS servers
|
||||||
|
|
||||||
|
## Improvements
|
||||||
|
* Reworked and improved the TLS dissector
|
||||||
|
* Reworked Kerberos dissector
|
||||||
|
* Improved DNS response decoding
|
||||||
|
* Support for DNS continuous flow dissection
|
||||||
|
* Improved Python bindings
|
||||||
|
* Improved Ethereum support
|
||||||
|
* Improved categories detection with streaming and HTTP
|
||||||
|
* Support for IP-based detection to compute the application protocol
|
||||||
|
* Renamed protocol 104 to IEC60870 (more meaningful)
|
||||||
|
* Added failed authentication support with FTP
|
||||||
|
* Renamed DNSoverHTTPS to handle bot DoH and DoT
|
||||||
|
* Implemented stacked DPI decoding
|
||||||
|
* Improvements for CapWAP and Bloomberg
|
||||||
|
* Improved SMB dissection
|
||||||
|
* Improved SSH dissection
|
||||||
|
* Added capwap support
|
||||||
|
* Modified API signatures for ndpi_ssl_version2str / ndpi_detection_giveup
|
||||||
|
* Removed ndpi_pref_http_dont_dissect_response / ndpi_pref_dns_dont_dissect_response (replaced by ndpi_extra_dissection_possible)
|
||||||
|
|
||||||
|
## Fixes
|
||||||
|
* Fixed memory invalid access in SMTP and leaks in TLS
|
||||||
|
* Fixed a few memory leaks
|
||||||
|
* Fixrd invalid memory access in a few protocol dissectors (HTTP, memcached, Citrix, STUN, DNS, Amazon Video, TLS, Viber)
|
||||||
|
* Fixed IPv6 address format across the various platforms/distributions
|
||||||
|
* Fixed infinite loop in ndpi_workflow_process_packet
|
||||||
|
* Fixed SHA1 certificate detection
|
||||||
|
* Fixed custom protocol detection
|
||||||
|
* Fixed SMTP dissection (including email)
|
||||||
|
* Fixed Telnet dissection and invalid password report
|
||||||
|
* Fixed invalid category matching in HTTP
|
||||||
|
* Fixed Skype and STUN false positives
|
||||||
|
* Fixed SQL Injection detection
|
||||||
|
* Fixed invalid SMBv1 detection
|
||||||
|
* Fixed SSH dissection
|
||||||
|
* Fixed ndpi_ssl_version2str
|
||||||
|
* Fixed ndpi_extra_dissection_possible
|
||||||
|
* Fixed out of bounds read in ndpi_match_custom_category
|
||||||
|
|
||||||
|
## Misc
|
||||||
|
* ndpiReader
|
||||||
|
* CSV output enhancements
|
||||||
|
* Added tunnelling decapsulation
|
||||||
|
* Improved HTTP reporting
|
||||||
|
|
||||||
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
#### nDPI 3.0 (October 2019)
|
#### nDPI 3.0 (October 2019)
|
||||||
|
|
||||||
## New Features
|
## New Features
|
||||||
@@ -67,7 +153,6 @@
|
|||||||
* Fix DNS rsp_addr missing in some tiny responses
|
* Fix DNS rsp_addr missing in some tiny responses
|
||||||
* Various hardening fixes
|
* Various hardening fixes
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
|
|
||||||
#### nDPI 2.8 (March 2019)
|
#### nDPI 2.8 (March 2019)
|
||||||
@@ -145,10 +230,10 @@
|
|||||||
* Deb and RPM packages: ndpi with shared libraries and binaries, ndpi-dev with headers and static libraries
|
* Deb and RPM packages: ndpi with shared libraries and binaries, ndpi-dev with headers and static libraries
|
||||||
* Protocols now have an optional subprotocol: Spotify cannot have subprotocols, DNS can (DNS.Spotify)
|
* Protocols now have an optional subprotocol: Spotify cannot have subprotocols, DNS can (DNS.Spotify)
|
||||||
* New API functions:
|
* New API functions:
|
||||||
- ndpi_fill_ip_protocol_category to handle ICMP flows category
|
* ndpi_fill_ip_protocol_category to handle ICMP flows category
|
||||||
- ndpi_flowv4_flow_hash and ndpi_flowv6_flow_hash to support the Community ID Flow Hashing (https://github.com/corelight/community-id-spec)
|
* ndpi_flowv4_flow_hash and ndpi_flowv6_flow_hash to support the Community ID Flow Hashing (https://github.com/corelight/community-id-spec)
|
||||||
- ndpi_protocol2id to print the protocol as ID
|
* ndpi_protocol2id to print the protocol as ID
|
||||||
- ndpi_get_custom_category_match to search host in custom categories
|
* ndpi_get_custom_category_match to search host in custom categories
|
||||||
* Changed ndpi_detection_giveup API: guess is now part of the call
|
* Changed ndpi_detection_giveup API: guess is now part of the call
|
||||||
* Added DPDK support to ndpiReader
|
* Added DPDK support to ndpiReader
|
||||||
* Removed Musical.ly protocol (service no longer used)
|
* Removed Musical.ly protocol (service no longer used)
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
SUBDIRS = src/lib example tests
|
SUBDIRS = src/lib example tests
|
||||||
|
|
||||||
|
if BUILD_FUZZTARGETS
|
||||||
|
SUBDIRS += fuzz
|
||||||
|
endif
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = libndpi.pc
|
pkgconfig_DATA = libndpi.pc
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
[](https://travis-ci.org/ntop/nDPI)
|
[](https://travis-ci.org/ntop/nDPI)
|
||||||
[](https://lgtm.com/projects/g/ntop/nDPI/context:cpp)
|
[](https://lgtm.com/projects/g/ntop/nDPI/context:cpp)
|
||||||
[](https://lgtm.com/projects/g/ntop/nDPI/alerts)
|
[](https://lgtm.com/projects/g/ntop/nDPI/alerts)
|
||||||
|
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:ndpi)
|
||||||
|
|
||||||
## What is nDPI ?
|
## What is nDPI ?
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
NDPI_MAJOR="2"
|
NDPI_MAJOR="3"
|
||||||
NDPI_MINOR="9"
|
NDPI_MINOR="2"
|
||||||
NDPI_PATCH="0"
|
NDPI_PATCH="0"
|
||||||
NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
|
NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
|
||||||
|
|
||||||
@@ -45,4 +45,4 @@ cat configure | sed "s/#define PACKAGE/#define NDPI_PACKAGE/g" | sed "s/#define
|
|||||||
cat configure.tmp > configure
|
cat configure.tmp > configure
|
||||||
|
|
||||||
chmod +x configure
|
chmod +x configure
|
||||||
./configure $*
|
./configure "$*"
|
||||||
|
|||||||
+85
-46
@@ -4,6 +4,15 @@ AC_CONFIG_MACRO_DIR([m4])
|
|||||||
|
|
||||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||||
|
|
||||||
|
AC_ARG_WITH(llvm_sanitizer, [ --with-llvm-sanitizer Build with support for the LLVM address sanitizer])
|
||||||
|
|
||||||
|
AS_IF([test "${with_llvm_sanitizer+set}" = set],[
|
||||||
|
CFLAGS="${CFLAGS} -g -O2 -Wno-unused-value -fsanitize=address -fno-omit-frame-pointer"
|
||||||
|
LDFLAGS="${LDFLAGS} -fsanitize=address"
|
||||||
|
CC=clang
|
||||||
|
CXX=clang++
|
||||||
|
])
|
||||||
|
|
||||||
LT_INIT
|
LT_INIT
|
||||||
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
@@ -41,6 +50,7 @@ AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
|
|||||||
|
|
||||||
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h])
|
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h])
|
||||||
|
|
||||||
|
ADDITIONAL_LIBS=
|
||||||
PCAP_HOME=$HOME/PF_RING/userland
|
PCAP_HOME=$HOME/PF_RING/userland
|
||||||
|
|
||||||
DPDK_TARGET=
|
DPDK_TARGET=
|
||||||
@@ -69,6 +79,12 @@ if test $SYSTEM = "Darwin"; then
|
|||||||
CC=clang
|
CC=clang
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
CUSTOM_NDPI=
|
||||||
|
|
||||||
|
if test -d ../nDPI-custom; then :
|
||||||
|
CUSTOM_NDPI="-DCUSTOM_NDPI_PROTOCOLS"
|
||||||
|
AC_MSG_RESULT([Compiling with custom nDPI protocols])
|
||||||
|
fi
|
||||||
|
|
||||||
AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan])
|
AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan])
|
||||||
|
|
||||||
@@ -90,58 +106,80 @@ AS_IF([test "${with_hyperscan+set}" = set],[
|
|||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
|
case "$host" in
|
||||||
echo "Using libpcap from $PCAP_HOME"
|
*-*-mingw32*|*-*-msys)
|
||||||
PCAP_INC="-I $PCAP_HOME/libpcap"
|
CFLAGS="${CFLAGS} -DOS_WIN32"
|
||||||
PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PCAP_HOME/lib/libpfring.a $LIBNUMA `$PCAP_HOME/lib/pfring_config --libs`"
|
LDFLAGS="${LDFLAGS} -lws2_32 -lucrtbase"
|
||||||
|
;;
|
||||||
AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"])
|
*)
|
||||||
AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"])
|
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
|
||||||
# The dlopen() function is in libdl on GLIBC-based systems
|
echo "Using libpcap from $PCAP_HOME"
|
||||||
# and in the C library for *BSD systems
|
PCAP_INC="-I $PCAP_HOME/libpcap"
|
||||||
AC_CHECK_LIB([dl], [dlopen, dlsym], [DL_LIB="-ldl"],
|
PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PCAP_HOME/lib/libpfring.a $LIBNUMA `$PCAP_HOME/lib/pfring_config --libs`"
|
||||||
[AC_CHECK_LIB([c], [dlopen, dlsym], [DL_LIB="-lc"],
|
AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"])
|
||||||
[AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) ]) ])
|
AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"])
|
||||||
else
|
# The dlopen() function is in libdl on GLIBC-based systems
|
||||||
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
|
# and in the C library for *BSD systems
|
||||||
|
AC_CHECK_LIB([dl], [dlopen, dlsym], [DL_LIB="-ldl"],[AC_CHECK_LIB([c], [dlopen, dlsym], [DL_LIB="-lc"],[AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) ]) ])
|
||||||
if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
|
else
|
||||||
echo ""
|
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
|
||||||
echo "ERROR: Missing libpcap(-dev) library required to compile the example application"
|
if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
|
||||||
echo "ERROR: Please install it and try again"
|
echo ""
|
||||||
exit
|
echo "ERROR: Missing libpcap(-dev) library required to compile the example application"
|
||||||
fi
|
echo "ERROR: Please install it and try again"
|
||||||
fi
|
exit
|
||||||
|
fi
|
||||||
dnl> https://github.com/json-c/json-c
|
fi
|
||||||
AC_ARG_ENABLE([json-c],
|
;;
|
||||||
AS_HELP_STRING([--disable-json-c], [Disable json-c support]))
|
esac
|
||||||
|
|
||||||
AS_IF([test "x$enable_json_c" != "xno"], [
|
|
||||||
PKG_CHECK_MODULES([JSONC],[json-c],
|
|
||||||
[
|
|
||||||
CFLAGS="$CFLAGS $JSONC_CFLAGS"
|
|
||||||
LDFLAGS="$LDFLAGS $JSONC_LIBS"
|
|
||||||
AC_CHECK_LIB(json-c, json_object_new_object, AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present]))
|
|
||||||
],
|
|
||||||
[
|
|
||||||
JSONC_HOME="$HOME/json-c"
|
|
||||||
if test -d "$JSONC_HOME"; then :
|
|
||||||
CFLAGS="$CFLAGS -I $JSONC_HOME"
|
|
||||||
LDFLAGS="$LDFLAGS $JSONC_HOME/.libs/libjson-c.a"
|
|
||||||
AC_MSG_RESULT([Found json-c in $JSONC_HOME])
|
|
||||||
AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present])
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([debug-messages],
|
AC_ARG_ENABLE([debug-messages],
|
||||||
AS_HELP_STRING([--enable-debug-messages], [Define NDPI_ENABLE_DEBUG_MESSAGES=1]), [
|
AS_HELP_STRING([--enable-debug-messages], [Define NDPI_ENABLE_DEBUG_MESSAGES=1]), [
|
||||||
AC_DEFINE(NDPI_ENABLE_DEBUG_MESSAGES, 1, [Enable ndpi_debug_messages]) ])
|
AC_DEFINE(NDPI_ENABLE_DEBUG_MESSAGES, 1, [Enable ndpi_debug_messages]) ])
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(fuzztargets,
|
||||||
|
AS_HELP_STRING([--enable-fuzztargets], [Enable fuzz targets]),[enable_fuzztargets=$enableval],[enable_fuzztargets=no])
|
||||||
|
AM_CONDITIONAL([BUILD_FUZZTARGETS], [test "x$enable_fuzztargets" = "xyes"])
|
||||||
|
AS_IF([test "x$enable_fuzztargets" = "xyes"], [
|
||||||
|
AC_PROG_CXX
|
||||||
|
AC_LANG_PUSH(C++)
|
||||||
|
tmp_saved_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||||
|
AS_IF([test "x$LIB_FUZZING_ENGINE" = "x"], [
|
||||||
|
LIB_FUZZING_ENGINE=-fsanitize=fuzzer
|
||||||
|
AC_SUBST(LIB_FUZZING_ENGINE)
|
||||||
|
])
|
||||||
|
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $LIB_FUZZING_ENGINE"
|
||||||
|
AC_MSG_CHECKING([whether $CXX accepts $LIB_FUZZING_ENGINE])
|
||||||
|
AC_LINK_IFELSE([AC_LANG_SOURCE([[
|
||||||
|
#include <sys/types.h>
|
||||||
|
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *Data, size_t Size);
|
||||||
|
extern "C" int LLVMFuzzerTestOneInput(const unsigned char *Data, size_t Size) {
|
||||||
|
(void)Data;
|
||||||
|
(void)Size;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
]])],
|
||||||
|
[ AC_MSG_RESULT(yes)
|
||||||
|
has_sanitizefuzzer=yes],
|
||||||
|
[ AC_MSG_RESULT(no) ]
|
||||||
|
)
|
||||||
|
_AC_LANG_PREFIX[]FLAGS=$tmp_saved_flags
|
||||||
|
AC_LANG_POP()
|
||||||
|
])
|
||||||
|
AM_CONDITIONAL([HAS_FUZZLDFLAGS], [test "x$has_sanitizefuzzer" = "xyes"])
|
||||||
|
|
||||||
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile python/Makefile])
|
dnl> PCRE
|
||||||
|
AC_ARG_WITH(pcre, [ --with-pcre Enable nDPI build with libpcre])
|
||||||
|
if test "${with_pcre+set}" = set; then :
|
||||||
|
AC_CHECK_LIB(pcre, pcre_compile, AC_DEFINE_UNQUOTED(HAVE_PCRE, 1, [libpcre(-dev) is present]))
|
||||||
|
if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then :
|
||||||
|
ADDITIONAL_LIBS=-lpcre
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_CONFIG_FILES([Makefile example/Makefile example/Makefile.dpdk tests/Makefile libndpi.pc src/include/ndpi_define.h src/lib/Makefile python/Makefile fuzz/Makefile])
|
||||||
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
|
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
|
||||||
AC_SUBST(GIT_RELEASE)
|
AC_SUBST(GIT_RELEASE)
|
||||||
AC_SUBST(NDPI_MAJOR)
|
AC_SUBST(NDPI_MAJOR)
|
||||||
@@ -152,8 +190,9 @@ AC_SUBST(SVN_DATE)
|
|||||||
AC_SUBST(JSON_C_LIB)
|
AC_SUBST(JSON_C_LIB)
|
||||||
AC_SUBST(PCAP_INC)
|
AC_SUBST(PCAP_INC)
|
||||||
AC_SUBST(PCAP_LIB)
|
AC_SUBST(PCAP_LIB)
|
||||||
|
AC_SUBST(ADDITIONAL_LIBS)
|
||||||
AC_SUBST(DL_LIB)
|
AC_SUBST(DL_LIB)
|
||||||
AC_SUBST(DPDK_TARGET)
|
AC_SUBST(DPDK_TARGET)
|
||||||
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||||
|
AC_SUBST(CUSTOM_NDPI)
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ include $(RTE_SDK)/mk/rte.vars.mk
|
|||||||
APP = ndpiReader.dpdk
|
APP = ndpiReader.dpdk
|
||||||
LIBNDPI = $(PWD)/../src/lib/libndpi.a
|
LIBNDPI = $(PWD)/../src/lib/libndpi.a
|
||||||
|
|
||||||
SRCS-y := reader_util.c ndpiReader.c
|
SRCS-y := reader_util.c intrusion_detection.c ndpiReader.c
|
||||||
|
|
||||||
CFLAGS += -g
|
CFLAGS += -g
|
||||||
CFLAGS += -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-parameter -I $(PWD)/../src/include @CFLAGS@ -DUSE_DPDK
|
CFLAGS += -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-parameter -I $(PWD)/../src/include @CFLAGS@ -DUSE_DPDK
|
||||||
|
|||||||
+19
-10
@@ -1,25 +1,34 @@
|
|||||||
CC=@CC@
|
CC=@CC@
|
||||||
CXX=@CXX@
|
CXX=@CXX@
|
||||||
CFLAGS=-g -I../src/include @CFLAGS@
|
SRCHOME=../src
|
||||||
LIBNDPI=../src/lib/libndpi.a
|
CFLAGS=-g -fPIC -DPIC -I$(SRCHOME)/include @CFLAGS@
|
||||||
LDFLAGS=$(LIBNDPI) @PCAP_LIB@ -lpthread -lm @LDFLAGS@
|
LIBNDPI=$(SRCHOME)/lib/libndpi.a
|
||||||
OBJS=ndpiReader.o reader_util.o
|
LDFLAGS=$(LIBNDPI) @PCAP_LIB@ @ADDITIONAL_LIBS@ -lpthread -lm @LDFLAGS@
|
||||||
|
HEADERS=intrusion_detection.h reader_util.h $(SRCHOME)/include/ndpi_api.h \
|
||||||
|
$(SRCHOME)/include/ndpi_typedefs.h $(SRCHOME)/include/ndpi_protocol_ids.h
|
||||||
|
OBJS=ndpiReader.o reader_util.o intrusion_detection.o
|
||||||
PREFIX?=@prefix@
|
PREFIX?=@prefix@
|
||||||
|
|
||||||
all: ndpiReader @DPDK_TARGET@
|
all: ndpiReader @DPDK_TARGET@
|
||||||
|
|
||||||
ndpiReader: $(OBJS) $(LIBNDPI)
|
EXECUTABLE_SOURCES := ndpiReader.c
|
||||||
$(CXX) $(CFLAGS) $(OBJS) -o $@ $(LDFLAGS)
|
COMMON_SOURCES := $(filter-out $(EXECUTABLE_SOURCES),$(wildcard *.c ))
|
||||||
|
|
||||||
|
libndpiReader.a: $(COMMON_SOURCES:%.c=%.o) $(LIBNDPI)
|
||||||
|
ar rsv libndpiReader.a $(COMMON_SOURCES:%.c=%.o)
|
||||||
|
|
||||||
|
ndpiReader: libndpiReader.a $(LIBNDPI) $(EXECUTABLE_SOURCES:%.c=%.o)
|
||||||
|
$(CXX) $(CFLAGS) $(EXECUTABLE_SOURCES:%.c=%.o) libndpiReader.a -o $@ $(LDFLAGS)
|
||||||
|
|
||||||
%.o: %.c $(HEADERS) Makefile
|
%.o: %.c $(HEADERS) Makefile
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
install:
|
install:
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/bin/
|
mkdir -p $(DESTDIR)$(PREFIX)/bin/
|
||||||
mkdir -p $(DESTDIR)$(PREFIX)/sbin/ndpi
|
mkdir -p $(DESTDIR)$(PREFIX)/share/ndpi
|
||||||
cp ndpiReader $(DESTDIR)$(PREFIX)/bin/
|
cp ndpiReader $(DESTDIR)$(PREFIX)/bin/
|
||||||
cp protos.txt $(DESTDIR)$(PREFIX)/sbin/ndpi/ndpiProtos.txt
|
cp protos.txt $(DESTDIR)$(PREFIX)/share/ndpi/ndpiProtos.txt
|
||||||
cp mining_hosts.txt $(DESTDIR)$(PREFIX)/sbin/ndpi/ndpiCustomCategory.txt
|
cp mining_hosts.txt $(DESTDIR)$(PREFIX)/share/ndpi/ndpiCustomCategory.txt
|
||||||
[ -f build/app/ndpiReader.dpdk ] && cp build/app/ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
|
[ -f build/app/ndpiReader.dpdk ] && cp build/app/ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
|
||||||
[ -f ndpiReader.dpdk ] && cp ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
|
[ -f ndpiReader.dpdk ] && cp ndpiReader.dpdk $(DESTDIR)$(PREFIX)/bin/ || true
|
||||||
|
|
||||||
@@ -27,7 +36,7 @@ dpdk:
|
|||||||
make -f Makefile.dpdk
|
make -f Makefile.dpdk
|
||||||
|
|
||||||
check:
|
check:
|
||||||
cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I../src/include -I/usr/local/include/json-c *.c
|
cppcheck --template='{file}:{line}:{severity}:{message}' --quiet --enable=all --force -I$(SRCHOME)/include *.c
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f *.o ndpiReader ndpiReader.dpdk
|
/bin/rm -f *.o ndpiReader ndpiReader.dpdk
|
||||||
|
|||||||
@@ -0,0 +1,468 @@
|
|||||||
|
/*
|
||||||
|
* intrusion_detection.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011-19 - ntop.org
|
||||||
|
*
|
||||||
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
*
|
||||||
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* nDPI is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "intrusion_detection.h"
|
||||||
|
|
||||||
|
double normalize(ndpi_norm_value* tresholds){
|
||||||
|
if(tresholds->upper_bound != tresholds->lower_bound){
|
||||||
|
tresholds->norm_value = (tresholds->value - tresholds->lower_bound) / (tresholds->upper_bound - tresholds->lower_bound);
|
||||||
|
}else{
|
||||||
|
if(tresholds->value > tresholds->upper_bound){
|
||||||
|
tresholds->norm_value = 1 + (tresholds->value - tresholds->lower_bound) / tresholds->upper_bound;
|
||||||
|
}else{
|
||||||
|
tresholds->norm_value = 1 - (tresholds->value - tresholds->lower_bound) / tresholds->upper_bound;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(tresholds->norm_value >= 0){
|
||||||
|
return tresholds->norm_value * tresholds->weight;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return (1 - tresholds->norm_value) * tresholds->weight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
double get_flow_score(ndpi_norm_value* scores, int n_metrics){
|
||||||
|
double flow_score = 0;
|
||||||
|
for(int i=0; i<n_metrics; i++){
|
||||||
|
flow_score += normalize(&scores[i]);
|
||||||
|
}
|
||||||
|
return flow_score;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
double Ddos_score(struct ndpi_flow_info* flow){
|
||||||
|
double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0;
|
||||||
|
int n_metrics = 6;
|
||||||
|
ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value));
|
||||||
|
/* pktlen_c_to_s_avg */
|
||||||
|
int i = 0;
|
||||||
|
scores[i].lower_bound = 70.0;
|
||||||
|
scores[i].upper_bound = 263.4799999999999;
|
||||||
|
scores[i].weight = 0.21257330032661592;
|
||||||
|
scores[i].value = ndpi_data_average(flow->pktlen_c_to_s);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_max */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 90.0;
|
||||||
|
scores[i].upper_bound = 2974.0;
|
||||||
|
scores[i].weight = 0.21073785073559176;
|
||||||
|
scores[i].value = ndpi_data_max(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_avg */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 72.7;
|
||||||
|
scores[i].upper_bound = 1130.4199999999996;
|
||||||
|
scores[i].weight = 0.21257330032661592;
|
||||||
|
scores[i].value = ndpi_data_average(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_stddev */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 906.0;
|
||||||
|
scores[i].weight = 0.20990954527912953;
|
||||||
|
scores[i].value = ndpi_data_stddev(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* fin */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.07710300166602348;
|
||||||
|
scores[i].value = flow->fin_count;
|
||||||
|
|
||||||
|
/* s_to_c_fin */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.07710300166602348;
|
||||||
|
scores[i].value = flow->dst2src_fin_count;
|
||||||
|
|
||||||
|
// sum = 1.0
|
||||||
|
double flow_score = get_flow_score(scores, n_metrics);
|
||||||
|
free(scores);
|
||||||
|
return flow_score;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Dos_goldeneye_score(struct ndpi_flow_info* flow){
|
||||||
|
double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0;
|
||||||
|
int n_metrics = 6;
|
||||||
|
ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value));
|
||||||
|
/* pktlen_s_to_c_max */
|
||||||
|
int i = 0;
|
||||||
|
scores[i].lower_bound = 74.0;
|
||||||
|
scores[i].upper_bound = 3292.6699999999764;
|
||||||
|
scores[i].weight = 0.3123007140611667;
|
||||||
|
scores[i].value = ndpi_data_max(flow->pktlen_s_to_c);
|
||||||
|
/* pktlen_s_to_c_avg */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 68.7;
|
||||||
|
scores[i].upper_bound = 1354.0569999999987;
|
||||||
|
scores[i].weight = 0.23802038891633356;
|
||||||
|
scores[i].value = ndpi_data_average(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_stddev */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 959.4469999999993;
|
||||||
|
scores[i].weight = 0.3111779763775991;
|
||||||
|
scores[i].value = ndpi_data_stddev(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* syn */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.0464364305923564;
|
||||||
|
scores[i].value = flow->syn_count;
|
||||||
|
|
||||||
|
/* c_to_s_syn */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 1.0;
|
||||||
|
scores[i].weight = 0.04562805946018772;
|
||||||
|
scores[i].value = flow->src2dst_syn_count;
|
||||||
|
|
||||||
|
/* s_to_c_syn */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.0464364305923564;
|
||||||
|
scores[i].value = flow->dst2src_syn_count;
|
||||||
|
|
||||||
|
// sum = 0.9999999999999998
|
||||||
|
double flow_score = get_flow_score(scores, n_metrics);
|
||||||
|
free(scores);
|
||||||
|
return flow_score;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Dos_hulk_score(struct ndpi_flow_info* flow){
|
||||||
|
double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0;
|
||||||
|
int n_metrics = 6;
|
||||||
|
ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value));
|
||||||
|
/* duration */
|
||||||
|
int i = 0;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 539.40668006422;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = (l - f);
|
||||||
|
|
||||||
|
/* src2dst_packets */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 2.0;
|
||||||
|
scores[i].upper_bound = 41.0;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = flow->src2dst_packets;
|
||||||
|
|
||||||
|
/* dst2src_packets */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 2.0;
|
||||||
|
scores[i].upper_bound = 45.0;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = flow->dst2src_packets;
|
||||||
|
|
||||||
|
/* src2dst_bytes */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 146.0;
|
||||||
|
scores[i].upper_bound = 6306.300000000001;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = flow->src2dst_bytes;
|
||||||
|
|
||||||
|
/* ack */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 82.0;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = flow->ack_count;
|
||||||
|
|
||||||
|
/* syn */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = flow->syn_count;
|
||||||
|
|
||||||
|
// sum = 0.9999999999999999
|
||||||
|
double flow_score = get_flow_score(scores, n_metrics);
|
||||||
|
free(scores);
|
||||||
|
return flow_score;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Dos_slow_score(struct ndpi_flow_info* flow){
|
||||||
|
double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0;
|
||||||
|
int n_metrics = 6;
|
||||||
|
ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value));
|
||||||
|
/* pktlen_s_to_c_max */
|
||||||
|
int i = 0;
|
||||||
|
scores[i].lower_bound = 90.0;
|
||||||
|
scores[i].upper_bound = 3135.0;
|
||||||
|
scores[i].weight = 0.1760747755022144;
|
||||||
|
scores[i].value = ndpi_data_max(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_avg */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 80.37100000000001;
|
||||||
|
scores[i].upper_bound = 1292.5900000000008;
|
||||||
|
scores[i].weight = 0.17600137023171597;
|
||||||
|
scores[i].value = ndpi_data_average(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* dst2src_bytes */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 262.0;
|
||||||
|
scores[i].upper_bound = 53227.80000000002;
|
||||||
|
scores[i].weight = 0.16919914849886225;
|
||||||
|
scores[i].value = flow->dst2src_bytes;
|
||||||
|
|
||||||
|
/* syn */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.168000195747388;
|
||||||
|
scores[i].value = flow->syn_count;
|
||||||
|
|
||||||
|
/* c_to_s_syn */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 1.0;
|
||||||
|
scores[i].weight = 0.14272431427243143;
|
||||||
|
scores[i].value = flow->src2dst_syn_count;
|
||||||
|
|
||||||
|
/* s_to_c_syn */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.168000195747388;
|
||||||
|
scores[i].value = flow->dst2src_syn_count;
|
||||||
|
|
||||||
|
// sum = 1.0
|
||||||
|
double flow_score = get_flow_score(scores, n_metrics);
|
||||||
|
free(scores);
|
||||||
|
return flow_score;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Ftp_patator_score(struct ndpi_flow_info* flow){
|
||||||
|
double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0;
|
||||||
|
int n_metrics = 6;
|
||||||
|
ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value));
|
||||||
|
/* iat_flow_min */
|
||||||
|
int i = 0;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 24.0;
|
||||||
|
scores[i].weight = 0.002732919254658385;
|
||||||
|
scores[i].value = ndpi_data_min(flow->iat_flow);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_max */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 90.0;
|
||||||
|
scores[i].upper_bound = 3393.0;
|
||||||
|
scores[i].weight = 0.007453416149068323;
|
||||||
|
scores[i].value = ndpi_data_max(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_avg */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 81.3;
|
||||||
|
scores[i].upper_bound = 1315.021;
|
||||||
|
scores[i].weight = 0.9833540372670807;
|
||||||
|
scores[i].value = ndpi_data_average(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* dst2src_bytes */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 256.0;
|
||||||
|
scores[i].upper_bound = 56434.0;
|
||||||
|
scores[i].weight = 0.0034782608695652175;
|
||||||
|
scores[i].value = flow->dst2src_bytes;
|
||||||
|
|
||||||
|
/* fin */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.0014906832298136647;
|
||||||
|
scores[i].value = flow->fin_count;
|
||||||
|
|
||||||
|
/* rst */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.0014906832298136647;
|
||||||
|
scores[i].value = flow->rst_count;
|
||||||
|
|
||||||
|
// sum = 1.0
|
||||||
|
double flow_score = get_flow_score(scores, n_metrics);
|
||||||
|
free(scores);
|
||||||
|
return flow_score;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Hearthbleed_score(struct ndpi_flow_info* flow){
|
||||||
|
double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0;
|
||||||
|
int n_metrics = 6;
|
||||||
|
ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value));
|
||||||
|
/* iat_flow_max */
|
||||||
|
int i = 0;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 595213.3999999999;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = ndpi_data_max(flow->iat_flow);
|
||||||
|
|
||||||
|
/* iat_flow_stddev */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 245377.74799999973;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = ndpi_data_stddev(flow->iat_flow);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_max */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 74.0;
|
||||||
|
scores[i].upper_bound = 3380.0;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = ndpi_data_max(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_avg */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 70.0;
|
||||||
|
scores[i].upper_bound = 1344.6399999999996;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = ndpi_data_average(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_stddev */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 944.6399999999996;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = ndpi_data_stddev(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* duration */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 711.6677598000391;
|
||||||
|
scores[i].weight = 0.16666666666666666;
|
||||||
|
scores[i].value = (l - f);
|
||||||
|
|
||||||
|
// sum = 0.9999999999999999
|
||||||
|
double flow_score = get_flow_score(scores, n_metrics);
|
||||||
|
free(scores);
|
||||||
|
return flow_score;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Infiltration_score(struct ndpi_flow_info* flow){
|
||||||
|
double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0;
|
||||||
|
int n_metrics = 6;
|
||||||
|
ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value));
|
||||||
|
/* pktlen_c_to_s_max */
|
||||||
|
int i = 0;
|
||||||
|
scores[i].lower_bound = 72.0;
|
||||||
|
scores[i].upper_bound = 1840.739999999998;
|
||||||
|
scores[i].weight = 0.11937557392102846;
|
||||||
|
scores[i].value = ndpi_data_max(flow->pktlen_c_to_s);
|
||||||
|
|
||||||
|
/* pktlen_c_to_s_avg */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 70.0;
|
||||||
|
scores[i].upper_bound = 296.56599999999816;
|
||||||
|
scores[i].weight = 0.12526782981328435;
|
||||||
|
scores[i].value = ndpi_data_average(flow->pktlen_c_to_s);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_max */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 90.0;
|
||||||
|
scores[i].upper_bound = 3496.1399999999776;
|
||||||
|
scores[i].weight = 0.13927150290786652;
|
||||||
|
scores[i].value = ndpi_data_max(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* pktlen_s_to_c_avg */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 72.6;
|
||||||
|
scores[i].upper_bound = 1367.7959999999991;
|
||||||
|
scores[i].weight = 0.12182430364248545;
|
||||||
|
scores[i].value = ndpi_data_average(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
|
/* src2dst_bytes */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 144.0;
|
||||||
|
scores[i].upper_bound = 7847.69999999999;
|
||||||
|
scores[i].weight = 0.12059993878175697;
|
||||||
|
scores[i].value = flow->src2dst_bytes;
|
||||||
|
|
||||||
|
/* dst2src_bytes */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 236.0;
|
||||||
|
scores[i].upper_bound = 74486.7799999998;
|
||||||
|
scores[i].weight = 0.3736608509335782;
|
||||||
|
scores[i].value = flow->dst2src_bytes;
|
||||||
|
|
||||||
|
// sum = 1.0
|
||||||
|
double flow_score = get_flow_score(scores, n_metrics);
|
||||||
|
free(scores);
|
||||||
|
return flow_score;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Ssh_patator_score(struct ndpi_flow_info* flow){
|
||||||
|
double f = (double)flow->first_seen/1000.0, l = (double)flow->last_seen/1000.0;
|
||||||
|
int n_metrics = 6;
|
||||||
|
ndpi_norm_value* scores = malloc(n_metrics * sizeof(ndpi_norm_value));
|
||||||
|
/* fin */
|
||||||
|
int i = 0;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.0033738191632928477;
|
||||||
|
scores[i].value = flow->fin_count;
|
||||||
|
|
||||||
|
/* psh */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 30.0;
|
||||||
|
scores[i].weight = 0.33076923076923076;
|
||||||
|
scores[i].value = flow->psh_count;
|
||||||
|
|
||||||
|
/* c_to_s_syn */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 1.0;
|
||||||
|
scores[i].weight = 0.0004048582995951417;
|
||||||
|
scores[i].value = flow->src2dst_syn_count;
|
||||||
|
|
||||||
|
/* c_to_s_psh */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 12.0;
|
||||||
|
scores[i].weight = 0.33130904183535764;
|
||||||
|
scores[i].value = flow->src2dst_psh_count;
|
||||||
|
|
||||||
|
/* s_to_c_fin */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 2.0;
|
||||||
|
scores[i].weight = 0.0033738191632928477;
|
||||||
|
scores[i].value = flow->dst2src_fin_count;
|
||||||
|
|
||||||
|
/* s_to_c_psh */
|
||||||
|
i++;
|
||||||
|
scores[i].lower_bound = 0.0;
|
||||||
|
scores[i].upper_bound = 30.0;
|
||||||
|
scores[i].weight = 0.33076923076923076;
|
||||||
|
scores[i].value = flow->dst2src_psh_count;
|
||||||
|
|
||||||
|
// sum = 1.0
|
||||||
|
double flow_score = get_flow_score(scores, n_metrics);
|
||||||
|
free(scores);
|
||||||
|
return flow_score;
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* intrusion_detection.h
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011-19 - ntop.org
|
||||||
|
*
|
||||||
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
*
|
||||||
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* nDPI is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _INTRUSION_DETECTION_H_
|
||||||
|
#define _INTRUSION_DETECTION_H_
|
||||||
|
|
||||||
|
/*
|
||||||
|
Code to detect attacks reported in
|
||||||
|
|
||||||
|
https://www.unb.ca/cic/datasets/ids-2017.html
|
||||||
|
https://www.unb.ca/cic/datasets/ids-2018.html
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "reader_util.h"
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
typedef struct norm_values{
|
||||||
|
double upper_bound;
|
||||||
|
double lower_bound;
|
||||||
|
double weight;
|
||||||
|
double value;
|
||||||
|
double norm_value;
|
||||||
|
}ndpi_norm_value;
|
||||||
|
|
||||||
|
double normalize(ndpi_norm_value* tresholds);
|
||||||
|
|
||||||
|
double get_flow_score(ndpi_norm_value* scores, int n_metrics);
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
double Ddos_score(struct ndpi_flow_info* flow);
|
||||||
|
|
||||||
|
double Dos_goldeneye_score(struct ndpi_flow_info* flow);
|
||||||
|
|
||||||
|
double Dos_hulk_score(struct ndpi_flow_info* flow);
|
||||||
|
|
||||||
|
double Dos_slow_score(struct ndpi_flow_info* flow);
|
||||||
|
|
||||||
|
double Ftp_patator_score(struct ndpi_flow_info* flow);
|
||||||
|
|
||||||
|
double Hearthbleed_score(struct ndpi_flow_info* flow);
|
||||||
|
|
||||||
|
double Infiltration_score(struct ndpi_flow_info* flow);
|
||||||
|
|
||||||
|
double Ssh_patator_score(struct ndpi_flow_info* flow);
|
||||||
|
|
||||||
|
#endif /* _INTRUSION_DETECTION_H_ */
|
||||||
Executable
+136
@@ -0,0 +1,136 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
#
|
||||||
|
# Copyright (C) 2019 - ntop.org
|
||||||
|
#
|
||||||
|
# nDPI is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# nDPI is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Lesser General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU Lesser General Public License
|
||||||
|
# along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Usage
|
||||||
|
#
|
||||||
|
# 1) Generate a CSV file using the ndpiReader tool. Example:
|
||||||
|
# ./ndpiReader -C sample.json -i sample.pcap
|
||||||
|
#
|
||||||
|
# 2) Open Google Chrome and type in the URL 'chrome://tracing/'
|
||||||
|
#
|
||||||
|
# 3) Inside Chrome click on 'Load' or drop sample.json in the
|
||||||
|
# Chrome window to visualize the output
|
||||||
|
#
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import json
|
||||||
|
|
||||||
|
protos = {}
|
||||||
|
lastId = 1
|
||||||
|
|
||||||
|
def get_timestamp(seen):
|
||||||
|
tok = seen.split(".")
|
||||||
|
return int(tok[0]) * 1000 + int(tok[1])
|
||||||
|
|
||||||
|
def get_record(toks, csv_fields):
|
||||||
|
global protos
|
||||||
|
global lastId
|
||||||
|
|
||||||
|
if len(toks) < 11:
|
||||||
|
return None
|
||||||
|
|
||||||
|
record = dict()
|
||||||
|
ndpiProtocol = toks[10]
|
||||||
|
|
||||||
|
ndpi_protos = ndpiProtocol.split(".")
|
||||||
|
if(len(ndpi_protos) == 1):
|
||||||
|
app_proto = ndpi_protos[0]
|
||||||
|
else:
|
||||||
|
app_proto = ndpi_protos[1]
|
||||||
|
|
||||||
|
id = protos.get(ndpiProtocol)
|
||||||
|
if(id == None):
|
||||||
|
lastId = lastId + 1
|
||||||
|
protos[ndpiProtocol] = lastId
|
||||||
|
id = lastId
|
||||||
|
#print(ndpiProtocol+"="+str(id))
|
||||||
|
|
||||||
|
ip_address = toks[5]
|
||||||
|
server_name = toks[11]
|
||||||
|
record["cat"] = "flow"
|
||||||
|
record["pid"] = ip_address
|
||||||
|
record["tid"] = ndpiProtocol # id
|
||||||
|
record["ts"] = get_timestamp(toks[2])
|
||||||
|
record["ph"] = "X"
|
||||||
|
record["name"] = app_proto
|
||||||
|
|
||||||
|
if(server_name == ""):
|
||||||
|
args = {}
|
||||||
|
else:
|
||||||
|
args = { "name": server_name }
|
||||||
|
record["args"] = args
|
||||||
|
record["dur"] = get_timestamp(toks[3]) - record["ts"]
|
||||||
|
|
||||||
|
# if we do not have the legend we just return
|
||||||
|
if csv_fields is None:
|
||||||
|
return record
|
||||||
|
|
||||||
|
# Otherwise we just add everything we find as a string
|
||||||
|
if(0):
|
||||||
|
idx = 0
|
||||||
|
for tok in toks:
|
||||||
|
name = csv_fields[idx]
|
||||||
|
idx += 1
|
||||||
|
record["args"][name] = str(tok)
|
||||||
|
|
||||||
|
return record
|
||||||
|
|
||||||
|
def get_record_dict(filename):
|
||||||
|
csv_fields = None
|
||||||
|
records = []
|
||||||
|
fin = open(filename, "r");
|
||||||
|
for line in fin:
|
||||||
|
line = line.replace("\n","")
|
||||||
|
|
||||||
|
# Get the legend if present
|
||||||
|
if line[0] == '#':
|
||||||
|
csv_fields = []
|
||||||
|
line = line.replace("#", "")
|
||||||
|
toks = line.split(",")
|
||||||
|
for tok in toks:
|
||||||
|
csv_fields.append(tok)
|
||||||
|
continue
|
||||||
|
|
||||||
|
toks = line.split(",")
|
||||||
|
flow_id = int(toks[0])
|
||||||
|
record = get_record(toks, csv_fields)
|
||||||
|
if record is None:
|
||||||
|
print("Error while parsing " + line)
|
||||||
|
continue
|
||||||
|
|
||||||
|
records.append(record)
|
||||||
|
|
||||||
|
json_dict = dict()
|
||||||
|
json_dict["traceEvents"] = records
|
||||||
|
|
||||||
|
return json_dict
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) != 3:
|
||||||
|
print("ndpi2json <csv_file> <json_file>")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
|
record_dict = get_record_dict(sys.argv[1])
|
||||||
|
#print(record_dict)
|
||||||
|
#json_string = json.dumps(json_dict)
|
||||||
|
#print(json_string)
|
||||||
|
|
||||||
|
with open(sys.argv[2], 'w') as fp:
|
||||||
|
json.dump(record_dict, fp)
|
||||||
|
print("Written " + str(len(record_dict["traceEvents"])) + " records")
|
||||||
+399
-1331
File diff suppressed because it is too large
Load Diff
+345
-124
@@ -69,7 +69,8 @@
|
|||||||
/* mask for Bad FCF presence */
|
/* mask for Bad FCF presence */
|
||||||
#define BAD_FCS 0x50 /* 0101 0000 */
|
#define BAD_FCS 0x50 /* 0101 0000 */
|
||||||
|
|
||||||
#define GTP_U_V1_PORT 2152
|
#define GTP_U_V1_PORT 2152
|
||||||
|
#define NDPI_CAPWAP_DATA_PORT 5247
|
||||||
#define TZSP_PORT 37008
|
#define TZSP_PORT 37008
|
||||||
|
|
||||||
#ifndef DLT_LINUX_SLL
|
#ifndef DLT_LINUX_SLL
|
||||||
@@ -123,7 +124,6 @@ void ndpi_analyze_payload(struct ndpi_flow_info *flow,
|
|||||||
u_int16_t payload_len,
|
u_int16_t payload_len,
|
||||||
u_int32_t packet_id) {
|
u_int32_t packet_id) {
|
||||||
struct payload_stats *ret;
|
struct payload_stats *ret;
|
||||||
u_int i;
|
|
||||||
struct flow_id_stats *f;
|
struct flow_id_stats *f;
|
||||||
struct packet_id_stats *p;
|
struct packet_id_stats *p;
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ void ndpi_payload_analyzer(struct ndpi_flow_info *flow,
|
|||||||
u_int16_t i, j;
|
u_int16_t i, j;
|
||||||
u_int16_t scan_len = ndpi_min(max_packet_payload_dissection, payload_len);
|
u_int16_t scan_len = ndpi_min(max_packet_payload_dissection, payload_len);
|
||||||
|
|
||||||
if((flow->entropy.src2dst_pkt_count+flow->entropy.dst2src_pkt_count) <= max_num_packets_per_flow) {
|
if((flow->src2dst_packets+flow->dst2src_packets) <= max_num_packets_per_flow) {
|
||||||
#ifdef DEBUG_PAYLOAD
|
#ifdef DEBUG_PAYLOAD
|
||||||
printf("[hashval: %u][proto: %u][vlan: %u][%s:%u <-> %s:%u][direction: %s][payload_len: %u]\n",
|
printf("[hashval: %u][proto: %u][vlan: %u][%s:%u <-> %s:%u][direction: %s][payload_len: %u]\n",
|
||||||
flow->hashval, flow->protocol, flow->vlan_id,
|
flow->hashval, flow->protocol, flow->vlan_id,
|
||||||
@@ -306,8 +306,6 @@ void ndpi_report_payload_stats() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ***************************************************** */
|
/* ***************************************************** */
|
||||||
|
|
||||||
void ndpi_free_flow_info_half(struct ndpi_flow_info *flow) {
|
void ndpi_free_flow_info_half(struct ndpi_flow_info *flow) {
|
||||||
@@ -413,7 +411,7 @@ struct ndpi_workflow* ndpi_workflow_init(const struct ndpi_workflow_prefs * pref
|
|||||||
set_ndpi_flow_malloc(NULL), set_ndpi_flow_free(NULL);
|
set_ndpi_flow_malloc(NULL), set_ndpi_flow_free(NULL);
|
||||||
|
|
||||||
/* TODO: just needed here to init ndpi malloc wrapper */
|
/* TODO: just needed here to init ndpi malloc wrapper */
|
||||||
module = ndpi_init_detection_module();
|
module = ndpi_init_detection_module(ndpi_no_prefs);
|
||||||
|
|
||||||
if(module == NULL) {
|
if(module == NULL) {
|
||||||
NDPI_LOG(0, NULL, NDPI_LOG_ERROR, "global structure initialization failed\n");
|
NDPI_LOG(0, NULL, NDPI_LOG_ERROR, "global structure initialization failed\n");
|
||||||
@@ -457,7 +455,29 @@ void ndpi_flow_info_freer(void *node) {
|
|||||||
struct ndpi_flow_info *flow = (struct ndpi_flow_info*)node;
|
struct ndpi_flow_info *flow = (struct ndpi_flow_info*)node;
|
||||||
|
|
||||||
ndpi_free_flow_info_half(flow);
|
ndpi_free_flow_info_half(flow);
|
||||||
|
ndpi_free_flow_data_analysis(flow);
|
||||||
|
|
||||||
|
if(flow->ssh_tls.server_names) {
|
||||||
|
ndpi_free(flow->ssh_tls.server_names);
|
||||||
|
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.tls_supported_versions) {
|
||||||
|
ndpi_free(flow->ssh_tls.tls_supported_versions);
|
||||||
|
flow->ssh_tls.tls_supported_versions = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
ndpi_free(flow);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ***************************************************** */
|
||||||
|
|
||||||
|
void ndpi_free_flow_data_analysis(struct ndpi_flow_info *flow) {
|
||||||
if(flow->iat_c_to_s) ndpi_free_data_analysis(flow->iat_c_to_s);
|
if(flow->iat_c_to_s) ndpi_free_data_analysis(flow->iat_c_to_s);
|
||||||
if(flow->iat_s_to_c) ndpi_free_data_analysis(flow->iat_s_to_c);
|
if(flow->iat_s_to_c) ndpi_free_data_analysis(flow->iat_s_to_c);
|
||||||
|
|
||||||
@@ -465,8 +485,6 @@ void ndpi_flow_info_freer(void *node) {
|
|||||||
if(flow->pktlen_s_to_c) ndpi_free_data_analysis(flow->pktlen_s_to_c);
|
if(flow->pktlen_s_to_c) ndpi_free_data_analysis(flow->pktlen_s_to_c);
|
||||||
|
|
||||||
if(flow->iat_flow) ndpi_free_data_analysis(flow->iat_flow);
|
if(flow->iat_flow) ndpi_free_data_analysis(flow->iat_flow);
|
||||||
|
|
||||||
ndpi_free(flow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ***************************************************** */
|
/* ***************************************************** */
|
||||||
@@ -532,10 +550,6 @@ int ndpi_workflow_node_cmp(const void *a, const void *b) {
|
|||||||
static void
|
static void
|
||||||
ndpi_flow_update_byte_count(struct ndpi_flow_info *flow, const void *x,
|
ndpi_flow_update_byte_count(struct ndpi_flow_info *flow, const void *x,
|
||||||
unsigned int len, u_int8_t src_to_dst_direction) {
|
unsigned int len, u_int8_t src_to_dst_direction) {
|
||||||
const unsigned char *data = x;
|
|
||||||
u_int32_t i;
|
|
||||||
u_int32_t current_count = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* implementation note: The spec says that 4000 octets is enough of a
|
* implementation note: The spec says that 4000 octets is enough of a
|
||||||
* sample size to accurately reflect the byte distribution. Also, to avoid
|
* sample size to accurately reflect the byte distribution. Also, to avoid
|
||||||
@@ -545,6 +559,8 @@ ndpi_flow_update_byte_count(struct ndpi_flow_info *flow, const void *x,
|
|||||||
|
|
||||||
if((flow->entropy.src2dst_pkt_count+flow->entropy.dst2src_pkt_count) <= max_num_packets_per_flow) {
|
if((flow->entropy.src2dst_pkt_count+flow->entropy.dst2src_pkt_count) <= max_num_packets_per_flow) {
|
||||||
/* octet count was already incremented before processing this payload */
|
/* octet count was already incremented before processing this payload */
|
||||||
|
u_int32_t current_count;
|
||||||
|
|
||||||
if(src_to_dst_direction) {
|
if(src_to_dst_direction) {
|
||||||
current_count = flow->entropy.src2dst_l4_bytes - len;
|
current_count = flow->entropy.src2dst_l4_bytes - len;
|
||||||
} else {
|
} else {
|
||||||
@@ -552,6 +568,9 @@ ndpi_flow_update_byte_count(struct ndpi_flow_info *flow, const void *x,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(current_count < ETTA_MIN_OCTETS) {
|
if(current_count < ETTA_MIN_OCTETS) {
|
||||||
|
u_int32_t i;
|
||||||
|
const unsigned char *data = x;
|
||||||
|
|
||||||
for(i=0; i<len; i++) {
|
for(i=0; i<len; i++) {
|
||||||
if(src_to_dst_direction) {
|
if(src_to_dst_direction) {
|
||||||
flow->entropy.src2dst_byte_count[data[i]]++;
|
flow->entropy.src2dst_byte_count[data[i]]++;
|
||||||
@@ -580,11 +599,13 @@ static void
|
|||||||
ndpi_flow_update_byte_dist_mean_var(ndpi_flow_info_t *flow, const void *x,
|
ndpi_flow_update_byte_dist_mean_var(ndpi_flow_info_t *flow, const void *x,
|
||||||
unsigned int len, u_int8_t src_to_dst_direction) {
|
unsigned int len, u_int8_t src_to_dst_direction) {
|
||||||
const unsigned char *data = x;
|
const unsigned char *data = x;
|
||||||
double delta;
|
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
if((flow->entropy.src2dst_pkt_count+flow->entropy.dst2src_pkt_count) <= max_num_packets_per_flow) {
|
if((flow->entropy.src2dst_pkt_count+flow->entropy.dst2src_pkt_count) <= max_num_packets_per_flow) {
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
for(i=0; i<len; i++) {
|
for(i=0; i<len; i++) {
|
||||||
|
double delta;
|
||||||
|
|
||||||
if(src_to_dst_direction) {
|
if(src_to_dst_direction) {
|
||||||
flow->entropy.src2dst_num_bytes += 1;
|
flow->entropy.src2dst_num_bytes += 1;
|
||||||
delta = ((double)data[i] - flow->entropy.src2dst_bd_mean);
|
delta = ((double)data[i] - flow->entropy.src2dst_bd_mean);
|
||||||
@@ -606,33 +627,16 @@ float ndpi_flow_get_byte_count_entropy(const uint32_t byte_count[256],
|
|||||||
unsigned int num_bytes)
|
unsigned int num_bytes)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
float tmp, sum = 0.0;
|
float sum = 0.0;
|
||||||
|
|
||||||
for(i=0; i<256; i++) {
|
for(i=0; i<256; i++) {
|
||||||
tmp = (float) byte_count[i] / (float) num_bytes;
|
float tmp = (float) byte_count[i] / (float) num_bytes;
|
||||||
|
|
||||||
if(tmp > FLT_EPSILON) {
|
if(tmp > FLT_EPSILON) {
|
||||||
sum -= tmp * logf(tmp);
|
sum -= tmp * logf(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sum / logf(2.0);
|
return(sum / logf(2.0));
|
||||||
}
|
|
||||||
|
|
||||||
/* ***************************************************** */
|
|
||||||
|
|
||||||
static void patchIPv6Address(char *str) {
|
|
||||||
int i = 0, j = 0;
|
|
||||||
|
|
||||||
while(str[i] != '\0') {
|
|
||||||
if((str[i] == ':')
|
|
||||||
&& (str[i+1] == '0')
|
|
||||||
&& (str[i+2] == ':')) {
|
|
||||||
str[j++] = ':';
|
|
||||||
str[j++] = ':';
|
|
||||||
i += 3;
|
|
||||||
} else
|
|
||||||
str[j++] = str[i++];
|
|
||||||
}
|
|
||||||
if(str[j] != '\0') str[j] = '\0';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ***************************************************** */
|
/* ***************************************************** */
|
||||||
@@ -640,6 +644,7 @@ static void patchIPv6Address(char *str) {
|
|||||||
static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow,
|
static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow,
|
||||||
const u_int8_t version,
|
const u_int8_t version,
|
||||||
u_int16_t vlan_id,
|
u_int16_t vlan_id,
|
||||||
|
ndpi_packet_tunnel tunnel_type,
|
||||||
const struct ndpi_iphdr *iph,
|
const struct ndpi_iphdr *iph,
|
||||||
const struct ndpi_ipv6hdr *iph6,
|
const struct ndpi_ipv6hdr *iph6,
|
||||||
u_int16_t ip_offset,
|
u_int16_t ip_offset,
|
||||||
@@ -677,8 +682,13 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
l3 = (const u_int8_t*)iph;
|
l3 = (const u_int8_t*)iph;
|
||||||
} else {
|
} else {
|
||||||
l4_offset = sizeof(struct ndpi_ipv6hdr);
|
l4_offset = sizeof(struct ndpi_ipv6hdr);
|
||||||
|
if(sizeof(struct ndpi_ipv6hdr) > ipsize)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
l3 = (const u_int8_t*)iph6;
|
l3 = (const u_int8_t*)iph6;
|
||||||
}
|
}
|
||||||
|
if (ipsize < l4_offset + l4_packet_len)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
*proto = iph->protocol;
|
*proto = iph->protocol;
|
||||||
|
|
||||||
@@ -698,12 +708,12 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
if(l4_packet_len > workflow->stats.max_packet_len)
|
if(l4_packet_len > workflow->stats.max_packet_len)
|
||||||
workflow->stats.max_packet_len = l4_packet_len;
|
workflow->stats.max_packet_len = l4_packet_len;
|
||||||
|
|
||||||
l4 = ((const u_int8_t *) l3 + l4_offset);
|
l4 =& ((const u_int8_t *) l3)[l4_offset];
|
||||||
|
|
||||||
if(*proto == IPPROTO_TCP && l4_packet_len >= sizeof(struct ndpi_tcphdr)) {
|
if(*proto == IPPROTO_TCP && l4_packet_len >= sizeof(struct ndpi_tcphdr)) {
|
||||||
u_int tcp_len;
|
u_int tcp_len;
|
||||||
|
|
||||||
// tcp
|
// TCP
|
||||||
workflow->stats.tcp_count++;
|
workflow->stats.tcp_count++;
|
||||||
*tcph = (struct ndpi_tcphdr *)l4;
|
*tcph = (struct ndpi_tcphdr *)l4;
|
||||||
*sport = ntohs((*tcph)->source), *dport = ntohs((*tcph)->dest);
|
*sport = ntohs((*tcph)->source), *dport = ntohs((*tcph)->dest);
|
||||||
@@ -712,8 +722,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
*payload_len = ndpi_max(0, l4_packet_len-4*(*tcph)->doff);
|
*payload_len = ndpi_max(0, l4_packet_len-4*(*tcph)->doff);
|
||||||
l4_data_len = l4_packet_len - sizeof(struct ndpi_tcphdr);
|
l4_data_len = l4_packet_len - sizeof(struct ndpi_tcphdr);
|
||||||
} else if(*proto == IPPROTO_UDP && l4_packet_len >= sizeof(struct ndpi_udphdr)) {
|
} else if(*proto == IPPROTO_UDP && l4_packet_len >= sizeof(struct ndpi_udphdr)) {
|
||||||
// udp
|
// UDP
|
||||||
|
|
||||||
workflow->stats.udp_count++;
|
workflow->stats.udp_count++;
|
||||||
*udph = (struct ndpi_udphdr *)l4;
|
*udph = (struct ndpi_udphdr *)l4;
|
||||||
*sport = ntohs((*udph)->source), *dport = ntohs((*udph)->dest);
|
*sport = ntohs((*udph)->source), *dport = ntohs((*udph)->dest);
|
||||||
@@ -785,6 +794,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
memset(newflow, 0, sizeof(struct ndpi_flow_info));
|
memset(newflow, 0, sizeof(struct ndpi_flow_info));
|
||||||
newflow->flow_id = flow_id++;
|
newflow->flow_id = flow_id++;
|
||||||
newflow->hashval = hashval;
|
newflow->hashval = hashval;
|
||||||
|
newflow->tunnel_type = tunnel_type;
|
||||||
newflow->protocol = iph->protocol, newflow->vlan_id = vlan_id;
|
newflow->protocol = iph->protocol, newflow->vlan_id = vlan_id;
|
||||||
newflow->src_ip = iph->saddr, newflow->dst_ip = iph->daddr;
|
newflow->src_ip = iph->saddr, newflow->dst_ip = iph->daddr;
|
||||||
newflow->src_port = htons(*sport), newflow->dst_port = htons(*dport);
|
newflow->src_port = htons(*sport), newflow->dst_port = htons(*dport);
|
||||||
@@ -793,7 +803,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
newflow->iat_s_to_c = ndpi_alloc_data_analysis(DATA_ANALUYSIS_SLIDING_WINDOW);
|
newflow->iat_s_to_c = ndpi_alloc_data_analysis(DATA_ANALUYSIS_SLIDING_WINDOW);
|
||||||
newflow->pktlen_c_to_s = ndpi_alloc_data_analysis(DATA_ANALUYSIS_SLIDING_WINDOW),
|
newflow->pktlen_c_to_s = ndpi_alloc_data_analysis(DATA_ANALUYSIS_SLIDING_WINDOW),
|
||||||
newflow->pktlen_s_to_c = ndpi_alloc_data_analysis(DATA_ANALUYSIS_SLIDING_WINDOW),
|
newflow->pktlen_s_to_c = ndpi_alloc_data_analysis(DATA_ANALUYSIS_SLIDING_WINDOW),
|
||||||
newflow->iat_flow = ndpi_alloc_data_analysis(DATA_ANALUYSIS_SLIDING_WINDOW);;
|
newflow->iat_flow = ndpi_alloc_data_analysis(DATA_ANALUYSIS_SLIDING_WINDOW);
|
||||||
|
|
||||||
if(version == IPVERSION) {
|
if(version == IPVERSION) {
|
||||||
inet_ntop(AF_INET, &newflow->src_ip, newflow->src_name, sizeof(newflow->src_name));
|
inet_ntop(AF_INET, &newflow->src_ip, newflow->src_name, sizeof(newflow->src_name));
|
||||||
@@ -802,7 +812,7 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
inet_ntop(AF_INET6, &iph6->ip6_src, newflow->src_name, sizeof(newflow->src_name));
|
inet_ntop(AF_INET6, &iph6->ip6_src, newflow->src_name, sizeof(newflow->src_name));
|
||||||
inet_ntop(AF_INET6, &iph6->ip6_dst, newflow->dst_name, sizeof(newflow->dst_name));
|
inet_ntop(AF_INET6, &iph6->ip6_dst, newflow->dst_name, sizeof(newflow->dst_name));
|
||||||
/* For consistency across platforms replace :0: with :: */
|
/* For consistency across platforms replace :0: with :: */
|
||||||
patchIPv6Address(newflow->src_name), patchIPv6Address(newflow->dst_name);
|
ndpi_patchIPv6Address(newflow->src_name), ndpi_patchIPv6Address(newflow->dst_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((newflow->ndpi_flow = ndpi_flow_malloc(SIZEOF_FLOW_STRUCT)) == NULL) {
|
if((newflow->ndpi_flow = ndpi_flow_malloc(SIZEOF_FLOW_STRUCT)) == NULL) {
|
||||||
@@ -901,8 +911,10 @@ static struct ndpi_flow_info *get_ndpi_flow_info(struct ndpi_workflow * workflow
|
|||||||
|
|
||||||
static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflow,
|
static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflow,
|
||||||
u_int16_t vlan_id,
|
u_int16_t vlan_id,
|
||||||
|
ndpi_packet_tunnel tunnel_type,
|
||||||
const struct ndpi_ipv6hdr *iph6,
|
const struct ndpi_ipv6hdr *iph6,
|
||||||
u_int16_t ip_offset,
|
u_int16_t ip_offset,
|
||||||
|
u_int16_t ipsize,
|
||||||
struct ndpi_tcphdr **tcph,
|
struct ndpi_tcphdr **tcph,
|
||||||
struct ndpi_udphdr **udph,
|
struct ndpi_udphdr **udph,
|
||||||
u_int16_t *sport, u_int16_t *dport,
|
u_int16_t *sport, u_int16_t *dport,
|
||||||
@@ -927,8 +939,8 @@ static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflo
|
|||||||
iph.protocol = options[0];
|
iph.protocol = options[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return(get_ndpi_flow_info(workflow, 6, vlan_id, &iph, iph6, ip_offset,
|
return(get_ndpi_flow_info(workflow, 6, vlan_id, tunnel_type,
|
||||||
sizeof(struct ndpi_ipv6hdr),
|
&iph, iph6, ip_offset, ipsize,
|
||||||
ntohs(iph6->ip6_hdr.ip6_un1_plen),
|
ntohs(iph6->ip6_hdr.ip6_un1_plen),
|
||||||
tcph, udph, sport, dport,
|
tcph, udph, sport, dport,
|
||||||
src, dst, proto, payload,
|
src, dst, proto, payload,
|
||||||
@@ -937,17 +949,31 @@ static struct ndpi_flow_info *get_ndpi_flow_info6(struct ndpi_workflow * workflo
|
|||||||
|
|
||||||
/* ****************************************************** */
|
/* ****************************************************** */
|
||||||
|
|
||||||
|
static u_int8_t is_ndpi_proto(struct ndpi_flow_info *flow, u_int16_t id) {
|
||||||
|
if((flow->detected_protocol.master_protocol == id)
|
||||||
|
|| (flow->detected_protocol.app_protocol == id))
|
||||||
|
return(1);
|
||||||
|
else
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ****************************************************** */
|
||||||
|
|
||||||
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow) {
|
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow) {
|
||||||
|
u_int i;
|
||||||
|
|
||||||
if(!flow->ndpi_flow) return;
|
if(!flow->ndpi_flow) return;
|
||||||
|
|
||||||
snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s",
|
snprintf(flow->host_server_name, sizeof(flow->host_server_name), "%s",
|
||||||
flow->ndpi_flow->host_server_name);
|
flow->ndpi_flow->host_server_name);
|
||||||
|
|
||||||
if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_DHCP) {
|
snprintf(flow->flow_extra_info, sizeof(flow->flow_extra_info), "%s",
|
||||||
|
flow->ndpi_flow->flow_extra_info);
|
||||||
|
|
||||||
|
if(is_ndpi_proto(flow, NDPI_PROTOCOL_DHCP)) {
|
||||||
snprintf(flow->dhcp_fingerprint, sizeof(flow->dhcp_fingerprint), "%s", flow->ndpi_flow->protos.dhcp.fingerprint);
|
snprintf(flow->dhcp_fingerprint, sizeof(flow->dhcp_fingerprint), "%s", flow->ndpi_flow->protos.dhcp.fingerprint);
|
||||||
} else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_BITTORRENT) {
|
} else if(is_ndpi_proto(flow, NDPI_PROTOCOL_BITTORRENT)) {
|
||||||
u_int i, j, n = 0;
|
u_int j, n = 0;
|
||||||
|
|
||||||
for(i=0, j = 0; j < sizeof(flow->bittorent_hash)-1; i++) {
|
for(i=0, j = 0; j < sizeof(flow->bittorent_hash)-1; i++) {
|
||||||
sprintf(&flow->bittorent_hash[j], "%02x",
|
sprintf(&flow->bittorent_hash[j], "%02x",
|
||||||
@@ -958,60 +984,136 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
|||||||
|
|
||||||
if(n == 0) flow->bittorent_hash[0] = '\0';
|
if(n == 0) flow->bittorent_hash[0] = '\0';
|
||||||
}
|
}
|
||||||
|
/* DNS */
|
||||||
|
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_DNS)) {
|
||||||
|
if(flow->ndpi_flow->protos.dns.rsp_type == 0x1)
|
||||||
|
inet_ntop(AF_INET, &flow->ndpi_flow->protos.dns.rsp_addr.ipv4, flow->info, sizeof(flow->info));
|
||||||
|
else {
|
||||||
|
inet_ntop(AF_INET6, &flow->ndpi_flow->protos.dns.rsp_addr.ipv6, flow->info, sizeof(flow->info));
|
||||||
|
|
||||||
|
/* For consistency across platforms replace :0: with :: */
|
||||||
|
ndpi_patchIPv6Address(flow->info);
|
||||||
|
}
|
||||||
|
}
|
||||||
/* MDNS */
|
/* MDNS */
|
||||||
else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_MDNS) {
|
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_MDNS)) {
|
||||||
snprintf(flow->info, sizeof(flow->info), "%s", flow->ndpi_flow->protos.mdns.answer);
|
snprintf(flow->info, sizeof(flow->info), "%s", flow->ndpi_flow->protos.mdns.answer);
|
||||||
}
|
}
|
||||||
/* UBNTAC2 */
|
/* UBNTAC2 */
|
||||||
else if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UBNTAC2) {
|
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_UBNTAC2)) {
|
||||||
snprintf(flow->info, sizeof(flow->info), "%s", flow->ndpi_flow->protos.ubntac2.version);
|
snprintf(flow->info, sizeof(flow->info), "%s", flow->ndpi_flow->protos.ubntac2.version);
|
||||||
}
|
}
|
||||||
|
/* FTP */
|
||||||
|
else if((is_ndpi_proto(flow, NDPI_PROTOCOL_FTP_CONTROL))
|
||||||
|
|| /* IMAP */ is_ndpi_proto(flow, NDPI_PROTOCOL_MAIL_IMAP)
|
||||||
|
|| /* POP */ is_ndpi_proto(flow, NDPI_PROTOCOL_MAIL_POP)
|
||||||
|
|| /* SMTP */ is_ndpi_proto(flow, NDPI_PROTOCOL_MAIL_SMTP)) {
|
||||||
|
if(flow->ndpi_flow->protos.ftp_imap_pop_smtp.username[0] != '\0')
|
||||||
|
snprintf(flow->info, sizeof(flow->info), "User: %s][Pwd: %s%s",
|
||||||
|
flow->ndpi_flow->protos.ftp_imap_pop_smtp.username,
|
||||||
|
flow->ndpi_flow->protos.ftp_imap_pop_smtp.password,
|
||||||
|
flow->ndpi_flow->protos.ftp_imap_pop_smtp.auth_failed ? "][Auth Failed" : "");
|
||||||
|
}
|
||||||
|
/* KERBEROS */
|
||||||
|
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_KERBEROS)) {
|
||||||
|
if((flow->ndpi_flow->protos.kerberos.hostname[0] != '\0')
|
||||||
|
|| (flow->ndpi_flow->protos.kerberos.username[0] != '\0')) {
|
||||||
|
snprintf(flow->info, sizeof(flow->info), "%s%s%s%s",
|
||||||
|
flow->ndpi_flow->protos.kerberos.domain /* = realm */,
|
||||||
|
flow->ndpi_flow->protos.kerberos.domain[0] != '\0' ? "\\" : "",
|
||||||
|
flow->ndpi_flow->protos.kerberos.hostname,
|
||||||
|
flow->ndpi_flow->protos.kerberos.username);
|
||||||
|
} else if(flow->ndpi_flow->protos.kerberos.domain[0] != '\0')
|
||||||
|
snprintf(flow->info, sizeof(flow->info), "%s",
|
||||||
|
flow->ndpi_flow->protos.kerberos.domain);
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if(flow->info[0] != '\0')
|
||||||
|
printf("->> (%d) [%s][%s][%s]<<--\n",
|
||||||
|
htons(flow->src_port),
|
||||||
|
flow->ndpi_flow->protos.kerberos.domain,
|
||||||
|
flow->ndpi_flow->protos.kerberos.hostname,
|
||||||
|
flow->ndpi_flow->protos.kerberos.username);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
/* HTTP */
|
/* HTTP */
|
||||||
else if(flow->detected_protocol.master_protocol == NDPI_PROTOCOL_HTTP) {
|
else if((flow->detected_protocol.master_protocol == NDPI_PROTOCOL_HTTP)
|
||||||
|
|| is_ndpi_proto(flow, NDPI_PROTOCOL_HTTP)) {
|
||||||
if(flow->ndpi_flow->http.url != NULL) {
|
if(flow->ndpi_flow->http.url != NULL) {
|
||||||
snprintf(flow->http.url, sizeof(flow->http.url), "%s", flow->ndpi_flow->http.url);
|
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;
|
flow->http.response_status_code = flow->ndpi_flow->http.response_status_code;
|
||||||
|
snprintf(flow->http.content_type, sizeof(flow->http.content_type), "%s", flow->ndpi_flow->http.content_type ? flow->ndpi_flow->http.content_type : "");
|
||||||
|
snprintf(flow->http.user_agent, sizeof(flow->http.user_agent), "%s", flow->ndpi_flow->http.user_agent ? flow->ndpi_flow->http.user_agent : "");
|
||||||
}
|
}
|
||||||
|
} else if(is_ndpi_proto(flow, NDPI_PROTOCOL_TELNET)) {
|
||||||
|
snprintf(flow->telnet.username, sizeof(flow->telnet.username), "%s", flow->ndpi_flow->protos.telnet.username);
|
||||||
|
snprintf(flow->telnet.password, sizeof(flow->telnet.password), "%s", flow->ndpi_flow->protos.telnet.password);
|
||||||
|
} else if(is_ndpi_proto(flow, NDPI_PROTOCOL_SSH)) {
|
||||||
|
snprintf(flow->ssh_tls.client_requested_server_name,
|
||||||
|
sizeof(flow->ssh_tls.client_requested_server_name), "%s",
|
||||||
|
flow->ndpi_flow->protos.ssh.client_signature);
|
||||||
|
snprintf(flow->ssh_tls.server_info, sizeof(flow->ssh_tls.server_info), "%s",
|
||||||
|
flow->ndpi_flow->protos.ssh.server_signature);
|
||||||
|
snprintf(flow->ssh_tls.client_hassh, sizeof(flow->ssh_tls.client_hassh), "%s",
|
||||||
|
flow->ndpi_flow->protos.ssh.hassh_client);
|
||||||
|
snprintf(flow->ssh_tls.server_hassh, sizeof(flow->ssh_tls.server_hassh), "%s",
|
||||||
|
flow->ndpi_flow->protos.ssh.hassh_server);
|
||||||
}
|
}
|
||||||
else if(flow->detected_protocol.app_protocol != NDPI_PROTOCOL_DNS) {
|
/* TLS */
|
||||||
/* SSH */
|
else if((is_ndpi_proto(flow, NDPI_PROTOCOL_TLS))
|
||||||
if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_SSH) {
|
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_TLS)
|
||||||
snprintf(flow->ssh_tls.client_info, sizeof(flow->ssh_tls.client_info), "%s",
|
|| (flow->ndpi_flow->protos.stun_ssl.ssl.ja3_client[0] != '\0')
|
||||||
flow->ndpi_flow->protos.ssh.client_signature);
|
) {
|
||||||
snprintf(flow->ssh_tls.server_info, sizeof(flow->ssh_tls.server_info), "%s",
|
flow->ssh_tls.ssl_version = flow->ndpi_flow->protos.stun_ssl.ssl.ssl_version;
|
||||||
flow->ndpi_flow->protos.ssh.server_signature);
|
snprintf(flow->ssh_tls.client_requested_server_name,
|
||||||
snprintf(flow->ssh_tls.client_hassh, sizeof(flow->ssh_tls.client_hassh), "%s",
|
sizeof(flow->ssh_tls.client_requested_server_name), "%s",
|
||||||
flow->ndpi_flow->protos.ssh.hassh_client);
|
flow->ndpi_flow->protos.stun_ssl.ssl.client_requested_server_name);
|
||||||
snprintf(flow->ssh_tls.server_hassh, sizeof(flow->ssh_tls.server_hassh), "%s",
|
|
||||||
flow->ndpi_flow->protos.ssh.hassh_server);
|
if(flow->ndpi_flow->protos.stun_ssl.ssl.server_names_len > 0)
|
||||||
}
|
flow->ssh_tls.server_names = ndpi_strdup(flow->ndpi_flow->protos.stun_ssl.ssl.server_names);
|
||||||
/* TLS */
|
snprintf(flow->ssh_tls.server_organization, sizeof(flow->ssh_tls.server_organization), "%s",
|
||||||
else if((flow->detected_protocol.app_protocol == NDPI_PROTOCOL_TLS)
|
flow->ndpi_flow->protos.stun_ssl.ssl.server_organization);
|
||||||
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_TLS)
|
flow->ssh_tls.notBefore = flow->ndpi_flow->protos.stun_ssl.ssl.notBefore;
|
||||||
|| (flow->ndpi_flow->protos.stun_ssl.ssl.ja3_client[0] != '\0')
|
flow->ssh_tls.notAfter = flow->ndpi_flow->protos.stun_ssl.ssl.notAfter;
|
||||||
) {
|
snprintf(flow->ssh_tls.ja3_client, sizeof(flow->ssh_tls.ja3_client), "%s",
|
||||||
flow->ssh_tls.ssl_version = flow->ndpi_flow->protos.stun_ssl.ssl.ssl_version;
|
flow->ndpi_flow->protos.stun_ssl.ssl.ja3_client);
|
||||||
snprintf(flow->ssh_tls.client_info, sizeof(flow->ssh_tls.client_info), "%s",
|
snprintf(flow->ssh_tls.ja3_server, sizeof(flow->ssh_tls.ja3_server), "%s",
|
||||||
flow->ndpi_flow->protos.stun_ssl.ssl.client_certificate);
|
flow->ndpi_flow->protos.stun_ssl.ssl.ja3_server);
|
||||||
snprintf(flow->ssh_tls.server_info, sizeof(flow->ssh_tls.server_info), "%s",
|
flow->ssh_tls.server_unsafe_cipher = flow->ndpi_flow->protos.stun_ssl.ssl.server_unsafe_cipher;
|
||||||
flow->ndpi_flow->protos.stun_ssl.ssl.server_certificate);
|
flow->ssh_tls.server_cipher = flow->ndpi_flow->protos.stun_ssl.ssl.server_cipher;
|
||||||
snprintf(flow->ssh_tls.server_organization, sizeof(flow->ssh_tls.server_organization), "%s",
|
|
||||||
flow->ndpi_flow->protos.stun_ssl.ssl.server_organization);
|
if(flow->ndpi_flow->l4.tcp.tls.fingerprint_set) {
|
||||||
flow->ssh_tls.notBefore = flow->ndpi_flow->protos.stun_ssl.ssl.notBefore;
|
|
||||||
flow->ssh_tls.notAfter = flow->ndpi_flow->protos.stun_ssl.ssl.notAfter;
|
|
||||||
snprintf(flow->ssh_tls.ja3_client, sizeof(flow->ssh_tls.ja3_client), "%s",
|
|
||||||
flow->ndpi_flow->protos.stun_ssl.ssl.ja3_client);
|
|
||||||
snprintf(flow->ssh_tls.ja3_server, sizeof(flow->ssh_tls.ja3_server), "%s",
|
|
||||||
flow->ndpi_flow->protos.stun_ssl.ssl.ja3_server);
|
|
||||||
flow->ssh_tls.server_unsafe_cipher = flow->ndpi_flow->protos.stun_ssl.ssl.server_unsafe_cipher;
|
|
||||||
flow->ssh_tls.server_cipher = flow->ndpi_flow->protos.stun_ssl.ssl.server_cipher;
|
|
||||||
memcpy(flow->ssh_tls.sha1_cert_fingerprint,
|
memcpy(flow->ssh_tls.sha1_cert_fingerprint,
|
||||||
flow->ndpi_flow->l4.tcp.tls_sha1_certificate_fingerprint, 20);
|
flow->ndpi_flow->l4.tcp.tls.sha1_certificate_fingerprint, 20);
|
||||||
|
flow->ssh_tls.sha1_cert_fingerprint_set = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(flow->ndpi_flow->protos.stun_ssl.ssl.alpn) {
|
||||||
|
if((flow->ssh_tls.tls_alpn = ndpi_strdup(flow->ndpi_flow->protos.stun_ssl.ssl.alpn)) != NULL) {
|
||||||
|
/* Replace , with ; to avoid issues with CSVs */
|
||||||
|
for(i=0; flow->ssh_tls.tls_alpn[i] != '\0'; i++) if(flow->ssh_tls.tls_alpn[i] == ',') flow->ssh_tls.tls_alpn[i] = ';';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(flow->ssh_tls.tls_supported_versions) {
|
||||||
|
if((flow->ssh_tls.tls_supported_versions = ndpi_strdup(flow->ndpi_flow->protos.stun_ssl.ssl.tls_supported_versions)) != NULL) {
|
||||||
|
/* Replace , with ; to avoid issues with CSVs */
|
||||||
|
for(i=0; flow->ssh_tls.tls_supported_versions[i] != '\0'; i++) if(flow->ssh_tls.tls_supported_versions[i] == ',') flow->ssh_tls.tls_supported_versions[i] = ';';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(flow->ndpi_flow->protos.stun_ssl.ssl.alpn
|
||||||
|
&& flow->ndpi_flow->protos.stun_ssl.ssl.tls_supported_versions)
|
||||||
|
snprintf(flow->info, sizeof(flow->info), "ALPN: %s][TLS Supported Versions: %s",
|
||||||
|
flow->ndpi_flow->protos.stun_ssl.ssl.alpn,
|
||||||
|
flow->ndpi_flow->protos.stun_ssl.ssl.tls_supported_versions);
|
||||||
|
else if(flow->ndpi_flow->protos.stun_ssl.ssl.alpn)
|
||||||
|
snprintf(flow->info, sizeof(flow->info), "ALPN: %s",
|
||||||
|
flow->ndpi_flow->protos.stun_ssl.ssl.alpn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flow->detection_completed && (!flow->check_extra_packets)) {
|
if(flow->detection_completed && (!flow->check_extra_packets)) {
|
||||||
if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UNKNOWN) {
|
if(is_ndpi_proto(flow, NDPI_PROTOCOL_UNKNOWN)) {
|
||||||
if(workflow->__flow_giveup_callback != NULL)
|
if(workflow->__flow_giveup_callback != NULL)
|
||||||
workflow->__flow_giveup_callback(workflow, flow, workflow->__flow_giveup_udata);
|
workflow->__flow_giveup_callback(workflow, flow, workflow->__flow_giveup_udata);
|
||||||
} else {
|
} else {
|
||||||
@@ -1029,14 +1131,48 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
|
|||||||
* @brief Clear entropy stats if it meets prereq.
|
* @brief Clear entropy stats if it meets prereq.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ndpi_clear_entropy_stats(struct ndpi_flow_info *flow)
|
ndpi_clear_entropy_stats(struct ndpi_flow_info *flow) {
|
||||||
{
|
|
||||||
if(flow->entropy.src2dst_pkt_count + flow->entropy.dst2src_pkt_count == max_num_packets_per_flow) {
|
if(flow->entropy.src2dst_pkt_count + flow->entropy.dst2src_pkt_count == max_num_packets_per_flow) {
|
||||||
memcpy(&flow->last_entropy, &flow->entropy, sizeof(struct ndpi_entropy));
|
memcpy(&flow->last_entropy, &flow->entropy, sizeof(struct ndpi_entropy));
|
||||||
memset(&flow->entropy, 0x00, sizeof(struct ndpi_entropy));
|
memset(&flow->entropy, 0x00, sizeof(struct ndpi_entropy));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void update_tcp_flags_count(struct ndpi_flow_info* flow, struct ndpi_tcphdr* tcp, u_int8_t src_to_dst_direction){
|
||||||
|
if(tcp->cwr){
|
||||||
|
flow->cwr_count++;
|
||||||
|
src_to_dst_direction ? flow->src2dst_cwr_count++ : flow->dst2src_cwr_count++;
|
||||||
|
}
|
||||||
|
if(tcp->ece){
|
||||||
|
flow->ece_count++;
|
||||||
|
src_to_dst_direction ? flow->src2dst_ece_count++ : flow->dst2src_ece_count++;
|
||||||
|
}
|
||||||
|
if(tcp->rst){
|
||||||
|
flow->rst_count++;
|
||||||
|
src_to_dst_direction ? flow->src2dst_rst_count++ : flow->dst2src_rst_count++;
|
||||||
|
}
|
||||||
|
if(tcp->ack){
|
||||||
|
flow->ack_count++;
|
||||||
|
src_to_dst_direction ? flow->src2dst_ack_count++ : flow->dst2src_ack_count++;
|
||||||
|
}
|
||||||
|
if(tcp->fin){
|
||||||
|
flow->fin_count++;
|
||||||
|
src_to_dst_direction ? flow->src2dst_fin_count++ : flow->dst2src_fin_count++;
|
||||||
|
}
|
||||||
|
if(tcp->syn){
|
||||||
|
flow->syn_count++;
|
||||||
|
src_to_dst_direction ? flow->src2dst_syn_count++ : flow->dst2src_syn_count++;
|
||||||
|
}
|
||||||
|
if(tcp->psh){
|
||||||
|
flow->psh_count++;
|
||||||
|
src_to_dst_direction ? flow->src2dst_psh_count++ : flow->dst2src_psh_count++;
|
||||||
|
}
|
||||||
|
if(tcp->urg){
|
||||||
|
flow->urg_count++;
|
||||||
|
src_to_dst_direction ? flow->src2dst_urg_count++ : flow->dst2src_urg_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ****************************************************** */
|
/* ****************************************************** */
|
||||||
/**
|
/**
|
||||||
Function to process the packet:
|
Function to process the packet:
|
||||||
@@ -1048,6 +1184,7 @@ ndpi_clear_entropy_stats(struct ndpi_flow_info *flow)
|
|||||||
static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
||||||
const u_int64_t time,
|
const u_int64_t time,
|
||||||
u_int16_t vlan_id,
|
u_int16_t vlan_id,
|
||||||
|
ndpi_packet_tunnel tunnel_type,
|
||||||
const struct ndpi_iphdr *iph,
|
const struct ndpi_iphdr *iph,
|
||||||
struct ndpi_ipv6hdr *iph6,
|
struct ndpi_ipv6hdr *iph6,
|
||||||
u_int16_t ip_offset,
|
u_int16_t ip_offset,
|
||||||
@@ -1061,21 +1198,23 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
u_int8_t proto;
|
u_int8_t proto;
|
||||||
struct ndpi_tcphdr *tcph = NULL;
|
struct ndpi_tcphdr *tcph = NULL;
|
||||||
struct ndpi_udphdr *udph = NULL;
|
struct ndpi_udphdr *udph = NULL;
|
||||||
u_int16_t sport, dport, payload_len;
|
u_int16_t sport, dport, payload_len = 0;
|
||||||
u_int8_t *payload;
|
u_int8_t *payload;
|
||||||
u_int8_t src_to_dst_direction = 1;
|
u_int8_t src_to_dst_direction = 1;
|
||||||
u_int8_t begin_or_end_tcp = 0;
|
u_int8_t begin_or_end_tcp = 0;
|
||||||
struct ndpi_proto nproto = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN };
|
struct ndpi_proto nproto = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN };
|
||||||
|
|
||||||
if(iph)
|
if(iph)
|
||||||
flow = get_ndpi_flow_info(workflow, IPVERSION, vlan_id, iph, NULL,
|
flow = get_ndpi_flow_info(workflow, IPVERSION, vlan_id,
|
||||||
|
tunnel_type, iph, NULL,
|
||||||
ip_offset, ipsize,
|
ip_offset, ipsize,
|
||||||
ntohs(iph->tot_len) - (iph->ihl * 4),
|
ntohs(iph->tot_len) - (iph->ihl * 4),
|
||||||
&tcph, &udph, &sport, &dport,
|
&tcph, &udph, &sport, &dport,
|
||||||
&src, &dst, &proto,
|
&src, &dst, &proto,
|
||||||
&payload, &payload_len, &src_to_dst_direction, when);
|
&payload, &payload_len, &src_to_dst_direction, when);
|
||||||
else
|
else
|
||||||
flow = get_ndpi_flow_info6(workflow, vlan_id, iph6, ip_offset,
|
flow = get_ndpi_flow_info6(workflow, vlan_id,
|
||||||
|
tunnel_type, iph6, ip_offset, ipsize,
|
||||||
&tcph, &udph, &sport, &dport,
|
&tcph, &udph, &sport, &dport,
|
||||||
&src, &dst, &proto,
|
&src, &dst, &proto,
|
||||||
&payload, &payload_len, &src_to_dst_direction, when);
|
&payload, &payload_len, &src_to_dst_direction, when);
|
||||||
@@ -1088,13 +1227,24 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
workflow->stats.total_ip_bytes += rawsize;
|
workflow->stats.total_ip_bytes += rawsize;
|
||||||
ndpi_flow = flow->ndpi_flow;
|
ndpi_flow = flow->ndpi_flow;
|
||||||
|
|
||||||
|
if(tcph != NULL){
|
||||||
|
update_tcp_flags_count(flow, tcph, src_to_dst_direction);
|
||||||
|
if(tcph->syn && !flow->src2dst_bytes){
|
||||||
|
flow->c_to_s_init_win = rawsize;
|
||||||
|
}else if(tcph->syn && tcph->ack && flow->src2dst_bytes == flow->c_to_s_init_win){
|
||||||
|
flow->s_to_c_init_win = rawsize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if((tcph != NULL) && (tcph->fin || tcph->rst || tcph->syn))
|
if((tcph != NULL) && (tcph->fin || tcph->rst || tcph->syn))
|
||||||
begin_or_end_tcp = 1;
|
begin_or_end_tcp = 1;
|
||||||
|
|
||||||
if(flow->entropy.flow_last_pkt_time.tv_sec) {
|
if(flow->entropy.flow_last_pkt_time.tv_sec) {
|
||||||
ndpi_timer_sub(&when, &flow->entropy.flow_last_pkt_time, &tdiff);
|
ndpi_timer_sub(&when, &flow->entropy.flow_last_pkt_time, &tdiff);
|
||||||
|
|
||||||
if(flow->iat_flow) {
|
if(flow->iat_flow
|
||||||
|
&& (tdiff.tv_sec >= 0) /* Discard backward time */
|
||||||
|
) {
|
||||||
u_int32_t ms = ndpi_timeval_to_milliseconds(tdiff);
|
u_int32_t ms = ndpi_timeval_to_milliseconds(tdiff);
|
||||||
|
|
||||||
if(ms > 0)
|
if(ms > 0)
|
||||||
@@ -1107,7 +1257,9 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
if(flow->entropy.src2dst_last_pkt_time.tv_sec) {
|
if(flow->entropy.src2dst_last_pkt_time.tv_sec) {
|
||||||
ndpi_timer_sub(&when, &flow->entropy.src2dst_last_pkt_time, &tdiff);
|
ndpi_timer_sub(&when, &flow->entropy.src2dst_last_pkt_time, &tdiff);
|
||||||
|
|
||||||
if(flow->iat_c_to_s) {
|
if(flow->iat_c_to_s
|
||||||
|
&& (tdiff.tv_sec >= 0) /* Discard backward time */
|
||||||
|
) {
|
||||||
u_int32_t ms = ndpi_timeval_to_milliseconds(tdiff);
|
u_int32_t ms = ndpi_timeval_to_milliseconds(tdiff);
|
||||||
|
|
||||||
ndpi_data_add_value(flow->iat_c_to_s, ms);
|
ndpi_data_add_value(flow->iat_c_to_s, ms);
|
||||||
@@ -1115,7 +1267,7 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ndpi_data_add_value(flow->pktlen_c_to_s, rawsize);
|
ndpi_data_add_value(flow->pktlen_c_to_s, rawsize);
|
||||||
flow->src2dst_packets++, flow->src2dst_bytes += rawsize;
|
flow->src2dst_packets++, flow->src2dst_bytes += rawsize, flow->src2dst_goodput_bytes += payload_len;
|
||||||
memcpy(&flow->entropy.src2dst_last_pkt_time, &when, sizeof(when));
|
memcpy(&flow->entropy.src2dst_last_pkt_time, &when, sizeof(when));
|
||||||
} else {
|
} else {
|
||||||
if(flow->entropy.dst2src_last_pkt_time.tv_sec && (!begin_or_end_tcp)) {
|
if(flow->entropy.dst2src_last_pkt_time.tv_sec && (!begin_or_end_tcp)) {
|
||||||
@@ -1127,9 +1279,8 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
ndpi_data_add_value(flow->iat_s_to_c, ms);
|
ndpi_data_add_value(flow->iat_s_to_c, ms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ndpi_data_add_value(flow->pktlen_s_to_c, rawsize);
|
ndpi_data_add_value(flow->pktlen_s_to_c, rawsize);
|
||||||
flow->dst2src_packets++, flow->dst2src_bytes += rawsize;
|
flow->dst2src_packets++, flow->dst2src_bytes += rawsize, flow->dst2src_goodput_bytes += payload_len;
|
||||||
memcpy(&flow->entropy.dst2src_last_pkt_time, &when, sizeof(when));
|
memcpy(&flow->entropy.dst2src_last_pkt_time, &when, sizeof(when));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1146,21 +1297,21 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
if((flow->entropy.src2dst_pkt_count+flow->entropy.dst2src_pkt_count) <= max_num_packets_per_flow) {
|
if((flow->entropy.src2dst_pkt_count+flow->entropy.dst2src_pkt_count) <= max_num_packets_per_flow) {
|
||||||
if(flow->bidirectional)
|
if(flow->bidirectional)
|
||||||
flow->entropy.score = ndpi_classify(flow->entropy.src2dst_pkt_len, flow->entropy.src2dst_pkt_time,
|
flow->entropy.score = ndpi_classify(flow->entropy.src2dst_pkt_len, flow->entropy.src2dst_pkt_time,
|
||||||
flow->entropy.dst2src_pkt_len, flow->entropy.dst2src_pkt_time,
|
flow->entropy.dst2src_pkt_len, flow->entropy.dst2src_pkt_time,
|
||||||
flow->entropy.src2dst_start, flow->entropy.dst2src_start,
|
flow->entropy.src2dst_start, flow->entropy.dst2src_start,
|
||||||
max_num_packets_per_flow, flow->src_port, flow->dst_port,
|
max_num_packets_per_flow, flow->src_port, flow->dst_port,
|
||||||
flow->src2dst_packets, flow->dst2src_packets,
|
flow->src2dst_packets, flow->dst2src_packets,
|
||||||
flow->entropy.src2dst_opackets, flow->entropy.dst2src_opackets,
|
flow->entropy.src2dst_opackets, flow->entropy.dst2src_opackets,
|
||||||
flow->entropy.src2dst_l4_bytes, flow->entropy.dst2src_l4_bytes, 1,
|
flow->entropy.src2dst_l4_bytes, flow->entropy.dst2src_l4_bytes, 1,
|
||||||
flow->entropy.src2dst_byte_count, flow->entropy.dst2src_byte_count);
|
flow->entropy.src2dst_byte_count, flow->entropy.dst2src_byte_count);
|
||||||
else
|
else
|
||||||
flow->entropy.score = ndpi_classify(flow->entropy.src2dst_pkt_len, flow->entropy.src2dst_pkt_time,
|
flow->entropy.score = ndpi_classify(flow->entropy.src2dst_pkt_len, flow->entropy.src2dst_pkt_time,
|
||||||
NULL, NULL, flow->entropy.src2dst_start, flow->entropy.src2dst_start,
|
NULL, NULL, flow->entropy.src2dst_start, flow->entropy.src2dst_start,
|
||||||
max_num_packets_per_flow, flow->src_port, flow->dst_port,
|
max_num_packets_per_flow, flow->src_port, flow->dst_port,
|
||||||
flow->src2dst_packets, 0,
|
flow->src2dst_packets, 0,
|
||||||
flow->entropy.src2dst_opackets, 0,
|
flow->entropy.src2dst_opackets, 0,
|
||||||
flow->entropy.src2dst_l4_bytes, 0, 1,
|
flow->entropy.src2dst_l4_bytes, 0, 1,
|
||||||
flow->entropy.src2dst_byte_count, NULL);
|
flow->entropy.src2dst_byte_count, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1177,9 +1328,9 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
|
|
||||||
if((proto == IPPROTO_TCP)
|
if((proto == IPPROTO_TCP)
|
||||||
&& (
|
&& (
|
||||||
(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_TLS)
|
is_ndpi_proto(flow, NDPI_PROTOCOL_TLS)
|
||||||
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_TLS)
|
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_TLS)
|
||||||
|| (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_SSH)
|
|| is_ndpi_proto(flow, NDPI_PROTOCOL_SSH)
|
||||||
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_SSH))
|
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_SSH))
|
||||||
) {
|
) {
|
||||||
if((flow->src2dst_packets+flow->dst2src_packets) < 10 /* MIN_NUM_ENCRYPT_SKIP_PACKETS */)
|
if((flow->src2dst_packets+flow->dst2src_packets) < 10 /* MIN_NUM_ENCRYPT_SKIP_PACKETS */)
|
||||||
@@ -1196,9 +1347,9 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
} else {
|
} else {
|
||||||
if((proto == IPPROTO_TCP)
|
if((proto == IPPROTO_TCP)
|
||||||
&& (
|
&& (
|
||||||
(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_TLS)
|
is_ndpi_proto(flow, NDPI_PROTOCOL_TLS)
|
||||||
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_TLS)
|
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_TLS)
|
||||||
|| (flow->detected_protocol.app_protocol == NDPI_PROTOCOL_SSH)
|
|| is_ndpi_proto(flow, NDPI_PROTOCOL_SSH)
|
||||||
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_SSH))
|
|| (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_SSH))
|
||||||
)
|
)
|
||||||
flow->has_human_readeable_strings = 0;
|
flow->has_human_readeable_strings = 0;
|
||||||
@@ -1213,26 +1364,34 @@ static struct ndpi_proto packet_processing(struct ndpi_workflow * workflow,
|
|||||||
(((proto == IPPROTO_UDP) && ((flow->src2dst_packets + flow->dst2src_packets) > max_num_udp_dissected_pkts))
|
(((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;
|
|| ((proto == IPPROTO_TCP) && ((flow->src2dst_packets + flow->dst2src_packets) > max_num_tcp_dissected_pkts))) ? 1 : 0;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
printf("%s()\n", __FUNCTION__);
|
||||||
|
#endif
|
||||||
|
|
||||||
flow->detected_protocol = ndpi_detection_process_packet(workflow->ndpi_struct, ndpi_flow,
|
flow->detected_protocol = ndpi_detection_process_packet(workflow->ndpi_struct, ndpi_flow,
|
||||||
iph ? (uint8_t *)iph : (uint8_t *)iph6,
|
iph ? (uint8_t *)iph : (uint8_t *)iph6,
|
||||||
ipsize, time, src, dst);
|
ipsize, time, src, dst);
|
||||||
|
|
||||||
if(enough_packets || (flow->detected_protocol.app_protocol != NDPI_PROTOCOL_UNKNOWN)) {
|
if(enough_packets || (flow->detected_protocol.app_protocol != NDPI_PROTOCOL_UNKNOWN)) {
|
||||||
if((!enough_packets)
|
if((!enough_packets)
|
||||||
&& (flow->detected_protocol.master_protocol == NDPI_PROTOCOL_TLS)
|
&& ndpi_extra_dissection_possible(workflow->ndpi_struct, ndpi_flow))
|
||||||
&& (!flow->ndpi_flow->l4.tcp.tls_srv_cert_fingerprint_processed))
|
|
||||||
; /* Wait for certificate fingerprint */
|
; /* Wait for certificate fingerprint */
|
||||||
else {
|
else {
|
||||||
/* New protocol detected or give up */
|
/* New protocol detected or give up */
|
||||||
flow->detection_completed = 1;
|
flow->detection_completed = 1;
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* Check if we should keep checking extra packets */
|
/* Check if we should keep checking extra packets */
|
||||||
if(ndpi_flow && ndpi_flow->check_extra_packets)
|
if(ndpi_flow && ndpi_flow->check_extra_packets)
|
||||||
flow->check_extra_packets = 1;
|
flow->check_extra_packets = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UNKNOWN) {
|
||||||
|
u_int8_t proto_guessed;
|
||||||
|
|
||||||
if(flow->detected_protocol.app_protocol == NDPI_PROTOCOL_UNKNOWN)
|
|
||||||
flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow,
|
flow->detected_protocol = ndpi_detection_giveup(workflow->ndpi_struct, flow->ndpi_flow,
|
||||||
enable_protocol_guess);
|
enable_protocol_guess, &proto_guessed);
|
||||||
|
}
|
||||||
|
|
||||||
process_ndpi_collected_info(workflow, flow);
|
process_ndpi_collected_info(workflow, flow);
|
||||||
}
|
}
|
||||||
@@ -1275,6 +1434,7 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
struct ndpi_ipv6hdr *iph6;
|
struct ndpi_ipv6hdr *iph6;
|
||||||
|
|
||||||
struct ndpi_proto nproto = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN };
|
struct ndpi_proto nproto = { NDPI_PROTOCOL_UNKNOWN, NDPI_PROTOCOL_UNKNOWN };
|
||||||
|
ndpi_packet_tunnel tunnel_type = ndpi_no_tunnel;
|
||||||
|
|
||||||
/* lengths and offsets */
|
/* lengths and offsets */
|
||||||
u_int16_t eth_offset = 0;
|
u_int16_t eth_offset = 0;
|
||||||
@@ -1287,7 +1447,7 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
u_int64_t time;
|
u_int64_t time;
|
||||||
u_int16_t ip_offset = 0, ip_len;
|
u_int16_t ip_offset = 0, ip_len;
|
||||||
u_int16_t frag_off = 0, vlan_id = 0;
|
u_int16_t frag_off = 0, vlan_id = 0;
|
||||||
u_int8_t proto = 0;
|
u_int8_t proto = 0, recheck_type;
|
||||||
/*u_int32_t label;*/
|
/*u_int32_t label;*/
|
||||||
|
|
||||||
/* counters */
|
/* counters */
|
||||||
@@ -1316,7 +1476,11 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
datalink_type = (int)pcap_datalink(workflow->pcap_handle);
|
datalink_type = (int)pcap_datalink(workflow->pcap_handle);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
datalink_check:
|
datalink_check:
|
||||||
|
if(header->caplen < eth_offset + 40)
|
||||||
|
return(nproto); /* Too short */
|
||||||
|
|
||||||
switch(datalink_type) {
|
switch(datalink_type) {
|
||||||
case DLT_NULL:
|
case DLT_NULL:
|
||||||
if(ntohl(*((u_int32_t*)&packet[eth_offset])) == 2)
|
if(ntohl(*((u_int32_t*)&packet[eth_offset])) == 2)
|
||||||
@@ -1384,6 +1548,10 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
return(nproto);
|
return(nproto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(header->caplen < (eth_offset + radio_len + sizeof(struct ndpi_wifi_header)))
|
||||||
|
return(nproto);
|
||||||
|
|
||||||
|
|
||||||
/* Calculate 802.11 header length (variable) */
|
/* Calculate 802.11 header length (variable) */
|
||||||
wifi = (struct ndpi_wifi_header*)( packet + eth_offset + radio_len);
|
wifi = (struct ndpi_wifi_header*)( packet + eth_offset + radio_len);
|
||||||
fc = wifi->fc;
|
fc = wifi->fc;
|
||||||
@@ -1414,6 +1582,9 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
return(nproto);
|
return(nproto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ether_type_check:
|
||||||
|
recheck_type = 0;
|
||||||
|
|
||||||
/* check ether type */
|
/* check ether type */
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case VLAN:
|
case VLAN:
|
||||||
@@ -1421,13 +1592,16 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
|
type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
|
||||||
ip_offset += 4;
|
ip_offset += 4;
|
||||||
vlan_packet = 1;
|
vlan_packet = 1;
|
||||||
|
|
||||||
// double tagging for 802.1Q
|
// double tagging for 802.1Q
|
||||||
if(type == 0x8100) {
|
while((type == 0x8100) && (((bpf_u_int32)ip_offset) < header->caplen)) {
|
||||||
vlan_id = ((packet[ip_offset] << 8) + packet[ip_offset+1]) & 0xFFF;
|
vlan_id = ((packet[ip_offset] << 8) + packet[ip_offset+1]) & 0xFFF;
|
||||||
type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
|
type = (packet[ip_offset+2] << 8) + packet[ip_offset+3];
|
||||||
ip_offset += 4;
|
ip_offset += 4;
|
||||||
}
|
}
|
||||||
|
recheck_type = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MPLS_UNI:
|
case MPLS_UNI:
|
||||||
case MPLS_MULTI:
|
case MPLS_MULTI:
|
||||||
mpls.u32 = *((uint32_t *) &packet[ip_offset]);
|
mpls.u32 = *((uint32_t *) &packet[ip_offset]);
|
||||||
@@ -1440,20 +1614,30 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
mpls.u32 = ntohl(mpls.u32);
|
mpls.u32 = ntohl(mpls.u32);
|
||||||
ip_offset += 4;
|
ip_offset += 4;
|
||||||
}
|
}
|
||||||
|
recheck_type = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PPPoE:
|
case PPPoE:
|
||||||
workflow->stats.pppoe_count++;
|
workflow->stats.pppoe_count++;
|
||||||
type = ETH_P_IP;
|
type = ETH_P_IP;
|
||||||
ip_offset += 8;
|
ip_offset += 8;
|
||||||
|
recheck_type = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(recheck_type)
|
||||||
|
goto ether_type_check;
|
||||||
|
|
||||||
workflow->stats.vlan_count += vlan_packet;
|
workflow->stats.vlan_count += vlan_packet;
|
||||||
|
|
||||||
iph_check:
|
iph_check:
|
||||||
/* Check and set IP header size and total packet length */
|
/* Check and set IP header size and total packet length */
|
||||||
|
if (header->caplen < ip_offset + sizeof(struct ndpi_iphdr))
|
||||||
|
return(nproto); /* Too short for next IP header*/
|
||||||
|
|
||||||
iph = (struct ndpi_iphdr *) &packet[ip_offset];
|
iph = (struct ndpi_iphdr *) &packet[ip_offset];
|
||||||
|
|
||||||
/* just work on Ethernet packets that contain IP */
|
/* just work on Ethernet packets that contain IP */
|
||||||
@@ -1466,7 +1650,8 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
|
|
||||||
if(cap_warning_used == 0) {
|
if(cap_warning_used == 0) {
|
||||||
if(!workflow->prefs.quiet_mode)
|
if(!workflow->prefs.quiet_mode)
|
||||||
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_DEBUG, "\n\nWARNING: packet capture size is smaller than packet size, DETECTION MIGHT NOT WORK CORRECTLY\n\n");
|
NDPI_LOG(0, workflow->ndpi_struct, NDPI_LOG_DEBUG,
|
||||||
|
"\n\nWARNING: packet capture size is smaller than packet size, DETECTION MIGHT NOT WORK CORRECTLY\n\n");
|
||||||
cap_warning_used = 1;
|
cap_warning_used = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1478,7 +1663,8 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
|
|
||||||
if(iph->protocol == IPPROTO_IPV6) {
|
if(iph->protocol == IPPROTO_IPV6) {
|
||||||
ip_offset += ip_len;
|
ip_offset += ip_len;
|
||||||
goto iph_check;
|
if (ip_len > 0)
|
||||||
|
goto iph_check;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((frag_off & 0x1FFF) != 0) {
|
if((frag_off & 0x1FFF) != 0) {
|
||||||
@@ -1495,6 +1681,8 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
return(nproto);
|
return(nproto);
|
||||||
}
|
}
|
||||||
} else if(iph->version == 6) {
|
} else if(iph->version == 6) {
|
||||||
|
if (header->caplen < ip_offset + sizeof(struct ndpi_ipv6hdr))
|
||||||
|
return(nproto); /* Too short for IPv6 header*/
|
||||||
iph6 = (struct ndpi_ipv6hdr *)&packet[ip_offset];
|
iph6 = (struct ndpi_ipv6hdr *)&packet[ip_offset];
|
||||||
proto = iph6->ip6_hdr.ip6_un1_nxt;
|
proto = iph6->ip6_hdr.ip6_un1_nxt;
|
||||||
ip_len = sizeof(struct ndpi_ipv6hdr);
|
ip_len = sizeof(struct ndpi_ipv6hdr);
|
||||||
@@ -1530,6 +1718,8 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
u_int8_t flags = packet[offset];
|
u_int8_t flags = packet[offset];
|
||||||
u_int8_t message_type = packet[offset+1];
|
u_int8_t message_type = packet[offset+1];
|
||||||
|
|
||||||
|
tunnel_type = ndpi_gtp_tunnel;
|
||||||
|
|
||||||
if((((flags & 0xE0) >> 5) == 1 /* GTPv1 */) &&
|
if((((flags & 0xE0) >> 5) == 1 /* GTPv1 */) &&
|
||||||
(message_type == 0xFF /* T-PDU */)) {
|
(message_type == 0xFF /* T-PDU */)) {
|
||||||
|
|
||||||
@@ -1547,11 +1737,13 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
}
|
}
|
||||||
} else if((sport == TZSP_PORT) || (dport == TZSP_PORT)) {
|
} else if((sport == TZSP_PORT) || (dport == TZSP_PORT)) {
|
||||||
/* https://en.wikipedia.org/wiki/TZSP */
|
/* https://en.wikipedia.org/wiki/TZSP */
|
||||||
u_int offset = ip_offset+ip_len+sizeof(struct ndpi_udphdr);
|
u_int offset = ip_offset+ip_len+sizeof(struct ndpi_udphdr);
|
||||||
u_int8_t version = packet[offset];
|
u_int8_t version = packet[offset];
|
||||||
u_int8_t ts_type = packet[offset+1];
|
u_int8_t ts_type = packet[offset+1];
|
||||||
u_int16_t encapsulates = ntohs(*((u_int16_t*)&packet[offset+2]));
|
u_int16_t encapsulates = ntohs(*((u_int16_t*)&packet[offset+2]));
|
||||||
|
|
||||||
|
tunnel_type = ndpi_tzsp_tunnel;
|
||||||
|
|
||||||
if((version == 1) && (ts_type == 0) && (encapsulates == 1)) {
|
if((version == 1) && (ts_type == 0) && (encapsulates == 1)) {
|
||||||
u_int8_t stop = 0;
|
u_int8_t stop = 0;
|
||||||
|
|
||||||
@@ -1583,11 +1775,33 @@ struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if(sport == NDPI_CAPWAP_DATA_PORT) {
|
||||||
|
/* We dissect ONLY CAPWAP traffic */
|
||||||
|
u_int offset = ip_offset+ip_len+sizeof(struct ndpi_udphdr);
|
||||||
|
|
||||||
|
if((offset+40) < header->caplen) {
|
||||||
|
u_int16_t msg_len = packet[offset+1] >> 1;
|
||||||
|
|
||||||
|
offset += msg_len;
|
||||||
|
|
||||||
|
if(packet[offset] == 0x02) {
|
||||||
|
/* IEEE 802.11 Data */
|
||||||
|
|
||||||
|
offset += 24;
|
||||||
|
/* LLC header is 8 bytes */
|
||||||
|
type = ntohs((u_int16_t)*((u_int16_t*)&packet[offset+6]));
|
||||||
|
|
||||||
|
ip_offset = offset + 8;
|
||||||
|
|
||||||
|
tunnel_type = ndpi_capwap_tunnel;
|
||||||
|
goto iph_check;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process the packet */
|
/* process the packet */
|
||||||
return(packet_processing(workflow, time, vlan_id, iph, iph6,
|
return(packet_processing(workflow, time, vlan_id, tunnel_type, iph, iph6,
|
||||||
ip_offset, header->caplen - ip_offset,
|
ip_offset, header->caplen - ip_offset,
|
||||||
header->caplen, header, packet, header->ts));
|
header->caplen, header, packet, header->ts));
|
||||||
}
|
}
|
||||||
@@ -1645,8 +1859,15 @@ u_int32_t ethernet_crc32(const void* data, size_t n_bytes) {
|
|||||||
|
|
||||||
#ifdef USE_DPDK
|
#ifdef USE_DPDK
|
||||||
|
|
||||||
|
#include <rte_version.h>
|
||||||
|
#include <rte_ether.h>
|
||||||
|
|
||||||
static const struct rte_eth_conf port_conf_default = {
|
static const struct rte_eth_conf port_conf_default = {
|
||||||
|
#if (RTE_VERSION < RTE_VERSION_NUM(19, 8, 0, 0))
|
||||||
.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
|
.rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN }
|
||||||
|
#else
|
||||||
|
.rxmode = { .max_rx_pkt_len = RTE_ETHER_MAX_LEN }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ************************************ */
|
/* ************************************ */
|
||||||
|
|||||||
+26
-7
@@ -32,6 +32,7 @@
|
|||||||
#include "uthash.h"
|
#include "uthash.h"
|
||||||
#include <pcap.h>
|
#include <pcap.h>
|
||||||
#include "ndpi_classify.h"
|
#include "ndpi_classify.h"
|
||||||
|
#include "ndpi_typedefs.h"
|
||||||
|
|
||||||
#ifdef USE_DPDK
|
#ifdef USE_DPDK
|
||||||
#include <rte_eal.h>
|
#include <rte_eal.h>
|
||||||
@@ -93,7 +94,7 @@ typedef struct ndpi_ja3_info {
|
|||||||
|
|
||||||
// external hash table (host ip -> <ip string, hash table ja3c, hash table ja3s>)
|
// external hash table (host ip -> <ip string, hash table ja3c, hash table ja3s>)
|
||||||
// used to aggregate ja3 fingerprints by hosts
|
// used to aggregate ja3 fingerprints by hosts
|
||||||
typedef struct ndpi_host_ja3_fingerprints{
|
typedef struct ndpi_host_ja3_fingerprints {
|
||||||
u_int32_t ip;
|
u_int32_t ip;
|
||||||
char *ip_string;
|
char *ip_string;
|
||||||
char *dns_name;
|
char *dns_name;
|
||||||
@@ -160,11 +161,22 @@ typedef struct ndpi_flow_info {
|
|||||||
u_int16_t dst_port;
|
u_int16_t dst_port;
|
||||||
u_int8_t detection_completed, protocol, bidirectional, check_extra_packets;
|
u_int8_t detection_completed, protocol, bidirectional, check_extra_packets;
|
||||||
u_int16_t vlan_id;
|
u_int16_t vlan_id;
|
||||||
|
ndpi_packet_tunnel tunnel_type;
|
||||||
struct ndpi_flow_struct *ndpi_flow;
|
struct ndpi_flow_struct *ndpi_flow;
|
||||||
char src_name[48], dst_name[48];
|
char src_name[48], dst_name[48];
|
||||||
u_int8_t ip_version;
|
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;
|
||||||
|
u_int32_t urg_count, src2dst_urg_count, dst2src_urg_count;
|
||||||
|
u_int32_t ack_count, src2dst_ack_count, dst2src_ack_count;
|
||||||
|
u_int32_t psh_count, src2dst_psh_count, dst2src_psh_count;
|
||||||
|
u_int32_t syn_count, src2dst_syn_count, dst2src_syn_count;
|
||||||
|
u_int32_t fin_count, src2dst_fin_count, dst2src_fin_count;
|
||||||
|
u_int32_t rst_count, src2dst_rst_count, dst2src_rst_count;
|
||||||
|
u_int32_t c_to_s_init_win, s_to_c_init_win;
|
||||||
u_int64_t first_seen, last_seen;
|
u_int64_t first_seen, last_seen;
|
||||||
u_int64_t src2dst_bytes, dst2src_bytes;
|
u_int64_t src2dst_bytes, dst2src_bytes;
|
||||||
|
u_int64_t src2dst_goodput_bytes, dst2src_goodput_bytes;
|
||||||
u_int32_t src2dst_packets, dst2src_packets;
|
u_int32_t src2dst_packets, dst2src_packets;
|
||||||
u_int32_t has_human_readeable_strings;
|
u_int32_t has_human_readeable_strings;
|
||||||
char human_readeable_string_buffer[32];
|
char human_readeable_string_buffer[32];
|
||||||
@@ -176,33 +188,39 @@ typedef struct ndpi_flow_info {
|
|||||||
struct ndpi_analyze_struct *iat_c_to_s, *iat_s_to_c, *iat_flow,
|
struct ndpi_analyze_struct *iat_c_to_s, *iat_s_to_c, *iat_flow,
|
||||||
*pktlen_c_to_s, *pktlen_s_to_c;
|
*pktlen_c_to_s, *pktlen_s_to_c;
|
||||||
|
|
||||||
char info[96];
|
char info[160];
|
||||||
char host_server_name[256];
|
char flow_extra_info[16];
|
||||||
|
char host_server_name[240];
|
||||||
char bittorent_hash[41];
|
char bittorent_hash[41];
|
||||||
char dhcp_fingerprint[48];
|
char dhcp_fingerprint[48];
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
u_int16_t ssl_version;
|
u_int16_t ssl_version;
|
||||||
char client_info[64], server_info[64],
|
char client_requested_server_name[64], server_info[64],
|
||||||
client_hassh[33], server_hassh[33],
|
client_hassh[33], server_hassh[33], *server_names,
|
||||||
|
*tls_alpn, *tls_supported_versions,
|
||||||
server_organization[64],
|
server_organization[64],
|
||||||
ja3_client[33], ja3_server[33],
|
ja3_client[33], ja3_server[33],
|
||||||
sha1_cert_fingerprint[20];
|
sha1_cert_fingerprint[20];
|
||||||
|
u_int8_t sha1_cert_fingerprint_set;
|
||||||
time_t notBefore, notAfter;
|
time_t notBefore, notAfter;
|
||||||
u_int16_t server_cipher;
|
u_int16_t server_cipher;
|
||||||
ndpi_cipher_weakness client_unsafe_cipher, server_unsafe_cipher;
|
ndpi_cipher_weakness client_unsafe_cipher, server_unsafe_cipher;
|
||||||
} ssh_tls;
|
} ssh_tls;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char url[256];
|
char url[256], content_type[64], user_agent[128];
|
||||||
u_int response_status_code;
|
u_int response_status_code;
|
||||||
} http;
|
} http;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
char username[32], password[32];
|
||||||
|
} telnet;
|
||||||
|
|
||||||
void *src_id, *dst_id;
|
void *src_id, *dst_id;
|
||||||
|
|
||||||
struct ndpi_entropy entropy;
|
struct ndpi_entropy entropy;
|
||||||
struct ndpi_entropy last_entropy;
|
struct ndpi_entropy last_entropy;
|
||||||
|
|
||||||
} ndpi_flow_info_t;
|
} ndpi_flow_info_t;
|
||||||
|
|
||||||
|
|
||||||
@@ -299,6 +317,7 @@ 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);
|
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow);
|
||||||
u_int32_t ethernet_crc32(const void* data, size_t n_bytes);
|
u_int32_t ethernet_crc32(const void* data, size_t n_bytes);
|
||||||
void ndpi_flow_info_freer(void *node);
|
void ndpi_flow_info_freer(void *node);
|
||||||
|
void ndpi_free_flow_data_analysis(struct ndpi_flow_info *flow);
|
||||||
const char* print_cipher_id(u_int32_t cipher);
|
const char* print_cipher_id(u_int32_t cipher);
|
||||||
float ndpi_flow_get_byte_count_entropy(const uint32_t byte_count[256], unsigned int num_bytes);
|
float ndpi_flow_get_byte_count_entropy(const uint32_t byte_count[256], unsigned int num_bytes);
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
bin_PROGRAMS = fuzz_process_packet fuzz_ndpi_reader
|
||||||
|
|
||||||
|
fuzz_process_packet_SOURCES = fuzz_process_packet.c
|
||||||
|
fuzz_process_packet_LDFLAGS = ../src/lib/libndpi.a $(ADDITIONAL_LIBS)
|
||||||
|
if HAS_FUZZLDFLAGS
|
||||||
|
fuzz_process_packet_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
else
|
||||||
|
fuzz_process_packet_SOURCES += onefile.c
|
||||||
|
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 $@
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_SOURCES = fuzz_ndpi_reader.c
|
||||||
|
fuzz_ndpi_reader_CFLAGS = -I../example/
|
||||||
|
fuzz_ndpi_reader_LDFLAGS = ../example/libndpiReader.a ../src/lib/libndpi.a $(PCAP_LIB) $(ADDITIONAL_LIBS)
|
||||||
|
if HAS_FUZZLDFLAGS
|
||||||
|
fuzz_ndpi_reader_LDFLAGS += $(LIB_FUZZING_ENGINE)
|
||||||
|
else
|
||||||
|
fuzz_ndpi_reader_SOURCES += onefile.c
|
||||||
|
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 $@
|
||||||
|
|
||||||
|
EXTRA_fuzz_ndpi_reader_DEPENDENCIES = fuzz_ndpi_reader_seed_corpus.zip
|
||||||
|
|
||||||
|
testpcaps := $(wildcard ../tests/pcap/*.pcap)
|
||||||
|
|
||||||
|
fuzz_ndpi_reader_seed_corpus.zip: $(testpcaps)
|
||||||
|
zip -r fuzz_ndpi_reader_seed_corpus.zip $(testpcaps)
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
#include "reader_util.h"
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
#include <pcap/pcap.h>
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
struct ndpi_workflow_prefs *prefs = NULL;
|
||||||
|
|
||||||
|
int nDPI_LogLevel = 0;
|
||||||
|
char *_debug_protocols = NULL;
|
||||||
|
u_int32_t current_ndpi_memory = 0, max_ndpi_memory = 0;
|
||||||
|
u_int8_t enable_protocol_guess = 1, enable_payload_analyzer = 0;
|
||||||
|
u_int8_t enable_joy_stats = 0;
|
||||||
|
u_int8_t human_readeable_string_len = 5;
|
||||||
|
u_int8_t max_num_udp_dissected_pkts = 16 /* 8 is enough for most protocols, Signal requires more */, max_num_tcp_dissected_pkts = 80 /* due to telnet */;
|
||||||
|
|
||||||
|
int bufferToFile(const char * name, const uint8_t *Data, size_t Size) {
|
||||||
|
FILE * fd;
|
||||||
|
if (remove(name) != 0) {
|
||||||
|
if (errno != ENOENT) {
|
||||||
|
printf("failed remove, errno=%d\n", errno);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fd = fopen(name, "wb");
|
||||||
|
if (fd == NULL) {
|
||||||
|
printf("failed open, errno=%d\n", errno);
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
if (fwrite (Data, 1, Size, fd) != Size) {
|
||||||
|
fclose(fd);
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
fclose(fd);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||||
|
pcap_t * pkts;
|
||||||
|
const u_char *pkt;
|
||||||
|
struct pcap_pkthdr *header;
|
||||||
|
int r;
|
||||||
|
char errbuf[PCAP_ERRBUF_SIZE];
|
||||||
|
NDPI_PROTOCOL_BITMASK all;
|
||||||
|
|
||||||
|
if (prefs == NULL) {
|
||||||
|
prefs = calloc(sizeof(struct ndpi_workflow_prefs), 1);
|
||||||
|
if (prefs == NULL) {
|
||||||
|
//should not happen
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
prefs->decode_tunnels = 1;
|
||||||
|
prefs->num_roots = 16;
|
||||||
|
prefs->max_ndpi_flows = 1024;
|
||||||
|
prefs->quiet_mode = 0;
|
||||||
|
}
|
||||||
|
bufferToFile("/tmp/fuzz.pcap", Data, Size);
|
||||||
|
|
||||||
|
pkts = pcap_open_offline("/tmp/fuzz.pcap", errbuf);
|
||||||
|
if (pkts == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
struct ndpi_workflow * workflow = ndpi_workflow_init(prefs, pkts);
|
||||||
|
// enable all protocols
|
||||||
|
NDPI_BITMASK_SET_ALL(all);
|
||||||
|
ndpi_set_protocol_detection_bitmask2(workflow->ndpi_struct, &all);
|
||||||
|
memset(workflow->stats.protocol_counter, 0,
|
||||||
|
sizeof(workflow->stats.protocol_counter));
|
||||||
|
memset(workflow->stats.protocol_counter_bytes, 0,
|
||||||
|
sizeof(workflow->stats.protocol_counter_bytes));
|
||||||
|
memset(workflow->stats.protocol_flows, 0,
|
||||||
|
sizeof(workflow->stats.protocol_flows));
|
||||||
|
ndpi_finalize_initalization(workflow->ndpi_struct);
|
||||||
|
|
||||||
|
r = pcap_next_ex(pkts, &header, &pkt);
|
||||||
|
while (r > 0) {
|
||||||
|
/* allocate an exact size buffer to check overflows */
|
||||||
|
uint8_t *packet_checked = malloc(header->caplen);
|
||||||
|
memcpy(packet_checked, pkt, header->caplen);
|
||||||
|
ndpi_workflow_process_packet(workflow, header, packet_checked);
|
||||||
|
free(packet_checked);
|
||||||
|
r = pcap_next_ex(pkts, &header, &pkt);
|
||||||
|
}
|
||||||
|
ndpi_workflow_free(workflow);
|
||||||
|
pcap_close(pkts);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
struct ndpi_detection_module_struct *ndpi_info_mod = NULL;
|
||||||
|
struct ndpi_id_struct *src;
|
||||||
|
struct ndpi_id_struct *dst;
|
||||||
|
|
||||||
|
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
||||||
|
if (ndpi_info_mod == NULL) {
|
||||||
|
ndpi_info_mod = ndpi_init_detection_module(ndpi_no_prefs);
|
||||||
|
NDPI_PROTOCOL_BITMASK all;
|
||||||
|
NDPI_BITMASK_SET_ALL(all);
|
||||||
|
ndpi_set_protocol_detection_bitmask2(ndpi_info_mod, &all);
|
||||||
|
src = ndpi_malloc(SIZEOF_ID_STRUCT);
|
||||||
|
dst = ndpi_malloc(SIZEOF_ID_STRUCT);
|
||||||
|
}
|
||||||
|
|
||||||
|
struct ndpi_flow_struct *ndpi_flow = ndpi_flow_malloc(SIZEOF_FLOW_STRUCT);
|
||||||
|
memset(ndpi_flow, 0, SIZEOF_FLOW_STRUCT);
|
||||||
|
memset(src, 0, SIZEOF_ID_STRUCT);
|
||||||
|
memset(dst, 0, SIZEOF_ID_STRUCT);
|
||||||
|
ndpi_detection_process_packet(ndpi_info_mod, ndpi_flow, Data, Size, 0, src, dst);
|
||||||
|
ndpi_free_flow(ndpi_flow);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -29,8 +29,8 @@ build-rpm: build-src cleanup-rpm
|
|||||||
tar cvfz $(HOME)/rpmbuild/SOURCES/ndpi-@PACKAGE_VERSION@.tgz ndpi-@PACKAGE_VERSION@
|
tar cvfz $(HOME)/rpmbuild/SOURCES/ndpi-@PACKAGE_VERSION@.tgz ndpi-@PACKAGE_VERSION@
|
||||||
@rm -f $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
|
@rm -f $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
|
||||||
@rpmbuild -bb ./$(APPL).spec --define "buildnumber $(GIT_REVISION)"
|
@rpmbuild -bb ./$(APPL).spec --define "buildnumber $(GIT_REVISION)"
|
||||||
@if [[ $EUID -ne 0 ]]; then ./rpm-sign.exp $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE); fi
|
@if [[ $EUID -ne 0 ]]; then @RPM_SIGN_CMD@ $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE); fi
|
||||||
@if [[ $EUID -ne 0 ]]; then ./rpm-sign.exp $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(DEV_PACKAGE); fi
|
@if [[ $EUID -ne 0 ]]; then @RPM_SIGN_CMD@ $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(DEV_PACKAGE); fi
|
||||||
@echo ""
|
@echo ""
|
||||||
@echo "Package contents:"
|
@echo "Package contents:"
|
||||||
@rpm -qpl $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
|
@rpm -qpl $(HOME)/rpmbuild/RPMS/$(PLATFORM)/$(PACKAGE)
|
||||||
|
|||||||
Vendored
+12
@@ -583,6 +583,7 @@ PACKAGE_URL=''
|
|||||||
|
|
||||||
ac_subst_vars='LTLIBOBJS
|
ac_subst_vars='LTLIBOBJS
|
||||||
LIBOBJS
|
LIBOBJS
|
||||||
|
RPM_SIGN_CMD
|
||||||
MAJOR_RELEASE
|
MAJOR_RELEASE
|
||||||
GIT_REVISION
|
GIT_REVISION
|
||||||
KERNEL
|
KERNEL
|
||||||
@@ -1698,6 +1699,16 @@ PACKAGE_VERSION=`../version.sh --release`
|
|||||||
MAJOR_RELEASE=`../version.sh --major-release`
|
MAJOR_RELEASE=`../version.sh --major-release`
|
||||||
GIT_REVISION=`../version.sh --revision`
|
GIT_REVISION=`../version.sh --revision`
|
||||||
|
|
||||||
|
CENTOS_RELEASE=`cat /etc/centos-release | cut -d ' ' -f 3|cut -d '.' -f 1`
|
||||||
|
if test $CENTOS_RELEASE = "release"; then
|
||||||
|
CENTOS_RELEASE=`cat /etc/centos-release | cut -d ' ' -f 4|cut -d '.' -f 1`
|
||||||
|
fi
|
||||||
|
|
||||||
|
RPM_SIGN_CMD="rpm --addsign"
|
||||||
|
if test "$CENTOS_RELEASE" -ne 8; then
|
||||||
|
RPM_SIGN_CMD="./rpm-sign.exp"
|
||||||
|
fi
|
||||||
|
|
||||||
ac_config_files="$ac_config_files Makefile ndpi.spec"
|
ac_config_files="$ac_config_files Makefile ndpi.spec"
|
||||||
|
|
||||||
|
|
||||||
@@ -1710,6 +1721,7 @@ ac_config_files="$ac_config_files Makefile ndpi.spec"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
# tests run on this system so they can be shared between configure
|
# tests run on this system so they can be shared between configure
|
||||||
|
|||||||
@@ -29,6 +29,16 @@ PACKAGE_VERSION=`../version.sh --release`
|
|||||||
MAJOR_RELEASE=`../version.sh --major-release`
|
MAJOR_RELEASE=`../version.sh --major-release`
|
||||||
GIT_REVISION=`../version.sh --revision`
|
GIT_REVISION=`../version.sh --revision`
|
||||||
|
|
||||||
|
CENTOS_RELEASE=`cat /etc/centos-release | cut -d ' ' -f 3|cut -d '.' -f 1`
|
||||||
|
if test $CENTOS_RELEASE = "release"; then
|
||||||
|
CENTOS_RELEASE=`cat /etc/centos-release | cut -d ' ' -f 4|cut -d '.' -f 1`
|
||||||
|
fi
|
||||||
|
|
||||||
|
RPM_SIGN_CMD="rpm --addsign"
|
||||||
|
if test "$CENTOS_RELEASE" -ne 8; then
|
||||||
|
RPM_SIGN_CMD="./rpm-sign.exp"
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CONFIG_FILES([Makefile ndpi.spec])
|
AC_CONFIG_FILES([Makefile ndpi.spec])
|
||||||
|
|
||||||
AC_SUBST(PACKAGE_VERSION)
|
AC_SUBST(PACKAGE_VERSION)
|
||||||
@@ -39,6 +49,7 @@ AC_SUBST(DATE)
|
|||||||
AC_SUBST(KERNEL)
|
AC_SUBST(KERNEL)
|
||||||
AC_SUBST(GIT_REVISION)
|
AC_SUBST(GIT_REVISION)
|
||||||
AC_SUBST(MAJOR_RELEASE)
|
AC_SUBST(MAJOR_RELEASE)
|
||||||
|
AC_SUBST(RPM_SIGN_CMD)
|
||||||
|
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
|
|||||||
%{?el6:Requires: glibc >= 2.3.4 numactl coreutils }
|
%{?el6:Requires: glibc >= 2.3.4 numactl coreutils }
|
||||||
AutoReqProv: no
|
AutoReqProv: no
|
||||||
|
|
||||||
|
%define debug_package %{nil}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
nDPI Open and Extensible LGPLv3 Deep Packet Inspection Library.
|
nDPI Open and Extensible LGPLv3 Deep Packet Inspection Library.
|
||||||
|
|
||||||
@@ -75,6 +77,8 @@ rm -fr $RPM_BUILD_ROOT
|
|||||||
/usr/local/lib/libndpi.so.@MAJOR_RELEASE@
|
/usr/local/lib/libndpi.so.@MAJOR_RELEASE@
|
||||||
/usr/local/lib/libndpi.so.@PACKAGE_VERSION@
|
/usr/local/lib/libndpi.so.@PACKAGE_VERSION@
|
||||||
/usr/local/bin/ndpiReader
|
/usr/local/bin/ndpiReader
|
||||||
|
/usr/local/share/ndpi/ndpiCustomCategory.txt
|
||||||
|
/usr/local/share/ndpi/ndpiProtos.txt
|
||||||
/etc/ld.so.conf.d/ndpi.conf
|
/etc/ld.so.conf.d/ndpi.conf
|
||||||
%{libdir}/pkgconfig/libndpi.pc
|
%{libdir}/pkgconfig/libndpi.pc
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
This direcgory contains the Python bindings for nDPI
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
- python3 ndpi_example.py <interface>
|
|
||||||
- python3 ndpi_example.py <pcap_file>
|
|
||||||
|
|
||||||
Code courtesy of Massimo Puddu
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
nDPI Python bindings
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
This directory contains the Python3 bindings for nDPI. We provide both ctypes and cffi based bindings.
|
||||||
|
|
||||||
|
**ctypes bindings**
|
||||||
|
|
||||||
|
Files:
|
||||||
|
|
||||||
|
* ndpi_typestruct.py
|
||||||
|
* ndpi_wrap.c
|
||||||
|
* Makefile.in
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pip3 install scapy
|
||||||
|
python3 ndpi_example.py <interface>
|
||||||
|
python3 ndpi_example.py <pcap_file>
|
||||||
|
|
||||||
|
Code courtesy:
|
||||||
|
|
||||||
|
* Massimo Puddu
|
||||||
|
* Zied Aouini
|
||||||
|
|
||||||
|
**cffi bindings**
|
||||||
|
|
||||||
|
Files:
|
||||||
|
|
||||||
|
* ndpi.py
|
||||||
|
|
||||||
|
|
||||||
|
Example (using NFStream package):
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
pip3 install nfstream
|
||||||
|
python3 flow_printer.py <interface>
|
||||||
|
python3 flow_printer.py <pcap_file>
|
||||||
|
|
||||||
|
Code courtesy:
|
||||||
|
|
||||||
|
* Zied Aouini
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
"""
|
||||||
|
file: flow_printer.py
|
||||||
|
This file is part of nfstream.
|
||||||
|
|
||||||
|
Copyright (C) 2019 - Zied Aouini <aouinizied@gmail.com>
|
||||||
|
|
||||||
|
nfstream is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
nfstream is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||||
|
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along with nfstream.
|
||||||
|
If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
|
||||||
|
from nfstream import NFStreamer
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
path = sys.argv[1]
|
||||||
|
flow_streamer = NFStreamer(source=path)
|
||||||
|
result = {}
|
||||||
|
try:
|
||||||
|
for flow in flow_streamer:
|
||||||
|
print(flow)
|
||||||
|
try:
|
||||||
|
result[flow.application_name] += flow.total_packets
|
||||||
|
except KeyError:
|
||||||
|
result[flow.application_name] = flow.total_packets
|
||||||
|
print("Summary (Application Name: Packets):")
|
||||||
|
print(result)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print("Summary (Application Name: Packets):")
|
||||||
|
print(result)
|
||||||
|
print("Terminated.")
|
||||||
+1297
File diff suppressed because it is too large
Load Diff
+88
-67
@@ -1,43 +1,44 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
#
|
# -*- coding: utf-8 -*-
|
||||||
# ndpi_example.py
|
|
||||||
#
|
"""
|
||||||
# Copyright (C) 2011-19 - ntop.org
|
file: ndpi_example.py
|
||||||
#
|
This file is part of nDPI.
|
||||||
# nDPI is free software: you can redistribute it and/or modify
|
|
||||||
# it under the terms of the GNU Lesser General Public License as published by
|
Copyright (C) 2011-19 - ntop.org
|
||||||
# the Free Software Foundation, either version 3 of the License, or
|
Copyright (C) 2019 - Zied Aouini <aouinizied@gmail.com> (Incremental improvements)
|
||||||
# (at your option) any later version.
|
|
||||||
#
|
nDPI is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
|
||||||
# nDPI is distributed in the hope that it will be useful,
|
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
nDPI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||||
# GNU Lesser General Public License for more details.
|
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||||
#
|
|
||||||
# You should have received a copy of the GNU Lesser General Public License
|
You should have received a copy of the GNU General Public License along with nDPI.
|
||||||
# along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
"""
|
||||||
|
|
||||||
from ndpi_typestruct import *
|
from ndpi_typestruct import *
|
||||||
|
from ctypes import *
|
||||||
from scapy.all import *
|
from scapy.all import *
|
||||||
|
import sys
|
||||||
|
|
||||||
# ------- return type & pcapstruct to declare -------
|
# ------- return type & pcapstruct to declare -------
|
||||||
|
|
||||||
|
|
||||||
class workflow(Structure):
|
class WorkFlow(Structure):
|
||||||
_fields_ = [("src_ip", c_uint32),
|
_fields_ = [("src_ip", c_uint32),
|
||||||
("dst_ip", c_uint32),
|
("dst_ip", c_uint32),
|
||||||
("src_port", c_uint16),
|
("src_port", c_uint16),
|
||||||
("dst_port", c_uint16),
|
("dst_port", c_uint16),
|
||||||
("protocol", c_uint8),
|
("protocol", c_uint8),
|
||||||
("packets", c_uint32),
|
("packets", c_uint32),
|
||||||
("detected_protocol", ndpi_protocol),
|
("detected_protocol", NDPIProtocol),
|
||||||
("detection_completed", c_uint8),
|
("detection_completed", c_uint8),
|
||||||
("id", c_uint32),
|
("id", c_uint32),
|
||||||
("src_id", POINTER(ndpi_id_struct)),
|
("src_id", POINTER(NDPIIdStruct)),
|
||||||
("dst_id", POINTER(ndpi_id_struct)),
|
("dst_id", POINTER(NDPIIdStruct)),
|
||||||
("flow", POINTER(ndpi_flow_struct))]
|
("flow", POINTER(NDPIFlowStruct))]
|
||||||
|
|
||||||
|
|
||||||
CMCFUN = CFUNCTYPE(c_int, c_void_p, c_void_p)
|
CMCFUN = CFUNCTYPE(c_int, c_void_p, c_void_p)
|
||||||
@@ -48,17 +49,19 @@ FREE = CFUNCTYPE(None, c_void_p)
|
|||||||
def node_proto_guess_walker(nodo, which, depth, user_data):
|
def node_proto_guess_walker(nodo, which, depth, user_data):
|
||||||
global ndpi_info_mod
|
global ndpi_info_mod
|
||||||
|
|
||||||
flow = cast(nodo, POINTER(POINTER(workflow))).contents.contents
|
flow = cast(nodo, POINTER(POINTER(WorkFlow))).contents.contents
|
||||||
if which == 0 or which == 3: #execute only preorder operation of the tree
|
if which == 0 or which == 3: # execute only preorder operation of the tree
|
||||||
if flow.detection_completed == 0: # order for tree operation
|
if flow.detection_completed == 0: # order for tree operation
|
||||||
flow.detected_protocol = ndpi.ndpi_detection_giveup(ndpi_info_mod, flow.flow, flow.protocol,
|
flow.detected_protocol = ndpi.ndpi_detection_giveup(ndpi_info_mod,
|
||||||
int(socket.ntohl(flow.src_ip)), 1)
|
flow.flow,
|
||||||
|
1,
|
||||||
|
cast(addressof(c_uint8(0)), POINTER(c_uint8)))
|
||||||
count_protocol[flow.detected_protocol.app_protocol] += flow.packets
|
count_protocol[flow.detected_protocol.app_protocol] += flow.packets
|
||||||
|
|
||||||
|
|
||||||
def py_cmp_fun(a, b):
|
def py_cmp_fun(a, b):
|
||||||
fa = cast(a, POINTER(workflow))
|
fa = cast(a, POINTER(WorkFlow))
|
||||||
fb = cast(b, POINTER(workflow))
|
fb = cast(b, POINTER(WorkFlow))
|
||||||
|
|
||||||
if fa.contents.src_ip < fb.contents.src_ip: return -1
|
if fa.contents.src_ip < fb.contents.src_ip: return -1
|
||||||
elif fa.contents.src_ip > fb.contents.src_ip: return 1
|
elif fa.contents.src_ip > fb.contents.src_ip: return 1
|
||||||
@@ -83,7 +86,7 @@ free_walk = FREE(freer)
|
|||||||
|
|
||||||
# --------------------------------------
|
# --------------------------------------
|
||||||
|
|
||||||
# number of anylized packet
|
# number of analyzed packet
|
||||||
packet_number = 0
|
packet_number = 0
|
||||||
flow_count = 0
|
flow_count = 0
|
||||||
max_num_udp_dissected_pkts = 16
|
max_num_udp_dissected_pkts = 16
|
||||||
@@ -103,6 +106,8 @@ if ndpi.ndpi_get_api_version() != ndpi.ndpi_wrap_get_api_version():
|
|||||||
ndpi_info_mod = ndpi.ndpi_init_detection_module()
|
ndpi_info_mod = ndpi.ndpi_init_detection_module()
|
||||||
if ndpi_info_mod is None:
|
if ndpi_info_mod is None:
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
else:
|
||||||
|
ndpi_ndpi_finalize_initalization(ndpi_info_mod)
|
||||||
|
|
||||||
|
|
||||||
def ip2int(ip):
|
def ip2int(ip):
|
||||||
@@ -113,30 +118,34 @@ def ip2int(ip):
|
|||||||
return int(struct.unpack("!I", packedIP)[0])
|
return int(struct.unpack("!I", packedIP)[0])
|
||||||
|
|
||||||
|
|
||||||
def get_flow(packet):
|
def get_flow(pkt):
|
||||||
global flows_root
|
global flows_root
|
||||||
global flows_root_ref
|
global flows_root_ref
|
||||||
global flow_count
|
global flow_count
|
||||||
|
|
||||||
ip_packet = packet[1]
|
ip_packet = pkt[1]
|
||||||
ip_protocol = ip_packet.proto
|
ip_protocol = ip_packet.proto
|
||||||
transport_packet = None
|
transport_packet = None
|
||||||
|
|
||||||
if ip_protocol == 6 or ip_protocol == 17: transport_packet = packet[2]
|
if ip_protocol == 6 or ip_protocol == 17:
|
||||||
|
transport_packet = pkt[2]
|
||||||
if transport_packet is not None:
|
if transport_packet is not None:
|
||||||
# to avoid two nodes in one binary tree for a flow
|
# to avoid two nodes in one binary tree for a flow
|
||||||
ip_src = ip2int(ip_packet.src)
|
ip_src = ip2int(ip_packet.src)
|
||||||
ip_dst = ip2int(ip_packet.dst)
|
ip_dst = ip2int(ip_packet.dst)
|
||||||
src_port = transport_packet.sport
|
src_port = transport_packet.sport
|
||||||
dst_port = transport_packet.dport
|
dst_port = transport_packet.dport
|
||||||
else: return None
|
|
||||||
# set flows to correct type and data
|
|
||||||
ndpi_flow = pointer(ndpi_flow_struct())
|
|
||||||
memset(ndpi_flow, 0, sizeof(ndpi_flow_struct))
|
|
||||||
if ip_src > ip_dst:
|
|
||||||
flow = workflow(ip_src, ip_dst, src_port, dst_port, int(ip_packet.proto), 0, ndpi_protocol(), 0, 0, pointer(ndpi_id_struct()), pointer(ndpi_id_struct()), ndpi_flow)
|
|
||||||
else:
|
else:
|
||||||
flow = workflow(ip_dst, ip_src, dst_port, src_port, int(ip_packet.proto), 0, ndpi_protocol(), 0, 0, pointer(ndpi_id_struct()), pointer(ndpi_id_struct()), ndpi_flow)
|
return None
|
||||||
|
# set flows to correct type and data
|
||||||
|
ndpi_flow = pointer(NDPIFlowStruct())
|
||||||
|
memset(ndpi_flow, 0, sizeof(NDPIFlowStruct))
|
||||||
|
if ip_src > ip_dst:
|
||||||
|
flow = WorkFlow(ip_src, ip_dst, src_port, dst_port, int(ip_packet.proto), 0, NDPIProtocol(), 0, 0,
|
||||||
|
pointer(NDPIIdStruct()), pointer(NDPIIdStruct()), ndpi_flow)
|
||||||
|
else:
|
||||||
|
flow = WorkFlow(ip_dst, ip_src, dst_port, src_port, int(ip_packet.proto), 0, NDPIProtocol(), 0, 0,
|
||||||
|
pointer(NDPIIdStruct()), pointer(NDPIIdStruct()), ndpi_flow)
|
||||||
flow_ref = pointer(flow)
|
flow_ref = pointer(flow)
|
||||||
res = ndpi.ndpi_tfind(flow_ref, flows_root_ref, cmp_func)
|
res = ndpi.ndpi_tfind(flow_ref, flows_root_ref, cmp_func)
|
||||||
if res is None:
|
if res is None:
|
||||||
@@ -144,41 +153,45 @@ def get_flow(packet):
|
|||||||
lista.append(flow)
|
lista.append(flow)
|
||||||
flow_count += 1
|
flow_count += 1
|
||||||
return pointer(flow)
|
return pointer(flow)
|
||||||
flow = cast(res, POINTER(POINTER(workflow))).contents
|
flow = cast(res, POINTER(POINTER(WorkFlow))).contents
|
||||||
return flow
|
return flow
|
||||||
|
|
||||||
|
|
||||||
def packetcaptured(packet):
|
def packetcaptured(pkt):
|
||||||
global packet_number
|
global packet_number
|
||||||
global start_time
|
|
||||||
global ndpi_info_mod
|
global ndpi_info_mod
|
||||||
|
|
||||||
flow = None
|
flow = None
|
||||||
h = pcap_pkthdr()
|
h = PcapPktHdr()
|
||||||
|
|
||||||
#getting flow
|
# getting flow
|
||||||
try:
|
try:
|
||||||
flow = get_flow(packet)
|
flow = get_flow(pkt)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
pass # ignore packet
|
pass # ignore packet
|
||||||
if flow is None: return
|
if flow is None: return
|
||||||
|
|
||||||
#filling pcap_pkthdr
|
# filling pcap_pkthdr
|
||||||
h.len = h.caplen = len(packet)
|
h.len = h.caplen = len(pkt)
|
||||||
h.ts.tv_sec = int(packet["IP"].time/1000000)
|
h.ts.tv_sec = int(pkt["IP"].time/1000000)
|
||||||
h.ts.tv_usec = int(packet["IP"].time)
|
h.ts.tv_usec = int(pkt["IP"].time)
|
||||||
|
|
||||||
# real work
|
# real work
|
||||||
if int(packet[1].frag) == 0: # not fragmented packet
|
if int(pkt[1].frag) == 0: # not fragmented packet
|
||||||
flow.contents.packets += 1
|
flow.contents.packets += 1
|
||||||
packet_number += 1
|
packet_number += 1
|
||||||
# get ndpi_iphdr address
|
# get ndpi_iphdr address
|
||||||
iphdr_addr = cast(c_char_p(packet[1].build()), c_void_p)
|
iphdr_addr = cast(c_char_p(pkt[1].build()), c_void_p)
|
||||||
ndpi_flow = flow.contents.flow
|
ndpi_flow = flow.contents.flow
|
||||||
|
|
||||||
if flow.contents.detection_completed is 0:
|
if flow.contents.detection_completed is 0:
|
||||||
flow.contents.detected_protocol = ndpi.ndpi_detection_process_packet(ndpi_info_mod, ndpi_flow, cast(iphdr_addr, POINTER(c_uint8)),
|
flow.contents.detected_protocol = ndpi.ndpi_detection_process_packet(ndpi_info_mod,
|
||||||
int(packet[1].len), h.ts.tv_usec, flow.contents.src_id, flow.contents.dst_id)
|
ndpi_flow,
|
||||||
|
cast(iphdr_addr, POINTER(c_uint8)),
|
||||||
|
int(pkt[1].len),
|
||||||
|
h.ts.tv_usec,
|
||||||
|
flow.contents.src_id,
|
||||||
|
flow.contents.dst_id)
|
||||||
|
|
||||||
flow1 = flow.contents.detected_protocol
|
flow1 = flow.contents.detected_protocol
|
||||||
|
|
||||||
@@ -187,27 +200,32 @@ def packetcaptured(packet):
|
|||||||
if flow.contents.protocol == 6: valid = flow.contents.packets > max_num_tcp_dissected_pkts
|
if flow.contents.protocol == 6: valid = flow.contents.packets > max_num_tcp_dissected_pkts
|
||||||
elif flow.contents.protocol == 17: valid = flow.contents.packets > max_num_udp_dissected_pkts
|
elif flow.contents.protocol == 17: valid = flow.contents.packets > max_num_udp_dissected_pkts
|
||||||
|
|
||||||
#should we continue anylizing packet or not?
|
# should we continue anylizing packet or not?
|
||||||
if valid or flow1.app_protocol is not 0:
|
if valid or flow1.app_protocol is not 0:
|
||||||
if valid or flow1.master_protocol is not 91: #or # 91 is NDPI_PROTOCOL_TLS
|
if valid or flow1.master_protocol is not 91: # or # 91 is NDPI_PROTOCOL_TLS
|
||||||
flow.contents.detection_completed = 1 #protocol found
|
flow.contents.detection_completed = 1 # protocol found
|
||||||
if flow1.app_protocol is 0:
|
if flow1.app_protocol is 0:
|
||||||
flow.contents.detected_protocol = ndpi.ndpi_detection_giveup(ndpi_info_mod, ndpi_flow, 1)
|
flow.contents.detected_protocol = ndpi.ndpi_detection_giveup(ndpi_info_mod,
|
||||||
|
ndpi_flow,
|
||||||
|
1,
|
||||||
|
cast(addressof(c_uint8(0)),
|
||||||
|
POINTER(c_uint8)))
|
||||||
|
|
||||||
|
|
||||||
def result():
|
def result():
|
||||||
global flows_root_ref
|
global flows_root_ref
|
||||||
global ndpi_info_mod
|
global ndpi_info_mod
|
||||||
print('\nnumber of anylized packet ' + str(packet_number))
|
print('\nnumber of analyzed packet: ' + str(packet_number))
|
||||||
print('number of flows ' + str(flow_count))
|
print('number of flows: ' + str(flow_count))
|
||||||
|
|
||||||
ndpi.ndpi_twalk(flows_root_ref.contents, guess_walker, None)
|
ndpi.ndpi_twalk(flows_root_ref.contents, guess_walker, None)
|
||||||
|
|
||||||
print('\nDetected protocols:')
|
print('\nDetected protocols:')
|
||||||
for i in range(0, ndpi.ndpi_get_num_supported_protocols(ndpi_info_mod)):
|
for i in range(0, ndpi.ndpi_get_num_supported_protocols(ndpi_info_mod)):
|
||||||
if count_protocol[i] > 0:
|
if count_protocol[i] > 0:
|
||||||
print(cast(ndpi.ndpi_get_proto_name(ndpi_info_mod, i), c_char_p).value + ': '.encode('UTF-8') + str(count_protocol[i]).encode('UTF-8'))
|
print("{}: {} packets".format(
|
||||||
|
cast(ndpi.ndpi_get_proto_name(ndpi_info_mod, i), c_char_p).value.decode('utf-8'),
|
||||||
|
str(count_protocol[i])))
|
||||||
|
|
||||||
|
|
||||||
def free(ndpi_struct):
|
def free(ndpi_struct):
|
||||||
@@ -216,16 +234,16 @@ def free(ndpi_struct):
|
|||||||
|
|
||||||
|
|
||||||
def initialize(ndpi_struct):
|
def initialize(ndpi_struct):
|
||||||
all = NDPI_PROTOCOL_BITMASK()
|
all = NDPIProtocolBitMask()
|
||||||
ndpi.ndpi_wrap_NDPI_BITMASK_SET_ALL(pointer(all))
|
ndpi.ndpi_wrap_NDPI_BITMASK_SET_ALL(pointer(all))
|
||||||
ndpi.ndpi_set_protocol_detection_bitmask2(ndpi_struct, pointer(all))
|
ndpi.ndpi_set_protocol_detection_bitmask2(ndpi_struct, pointer(all))
|
||||||
|
|
||||||
|
|
||||||
print('Using nDPI ' + str(cast(ndpi.ndpi_revision(), c_char_p).value))
|
print('Using nDPI ' + cast(ndpi.ndpi_revision(), c_char_p).value.decode("utf-8"))
|
||||||
|
|
||||||
initialize(ndpi_info_mod)
|
initialize(ndpi_info_mod)
|
||||||
|
|
||||||
if(len(sys.argv) != 2):
|
if len(sys.argv) != 2:
|
||||||
print("\nUsage: ndpi_example.py <device>")
|
print("\nUsage: ndpi_example.py <device>")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
@@ -247,6 +265,9 @@ else:
|
|||||||
sniff(iface=sys.argv[1], prn=packetcaptured)
|
sniff(iface=sys.argv[1], prn=packetcaptured)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('\nInterrupted\n')
|
print('\nInterrupted\n')
|
||||||
|
except PermissionError:
|
||||||
|
sys.exit('\nRoot privilege required for live capture on interface: {}\n'.format(sys.argv[1]))
|
||||||
|
|
||||||
|
|
||||||
result()
|
result()
|
||||||
free(ndpi_info_mod)
|
free(ndpi_info_mod)
|
||||||
|
|||||||
+446
-355
File diff suppressed because it is too large
Load Diff
+110
-33
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_api.h
|
* ndpi_api.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -138,11 +138,23 @@ extern "C" {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a new initialized detection module
|
* Returns a new initialized detection module
|
||||||
|
* Note that before you can use it you can still load
|
||||||
|
* hosts and do other things. As soon as you are ready to use
|
||||||
|
* it do not forget to call first ndpi_finalize_initalization()
|
||||||
|
*
|
||||||
|
* @par prefs = load preferences
|
||||||
|
* @return the initialized detection module
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
struct ndpi_detection_module_struct *ndpi_init_detection_module(ndpi_init_prefs prefs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Completes the initialization (2nd step)
|
||||||
*
|
*
|
||||||
* @return the initialized detection module
|
* @return the initialized detection module
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
struct ndpi_detection_module_struct *ndpi_init_detection_module(void);
|
void ndpi_finalize_initalization(struct ndpi_detection_module_struct *ndpi_str);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Frees the memory allocated in the specified flow
|
* Frees the memory allocated in the specified flow
|
||||||
@@ -207,30 +219,21 @@ extern "C" {
|
|||||||
void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
const NDPI_PROTOCOL_BITMASK * detection_bitmask);
|
const NDPI_PROTOCOL_BITMASK * detection_bitmask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to be called to see in case of unknown match to see if there is
|
|
||||||
* a partial match that has been prevented by the current nDPI preferences configuration
|
|
||||||
*
|
|
||||||
* @par ndpi_struct = the detection module
|
|
||||||
* @par flow = the flow given for the detection module
|
|
||||||
* @return the detected protocol even if the flow is not completed;
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
ndpi_protocol ndpi_get_partial_detection(struct ndpi_detection_module_struct *ndpi_struct,
|
|
||||||
struct ndpi_flow_struct *flow);
|
|
||||||
/**
|
|
||||||
* Function to be called before we give up with detection for a given flow.
|
* Function to be called before we give up with detection for a given flow.
|
||||||
* This function reduces the NDPI_UNKNOWN_PROTOCOL detection
|
* This function reduces the NDPI_UNKNOWN_PROTOCOL detection
|
||||||
*
|
*
|
||||||
* @par ndpi_struct = the detection module
|
* @par ndpi_struct = the detection module
|
||||||
* @par flow = the flow given for the detection module
|
* @par flow = the flow given for the detection module
|
||||||
* @par enable_guess = guess protocol if unknown
|
* @par enable_guess = guess protocol if unknown
|
||||||
|
* @par protocol_was_guessed = 1 if the protocol was guesses (requires enable_guess = 1), 0 otherwise
|
||||||
* @return the detected protocol even if the flow is not completed;
|
* @return the detected protocol even if the flow is not completed;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_struct,
|
ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow,
|
struct ndpi_flow_struct *flow,
|
||||||
u_int8_t enable_guess);
|
u_int8_t enable_guess,
|
||||||
|
u_int8_t *protocol_was_guessed);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Processes an extra packet in order to get more information for a given protocol
|
* Processes an extra packet in order to get more information for a given protocol
|
||||||
@@ -503,6 +506,21 @@ extern "C" {
|
|||||||
u_int8_t ndpi_is_subprotocol_informative(struct ndpi_detection_module_struct *ndpi_mod,
|
u_int8_t ndpi_is_subprotocol_informative(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
u_int16_t protoId);
|
u_int16_t protoId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set hostname-based protocol
|
||||||
|
*
|
||||||
|
* @par ndpi_mod = the detection module
|
||||||
|
* @par flow = the flow to which this communication belongs to
|
||||||
|
* @par master_protocol = the master protocol for this flow
|
||||||
|
* @par name = the host name
|
||||||
|
* @par name_len = length of the host name
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int ndpi_match_hostname_protocol(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
|
u_int16_t master_protocol,
|
||||||
|
char *name, u_int name_len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get protocol category as string
|
* Get protocol category as string
|
||||||
*
|
*
|
||||||
@@ -613,6 +631,16 @@ extern "C" {
|
|||||||
int ndpi_load_protocols_file(struct ndpi_detection_module_struct *ndpi_mod,
|
int ndpi_load_protocols_file(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
const char* path);
|
const char* path);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read a file and load the categories
|
||||||
|
*
|
||||||
|
* @par ndpi_mod = the detection module
|
||||||
|
* @par path = the path of the file
|
||||||
|
* @return 0 if the file is loaded correctly;
|
||||||
|
* -1 else
|
||||||
|
*/
|
||||||
|
int ndpi_load_categories_file(struct ndpi_detection_module_struct *ndpi_str, const char* path);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the total number of the supported protocols
|
* Get the total number of the supported protocols
|
||||||
*
|
*
|
||||||
@@ -744,26 +772,32 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
int ndpi_match_string(void *_automa, char *string_to_match);
|
int ndpi_match_string(void *_automa, char *string_to_match);
|
||||||
|
|
||||||
void ndpi_load_ip_category(struct ndpi_detection_module_struct *ndpi_struct,
|
int ndpi_load_ip_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
char *ip_address_and_mask, ndpi_protocol_category_t category);
|
const char *ip_address_and_mask, ndpi_protocol_category_t category);
|
||||||
int ndpi_load_hostname_category(struct ndpi_detection_module_struct *ndpi_struct,
|
int ndpi_load_hostname_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
char *name, ndpi_protocol_category_t category);
|
const char *name_to_add, ndpi_protocol_category_t category);
|
||||||
|
int ndpi_load_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
const char *ip_or_name, ndpi_protocol_category_t category);
|
||||||
int ndpi_enable_loaded_categories(struct ndpi_detection_module_struct *ndpi_struct);
|
int ndpi_enable_loaded_categories(struct ndpi_detection_module_struct *ndpi_struct);
|
||||||
int ndpi_fill_ip_protocol_category(struct ndpi_detection_module_struct *ndpi_struct,
|
int ndpi_fill_ip_protocol_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
u_int32_t saddr,
|
u_int32_t saddr,
|
||||||
u_int32_t daddr,
|
u_int32_t daddr,
|
||||||
ndpi_protocol *ret);
|
ndpi_protocol *ret);
|
||||||
int ndpi_match_custom_category(struct ndpi_detection_module_struct *ndpi_struct,
|
int ndpi_match_custom_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
char *name, unsigned long *id);
|
char *name, u_int name_len, unsigned long *id);
|
||||||
void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow,
|
struct ndpi_flow_struct *flow,
|
||||||
ndpi_protocol *ret);
|
ndpi_protocol *ret);
|
||||||
int ndpi_get_custom_category_match(struct ndpi_detection_module_struct *ndpi_struct,
|
int ndpi_get_custom_category_match(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
char *name_or_ip, unsigned long *id);
|
char *name_or_ip, u_int name_len, unsigned long *id);
|
||||||
int ndpi_set_detection_preferences(struct ndpi_detection_module_struct *ndpi_mod,
|
int ndpi_set_detection_preferences(struct ndpi_detection_module_struct *ndpi_mod,
|
||||||
ndpi_detection_preference pref,
|
ndpi_detection_preference pref,
|
||||||
int value);
|
int value);
|
||||||
|
|
||||||
|
/* Tells to called on what l4 protocol given application protocol can be found */
|
||||||
|
ndpi_l4_proto_info ndpi_get_l4_proto_info(struct ndpi_detection_module_struct *ndpi_struct, u_int16_t ndpi_proto_id);
|
||||||
|
const char* ndpi_get_l4_proto_name(ndpi_l4_proto_info proto);
|
||||||
|
|
||||||
ndpi_proto_defaults_t* ndpi_get_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod);
|
ndpi_proto_defaults_t* ndpi_get_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod);
|
||||||
u_int ndpi_get_ndpi_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
u_int ndpi_get_ndpi_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
||||||
u_int ndpi_get_ndpi_num_custom_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
u_int ndpi_get_ndpi_num_custom_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
||||||
@@ -782,11 +816,12 @@ extern "C" {
|
|||||||
*
|
*
|
||||||
* @par The automata initialized with ndpi_init_automa();
|
* @par The automata initialized with ndpi_init_automa();
|
||||||
* @par The (sub)string to search
|
* @par The (sub)string to search
|
||||||
|
* @par The (sub)string length
|
||||||
* @par The id associated with the matched string or 0 id not found.
|
* @par The id associated with the matched string or 0 id not found.
|
||||||
* @return 0 in case of match, or -1 if no match, or -2 if an error occurred.
|
* @return 0 in case of match, or -1 if no match, or -2 if an error occurred.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
int ndpi_match_string_id(void *_automa, char *string_to_match, unsigned long *id);
|
int ndpi_match_string_id(void *_automa, char *string_to_match, u_int match_len, unsigned long *id);
|
||||||
|
|
||||||
/* Utility functions to set ndpi malloc/free/print wrappers */
|
/* Utility functions to set ndpi malloc/free/print wrappers */
|
||||||
void set_ndpi_malloc(void* (*__ndpi_malloc)(size_t size));
|
void set_ndpi_malloc(void* (*__ndpi_malloc)(size_t size));
|
||||||
@@ -810,13 +845,39 @@ extern "C" {
|
|||||||
struct ndpi_flow_struct *flow);
|
struct ndpi_flow_struct *flow);
|
||||||
u_int8_t ndpi_is_safe_ssl_cipher(u_int32_t cipher);
|
u_int8_t ndpi_is_safe_ssl_cipher(u_int32_t cipher);
|
||||||
const char* ndpi_cipher2str(u_int32_t cipher);
|
const char* ndpi_cipher2str(u_int32_t cipher);
|
||||||
|
const char* ndpi_tunnel2str(ndpi_packet_tunnel tt);
|
||||||
u_int16_t ndpi_guess_host_protocol_id(struct ndpi_detection_module_struct *ndpi_struct,
|
u_int16_t ndpi_guess_host_protocol_id(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow);
|
struct ndpi_flow_struct *flow);
|
||||||
int ndpi_has_human_readeable_string(struct ndpi_detection_module_struct *ndpi_struct,
|
int ndpi_has_human_readeable_string(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
char *buffer, u_int buffer_size,
|
char *buffer, u_int buffer_size,
|
||||||
u_int8_t min_string_match_len, /* Will return 0 if no string > min_string_match_len have been found */
|
u_int8_t min_string_match_len, /* Will return 0 if no string > min_string_match_len have been found */
|
||||||
char *outbuf, u_int outbuf_len);
|
char *outbuf, u_int outbuf_len);
|
||||||
char* ndpi_ssl_version2str(u_int16_t version);
|
char* ndpi_ssl_version2str(u_int16_t version, u_int8_t *unknown_tls_version);
|
||||||
|
void ndpi_patchIPv6Address(char *str);
|
||||||
|
void ndpi_user_pwd_payload_copy(u_int8_t *dest, u_int dest_len, u_int offset,
|
||||||
|
const u_int8_t *src, u_int src_len);
|
||||||
|
u_char* ndpi_base64_decode(const u_char *src, size_t len, size_t *out_len);
|
||||||
|
char* ndpi_base64_encode(unsigned char const* bytes_to_encode, ssize_t in_len);
|
||||||
|
int ndpi_load_ipv4_ptree(struct ndpi_detection_module_struct *ndpi_str,
|
||||||
|
const char *path, u_int16_t protocol_id);
|
||||||
|
|
||||||
|
int ndpi_flow2json(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
|
u_int8_t ip_version,
|
||||||
|
u_int8_t l4_protocol, u_int16_t vlan_id,
|
||||||
|
u_int32_t src_v4, u_int32_t dst_v4,
|
||||||
|
struct ndpi_in6_addr *src_v6, struct ndpi_in6_addr *dst_v6,
|
||||||
|
u_int16_t src_port, u_int16_t dst_port,
|
||||||
|
ndpi_protocol l7_protocol,
|
||||||
|
ndpi_serializer *serializer);
|
||||||
|
|
||||||
|
void ndpi_md5(const u_char *data, size_t data_len, u_char hash[16]);
|
||||||
|
|
||||||
|
/* ptree (trie) API */
|
||||||
|
ndpi_ptree_t* ndpi_ptree_create(void);
|
||||||
|
int ndpi_ptree_insert(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr, u_int8_t bits, uint user_data);
|
||||||
|
int ndpi_ptree_match_addr(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr, uint *user_data);
|
||||||
|
void ndpi_ptree_destroy(ndpi_ptree_t *tree);
|
||||||
|
|
||||||
/* Serializer */
|
/* Serializer */
|
||||||
int ndpi_init_serializer_ll(ndpi_serializer *serializer, ndpi_serialization_format fmt,
|
int ndpi_init_serializer_ll(ndpi_serializer *serializer, ndpi_serialization_format fmt,
|
||||||
@@ -824,10 +885,7 @@ extern "C" {
|
|||||||
int ndpi_init_serializer(ndpi_serializer *serializer, ndpi_serialization_format fmt);
|
int ndpi_init_serializer(ndpi_serializer *serializer, ndpi_serialization_format fmt);
|
||||||
void ndpi_term_serializer(ndpi_serializer *serializer);
|
void ndpi_term_serializer(ndpi_serializer *serializer);
|
||||||
void ndpi_reset_serializer(ndpi_serializer *serializer);
|
void ndpi_reset_serializer(ndpi_serializer *serializer);
|
||||||
int ndpi_serialize_string_int32(ndpi_serializer *serializer,
|
|
||||||
const char *key, int32_t value);
|
|
||||||
int ndpi_serialize_string_int64(ndpi_serializer *serializer,
|
|
||||||
const char *key, int64_t value);
|
|
||||||
int ndpi_serialize_uint32_uint32(ndpi_serializer *serializer,
|
int ndpi_serialize_uint32_uint32(ndpi_serializer *serializer,
|
||||||
u_int32_t key, u_int32_t value);
|
u_int32_t key, u_int32_t value);
|
||||||
int ndpi_serialize_uint32_uint64(ndpi_serializer *serializer,
|
int ndpi_serialize_uint32_uint64(ndpi_serializer *serializer,
|
||||||
@@ -841,6 +899,13 @@ extern "C" {
|
|||||||
const char *format /* e.f. "%.2f" */);
|
const char *format /* e.f. "%.2f" */);
|
||||||
int ndpi_serialize_uint32_string(ndpi_serializer *serializer,
|
int ndpi_serialize_uint32_string(ndpi_serializer *serializer,
|
||||||
u_int32_t key, const char *value);
|
u_int32_t key, const char *value);
|
||||||
|
int ndpi_serialize_uint32_boolean(ndpi_serializer *serializer,
|
||||||
|
u_int32_t key, u_int8_t value);
|
||||||
|
|
||||||
|
int ndpi_serialize_string_int32(ndpi_serializer *serializer,
|
||||||
|
const char *key, int32_t value);
|
||||||
|
int ndpi_serialize_string_int64(ndpi_serializer *serializer,
|
||||||
|
const char *key, int64_t value);
|
||||||
int ndpi_serialize_string_uint32(ndpi_serializer *serializer,
|
int ndpi_serialize_string_uint32(ndpi_serializer *serializer,
|
||||||
const char *key, u_int32_t value);
|
const char *key, u_int32_t value);
|
||||||
int ndpi_serialize_string_uint32_format(ndpi_serializer *serializer,
|
int ndpi_serialize_string_uint32_format(ndpi_serializer *serializer,
|
||||||
@@ -850,20 +915,27 @@ extern "C" {
|
|||||||
const char *key, u_int64_t value);
|
const char *key, u_int64_t value);
|
||||||
int ndpi_serialize_string_string(ndpi_serializer *serializer,
|
int ndpi_serialize_string_string(ndpi_serializer *serializer,
|
||||||
const char *key, const char *value);
|
const char *key, const char *value);
|
||||||
int ndpi_serialize_string_binary(ndpi_serializer *_serializer,
|
int ndpi_serialize_string_binary(ndpi_serializer *serializer,
|
||||||
const char *key, const char *_value,
|
const char *key, const char *_value,
|
||||||
u_int16_t vlen);
|
u_int16_t vlen);
|
||||||
|
int ndpi_serialize_string_raw(ndpi_serializer *_serializer,
|
||||||
|
const char *key, const char *_value,
|
||||||
|
u_int16_t vlen);
|
||||||
int ndpi_serialize_string_float(ndpi_serializer *serializer,
|
int ndpi_serialize_string_float(ndpi_serializer *serializer,
|
||||||
const char *key, float value,
|
const char *key, float value,
|
||||||
const char *format /* e.f. "%.2f" */);
|
const char *format /* e.f. "%.2f" */);
|
||||||
|
int ndpi_serialize_string_boolean(ndpi_serializer *serializer,
|
||||||
|
const char *key, u_int8_t value);
|
||||||
|
|
||||||
int ndpi_serialize_end_of_record(ndpi_serializer *serializer);
|
int ndpi_serialize_end_of_record(ndpi_serializer *serializer);
|
||||||
int ndpi_serialize_start_of_block(ndpi_serializer *_serializer,
|
int ndpi_serialize_start_of_block(ndpi_serializer *serializer,
|
||||||
const char *key);
|
const char *key);
|
||||||
int ndpi_serialize_end_of_block(ndpi_serializer *_serializer);
|
int ndpi_serialize_end_of_block(ndpi_serializer *serializer);
|
||||||
char* ndpi_serializer_get_buffer(ndpi_serializer *_serializer, u_int32_t *buffer_len);
|
char* ndpi_serializer_get_buffer(ndpi_serializer *serializer, u_int32_t *buffer_len);
|
||||||
u_int32_t ndpi_serializer_get_buffer_len(ndpi_serializer *_serializer);
|
u_int32_t ndpi_serializer_get_buffer_len(ndpi_serializer *serializer);
|
||||||
int ndpi_serializer_set_buffer_len(ndpi_serializer *_serializer, u_int32_t l);
|
u_int32_t ndpi_serializer_get_internal_buffer_size(ndpi_serializer *serializer);
|
||||||
|
int ndpi_serializer_set_buffer_len(ndpi_serializer *serializer, u_int32_t l);
|
||||||
|
ndpi_serialization_format ndpi_serializer_get_format(ndpi_serializer *serializer);
|
||||||
void ndpi_serializer_set_csv_separator(ndpi_serializer *serializer, char separator);
|
void ndpi_serializer_set_csv_separator(ndpi_serializer *serializer, char separator);
|
||||||
|
|
||||||
void ndpi_serializer_create_snapshot(ndpi_serializer *serializer);
|
void ndpi_serializer_create_snapshot(ndpi_serializer *serializer);
|
||||||
@@ -912,6 +984,11 @@ extern "C" {
|
|||||||
const char* ndpi_data_ratio2str(float ratio);
|
const char* ndpi_data_ratio2str(float ratio);
|
||||||
|
|
||||||
void ndpi_data_print_window_values(struct ndpi_analyze_struct *s); /* debug */
|
void ndpi_data_print_window_values(struct ndpi_analyze_struct *s); /* debug */
|
||||||
|
|
||||||
|
ndpi_url_risk ndpi_validate_url(char *url);
|
||||||
|
|
||||||
|
u_int8_t ndpi_is_protocol_detected(struct ndpi_detection_module_struct *ndpi_str,
|
||||||
|
ndpi_protocol proto);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -43,8 +43,7 @@
|
|||||||
#ifndef NDPI_CLASSIFY_H
|
#ifndef NDPI_CLASSIFY_H
|
||||||
#define NDPI_CLASSIFY_H
|
#define NDPI_CLASSIFY_H
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
/* constants */
|
/* constants */
|
||||||
#define NUM_PARAMETERS_SPLT_LOGREG 208
|
#define NUM_PARAMETERS_SPLT_LOGREG 208
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_main.h
|
* ndpi_main.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -114,6 +114,7 @@ extern "C" {
|
|||||||
|
|
||||||
extern int ndpi_parse_ip_string(const char *ip_str, ndpi_ip_addr_t *parsed_ip);
|
extern int ndpi_parse_ip_string(const char *ip_str, ndpi_ip_addr_t *parsed_ip);
|
||||||
extern char *ndpi_get_ip_string(const ndpi_ip_addr_t * ip, char *buf, u_int buf_len);
|
extern char *ndpi_get_ip_string(const ndpi_ip_addr_t * ip, char *buf, u_int buf_len);
|
||||||
|
extern u_int8_t ndpi_is_ipv6(const ndpi_ip_addr_t *ip);
|
||||||
|
|
||||||
extern char* ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_mod, u_int id);
|
extern char* ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_mod, u_int id);
|
||||||
u_int16_t ndpi_get_proto_by_name(struct ndpi_detection_module_struct *ndpi_mod, const char *name);
|
u_int16_t ndpi_get_proto_by_name(struct ndpi_detection_module_struct *ndpi_mod, const char *name);
|
||||||
@@ -131,7 +132,7 @@ extern "C" {
|
|||||||
u_int16_t** tcp_master_proto,
|
u_int16_t** tcp_master_proto,
|
||||||
u_int16_t** udp_master_proto);
|
u_int16_t** udp_master_proto);
|
||||||
#/* NDPI_PROTOCOL_NETBIOS */
|
#/* NDPI_PROTOCOL_NETBIOS */
|
||||||
int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len);
|
int ndpi_netbios_name_interpret(char *in, size_t inlen, char *out, u_int out_len);
|
||||||
|
|
||||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||||
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* ndpi_protocol_ids.h
|
* ndpi_protocol_ids.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -23,12 +22,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef __NDPI_API_H__
|
#ifndef __NDPI_PROTOCOLS_IDS_H__
|
||||||
|
#define __NDPI_PROTOCOLS_IDS_H__
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __NDPI_PROTOCOLS_DEFAULT_H__
|
|
||||||
#define __NDPI_PROTOCOLS_DEFAULT_H__
|
|
||||||
|
|
||||||
#define NDPI_DETECTION_SUPPORT_IPV6
|
#define NDPI_DETECTION_SUPPORT_IPV6
|
||||||
#define NDPI_PROTOCOL_SIZE 2
|
#define NDPI_PROTOCOL_SIZE 2
|
||||||
@@ -230,7 +225,7 @@ typedef enum {
|
|||||||
NDPI_PROTOCOL_KAKAOTALK = 193, /* KakaoTalk Chat (no voice call) */
|
NDPI_PROTOCOL_KAKAOTALK = 193, /* KakaoTalk Chat (no voice call) */
|
||||||
NDPI_PROTOCOL_KAKAOTALK_VOICE = 194, /* KakaoTalk Voice */
|
NDPI_PROTOCOL_KAKAOTALK_VOICE = 194, /* KakaoTalk Voice */
|
||||||
NDPI_PROTOCOL_TWITCH = 195, /* Edoardo Dominici <edoaramis@gmail.com> */
|
NDPI_PROTOCOL_TWITCH = 195, /* Edoardo Dominici <edoaramis@gmail.com> */
|
||||||
NDPI_PROTOCOL_DNS_OVER_HTTPS = 196,
|
NDPI_PROTOCOL_DOH_DOT = 196, /* DoH (DNS over HTTPS), DoT (DNS over TLS) */
|
||||||
NDPI_PROTOCOL_WECHAT = 197,
|
NDPI_PROTOCOL_WECHAT = 197,
|
||||||
NDPI_PROTOCOL_MPEGTS = 198,
|
NDPI_PROTOCOL_MPEGTS = 198,
|
||||||
NDPI_PROTOCOL_SNAPCHAT = 199,
|
NDPI_PROTOCOL_SNAPCHAT = 199,
|
||||||
@@ -239,7 +234,7 @@ typedef enum {
|
|||||||
NDPI_PROTOCOL_IFLIX = 202, /* www.vizuamatix.com R&D team & M.Mallawaarachchie <manoj_ws@yahoo.com> */
|
NDPI_PROTOCOL_IFLIX = 202, /* www.vizuamatix.com R&D team & M.Mallawaarachchie <manoj_ws@yahoo.com> */
|
||||||
NDPI_PROTOCOL_GITHUB = 203,
|
NDPI_PROTOCOL_GITHUB = 203,
|
||||||
NDPI_PROTOCOL_BJNP = 204,
|
NDPI_PROTOCOL_BJNP = 204,
|
||||||
NDPI_PROTOCOL_LINE = 205, /* https://en.wikipedia.org/wiki/Line_(software) */
|
NDPI_PROTOCOL_FREE_205 = 205,
|
||||||
NDPI_PROTOCOL_WIREGUARD = 206,
|
NDPI_PROTOCOL_WIREGUARD = 206,
|
||||||
NDPI_PROTOCOL_SMPP = 207, /* Damir Franusic <df@release14.org> */
|
NDPI_PROTOCOL_SMPP = 207, /* Damir Franusic <df@release14.org> */
|
||||||
NDPI_PROTOCOL_DNSCRYPT = 208,
|
NDPI_PROTOCOL_DNSCRYPT = 208,
|
||||||
@@ -279,8 +274,16 @@ typedef enum {
|
|||||||
NDPI_PROTOCOL_WHATSAPP_FILES = 242, /* Videos, pictures, voice messages... */
|
NDPI_PROTOCOL_WHATSAPP_FILES = 242, /* Videos, pictures, voice messages... */
|
||||||
NDPI_PROTOCOL_TARGUS_GETDATA = 243,
|
NDPI_PROTOCOL_TARGUS_GETDATA = 243,
|
||||||
NDPI_PROTOCOL_DNP3 = 244,
|
NDPI_PROTOCOL_DNP3 = 244,
|
||||||
NDPI_PROTOCOL_104 = 245,
|
NDPI_PROTOCOL_IEC60870 = 245, /* https://en.wikipedia.org/wiki/IEC_60870-5 */
|
||||||
/*
|
NDPI_PROTOCOL_BLOOMBERG = 246,
|
||||||
|
NDPI_PROTOCOL_CAPWAP = 247,
|
||||||
|
NDPI_PROTOCOL_ZABBIX = 248,
|
||||||
|
|
||||||
|
#ifdef CUSTOM_NDPI_PROTOCOLS
|
||||||
|
#include "../../../nDPI-custom/custom_ndpi_protocol_ids.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
IMPORTANT
|
IMPORTANT
|
||||||
before allocating a new identifier please fill up
|
before allocating a new identifier please fill up
|
||||||
one of those named NDPI_PROTOCOL_FREE_XXX and not used
|
one of those named NDPI_PROTOCOL_FREE_XXX and not used
|
||||||
@@ -294,4 +297,5 @@ typedef enum {
|
|||||||
#define NDPI_PROTOCOL_NO_MASTER_PROTO NDPI_PROTOCOL_UNKNOWN
|
#define NDPI_PROTOCOL_NO_MASTER_PROTO NDPI_PROTOCOL_UNKNOWN
|
||||||
#define NDPI_MAX_SUPPORTED_PROTOCOLS NDPI_LAST_IMPLEMENTED_PROTOCOL
|
#define NDPI_MAX_SUPPORTED_PROTOCOLS NDPI_LAST_IMPLEMENTED_PROTOCOL
|
||||||
#define NDPI_MAX_NUM_CUSTOM_PROTOCOLS (NDPI_NUM_BITS-NDPI_LAST_IMPLEMENTED_PROTOCOL)
|
#define NDPI_MAX_NUM_CUSTOM_PROTOCOLS (NDPI_NUM_BITS-NDPI_LAST_IMPLEMENTED_PROTOCOL)
|
||||||
#endif
|
|
||||||
|
#endif /* __NDPI_PROTOCOL_IDS_H__ */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_protocols.h
|
* ndpi_protocols.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -51,165 +51,6 @@ u_int ndpi_search_tcp_or_udp_raw(struct ndpi_detection_module_struct *ndpi_struc
|
|||||||
|
|
||||||
void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
/* Applications and other protocols. */
|
|
||||||
void ndpi_search_diameter(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_lisp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_edonkey(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_directconnect(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_i23v5(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_socrates(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_soulseek_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_msn(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_yahoo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_oscar(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_sip(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_imo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_direct_download_link_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mail_pop_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mail_smtp_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_http_subprotocol_conf(struct ndpi_detection_module_struct *ndpi_struct, char *attr, char *value, int protocol_id);
|
|
||||||
void ndpi_search_ftp_control(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ftp_data(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_usenet_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_rtsp_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_filetopia_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_vmware(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ssl_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mms_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_shoutcast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_veohtv_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_openft_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_stun(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_tvants_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_sopcast(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_tvuplayer(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ppstream(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_pplive(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_iax(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mgcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_zattoo(struct ndpi_detection_module_struct*ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_qq(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_feidian(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ssh_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ayiya(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_thunder(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_activesync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_in_non_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_vnc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_steam(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_halflife2(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_xbox(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_smb_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_telnet_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ntp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_nfs(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_rtp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ssdp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_worldofwarcraft(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_postgres_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mysql_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_quake(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_battlefield(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_secondlife(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_pcanywhere(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_rdp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_snmp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_kontiki(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_syslog(struct ndpi_detection_module_struct*ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_netbios(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mdns(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_warcraft3(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_xdmcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_tftp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mssql_tds(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_pptp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_stealthnet(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_checkmk(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_maplestory(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_world_of_kung_fu(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_guildwars_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_dropbox(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_citrix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_dcerpc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_netflow(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_sflow(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_radius(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_wsus(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_teamview(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_lotus_notes(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_gtp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_spotify(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_h323(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_openvpn(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_noe(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_viber(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_teamspeak(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_corba(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_oracle(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_rsync(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_rtcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_skinny(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_tor(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_whois_das(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_socks5(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_socks4(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_rtmp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_pando(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_megaco(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_redis(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_zmq(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_vhua(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_telegram(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_quic(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_eaq(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_kakaotalk_voice(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mpegts(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_starcraft(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ubntac2(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_coap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_mqtt (struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_rx(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_git(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_drda(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_bjnp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_smpp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_tinc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_csgo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_ajp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_memcached(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_nest_log_sink(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_wireguard(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_targus_getdata(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_apple_push(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
void ndpi_search_amazon_video(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
|
||||||
/* --- INIT FUNCTIONS --- */
|
|
||||||
void init_diameter_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_diameter_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_aimini_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_aimini_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
@@ -369,7 +210,8 @@ void init_memcached_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
void init_nest_log_sink_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_nest_log_sink_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_ookla_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_ookla_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_modbus_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_modbus_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_line_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_capwap_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
|
void init_zabbix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_wireguard_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_wireguard_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_targus_getdata_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_targus_getdata_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
void init_dnp3_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
void init_dnp3_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||||
|
|||||||
+103
-29
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_typedefs.h
|
* ndpi_typedefs.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -35,6 +35,28 @@ typedef enum {
|
|||||||
NDPI_LOG_DEBUG_EXTRA
|
NDPI_LOG_DEBUG_EXTRA
|
||||||
} ndpi_log_level_t;
|
} ndpi_log_level_t;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ndpi_l4_proto_unknown = 0,
|
||||||
|
ndpi_l4_proto_tcp_only,
|
||||||
|
ndpi_l4_proto_udp_only,
|
||||||
|
ndpi_l4_proto_tcp_and_udp,
|
||||||
|
} ndpi_l4_proto_info;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ndpi_no_tunnel = 0,
|
||||||
|
ndpi_gtp_tunnel,
|
||||||
|
ndpi_capwap_tunnel,
|
||||||
|
ndpi_tzsp_tunnel,
|
||||||
|
ndpi_l2tp_tunnel,
|
||||||
|
} ndpi_packet_tunnel;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
ndpi_url_no_problem = 0,
|
||||||
|
ndpi_url_possible_xss,
|
||||||
|
ndpi_url_possible_sql_injection,
|
||||||
|
ndpi_url_possible_rce_injection
|
||||||
|
} ndpi_url_risk;
|
||||||
|
|
||||||
/* NDPI_VISIT */
|
/* NDPI_VISIT */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ndpi_preorder,
|
ndpi_preorder,
|
||||||
@@ -616,17 +638,19 @@ struct ndpi_flow_tcp_struct {
|
|||||||
/* NDPI_PROTOCOL_TELNET */
|
/* NDPI_PROTOCOL_TELNET */
|
||||||
u_int32_t telnet_stage:2; // 0 - 2
|
u_int32_t telnet_stage:2; // 0 - 2
|
||||||
|
|
||||||
void* tls_srv_cert_fingerprint_ctx;
|
struct {
|
||||||
|
struct {
|
||||||
|
u_int8_t *buffer;
|
||||||
|
u_int buffer_len, buffer_used;
|
||||||
|
} message;
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_TLS */
|
void* srv_cert_fingerprint_ctx; /* SHA-1 */
|
||||||
u_int8_t tls_seen_client_cert:1,
|
|
||||||
tls_seen_server_cert:1,
|
/* NDPI_PROTOCOL_TLS */
|
||||||
tls_seen_certificate:1,
|
u_int8_t hello_processed:1, certificate_processed:1, subprotocol_detected:1,
|
||||||
tls_srv_cert_fingerprint_found:1,
|
fingerprint_set:1, _pad:4;
|
||||||
tls_srv_cert_fingerprint_processed:1,
|
u_int8_t sha1_certificate_fingerprint[20];
|
||||||
tls_stage:2, _pad:1; // 0 - 5
|
} tls;
|
||||||
int16_t tls_record_offset, tls_fingerprint_len; /* Need to be signed */
|
|
||||||
u_int8_t tls_sha1_certificate_fingerprint[20];
|
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_POSTGRES */
|
/* NDPI_PROTOCOL_POSTGRES */
|
||||||
u_int32_t postgres_stage:3;
|
u_int32_t postgres_stage:3;
|
||||||
@@ -919,10 +943,7 @@ typedef enum {
|
|||||||
} ndpi_protocol_category_t;
|
} ndpi_protocol_category_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ndpi_pref_http_dont_dissect_response = 0,
|
ndpi_pref_direction_detect_disable = 0,
|
||||||
ndpi_pref_dns_dont_dissect_response,
|
|
||||||
ndpi_pref_direction_detect_disable,
|
|
||||||
ndpi_pref_disable_metadata_export,
|
|
||||||
} ndpi_detection_preference;
|
} ndpi_detection_preference;
|
||||||
|
|
||||||
/* ntop extensions */
|
/* ntop extensions */
|
||||||
@@ -982,6 +1003,15 @@ struct hs {
|
|||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_PCRE
|
||||||
|
#include <pcre.h>
|
||||||
|
|
||||||
|
struct pcre_struct {
|
||||||
|
pcre *compiled;
|
||||||
|
pcre_extra *optimized;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
struct ndpi_detection_module_struct {
|
struct ndpi_detection_module_struct {
|
||||||
NDPI_PROTOCOL_BITMASK detection_bitmask;
|
NDPI_PROTOCOL_BITMASK detection_bitmask;
|
||||||
NDPI_PROTOCOL_BITMASK generic_http_packet_bitmask;
|
NDPI_PROTOCOL_BITMASK generic_http_packet_bitmask;
|
||||||
@@ -1038,6 +1068,7 @@ struct ndpi_detection_module_struct {
|
|||||||
content_automa, /* Used for HTTP subprotocol_detection */
|
content_automa, /* Used for HTTP subprotocol_detection */
|
||||||
subprotocol_automa, /* Used for HTTP subprotocol_detection */
|
subprotocol_automa, /* Used for HTTP subprotocol_detection */
|
||||||
bigrams_automa, impossible_bigrams_automa; /* TOR */
|
bigrams_automa, impossible_bigrams_automa; /* TOR */
|
||||||
|
/* IMPORTANT: please update ndpi_finalize_initalization() whenever you add a new automa */
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
#ifdef HAVE_HYPERSCAN
|
#ifdef HAVE_HYPERSCAN
|
||||||
@@ -1098,10 +1129,8 @@ struct ndpi_detection_module_struct {
|
|||||||
|
|
||||||
ndpi_proto_defaults_t proto_defaults[NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS];
|
ndpi_proto_defaults_t proto_defaults[NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS];
|
||||||
|
|
||||||
u_int8_t http_dont_dissect_response:1, dns_dont_dissect_response:1,
|
u_int8_t direction_detect_disable:1, /* disable internal detection of packet direction */
|
||||||
direction_detect_disable:1, /* disable internal detection of packet direction */
|
_pad:7;
|
||||||
disable_metadata_export:1 /* No metadata is exported */
|
|
||||||
;
|
|
||||||
|
|
||||||
void *hyperscan; /* Intel Hyperscan */
|
void *hyperscan; /* Intel Hyperscan */
|
||||||
};
|
};
|
||||||
@@ -1123,7 +1152,8 @@ struct ndpi_flow_struct {
|
|||||||
|
|
||||||
/* init parameter, internal used to set up timestamp,... */
|
/* init parameter, internal used to set up timestamp,... */
|
||||||
u_int16_t guessed_protocol_id, guessed_host_protocol_id, guessed_category, guessed_header_category;
|
u_int16_t guessed_protocol_id, guessed_host_protocol_id, guessed_category, guessed_header_category;
|
||||||
u_int8_t l4_proto, protocol_id_already_guessed:1, host_already_guessed:1, init_finished:1, setup_packet_direction:1, packet_direction:1, check_extra_packets:1;
|
u_int8_t l4_proto, protocol_id_already_guessed:1, host_already_guessed:1,
|
||||||
|
init_finished:1, setup_packet_direction:1, packet_direction:1, check_extra_packets:1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if ndpi_struct->direction_detect_disable == 1
|
if ndpi_struct->direction_detect_disable == 1
|
||||||
@@ -1146,13 +1176,16 @@ struct ndpi_flow_struct {
|
|||||||
struct ndpi_flow_udp_struct udp;
|
struct ndpi_flow_udp_struct udp;
|
||||||
} l4;
|
} l4;
|
||||||
|
|
||||||
|
/* Place textual flow info here */
|
||||||
|
char flow_extra_info[16];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Pointer to src or dst that identifies the
|
Pointer to src or dst that identifies the
|
||||||
server of this connection
|
server of this connection
|
||||||
*/
|
*/
|
||||||
struct ndpi_id_struct *server_id;
|
struct ndpi_id_struct *server_id;
|
||||||
/* HTTP host or DNS query */
|
/* HTTP host or DNS query */
|
||||||
u_char host_server_name[256];
|
u_char host_server_name[240];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This structure below will not not stay inside the protos
|
This structure below will not not stay inside the protos
|
||||||
@@ -1163,12 +1196,22 @@ struct ndpi_flow_struct {
|
|||||||
*/
|
*/
|
||||||
struct {
|
struct {
|
||||||
ndpi_http_method method;
|
ndpi_http_method method;
|
||||||
char *url, *content_type;
|
char *url, *content_type, *user_agent;
|
||||||
u_int8_t num_request_headers, num_response_headers;
|
u_int8_t num_request_headers, num_response_headers;
|
||||||
u_int8_t request_version; /* 0=1.0 and 1=1.1. Create an enum for this? */
|
u_int8_t request_version; /* 0=1.0 and 1=1.1. Create an enum for this? */
|
||||||
u_int16_t response_status_code; /* 200, 404, etc. */
|
u_int16_t response_status_code; /* 200, 404, etc. */
|
||||||
} http;
|
} http;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Put outside of the union to avoid issues in case the protocol
|
||||||
|
is remapped to somethign pther than Kerberos due to a faulty
|
||||||
|
dissector
|
||||||
|
*/
|
||||||
|
struct {
|
||||||
|
char *pktbuf;
|
||||||
|
u_int16_t pktbuf_maxlen, pktbuf_currlen;
|
||||||
|
} kerberos_buf;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
/* the only fields useful for nDPI and ntopng */
|
/* the only fields useful for nDPI and ntopng */
|
||||||
struct {
|
struct {
|
||||||
@@ -1182,10 +1225,15 @@ struct ndpi_flow_struct {
|
|||||||
u_int8_t version;
|
u_int8_t version;
|
||||||
} ntp;
|
} ntp;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
char hostname[48], domain[48], username[48];
|
||||||
|
} kerberos;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct {
|
struct {
|
||||||
u_int16_t ssl_version;
|
u_int16_t ssl_version, server_names_len;
|
||||||
char client_certificate[64], server_certificate[64], server_organization[64];
|
char client_requested_server_name[64], *server_names, server_organization[64],
|
||||||
|
*alpn, *tls_supported_versions;
|
||||||
u_int32_t notBefore, notAfter;
|
u_int32_t notBefore, notAfter;
|
||||||
char ja3_client[33], ja3_server[33];
|
char ja3_client[33], ja3_server[33];
|
||||||
u_int16_t server_cipher;
|
u_int16_t server_cipher;
|
||||||
@@ -1208,6 +1256,14 @@ struct ndpi_flow_struct {
|
|||||||
u_int8_t last_one_byte_pkt, last_byte;
|
u_int8_t last_one_byte_pkt, last_byte;
|
||||||
} imo;
|
} imo;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u_int8_t username_detected:1, username_found:1,
|
||||||
|
password_detected:1, password_found:1,
|
||||||
|
_pad:4;
|
||||||
|
u_int8_t character_id;
|
||||||
|
char username[32], password[32];
|
||||||
|
} telnet;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
char answer[96];
|
char answer[96];
|
||||||
} mdns;
|
} mdns;
|
||||||
@@ -1223,6 +1279,11 @@ struct ndpi_flow_struct {
|
|||||||
u_char nat_ip[24];
|
u_char nat_ip[24];
|
||||||
} http;
|
} http;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
u_int8_t auth_found:1, auth_failed:1, _pad:5;
|
||||||
|
char username[16], password[16];
|
||||||
|
} ftp_imap_pop_smtp;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
/* Bittorrent hash */
|
/* Bittorrent hash */
|
||||||
u_char hash[20];
|
u_char hash[20];
|
||||||
@@ -1258,7 +1319,6 @@ struct ndpi_flow_struct {
|
|||||||
|
|
||||||
/* NDPI_PROTOCOL_HTTP */
|
/* NDPI_PROTOCOL_HTTP */
|
||||||
u_int8_t http_detected:1;
|
u_int8_t http_detected:1;
|
||||||
u_int16_t http_upper_protocol, http_lower_protocol;
|
|
||||||
|
|
||||||
/* NDPI_PROTOCOL_RTSP */
|
/* NDPI_PROTOCOL_RTSP */
|
||||||
u_int8_t rtsprdt_stage:2, rtsp_control_flow:1;
|
u_int8_t rtsprdt_stage:2, rtsp_control_flow:1;
|
||||||
@@ -1345,6 +1405,14 @@ typedef struct {
|
|||||||
u_int8_t value;
|
u_int8_t value;
|
||||||
} ndpi_network;
|
} ndpi_network;
|
||||||
|
|
||||||
|
typedef u_int32_t ndpi_init_prefs;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
ndpi_no_prefs = 0,
|
||||||
|
ndpi_dont_load_tor_hosts,
|
||||||
|
} ndpi_prefs;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int protocol_id;
|
int protocol_id;
|
||||||
ndpi_protocol_category_t protocol_category;
|
ndpi_protocol_category_t protocol_category;
|
||||||
@@ -1378,10 +1446,12 @@ typedef enum {
|
|||||||
#define NDPI_SERIALIZER_DEFAULT_BUFFER_SIZE 8192
|
#define NDPI_SERIALIZER_DEFAULT_BUFFER_SIZE 8192
|
||||||
#define NDPI_SERIALIZER_DEFAULT_BUFFER_INCR 1024
|
#define NDPI_SERIALIZER_DEFAULT_BUFFER_INCR 1024
|
||||||
|
|
||||||
#define NDPI_SERIALIZER_STATUS_COMMA (1 << 0)
|
#define NDPI_SERIALIZER_STATUS_COMMA (1 << 0)
|
||||||
#define NDPI_SERIALIZER_STATUS_ARRAY (1 << 1)
|
#define NDPI_SERIALIZER_STATUS_ARRAY (1 << 1)
|
||||||
#define NDPI_SERIALIZER_STATUS_EOR (1 << 2)
|
#define NDPI_SERIALIZER_STATUS_EOR (1 << 2)
|
||||||
#define NDPI_SERIALIZER_STATUS_SOB (1 << 3)
|
#define NDPI_SERIALIZER_STATUS_SOB (1 << 3)
|
||||||
|
#define NDPI_SERIALIZER_STATUS_NOT_EMPTY (1 << 4)
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u_int32_t flags;
|
u_int32_t flags;
|
||||||
@@ -1427,4 +1497,8 @@ struct ndpi_analyze_struct {
|
|||||||
#define MAX_SERIES_LEN 512
|
#define MAX_SERIES_LEN 512
|
||||||
#define MIN_SERIES_LEN 8
|
#define MIN_SERIES_LEN 8
|
||||||
|
|
||||||
|
/* **************************************** */
|
||||||
|
|
||||||
|
typedef struct ndpi_ptree ndpi_ptree_t;
|
||||||
|
|
||||||
#endif /* __NDPI_TYPEDEFS_H__ */
|
#endif /* __NDPI_TYPEDEFS_H__ */
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ typedef unsigned __int64 u_int64_t;
|
|||||||
|
|
||||||
extern unsigned long waitForNextEvent(unsigned long ulDelay /* ms */);
|
extern unsigned long waitForNextEvent(unsigned long ulDelay /* ms */);
|
||||||
|
|
||||||
#define sleep(a /* sec */) waitForNextEvent(1000*a /* ms */)
|
#define sleep(a /* sec */) waitForNextEvent(1000*a /* ms */)
|
||||||
|
#define localtime_r(a, b) localtime_s(b, a)
|
||||||
|
#define strtok_r strtok_s
|
||||||
|
#define timegm _mkgmtime
|
||||||
|
|
||||||
#endif /* __NDPI_WIN32_H__ */
|
#endif /* __NDPI_WIN32_H__ */
|
||||||
|
|||||||
+4
-3
@@ -14,7 +14,8 @@ prefix = @prefix@
|
|||||||
libdir = ${prefix}/lib
|
libdir = ${prefix}/lib
|
||||||
includedir = ${prefix}/include/ndpi
|
includedir = ${prefix}/include/ndpi
|
||||||
CC = @CC@
|
CC = @CC@
|
||||||
CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -O2 -g -Wall
|
CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -Wall @CFLAGS@ @CUSTOM_NDPI@
|
||||||
|
LDFLAGS = @LDFLAGS@
|
||||||
RANLIB = ranlib
|
RANLIB = ranlib
|
||||||
|
|
||||||
OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) $(patsubst ./%.c, ./%.o, $(wildcard ./*.c))
|
OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) $(patsubst ./%.c, ./%.o, $(wildcard ./*.c))
|
||||||
@@ -45,12 +46,12 @@ $(NDPI_LIB_STATIC): $(OBJECTS)
|
|||||||
$(RANLIB) $@
|
$(RANLIB) $@
|
||||||
|
|
||||||
$(NDPI_LIB_SHARED): $(OBJECTS)
|
$(NDPI_LIB_SHARED): $(OBJECTS)
|
||||||
$(CC) -shared -fPIC $(SONAME_FLAG) -o $@ $(OBJECTS)
|
$(CC) -shared -fPIC $(SONAME_FLAG) -o $@ $(OBJECTS) $(LDFLAGS) @ADDITIONAL_LIBS@
|
||||||
ln -fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE)
|
ln -fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE)
|
||||||
ln -fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR)
|
ln -fs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR)
|
||||||
|
|
||||||
%.o: %.c $(HEADERS) Makefile
|
%.o: %.c $(HEADERS) Makefile
|
||||||
$(CC) $(CFLAGS) -c $< -o $@
|
$(CC) $(CFLAGS) -c $< -o $@ $(LDFLAGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
/bin/rm -f $(NDPI_LIB_STATIC) $(OBJECTS) *.o *.so *.lo $(NDPI_LIB_SHARED)
|
/bin/rm -f $(NDPI_LIB_STATIC) $(OBJECTS) *.o *.so *.lo $(NDPI_LIB_SHARED)
|
||||||
|
|||||||
+450
-449
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,376 @@
|
|||||||
|
/*
|
||||||
|
* ndpi_community_id.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
|
*
|
||||||
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
*
|
||||||
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* nDPI is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "ndpi_config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
#include "ndpi_config.h"
|
||||||
|
|
||||||
|
#include <time.h>
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
|
||||||
|
#include <sys/endian.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "ndpi_sha1.h"
|
||||||
|
|
||||||
|
#define NDPI_ICMP6_ECHO_REQUEST 128
|
||||||
|
#define NDPI_ICMP6_ECHO_REPLY 129
|
||||||
|
#define NDPI_MLD_LISTENER_QUERY 130
|
||||||
|
#define NDPI_MLD_LISTENER_REPORT 131
|
||||||
|
|
||||||
|
#define NDPI_ROUTER_SOLICIT 133
|
||||||
|
#define NDPI_ROUTER_ADVERT 134
|
||||||
|
#define NDPI_NEIGHBOR_SOLICIT 135
|
||||||
|
#define NDPI_NEIGHBOR_ADVERT 136
|
||||||
|
|
||||||
|
#define NDPI_ICMP_ECHOREPLY 0
|
||||||
|
#define NDPI_ICMP_ECHO 8
|
||||||
|
#define NDPI_ICMP_ROUTERADVERT 9
|
||||||
|
#define NDPI_ICMP_ROUTERSOLICIT 10
|
||||||
|
#define NDPI_ICMP_TIMESTAMP 13
|
||||||
|
#define NDPI_ICMP_TIMESTAMPREPLY 14
|
||||||
|
#define NDPI_ICMP_INFO_REQUEST 15
|
||||||
|
#define NDPI_ICMP_INFO_REPLY 16
|
||||||
|
#define NDPI_ICMP_MASKREQ 17
|
||||||
|
#define NDPI_ICMP_MASKREPLY 18
|
||||||
|
|
||||||
|
#define NDPI_ICMP6_WRUREQUEST 139
|
||||||
|
#define NDPI_ICMP6_WRUREPLY 140
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
|
|
||||||
|
static ssize_t ndpi_community_id_buf_copy(u_int8_t * const dst, const void * const src, ssize_t len) {
|
||||||
|
if(src)
|
||||||
|
memcpy(dst, src, len);
|
||||||
|
else
|
||||||
|
memset(dst, 0, len);
|
||||||
|
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
|
|
||||||
|
/*
|
||||||
|
https://github.com/corelight/community-id-spec/blob/bda913f617389df07cdaa23606e11bbd318e265c/community-id.py#L56
|
||||||
|
*/
|
||||||
|
static u_int8_t ndpi_community_id_icmp_type_to_code_v4(u_int8_t icmp_type, u_int8_t icmp_code, int *is_one_way) {
|
||||||
|
*is_one_way = 0;
|
||||||
|
|
||||||
|
switch(icmp_type) {
|
||||||
|
case NDPI_ICMP_ECHO:
|
||||||
|
return NDPI_ICMP_ECHOREPLY;
|
||||||
|
case NDPI_ICMP_ECHOREPLY:
|
||||||
|
return NDPI_ICMP_ECHO;
|
||||||
|
case NDPI_ICMP_TIMESTAMP:
|
||||||
|
return NDPI_ICMP_TIMESTAMPREPLY;
|
||||||
|
case NDPI_ICMP_TIMESTAMPREPLY:
|
||||||
|
return NDPI_ICMP_TIMESTAMP;
|
||||||
|
case NDPI_ICMP_INFO_REQUEST:
|
||||||
|
return NDPI_ICMP_INFO_REPLY;
|
||||||
|
case NDPI_ICMP_INFO_REPLY:
|
||||||
|
return NDPI_ICMP_INFO_REQUEST;
|
||||||
|
case NDPI_ICMP_ROUTERSOLICIT:
|
||||||
|
return NDPI_ICMP_ROUTERADVERT;
|
||||||
|
case NDPI_ICMP_ROUTERADVERT:
|
||||||
|
return NDPI_ICMP_ROUTERSOLICIT;
|
||||||
|
case NDPI_ICMP_MASKREQ:
|
||||||
|
return NDPI_ICMP_MASKREPLY;
|
||||||
|
case NDPI_ICMP_MASKREPLY:
|
||||||
|
return NDPI_ICMP_MASKREQ;
|
||||||
|
default:
|
||||||
|
*is_one_way = 1;
|
||||||
|
return icmp_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
|
|
||||||
|
/*
|
||||||
|
https://github.com/corelight/community-id-spec/blob/bda913f617389df07cdaa23606e11bbd318e265c/community-id.py#L83
|
||||||
|
*/
|
||||||
|
static u_int8_t ndpi_community_id_icmp_type_to_code_v6(u_int8_t icmp_type, u_int8_t icmp_code, int *is_one_way) {
|
||||||
|
*is_one_way = 0;
|
||||||
|
|
||||||
|
switch(icmp_type) {
|
||||||
|
case NDPI_ICMP6_ECHO_REQUEST:
|
||||||
|
return NDPI_ICMP6_ECHO_REPLY;
|
||||||
|
case NDPI_ICMP6_ECHO_REPLY:
|
||||||
|
return NDPI_ICMP6_ECHO_REQUEST;
|
||||||
|
case NDPI_ROUTER_SOLICIT:
|
||||||
|
return NDPI_ROUTER_ADVERT;
|
||||||
|
case NDPI_ROUTER_ADVERT:
|
||||||
|
return NDPI_ROUTER_SOLICIT;
|
||||||
|
case NDPI_NEIGHBOR_SOLICIT:
|
||||||
|
return NDPI_NEIGHBOR_ADVERT;
|
||||||
|
case NDPI_NEIGHBOR_ADVERT:
|
||||||
|
return NDPI_NEIGHBOR_SOLICIT;
|
||||||
|
case NDPI_MLD_LISTENER_QUERY:
|
||||||
|
return NDPI_MLD_LISTENER_REPORT;
|
||||||
|
case NDPI_MLD_LISTENER_REPORT:
|
||||||
|
return NDPI_MLD_LISTENER_QUERY;
|
||||||
|
case NDPI_ICMP6_WRUREQUEST:
|
||||||
|
return NDPI_ICMP6_WRUREPLY;
|
||||||
|
case NDPI_ICMP6_WRUREPLY:
|
||||||
|
return NDPI_ICMP6_WRUREQUEST;
|
||||||
|
// Home Agent Address Discovery Request Message and reply
|
||||||
|
case 144:
|
||||||
|
return 145;
|
||||||
|
case 145:
|
||||||
|
return 144;
|
||||||
|
default:
|
||||||
|
*is_one_way = 1;
|
||||||
|
return icmp_code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
|
|
||||||
|
/*
|
||||||
|
https://github.com/corelight/community-id-spec/blob/bda913f617389df07cdaa23606e11bbd318e265c/community-id.py#L164
|
||||||
|
*/
|
||||||
|
static int ndpi_community_id_peer_v4_is_less_than(u_int32_t ip1, u_int32_t ip2, u_int16_t p1, u_int16_t p2) {
|
||||||
|
int comp = memcmp(&ip1, &ip2, sizeof(u_int32_t));
|
||||||
|
return comp < 0 || (comp == 0 && p1 < p2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
|
|
||||||
|
static int ndpi_community_id_peer_v6_is_less_than(struct ndpi_in6_addr *ip1, struct ndpi_in6_addr *ip2, u_int16_t p1, u_int16_t p2) {
|
||||||
|
int comp = memcmp(ip1, ip2, sizeof(struct ndpi_in6_addr));
|
||||||
|
return comp < 0 || (comp == 0 && p1 < p2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
|
|
||||||
|
static void ndpi_community_id_sha1_hash(const uint8_t *message, size_t len, u_char *hash /* 20-bytes */) {
|
||||||
|
SHA1_CTX ctx;
|
||||||
|
SHA1Init(&ctx);
|
||||||
|
SHA1Update(&ctx, message, len);
|
||||||
|
SHA1Final(hash, &ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
|
|
||||||
|
/*
|
||||||
|
https://github.com/corelight/community-id-spec/blob/bda913f617389df07cdaa23606e11bbd318e265c/community-id.py#L285
|
||||||
|
*/
|
||||||
|
static int ndpi_community_id_finalize_and_compute_hash(u_int8_t *comm_buf, u_int16_t off, u_int8_t l4_proto,
|
||||||
|
u_int16_t src_port, u_int16_t dst_port, char *hash_buf, u_int8_t hash_buf_len) {
|
||||||
|
u_int8_t pad = 0;
|
||||||
|
uint32_t hash[5];
|
||||||
|
char *community_id;
|
||||||
|
|
||||||
|
/* L4 proto */
|
||||||
|
off += ndpi_community_id_buf_copy(&comm_buf[off], &l4_proto, sizeof(l4_proto));
|
||||||
|
|
||||||
|
/* Pad */
|
||||||
|
off += ndpi_community_id_buf_copy(&comm_buf[off], &pad, sizeof(pad));
|
||||||
|
|
||||||
|
/* Source and destination ports */
|
||||||
|
switch(l4_proto) {
|
||||||
|
case IPPROTO_ICMP:
|
||||||
|
case IPPROTO_ICMPV6:
|
||||||
|
case IPPROTO_SCTP:
|
||||||
|
case IPPROTO_UDP:
|
||||||
|
case IPPROTO_TCP:
|
||||||
|
off += ndpi_community_id_buf_copy(&comm_buf[off], &src_port, sizeof(src_port));
|
||||||
|
off += ndpi_community_id_buf_copy(&comm_buf[off], &dst_port, sizeof(dst_port));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Compute SHA1 */
|
||||||
|
ndpi_community_id_sha1_hash(comm_buf, off, (u_char*)hash);
|
||||||
|
|
||||||
|
/* Base64 encoding */
|
||||||
|
community_id = ndpi_base64_encode((u_int8_t*)hash, sizeof(hash));
|
||||||
|
|
||||||
|
if (community_id == NULL)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
#if 0 /* Debug Info */
|
||||||
|
printf("Hex output: ");
|
||||||
|
for(int i = 0; i < off; i++)
|
||||||
|
printf("%.2x ", comm_buf[i]);
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
printf("Sha1 sum: ");
|
||||||
|
for(int i = 0; i < 5; i++)
|
||||||
|
printf("%.2x ", ntohl(hash[i]));
|
||||||
|
printf("\n");
|
||||||
|
|
||||||
|
printf("Base64: %s\n", community_id);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (hash_buf_len < 2 || hash_buf_len-2 < strlen(community_id)+1) {
|
||||||
|
ndpi_free(community_id);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Writing hash */
|
||||||
|
hash_buf[0] = '1';
|
||||||
|
hash_buf[1] = ':';
|
||||||
|
strcpy(&hash_buf[2], community_id);
|
||||||
|
ndpi_free(community_id);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
|
|
||||||
|
/*
|
||||||
|
NOTE:
|
||||||
|
- Leave fields empty/zero when information is missing (e.g. with ICMP ports are zero)
|
||||||
|
- The hash_buf most be 30+1 bits or longer
|
||||||
|
- Return code: 0 = OK, -1 otherwise
|
||||||
|
*/
|
||||||
|
|
||||||
|
int ndpi_flowv4_flow_hash(u_int8_t l4_proto, u_int32_t src_ip, u_int32_t dst_ip,
|
||||||
|
u_int16_t src_port, u_int16_t dst_port,
|
||||||
|
u_int8_t icmp_type, u_int8_t icmp_code,
|
||||||
|
u_char *hash_buf, u_int8_t hash_buf_len) {
|
||||||
|
/*
|
||||||
|
Input buffer (40 bytes)
|
||||||
|
2 - Seed
|
||||||
|
16 - IPv6 src
|
||||||
|
16 - IPv6 dst
|
||||||
|
1 - L4 proto
|
||||||
|
1 - Pad
|
||||||
|
2 - Port src
|
||||||
|
2 - Port dst
|
||||||
|
*/
|
||||||
|
u_int8_t comm_buf[40] = { 0 };
|
||||||
|
u_int16_t off = 0;
|
||||||
|
u_int16_t seed = 0;
|
||||||
|
u_int32_t *ip_a_ptr, *ip_b_ptr;
|
||||||
|
u_int16_t port_a, port_b;
|
||||||
|
int icmp_one_way = 0;
|
||||||
|
|
||||||
|
/* Adjust the ports according to the specs */
|
||||||
|
switch(l4_proto) {
|
||||||
|
case IPPROTO_ICMP:
|
||||||
|
src_port = icmp_type;
|
||||||
|
dst_port = ndpi_community_id_icmp_type_to_code_v4(icmp_type, icmp_code, &icmp_one_way);
|
||||||
|
break;
|
||||||
|
case IPPROTO_SCTP:
|
||||||
|
case IPPROTO_UDP:
|
||||||
|
case IPPROTO_TCP:
|
||||||
|
/* src/dst port ok */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
src_port = dst_port = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Convert tuple to NBO */
|
||||||
|
src_ip = htonl(src_ip);
|
||||||
|
dst_ip = htonl(dst_ip);
|
||||||
|
src_port = htons(src_port);
|
||||||
|
dst_port = htons(dst_port);
|
||||||
|
|
||||||
|
/*
|
||||||
|
The community id hash doesn't have the definition of client and server, it just sorts IP addresses
|
||||||
|
and ports to make sure the smaller ip address is the first. This performs this check and
|
||||||
|
possibly swap client ip and port.
|
||||||
|
*/
|
||||||
|
if(icmp_one_way || ndpi_community_id_peer_v4_is_less_than(src_ip, dst_ip, src_port, dst_port)) {
|
||||||
|
ip_a_ptr = &src_ip, ip_b_ptr = &dst_ip;
|
||||||
|
port_a = src_port, port_b = dst_port;
|
||||||
|
} else {
|
||||||
|
/* swap flow peers */
|
||||||
|
ip_a_ptr = &dst_ip, ip_b_ptr = &src_ip;
|
||||||
|
port_a = dst_port, port_b = src_port;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Seed */
|
||||||
|
off = ndpi_community_id_buf_copy(&comm_buf[off], &seed, sizeof(seed));
|
||||||
|
|
||||||
|
/* Source and destination IPs */
|
||||||
|
off += ndpi_community_id_buf_copy(&comm_buf[off], ip_a_ptr, sizeof(src_ip));
|
||||||
|
off += ndpi_community_id_buf_copy(&comm_buf[off], ip_b_ptr, sizeof(dst_ip));
|
||||||
|
|
||||||
|
return ndpi_community_id_finalize_and_compute_hash(comm_buf, off,
|
||||||
|
l4_proto, port_a, port_b, (char*)hash_buf, hash_buf_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
|
|
||||||
|
int ndpi_flowv6_flow_hash(u_int8_t l4_proto, struct ndpi_in6_addr *src_ip, struct ndpi_in6_addr *dst_ip,
|
||||||
|
u_int16_t src_port, u_int16_t dst_port,
|
||||||
|
u_int8_t icmp_type, u_int8_t icmp_code,
|
||||||
|
u_char *hash_buf, u_int8_t hash_buf_len) {
|
||||||
|
u_int8_t comm_buf[40] = { 0 };
|
||||||
|
u_int16_t off = 0;
|
||||||
|
u_int16_t seed = 0;
|
||||||
|
struct ndpi_in6_addr *ip_a_ptr, *ip_b_ptr;
|
||||||
|
u_int16_t port_a, port_b;
|
||||||
|
int icmp_one_way = 0;
|
||||||
|
|
||||||
|
switch(l4_proto) {
|
||||||
|
case IPPROTO_ICMPV6:
|
||||||
|
src_port = icmp_type;
|
||||||
|
dst_port = ndpi_community_id_icmp_type_to_code_v6(icmp_type, icmp_code, &icmp_one_way);
|
||||||
|
break;
|
||||||
|
case IPPROTO_SCTP:
|
||||||
|
case IPPROTO_UDP:
|
||||||
|
case IPPROTO_TCP:
|
||||||
|
/* src/dst port ok */
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
src_port = dst_port = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Convert tuple to NBO */
|
||||||
|
src_port = htons(src_port);
|
||||||
|
dst_port = htons(dst_port);
|
||||||
|
|
||||||
|
if(icmp_one_way || ndpi_community_id_peer_v6_is_less_than(src_ip, dst_ip, src_port, dst_port)) {
|
||||||
|
ip_a_ptr = src_ip, ip_b_ptr = dst_ip;
|
||||||
|
port_a = src_port, port_b = dst_port;
|
||||||
|
} else {
|
||||||
|
ip_a_ptr = dst_ip, ip_b_ptr = src_ip;
|
||||||
|
port_a = dst_port, port_b = src_port;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Seed */
|
||||||
|
off = ndpi_community_id_buf_copy(&comm_buf[off], &seed, sizeof(seed));
|
||||||
|
|
||||||
|
/* Source and destination IPs */
|
||||||
|
off += ndpi_community_id_buf_copy(&comm_buf[off], ip_a_ptr, sizeof(struct ndpi_in6_addr));
|
||||||
|
off += ndpi_community_id_buf_copy(&comm_buf[off], ip_b_ptr, sizeof(struct ndpi_in6_addr));
|
||||||
|
|
||||||
|
return ndpi_community_id_finalize_and_compute_hash(comm_buf, off,
|
||||||
|
l4_proto, port_a, port_b, (char*)hash_buf, hash_buf_len);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* **************************************************** */
|
||||||
+596
-244
@@ -79,201 +79,19 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
WhatsApp Inc.
|
WhatsApp Inc.
|
||||||
List of the WhatsApp server IP addresses and ranges (https://developers.facebook.com/docs/whatsapp/network-debugging/ Dec 21, 2018)
|
List of the WhatsApp server IP addresses and ranges
|
||||||
|
https://developers.facebook.com/docs/whatsapp/network-debugging/
|
||||||
|
Dec 1st, 2019
|
||||||
*/
|
*/
|
||||||
{ 0x6CA8AE00 /* 108.168.174.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x6CA8B0C0 /* 108.168.176.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x6CA8B100 /* 108.168.177.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x6CA8B460 /* 108.168.180.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x6CA8FE41 /* 108.168.254.65/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x6CA8FFE0 /* 108.168.255.224/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x6CA8FFE3 /* 108.168.255.227/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00135 /* 157.240.1.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00136 /* 157.240.1.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00A35 /* 157.240.10.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00A36 /* 157.240.10.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00B35 /* 157.240.11.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00B36 /* 157.240.11.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00C35 /* 157.240.12.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00C36 /* 157.240.12.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00D36 /* 157.240.13.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00E34 /* 157.240.14.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00F35 /* 157.240.15.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00F36 /* 157.240.15.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01034 /* 157.240.16.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01234 /* 157.240.18.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01335 /* 157.240.19.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01336 /* 157.240.19.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00235 /* 157.240.2.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00236 /* 157.240.2.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01434 /* 157.240.20.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01534 /* 157.240.21.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01635 /* 157.240.22.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01636 /* 157.240.22.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01735 /* 157.240.23.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01736 /* 157.240.23.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01D35 /* 157.240.29.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF01D36 /* 157.240.29.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00635 /* 157.240.6.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00636 /* 157.240.6.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00735 /* 157.240.7.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00736 /* 157.240.7.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00835 /* 157.240.8.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00836 /* 157.240.8.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00935 /* 157.240.9.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9DF00936 /* 157.240.9.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E550060 /* 158.85.0.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E55E0A0 /* 158.85.224.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E55E920 /* 158.85.233.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E55F980 /* 158.85.249.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E55FE40 /* 158.85.254.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E552E80 /* 158.85.46.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E5530E0 /* 158.85.48.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E5505C0 /* 158.85.5.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E553A00 /* 158.85.58.0/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x9E553DC0 /* 158.85.61.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92CA700 /* 169.44.167.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C2400 /* 169.44.36.0/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C3940 /* 169.44.57.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C3A40 /* 169.44.58.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C5000 /* 169.44.80.0/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C5280 /* 169.44.82.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C52C0 /* 169.44.82.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C5260 /* 169.44.82.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C5300 /* 169.44.83.0/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C5380 /* 169.44.83.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C53C0 /* 169.44.83.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C5360 /* 169.44.83.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C5400 /* 169.44.84.0/24 */, 24, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C5540 /* 169.44.85.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92C57A0 /* 169.44.87.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DA9C0 /* 169.45.169.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DB660 /* 169.45.182.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DD240 /* 169.45.210.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DD6E0 /* 169.45.214.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DDBE0 /* 169.45.219.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DEDC0 /* 169.45.237.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DEE20 /* 169.45.238.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DF2C0 /* 169.45.242.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DF8A0 /* 169.45.248.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92DF860 /* 169.45.248.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92D4720 /* 169.45.71.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92D4760 /* 169.45.71.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92D5780 /* 169.45.87.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92E6F90 /* 169.46.111.144/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92E34E0 /* 169.46.52.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F8260 /* 169.47.130.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F9100 /* 169.47.145.0/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F9980 /* 169.47.153.128/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92FC0C0 /* 169.47.192.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92FC280 /* 169.47.194.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92FC680 /* 169.47.198.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92FD4A0 /* 169.47.212.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F2180 /* 169.47.33.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F2320 /* 169.47.35.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F2580 /* 169.47.37.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F2880 /* 169.47.40.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F2AA0 /* 169.47.42.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F2AC0 /* 169.47.42.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F2A60 /* 169.47.42.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F2FA0 /* 169.47.47.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F05C0 /* 169.47.5.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA92F0640 /* 169.47.6.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9307220 /* 169.48.114.32/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93079C0 /* 169.48.121.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9307A40 /* 169.48.122.64/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA930D2B0 /* 169.48.210.176/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA930D2E0 /* 169.48.210.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA930D340 /* 169.48.211.64/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA930D480 /* 169.48.212.128/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA935FA80 /* 169.53.250.128/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA935FC40 /* 169.53.252.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA935FF40 /* 169.53.255.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9351D80 /* 169.53.29.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9353020 /* 169.53.48.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93547E0 /* 169.53.71.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9355140 /* 169.53.81.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA936C1A0 /* 169.54.193.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93602A0 /* 169.54.2.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA936D200 /* 169.54.210.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA936DE80 /* 169.54.222.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9362CE0 /* 169.54.44.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9363320 /* 169.54.51.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93637C0 /* 169.54.55.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93764A0 /* 169.55.100.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9377E40 /* 169.55.126.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA937D260 /* 169.55.210.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA937EBA0 /* 169.55.235.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9373C94 /* 169.55.60.148/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9373CAA /* 169.55.60.170/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93743E0 /* 169.55.67.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9374580 /* 169.55.69.128/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9374A20 /* 169.55.74.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA9374B60 /* 169.55.75.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93C8180 /* 169.60.129.128/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93C9300 /* 169.60.147.0/24 */, 24, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93CC540 /* 169.60.197.64/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93C4A70 /* 169.60.74.112/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93C4A80 /* 169.60.74.128/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93C4A20 /* 169.60.74.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93C4B80 /* 169.60.75.128/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93C4F00 /* 169.60.79.0/24 */, 24, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93D6500 /* 169.61.101.0/24 */, 24, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93D5190 /* 169.61.81.144/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93D51E0 /* 169.61.81.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93D5240 /* 169.61.82.64/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93D5480 /* 169.61.84.128/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93F4080 /* 169.63.64.128/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93F4920 /* 169.63.73.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93F4940 /* 169.63.73.64/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xA93F4C00 /* 169.63.76.0/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xADC0A220 /* 173.192.162.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xADC0DB80 /* 173.192.219.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xADC0DEA0 /* 173.192.222.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xADC1E680 /* 173.193.230.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xADC1E6C0 /* 173.193.230.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xADC1EF00 /* 173.193.239.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xAE24D080 /* 174.36.208.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xAE24D220 /* 174.36.210.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xAE24FBC0 /* 174.36.251.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xAE25F340 /* 174.37.243.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xAE25FB00 /* 174.37.251.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB33CC030 /* 179.60.192.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB33CC031 /* 179.60.192.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB33CC033 /* 179.60.192.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB33CC134 /* 179.60.193.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB33CC235 /* 179.60.194.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB33CC236 /* 179.60.194.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB33CC331 /* 179.60.195.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB33CC333 /* 179.60.195.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB8AD8840 /* 184.173.136.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB8AD9320 /* 184.173.147.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB8ADA140 /* 184.173.161.64/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB8ADAD74 /* 184.173.173.116/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB8ADB320 /* 184.173.179.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB93CD835 /* 185.60.216.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB93CD836 /* 185.60.216.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB93CD935 /* 185.60.217.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB93CD936 /* 185.60.217.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB93CDA35 /* 185.60.218.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB93CDA36 /* 185.60.218.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB93CDB35 /* 185.60.219.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xB93CDB36 /* 185.60.219.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xC09BD4C0 /* 192.155.212.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xC60BC1B6 /* 198.11.193.182/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xC60BFB20 /* 198.11.251.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xC6175000 /* 198.23.80.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xD02B73C0 /* 208.43.115.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xD02B754F /* 208.43.117.79/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0xD02B7A80 /* 208.43.122.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x1F0D4033 /* 31.13.64.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4033 /* 31.13.64.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4035 /* 31.13.64.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4035 /* 31.13.64.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4131 /* 31.13.65.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4131 /* 31.13.65.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4132 /* 31.13.65.50/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4132 /* 31.13.65.50/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x1F0D4233 /* 31.13.66.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x1F0D4238 /* 31.13.66.56/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4334 /* 31.13.67.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4334 /* 31.13.67.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4430 /* 31.13.68.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4430 /* 31.13.68.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4434 /* 31.13.68.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4434 /* 31.13.68.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D45F0 /* 31.13.69.240/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x1F0D4631 /* 31.13.70.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4631 /* 31.13.70.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4632 /* 31.13.70.50/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4632 /* 31.13.70.50/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4731 /* 31.13.71.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4731 /* 31.13.71.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
@@ -282,12 +100,8 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0x1F0D4834 /* 31.13.72.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4834 /* 31.13.72.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4934 /* 31.13.73.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4934 /* 31.13.73.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4A34 /* 31.13.74.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4A34 /* 31.13.74.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4B30 /* 31.13.75.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4F35 /* 31.13.79.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4B34 /* 31.13.75.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D4F36 /* 31.13.79.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4C51 /* 31.13.76.81/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x1F0D4C52 /* 31.13.76.82/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x1F0D4E35 /* 31.13.78.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x1F0D4E37 /* 31.13.78.55/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x1F0D5030 /* 31.13.80.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5030 /* 31.13.80.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D5035 /* 31.13.80.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5035 /* 31.13.80.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D5130 /* 31.13.81.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5130 /* 31.13.81.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
@@ -304,8 +118,6 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0x1F0D5633 /* 31.13.86.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5633 /* 31.13.86.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D5730 /* 31.13.87.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5730 /* 31.13.87.48/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D5733 /* 31.13.87.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5733 /* 31.13.87.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D5831 /* 31.13.88.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x1F0D5834 /* 31.13.88.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x1F0D5935 /* 31.13.89.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5935 /* 31.13.89.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D5936 /* 31.13.89.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5936 /* 31.13.89.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D5A31 /* 31.13.90.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5A31 /* 31.13.90.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
@@ -320,45 +132,158 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0x1F0D5E36 /* 31.13.94.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5E36 /* 31.13.94.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D5F32 /* 31.13.95.50/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5F32 /* 31.13.95.50/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D5F3F /* 31.13.95.63/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x1F0D5F3F /* 31.13.95.63/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x3216C6CC /* 50.22.198.204/30 */, 30, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x3216D280 /* 50.22.210.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x3216D220 /* 50.22.210.32/30 */, 30, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x3216E140 /* 50.22.225.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x3216EBF8 /* 50.22.235.248/30 */, 30, NDPI_PROTOCOL_WHATSAPP },
|
|
||||||
{ 0x3216F0A0 /* 50.22.240.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x3216F0A0 /* 50.22.240.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x32175A80 /* 50.23.90.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x32175A80 /* 50.23.90.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x32613980 /* 50.97.57.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x45ABEF0B /* 69.171.239.11/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x4B7E0C70 /* 75.126.12.112/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x45ABFA34 /* 69.171.250.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x4B7E7B40 /* 75.126.123.64/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x45ABFA36 /* 69.171.250.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x4B7E8AA0 /* 75.126.138.160/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x45ABFF0B /* 69.171.255.11/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x4B7E8D50 /* 75.126.141.80/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x66846036 /* 102.132.96.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x4B7E1430 /* 75.126.20.48/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x66846136 /* 102.132.97.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x4B7E2720 /* 75.126.39.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x6CA8AE00 /* 108.168.174.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x4B7E51C0 /* 75.126.81.192/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x6CA8B0C0 /* 108.168.176.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x66846036 /* 102.132.96.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x6CA8B100 /* 108.168.177.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x66846136 /* 102.132.97.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x6CA8B460 /* 108.168.180.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF00D36 /* 157.240.13.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x6CA8FE41 /* 108.168.254.65/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF00E34 /* 157.240.14.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x6CA8FFE0 /* 108.168.255.224/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01034 /* 157.240.16.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x6CA8FFE3 /* 108.168.255.227/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01234 /* 157.240.18.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9DF00135 /* 157.240.1.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00136 /* 157.240.1.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00235 /* 157.240.2.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00236 /* 157.240.2.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00336 /* 157.240.3.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00635 /* 157.240.6.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00636 /* 157.240.6.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00735 /* 157.240.7.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00736 /* 157.240.7.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00835 /* 157.240.8.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00836 /* 157.240.8.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00935 /* 157.240.9.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00936 /* 157.240.9.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00A35 /* 157.240.10.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00A36 /* 157.240.10.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00B35 /* 157.240.11.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00B36 /* 157.240.11.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00C35 /* 157.240.12.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00C36 /* 157.240.12.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00D36 /* 157.240.13.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00E34 /* 157.240.14.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00F35 /* 157.240.15.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF00F36 /* 157.240.15.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01034 /* 157.240.16.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01234 /* 157.240.18.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01335 /* 157.240.19.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01336 /* 157.240.19.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01434 /* 157.240.20.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01534 /* 157.240.21.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01635 /* 157.240.22.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01636 /* 157.240.22.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01735 /* 157.240.23.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01736 /* 157.240.23.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01836 /* 157.240.24.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01936 /* 157.240.25.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01A36 /* 157.240.26.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01B36 /* 157.240.27.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01C33 /* 157.240.28.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01C37 /* 157.240.28.55/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01D35 /* 157.240.29.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01D36 /* 157.240.29.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF01E36 /* 157.240.30.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF0C034 /* 157.240.192.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9DF0C034 /* 157.240.192.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0C037 /* 157.240.192.55/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF0C132 /* 157.240.193.50/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9DF0C132 /* 157.240.193.50/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF0C236 /* 157.240.194.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9DF0C137 /* 157.240.193.55/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01434 /* 157.240.20.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9DF0C236 /* 157.240.194.54/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01533 /* 157.240.21.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9DF0C336 /* 157.240.195.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01534 /* 157.240.21.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9DF0C338 /* 157.240.195.56/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01836 /* 157.240.24.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9DF0C43C /* 157.240.196.60/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01936 /* 157.240.25.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9DF0C93C /* 157.240.201.60/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01A36 /* 157.240.26.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E550060 /* 158.85.0.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01B36 /* 157.240.27.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E5505C0 /* 158.85.5.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF00336 /* 157.240.3.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E552E80 /* 158.85.46.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x9DF01E36 /* 157.240.30.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E5530E0 /* 158.85.48.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0xB33CC134 /* 179.60.193.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E553A20 /* 158.85.58.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4238 /* 31.13.66.56/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E553A60 /* 158.85.58.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4334 /* 31.13.67.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E553DC0 /* 158.85.61.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4934 /* 31.13.73.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E55E0A0 /* 158.85.224.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4A34 /* 31.13.74.52/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0x9E55E920 /* 158.85.233.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
{ 0x1F0D4F35 /* 31.13.79.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
{ 0xA92C2400 /* 169.44.36.0/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92C5020 /* 169.44.80.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92C5260 /* 169.44.82.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92C5480 /* 169.44.84.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92D4720 /* 169.45.71.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92D5780 /* 169.45.87.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DA9C0 /* 169.45.169.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DD240 /* 169.45.210.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DD6E0 /* 169.45.214.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DDBE0 /* 169.45.219.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DEE20 /* 169.45.238.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DF2C0 /* 169.45.242.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DF860 /* 169.45.248.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92DF8A0 /* 169.45.248.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F05C0 /* 169.47.5.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F0640 /* 169.47.6.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F2320 /* 169.47.35.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F2880 /* 169.47.40.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F2A60 /* 169.47.42.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F2AA0 /* 169.47.42.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F2AC0 /* 169.47.42.192/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F8260 /* 169.47.130.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92F9980 /* 169.47.153.128/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92FC680 /* 169.47.198.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA92FD4A0 /* 169.47.212.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93547E0 /* 169.53.71.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA9355140 /* 169.53.81.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA9363320 /* 169.54.51.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93637C0 /* 169.54.55.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA936DE80 /* 169.54.222.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA9373C94 /* 169.55.60.148/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA9373CAA /* 169.55.60.170/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93743E0 /* 169.55.67.224/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93745A0 /* 169.55.69.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA9374A20 /* 169.55.74.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA9374B60 /* 169.55.75.96/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93C4B80 /* 169.60.75.128/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93C4F00 /* 169.60.79.0/24 */, 24, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93C9300 /* 169.60.147.0/24 */, 24, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93D6500 /* 169.61.101.0/24 */, 24, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93E9F10 /* 169.62.159.16/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93F4080 /* 169.63.64.128/28 */, 28, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93F4920 /* 169.63.73.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93F4940 /* 169.63.73.64/26 */, 26, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xA93F4C00 /* 169.63.76.0/25 */, 25, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xADC0A220 /* 173.192.162.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xADC0DEA0 /* 173.192.222.160/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xADC1E680 /* 173.193.230.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xADC1EF00 /* 173.193.239.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xAE24D080 /* 174.36.208.128/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xAE24D220 /* 174.36.210.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xAE25F340 /* 174.37.243.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB33CC031 /* 179.60.192.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB33CC033 /* 179.60.192.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB33CC134 /* 179.60.193.52/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB33CC235 /* 179.60.194.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB33CC236 /* 179.60.194.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB33CC331 /* 179.60.195.49/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB33CC333 /* 179.60.195.51/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB8AD8840 /* 184.173.136.64/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB8AD9320 /* 184.173.147.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB8ADA140 /* 184.173.161.64/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB8ADAD74 /* 184.173.173.116/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB93CD835 /* 185.60.216.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB93CD836 /* 185.60.216.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB93CD935 /* 185.60.217.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB93CD936 /* 185.60.217.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB93CDA35 /* 185.60.218.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB93CDA36 /* 185.60.218.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB93CDB35 /* 185.60.219.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xB93CDB36 /* 185.60.219.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xC09BD4C0 /* 192.155.212.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xC60BC1B6 /* 198.11.193.182/31 */, 31, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xC60BFB20 /* 198.11.251.32/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xC6175000 /* 198.23.80.0/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0xD02B73C0 /* 208.43.115.192/27 */, 27, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
|
||||||
/* Files */
|
/* Files */
|
||||||
{ 0xB93CD835 /* 185.60.216.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP_FILES },
|
{ 0xB93CD835 /* 185.60.216.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP_FILES },
|
||||||
{ 0xB93CD836 /* 185.60.216.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP_FILES },
|
{ 0xB93CD836 /* 185.60.216.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP_FILES },
|
||||||
@@ -369,6 +294,119 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0xB93CDB35 /* 185.60.219.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP_FILES },
|
{ 0xB93CDB35 /* 185.60.219.53/32 */, 32, NDPI_PROTOCOL_WHATSAPP_FILES },
|
||||||
{ 0xB93CDB36 /* 185.60.219.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP_FILES },
|
{ 0xB93CDB36 /* 185.60.219.54/32 */, 32, NDPI_PROTOCOL_WHATSAPP_FILES },
|
||||||
|
|
||||||
|
/*
|
||||||
|
WhatsApp Web
|
||||||
|
List of the WhatsApp Web server IP addresses and ranges
|
||||||
|
*/
|
||||||
|
{ 0x9DF01337 /* 157.240.19.55/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0143D /* 157.240.20.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF080A0 /* 157.240.128.160/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08121 /* 157.240.129.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08221 /* 157.240.130.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08321 /* 157.240.131.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08421 /* 157.240.132.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08521 /* 157.240.133.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08621 /* 157.240.134.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08721 /* 157.240.135.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08821 /* 157.240.136.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08921 /* 157.240.137.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08A21 /* 157.240.138.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08B22 /* 157.240.139.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08C22 /* 157.240.140.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08D22 /* 157.240.141.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08E22 /* 157.240.142.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF08F22 /* 157.240.143.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09022 /* 157.240.144.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09122 /* 157.240.145.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09222 /* 157.240.146.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09322 /* 157.240.147.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09422 /* 157.240.148.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09722 /* 157.240.151.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09822 /* 157.240.152.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09BA2 /* 157.240.155.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09EA2 /* 157.240.158.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF09FA2 /* 157.240.159.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A0A2 /* 157.240.160.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A222 /* 157.240.162.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A262 /* 157.240.162.98/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A2A2 /* 157.240.162.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A2E2 /* 157.240.162.226/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A422 /* 157.240.164.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A462 /* 157.240.164.98/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A522 /* 157.240.165.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A562 /* 157.240.165.98/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A622 /* 157.240.166.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A662 /* 157.240.166.98/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A722 /* 157.240.167.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A762 /* 157.240.167.98/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A822 /* 157.240.168.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0A862 /* 157.240.168.98/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0ACA0 /* 157.240.172.160/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0AD22 /* 157.240.173.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0AEA2 /* 157.240.174.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0AF22 /* 157.240.175.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B0A2 /* 157.240.176.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B1A2 /* 157.240.177.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B2A2 /* 157.240.178.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B3A2 /* 157.240.179.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B4A2 /* 157.240.180.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B5A2 /* 157.240.181.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B622 /* 157.240.182.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B722 /* 157.240.183.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B822 /* 157.240.184.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B922 /* 157.240.185.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0B962 /* 157.240.185.98/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BA62 /* 157.240.186.98/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BB62 /* 157.240.187.98/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BCA2 /* 157.240.188.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BCE2 /* 157.240.188.226/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BD21 /* 157.240.189.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BD61 /* 157.240.189.97/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BDA2 /* 157.240.189.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BDE2 /* 157.240.189.226/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BE21 /* 157.240.190.33/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BE61 /* 157.240.190.97/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BEA2 /* 157.240.190.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BEE2 /* 157.240.190.226/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BF22 /* 157.240.191.34/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BFA2 /* 157.240.191.162/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0BFE2 /* 157.240.191.226/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0C53C /* 157.240.197.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0C53D /* 157.240.197.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0C63C /* 157.240.198.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0C63D /* 157.240.198.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0C83C /* 157.240.200.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0C83D /* 157.240.200.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0CB3C /* 157.240.203.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0CB3D /* 157.240.203.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0CC3C /* 157.240.204.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0CC3D /* 157.240.204.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0CE3C /* 157.240.206.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0CE3D /* 157.240.206.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0CF3C /* 157.240.207.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0CF3D /* 157.240.207.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D03C /* 157.240.208.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D03D /* 157.240.208.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D13C /* 157.240.209.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D13D /* 157.240.209.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D23C /* 157.240.210.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D23D /* 157.240.210.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D43C /* 157.240.212.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D43D /* 157.240.212.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D53C /* 157.240.213.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D53D /* 157.240.213.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D63C /* 157.240.214.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D63D /* 157.240.214.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D83C /* 157.240.216.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0D83D /* 157.240.216.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0DE3C /* 157.240.222.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x9DF0DE3D /* 157.240.222.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x1F0D4239 /* 31.13.66.57/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x1F0D4C3C /* 31.13.76.60/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x1F0D4C3D /* 31.13.76.61/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x1F0D5C3E /* 31.13.92.62/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
{ 0x1F0D5D37 /* 31.13.93.55/32 */, 32, NDPI_PROTOCOL_WHATSAPP },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
WeChat
|
WeChat
|
||||||
origin AS132203, AS132591, AS45090
|
origin AS132203, AS132591, AS45090
|
||||||
@@ -488,6 +526,7 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0x344E0000 /* 52.78.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
{ 0x344E0000 /* 52.78.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x344F0000 /* 52.79.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
{ 0x344F0000 /* 52.79.0.0/16 */, 16, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x34520000 /* 52.82.0.0/14 */, 14, NDPI_PROTOCOL_AMAZON },
|
{ 0x34520000 /* 52.82.0.0/14 */, 14, NDPI_PROTOCOL_AMAZON },
|
||||||
|
{ 0x34540000 /* 52.84.0.0/14 */, 14, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x34580000 /* 52.88.0.0/13 */, 13, NDPI_PROTOCOL_AMAZON },
|
{ 0x34580000 /* 52.88.0.0/13 */, 13, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x345A0000 /* 52.90.0.0/15 */, 15, NDPI_PROTOCOL_AMAZON },
|
{ 0x345A0000 /* 52.90.0.0/15 */, 15, NDPI_PROTOCOL_AMAZON },
|
||||||
{ 0x345EE000 /* 52.94.224.0/19 */, 19, NDPI_PROTOCOL_AMAZON },
|
{ 0x345EE000 /* 52.94.224.0/19 */, 19, NDPI_PROTOCOL_AMAZON },
|
||||||
@@ -967,7 +1006,6 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0x9D38C600 /* 157.56.198.0 */, 26, NDPI_PROTOCOL_SKYPE },
|
{ 0x9D38C600 /* 157.56.198.0 */, 26, NDPI_PROTOCOL_SKYPE },
|
||||||
{ 0x9D3C0000 /* 157.60.0.0 */, 16, NDPI_PROTOCOL_SKYPE },
|
{ 0x9D3C0000 /* 157.60.0.0 */, 16, NDPI_PROTOCOL_SKYPE },
|
||||||
{ 0x9D360000 /* 157.54.0.0 */, 15, NDPI_PROTOCOL_SKYPE },
|
{ 0x9D360000 /* 157.54.0.0 */, 15, NDPI_PROTOCOL_SKYPE },
|
||||||
{ 0x0D400000 /* 13.64.0.0 */, 11, NDPI_PROTOCOL_SKYPE },
|
|
||||||
{ 0x0D6B0380 /* 13.107.3.128 */, 32, NDPI_PROTOCOL_SKYPE },
|
{ 0x0D6B0380 /* 13.107.3.128 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
{ 0x0D6B0381 /* 13.107.3.129 */, 32, NDPI_PROTOCOL_SKYPE },
|
{ 0x0D6B0381 /* 13.107.3.129 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
{ 0x6FDD4000 /* 111.221.64.0 */, 18, NDPI_PROTOCOL_SKYPE },
|
{ 0x6FDD4000 /* 111.221.64.0 */, 18, NDPI_PROTOCOL_SKYPE },
|
||||||
@@ -977,6 +1015,8 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0x4237DF00 /* 65.55.223.0 */, 26, NDPI_PROTOCOL_SKYPE },
|
{ 0x4237DF00 /* 65.55.223.0 */, 26, NDPI_PROTOCOL_SKYPE },
|
||||||
{ 0x17600000 /* 23.96.0.0 */, 13, NDPI_PROTOCOL_SKYPE },
|
{ 0x17600000 /* 23.96.0.0 */, 13, NDPI_PROTOCOL_SKYPE },
|
||||||
{ 0x34724A05 /* 52.114.74.5 */, 32, NDPI_PROTOCOL_SKYPE },
|
{ 0x34724A05 /* 52.114.74.5 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x14B40000 /* 20.180.0.0 */, 14, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x14B80000 /* 20.184.0.0 */, 13, NDPI_PROTOCOL_SKYPE },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Blizzard Entertainment, Inc
|
Blizzard Entertainment, Inc
|
||||||
@@ -1114,9 +1154,40 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0xB2A4F550 /* 178.164.245.80/32 */, 32, NDPI_PROTOCOL_BITTORRENT },
|
{ 0xB2A4F550 /* 178.164.245.80/32 */, 32, NDPI_PROTOCOL_BITTORRENT },
|
||||||
{ 0xAE597B3E /* 174.89.123.62/32 */, 32, NDPI_PROTOCOL_BITTORRENT },
|
{ 0xAE597B3E /* 174.89.123.62/32 */, 32, NDPI_PROTOCOL_BITTORRENT },
|
||||||
|
|
||||||
|
/*
|
||||||
|
Ethereum
|
||||||
|
curl -s https://raw.githubusercontent.com/ethereum/go-ethereum/master/params/bootnodes.go | grep -v '^/' | grep ':' | cut -d '@' -f 2 | cut -d ':' -f 1
|
||||||
|
*/
|
||||||
|
{ 0x128A6C43 /* 18.138.108.67/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x03D12D4F /* 3.209.45.79/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x22FF1771 /* 34.255.23.113/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x239EF497 /* 35.158.244.151/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x34BBCF1B /* 52.187.207.27/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0xBFEAA2C6 /* 191.234.162.198/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x34E7A56C /* 52.231.165.108/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x682AD919 /* 104.42.217.25/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x050153E2 /* 5.1.83.226/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x34B0070A /* 52.176.7.10/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x34B0644D /* 52.176.100.77/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x34E8F398 /* 52.232.243.152/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0xC051D0DF /* 192.81.208.223/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x34A92A65 /* 52.169.42.101/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x34039EB8 /* 52.3.158.184/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x9F591CD3 /* 159.89.28.211/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x338D4E35 /* 51.141.78.53/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x0D5D3689 /* 13.93.54.137/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x5EED3672 /* 94.237.54.114/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x34409B93 /* 52.64.155.147/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0xD5BA1052 /* 213.186.16.82/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x343888C8 /* 52.56.136.200/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x23B1E2A8 /* 35.177.226.168/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x287603DF /* 40.118.3.223/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x287603DF /* 40.118.3.223/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
{ 0x287603DF /* 40.118.3.223/32 */, 32, NDPI_PROTOCOL_MINING },
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Tor
|
Tor
|
||||||
http://torstatus.blutmagie.de/ip_list_all.php/Tor_ip_list_ALL.csv
|
https://torstatus.rueckgr.at/ip_list_all.php/Tor_ip_list_ALL.csv
|
||||||
From 09.09.2019
|
From 09.09.2019
|
||||||
|
|
||||||
Use utils/toripaddr2list.py to convert them
|
Use utils/toripaddr2list.py to convert them
|
||||||
@@ -8217,9 +8288,6 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0xD040C900 /* 208.64.201.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
{ 0xD040C900 /* 208.64.201.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
||||||
{ 0xD04EA400 /* 208.78.164.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
{ 0xD04EA400 /* 208.78.164.0/22 */, 22, NDPI_PROTOCOL_STEAM },
|
||||||
|
|
||||||
/* Line */
|
|
||||||
{ 0x7DD1FC00 /* 125.209.252.0/24 */, 24, NDPI_PROTOCOL_LINE },
|
|
||||||
|
|
||||||
/* Zoom video conference app. */
|
/* Zoom video conference app. */
|
||||||
{ 0x03501480 /* 3.80.20.128/25 */, 25, NDPI_PROTOCOL_ZOOM },
|
{ 0x03501480 /* 3.80.20.128/25 */, 25, NDPI_PROTOCOL_ZOOM },
|
||||||
{ 0x03787900 /* 3.120.121.0/25 */, 25, NDPI_PROTOCOL_ZOOM },
|
{ 0x03787900 /* 3.120.121.0/25 */, 25, NDPI_PROTOCOL_ZOOM },
|
||||||
@@ -8307,6 +8375,223 @@ static ndpi_network host_protocol_list[] = {
|
|||||||
{ 0xA7CEDA82 /* 167.206.218.130/32*/, 32, NDPI_PROTOCOL_PS_VUE },
|
{ 0xA7CEDA82 /* 167.206.218.130/32*/, 32, NDPI_PROTOCOL_PS_VUE },
|
||||||
{ 0xA7CEDA8A /* 167.206.218.138/32*/, 32, NDPI_PROTOCOL_PS_VUE },
|
{ 0xA7CEDA8A /* 167.206.218.138/32*/, 32, NDPI_PROTOCOL_PS_VUE },
|
||||||
|
|
||||||
|
/* Bloomberg */
|
||||||
|
{ 0xD086A100 /* 208.134.161.0/24 */, 24, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0xCDB7F600 /* 205.183.246.0/24 */, 24, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0xC769B000 /* 199.105.176.0/21 */, 21, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0xC769B800 /* 199.105.184.0/23 */, 23, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0x45B80000 /* 69.184.0.0/13 */, 13, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0xA02B0000 /* 160.43.0.0/16 */, 24, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0xCE9C3500 /* 206.156.53.0/24 */, 24, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0xCDD87000 /* 205.216.112.0/24 */, 24, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0xD0163800 /* 208.22.56.0/24 */, 24, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0xD0163900 /* 208.22.57.0/24 */, 24, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
{ 0x45BFC000 /* 69.191.192.0/18 */, 18, NDPI_PROTOCOL_BLOOMBERG },
|
||||||
|
|
||||||
|
/* Microsoft
|
||||||
|
https://docs.microsoft.com/en-us/office365/enterprise/urls-and-ip-address-ranges
|
||||||
|
*/
|
||||||
|
{ 0x0D6B0698 /* 13.107.6.152/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B120A /* 13.107.18.10/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B8000 /* 13.107.128.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x1767A000 /* 23.103.160.0/20 */, 20, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28600000 /* 40.96.0.0/13 */, 13, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28680000 /* 40.104.0.0/15 */, 15, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34600000 /* 52.96.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x83FD21D7 /* 131.253.33.215/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x84F50000 /* 132.245.0.0/16 */, 16, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x96AB2000 /* 150.171.32.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0xBFEA8C00 /* 191.234.140.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0xCC4FC5D7 /* 204.79.197.215/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B0698 /* 13.107.6.152/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B120A /* 13.107.18.10/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B8000 /* 13.107.128.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x1767A000 /* 23.103.160.0/20 */, 20, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28600000 /* 40.96.0.0/13 */, 13, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28680000 /* 40.104.0.0/15 */, 15, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34600000 /* 52.96.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x83FD21D7 /* 131.253.33.215/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x84F50000 /* 132.245.0.0/16 */, 16, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x96AB2000 /* 150.171.32.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0xBFEA8C00 /* 191.234.140.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0xCC4FC5D7 /* 204.79.197.215/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B0698 /* 13.107.6.152/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B120A /* 13.107.18.10/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B8000 /* 13.107.128.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x1767A000 /* 23.103.160.0/20 */, 20, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28600000 /* 40.96.0.0/13 */, 13, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28680000 /* 40.104.0.0/15 */, 15, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34600000 /* 52.96.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x83FD21D7 /* 131.253.33.215/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x84F50000 /* 132.245.0.0/16 */, 16, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x96AB2000 /* 150.171.32.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0xBFEA8C00 /* 191.234.140.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0xCC4FC5D7 /* 204.79.197.215/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B0698 /* 13.107.6.152/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B120A /* 13.107.18.10/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B8000 /* 13.107.128.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x1767A000 /* 23.103.160.0/20 */, 20, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28600000 /* 40.96.0.0/13 */, 13, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28680000 /* 40.104.0.0/15 */, 15, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34600000 /* 52.96.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x83FD21D7 /* 131.253.33.215/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x84F50000 /* 132.245.0.0/16 */, 16, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x96AB2000 /* 150.171.32.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0xBFEA8C00 /* 191.234.140.0/22 */, 22, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0xCC4FC5D7 /* 204.79.197.215/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x285C0000 /* 40.92.0.0/15 */, 15, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x286B0000 /* 40.107.0.0/16 */, 16, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34640000 /* 52.100.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34EE4E58 /* 52.238.78.88/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x682F0000 /* 104.47.0.0/17 */, 17, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x285C0000 /* 40.92.0.0/15 */, 15, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x286B0000 /* 40.107.0.0/16 */, 16, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34640000 /* 52.100.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x682F0000 /* 104.47.0.0/17 */, 17, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
/* ** */
|
||||||
|
{ 0x0D6B8800 /* 13.107.136.0/22 */, 22, NDPI_PROTOCOL_MS_ONE_DRIVE },
|
||||||
|
{ 0x286C8000 /* 40.108.128.0/17 */, 17, NDPI_PROTOCOL_MS_ONE_DRIVE },
|
||||||
|
{ 0x34680000 /* 52.104.0.0/14 */, 14, NDPI_PROTOCOL_MS_ONE_DRIVE },
|
||||||
|
{ 0x68928000 /* 104.146.128.0/17 */, 17, NDPI_PROTOCOL_MS_ONE_DRIVE },
|
||||||
|
{ 0x96AB2800 /* 150.171.40.0/22 */, 22, NDPI_PROTOCOL_MS_ONE_DRIVE },
|
||||||
|
/* ** */
|
||||||
|
{ 0x0D6B4000 /* 13.107.64.0/18 */, 18, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34700000 /* 52.112.0.0/14 */, 14, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D4697D8 /* 13.70.151.216/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D477FC5 /* 13.71.127.197/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D48F573 /* 13.72.245.115/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D490178 /* 13.73.1.120/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D4B7EA9 /* 13.75.126.169/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D59F071 /* 13.89.240.113/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D6B0300 /* 13.107.3.0/24 */, 24, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D6B4000 /* 13.107.64.0/18 */, 18, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x338C9BEA /* 51.140.155.234/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x338CCBBE /* 51.140.203.190/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x338D334C /* 51.141.51.76/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34700000 /* 52.112.0.0/14 */, 14, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34A37ED7 /* 52.163.126.215/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34AA1543 /* 52.170.21.67/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34ACB912 /* 52.172.185.18/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34B25E02 /* 52.178.94.2/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34B2A18B /* 52.178.161.139/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34E41960 /* 52.228.25.96/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34EE778D /* 52.238.119.141/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34F217BD /* 52.242.23.189/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34F4A0CF /* 52.244.160.207/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x68D70B90 /* 104.215.11.144/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x68D73EC3 /* 104.215.62.195/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x8A5BEDED /* 138.91.237.237/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D4697D8 /* 13.70.151.216/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D477FC5 /* 13.71.127.197/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D48F573 /* 13.72.245.115/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D490178 /* 13.73.1.120/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D4B7EA9 /* 13.75.126.169/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D59F071 /* 13.89.240.113/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D6B0300 /* 13.107.3.0/24 */, 24, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D6B4000 /* 13.107.64.0/18 */, 18, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x338C9BEA /* 51.140.155.234/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x338CCBBE /* 51.140.203.190/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x338D334C /* 51.141.51.76/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34700000 /* 52.112.0.0/14 */, 14, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34A37ED7 /* 52.163.126.215/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34AA1543 /* 52.170.21.67/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34ACB912 /* 52.172.185.18/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34B25E02 /* 52.178.94.2/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34B2A18B /* 52.178.161.139/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34E41960 /* 52.228.25.96/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34EE778D /* 52.238.119.141/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34F217BD /* 52.242.23.189/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34F4A0CF /* 52.244.160.207/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x68D70B90 /* 104.215.11.144/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x68D73EC3 /* 104.215.62.195/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x8A5BEDED /* 138.91.237.237/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D4697D8 /* 13.70.151.216/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D477FC5 /* 13.71.127.197/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D48F573 /* 13.72.245.115/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D490178 /* 13.73.1.120/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D4B7EA9 /* 13.75.126.169/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D59F071 /* 13.89.240.113/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D6B0300 /* 13.107.3.0/24 */, 24, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x0D6B4000 /* 13.107.64.0/18 */, 18, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x338C9BEA /* 51.140.155.234/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x338CCBBE /* 51.140.203.190/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x338D334C /* 51.141.51.76/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34700000 /* 52.112.0.0/14 */, 14, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34A37ED7 /* 52.163.126.215/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34AA1543 /* 52.170.21.67/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34ACB912 /* 52.172.185.18/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34B25E02 /* 52.178.94.2/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34B2A18B /* 52.178.161.139/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34E41960 /* 52.228.25.96/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34EE778D /* 52.238.119.141/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34F217BD /* 52.242.23.189/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x34F4A0CF /* 52.244.160.207/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x68D70B90 /* 104.215.11.144/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x68D73EC3 /* 104.215.62.195/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
{ 0x8A5BEDED /* 138.91.237.237/32 */, 32, NDPI_PROTOCOL_SKYPE },
|
||||||
|
/* ** */
|
||||||
|
{ 0x0D6B06AB /* 13.107.6.171/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B8C06 /* 13.107.140.6/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x346C0000 /* 52.108.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34EE6A74 /* 52.238.106.116/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34F796BF /* 52.247.150.191/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6A0480 /* 13.106.4.128/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6A3800 /* 13.106.56.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x14BE8000 /* 20.190.128.0/18 */, 18, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x287E0000 /* 40.126.0.0/18 */, 18, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x4136AA80 /* 65.54.170.128/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x682CDA80 /* 104.44.218.128/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x682CFE80 /* 104.44.254.128/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x682CFF00 /* 104.44.255.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x86AA4300 /* 134.170.67.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x86AAAC80 /* 134.170.172.128/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D372D80 /* 157.55.45.128/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D378200 /* 157.55.130.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D379100 /* 157.55.145.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D379B00 /* 157.55.155.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D37E3C0 /* 157.55.227.192/26 */, 26, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0xBFE80280 /* 191.232.2.128/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D507D16 /* 13.80.125.22/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D5B5BF3 /* 13.91.91.243/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B069C /* 13.107.6.156/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B07BE /* 13.107.7.190/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B099C /* 13.107.9.156/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28519C9A /* 40.81.156.154/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x285ADAC6 /* 40.90.218.198/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x346C0000 /* 52.108.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34AE38B4 /* 52.174.56.180/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34B74B3E /* 52.183.75.62/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34B8A552 /* 52.184.165.82/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x682AE65B /* 104.42.230.91/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D379100 /* 157.55.145.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D379B00 /* 157.55.155.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D37E3C0 /* 157.55.227.192/26 */, 26, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D507D16 /* 13.80.125.22/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D5B5BF3 /* 13.91.91.243/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B069C /* 13.107.6.156/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B07BE /* 13.107.7.190/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B099C /* 13.107.9.156/31 */, 31, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x28519C9A /* 40.81.156.154/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x285ADAC6 /* 40.90.218.198/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x346C0000 /* 52.108.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34AE38B4 /* 52.174.56.180/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34B74B3E /* 52.183.75.62/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34B8A552 /* 52.184.165.82/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x682AE65B /* 104.42.230.91/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D379100 /* 157.55.145.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D379B00 /* 157.55.155.0/25 */, 25, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x9D37E3C0 /* 157.55.227.192/26 */, 26, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B06AB /* 13.107.6.171/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x0D6B8C06 /* 13.107.140.6/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x346C0000 /* 52.108.0.0/14 */, 14, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34EE6A74 /* 52.238.106.116/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
{ 0x34F796BF /* 52.247.150.191/32 */, 32, NDPI_PROTOCOL_OFFICE_365 },
|
||||||
|
/* ** */
|
||||||
|
{ 0x0D400000 /* 13.64.0.0 */, 11, NDPI_PROTOCOL_MICROSOFT },
|
||||||
|
{ 0x0D600000 /* 13.96.0.0 */, 13, NDPI_PROTOCOL_MICROSOFT },
|
||||||
|
{ 0x0D680000 /* 13.104.0.0 */, 14, NDPI_PROTOCOL_MICROSOFT },
|
||||||
|
|
||||||
|
/* End */
|
||||||
{ 0x0, 0, 0 }
|
{ 0x0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -8400,8 +8685,17 @@ static ndpi_protocol_match host_match[] = {
|
|||||||
{ "images-amazon.com", NULL, "images-amazon" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "images-amazon.com", NULL, "images-amazon" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "amazonaws.com", NULL, "amazonaws" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "amazonaws.com", NULL, "amazonaws" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "amazon-adsystem.com", NULL, "amazon-adsystem" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "amazon-adsystem.com", NULL, "amazon-adsystem" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".aws.", NULL, "\\.aws\\." TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".cloudfront.net", NULL, "\\.cloudfront" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".cloudfront.net", NULL, "\\.cloudfront" TLD, "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ ".us-west-2.compute.amazonaws.com", NULL, "\\.us-west-2\\.compute\\.amazonaws\\.com", "Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".us-west-2.compute.amazonaws.com", NULL, "\\.us-west-2\\.compute\\.amazonaws\\.com","Amazon", NDPI_PROTOCOL_AMAZON, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
/* Microsoft + Azure */
|
||||||
|
{ ".azure.com", NULL, "\\.azure.\\com" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".windows.net", NULL, "\\.windows.\\net" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".microsoft.com", NULL, "\\.microsoft.\\com" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
|
{ ".bloombergvault.com", NULL, "\\.bloombergvault.\\com" TLD, "Bloomberg", NDPI_PROTOCOL_BLOOMBERG, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_SAFE },
|
||||||
|
{ ".bloomberg.com", NULL, "\\.bloomberg.\\com" TLD, "Bloomberg", NDPI_PROTOCOL_BLOOMBERG, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
{ ".push.apple.com", NULL, "\\.push\\.apple" TLD, "ApplePush", NDPI_PROTOCOL_APPLE_PUSH, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_SAFE },
|
{ ".push.apple.com", NULL, "\\.push\\.apple" TLD, "ApplePush", NDPI_PROTOCOL_APPLE_PUSH, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_SAFE },
|
||||||
{ ".apple-dns.net", NULL, "\\.apple-dns" TLD, "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ ".apple-dns.net", NULL, "\\.apple-dns" TLD, "Apple", NDPI_PROTOCOL_APPLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
@@ -8481,16 +8775,62 @@ static ndpi_protocol_match host_match[] = {
|
|||||||
|
|
||||||
This traffic will bypass checks and blocks as it will include all the communications from/to
|
This traffic will bypass checks and blocks as it will include all the communications from/to
|
||||||
the browser instead of using the standard communication mechanisms SSL/HTTP(S)/DNS
|
the browser instead of using the standard communication mechanisms SSL/HTTP(S)/DNS
|
||||||
*/
|
|
||||||
|
https://github.com/curl/curl/wiki/DNS-over-HTTPS
|
||||||
|
*/
|
||||||
{ ".googlezip.net", NULL, ".googlezip\\.net" TLD, "DataSaver", NDPI_PROTOCOL_DATASAVER, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".googlezip.net", NULL, ".googlezip\\.net" TLD, "DataSaver", NDPI_PROTOCOL_DATASAVER, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "datasaver.googleapis.com", NULL, "datasaver\\.googleapis\\.com" TLD, "DataSaver", NDPI_PROTOCOL_DATASAVER, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "datasaver.googleapis.com", NULL, "datasaver\\.googleapis\\.com" TLD, "DataSaver", NDPI_PROTOCOL_DATASAVER, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
/* http://check.googlezip.net/connect [check browser connectivity] */
|
/* http://check.googlezip.net/connect [check browser connectivity] */
|
||||||
// { ".googlezip.net", NULL, "\\.googlezip" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
// { ".googlezip.net", NULL, "\\.googlezip" TLD, "Google", NDPI_PROTOCOL_GOOGLE, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
{ "dns.google", NULL, "dns\\.google" TLD, "DNSoverHTTPS", NDPI_PROTOCOL_DNS_OVER_HTTPS, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "dns.google", NULL, "dns\\.google" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
// { "mozilla.cloudflare-dns.com", NULL, "mozilla\\.cloudflare-dns\\.com" TLD, "DNSoverHTTPS", NDPI_PROTOCOL_DNS_OVER_HTTPS, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE }, /* Firefox */
|
{ "mozilla.cloudflare-dns.com", NULL, "mozilla\\.cloudflare-dns\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE }, /* Firefox */
|
||||||
{ "cloudflare-dns.com", NULL, "cloudflare-dns\\.com" TLD, "DNSoverHTTPS", NDPI_PROTOCOL_DNS_OVER_HTTPS, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "cloudflare-dns.com", NULL, "cloudflare-dns\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "commons.host", NULL, "commons\\.host" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.li", NULL, "doh\\.li" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns9.quad9.net", NULL, "dns9\\.quad9\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.opendns.com", NULL, "doh\\.opendns\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.dns.sb", NULL, "doh\\.dns\\.sb" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.netweaver.uk", NULL, "doh\\.netweaver\\.uk" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns.dns-over-https.com", NULL, "dns\\.dns-over-https\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "jp.tiarap.org", NULL, "jp\\.tiarap\\.org" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns.dnsoverhttps.net", NULL, "dns\\.dnsoverhttps\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.powerdns.org", NULL, "doh\\.powerdns\\.org" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "adblock.mydns.network", NULL, "adblock\\.mydns\\.network" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "jp.tiar.app", NULL, "jp\\.tiar\\.app" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.crypto.sx", NULL, "doh\\.crypto\\.sx" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns.quad9.net", NULL, "dns\\.quad9\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns.containerpi.com", NULL, "dns\\.containerpi\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "ibksturm.synology.me", NULL, "ibksturm\\.synology\\.me" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.captnemo.in", NULL, "doh\\.captnemo\\.in" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns.rubyfish.cn", NULL, "dns\\.rubyfish\\.cn" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.42l.fr", NULL, "doh\\.42l\\.fr" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns-family.adguard.com", NULL, "dns-family\\.adguard\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "appliedprivacy.net", NULL, "appliedprivacy\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.cleanbrowsing.org", NULL, "doh\\.cleanbrowsing\\.org" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns10.quad9.net", NULL, "dns10\\.quad9\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh-ch.blahdns.com", NULL, "doh-ch\\.blahdns\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.seby.io", NULL, "doh\\.seby\\.io" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns.adguard.com", NULL, "dns\\.adguard\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "ibuki.cgnat.net", NULL, "ibuki\\.cgnat\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "jcdns.fun", NULL, "jcdns\\.fun" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh-2.seby.io", NULL, "doh-2\\.seby\\.io" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.tiar.app", NULL, "doh\\.tiar\\.app" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.dnswarden.com", NULL, "doh\\.dnswarden\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh-de.blahdns.com", NULL, "doh-de\\.blahdns\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh-jp.blahdns.com", NULL, "doh-jp\\.blahdns\\.com" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.appliedprivacy.net", NULL, "doh\\.appliedprivacy\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.tiarap.org", NULL, "doh\\.tiarap\\.org" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.armadillodns.net", NULL, "doh\\.armadillodns\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns-nyc.aaflalo.me", NULL, "dns-nyc\\.aaflalo\\.me" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns.aa.net.uk", NULL, "dns\\.aa\\.net\\.uk" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns.aaflalo.me", NULL, "dns\\.aaflalo\\.me" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns11.quad9.net", NULL, "dns11\\.quad9\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "dns.nextdns.io", NULL, "dns\\.nextdns\\.io" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "doh.securedns.eu", NULL, "doh\\.securedns\\.eu" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "rdns.faelix.net", NULL, "rdns\\.faelix\\.net" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "captnemo.in", NULL, "captnemo\\.in" TLD, "DoH_DoT", NDPI_PROTOCOL_DOH_DOT, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -8569,6 +8909,7 @@ static ndpi_protocol_match host_match[] = {
|
|||||||
{ "e7768.b.akamaiedge.net", NULL, "e7768\\.b\\.akamaiedge" TLD, "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "e7768.b.akamaiedge.net", NULL, "e7768\\.b\\.akamaiedge" TLD, "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "e4593.dspg.akamaiedge.net", NULL, "e4593\\.dspg\\.akamaiedge" TLD,"Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "e4593.dspg.akamaiedge.net", NULL, "e4593\\.dspg\\.akamaiedge" TLD,"Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "e4593.g.akamaiedge.net", NULL, "e4593\\.g\\.akamaiedge" TLD, "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "e4593.g.akamaiedge.net", NULL, "e4593\\.g\\.akamaiedge" TLD, "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ "*.gateway.messenger.live.com", NULL, "\\*\\.gateway\\.messenger\\.live" TLD, "Skype", NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ ".tuenti.com", NULL, "\\.tuenti" TLD, "Tuenti", NDPI_PROTOCOL_TUENTI, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
{ ".tuenti.com", NULL, "\\.tuenti" TLD, "Tuenti", NDPI_PROTOCOL_TUENTI, NDPI_PROTOCOL_CATEGORY_VOIP, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
@@ -8623,6 +8964,7 @@ static ndpi_protocol_match host_match[] = {
|
|||||||
{ "ttvnw.net", NULL, "ttvnw" TLD, "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_VIDEO, NDPI_PROTOCOL_FUN },
|
{ "ttvnw.net", NULL, "ttvnw" TLD, "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_VIDEO, NDPI_PROTOCOL_FUN },
|
||||||
{ "static-cdn.jtvnw.net", NULL, "static-cdn\\.jtvnw" TLD, "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_VIDEO, NDPI_PROTOCOL_FUN },
|
{ "static-cdn.jtvnw.net", NULL, "static-cdn\\.jtvnw" TLD, "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_VIDEO, NDPI_PROTOCOL_FUN },
|
||||||
{ "www-cdn.jtvnw.net", NULL, "www-cdn\\.jtvnw" TLD, "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_VIDEO, NDPI_PROTOCOL_FUN },
|
{ "www-cdn.jtvnw.net", NULL, "www-cdn\\.jtvnw" TLD, "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_VIDEO, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "twitch.tv", NULL, "twitch\\.tv$", "Twitch", NDPI_PROTOCOL_TWITCH, NDPI_PROTOCOL_CATEGORY_VIDEO, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
{ ".qq.com", NULL, "\\.qq" TLD, "QQ", NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
{ ".qq.com", NULL, "\\.qq" TLD, "QQ", NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
{ ".gtimg.com", NULL, "\\.gtimg" TLD, "QQ", NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
{ ".gtimg.com", NULL, "\\.gtimg" TLD, "QQ", NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_FUN },
|
||||||
@@ -8659,7 +9001,6 @@ static ndpi_protocol_match host_match[] = {
|
|||||||
{ "login.live.com", NULL, "login\\.live" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
{ "login.live.com", NULL, "login\\.live" TLD, "Microsoft", NDPI_PROTOCOL_MICROSOFT, NDPI_PROTOCOL_CATEGORY_WEB, NDPI_PROTOCOL_SAFE },
|
||||||
|
|
||||||
{ "bn1301.storage.live.com", NULL, "bn1301\\.storage\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE,NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "bn1301.storage.live.com", NULL, "bn1301\\.storage\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE,NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "*.gateway.messenger.live.com", NULL, "\\*\\.gateway\\.messenger\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
|
||||||
{ "skyapi.live.net", NULL, "skyapi\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "skyapi.live.net", NULL, "skyapi\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "d.docs.live.net", NULL, "d\\.docs\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "d.docs.live.net", NULL, "d\\.docs\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "onedrive.live.com", NULL, "onedrive\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "onedrive.live.com", NULL, "onedrive\\.live" TLD, "MS_OneDrive", NDPI_PROTOCOL_MS_ONE_DRIVE, NDPI_PROTOCOL_CATEGORY_CLOUD, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
@@ -8767,6 +9108,7 @@ static ndpi_protocol_match host_match[] = {
|
|||||||
{ "tupdate.com", NULL, "tupdate" TLD, "Telegram", NDPI_PROTOCOL_TELEGRAM, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "tupdate.com", NULL, "tupdate" TLD, "Telegram", NDPI_PROTOCOL_TELEGRAM, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ ".pastebin.com", NULL, "\\.pastebin" TLD, "Pastebin", NDPI_PROTOCOL_PASTEBIN, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
{ ".pastebin.com", NULL, "\\.pastebin" TLD, "Pastebin", NDPI_PROTOCOL_PASTEBIN, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
||||||
|
{ "pastebin.com", NULL, "^pastebin" TLD, "Pastebin", NDPI_PROTOCOL_PASTEBIN, NDPI_PROTOCOL_CATEGORY_DOWNLOAD_FT, NDPI_PROTOCOL_POTENTIALLY_DANGEROUS },
|
||||||
|
|
||||||
{ ".ppstream.com", NULL, "\\.ppstream" TLD, "PPStream", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
{ ".ppstream.com", NULL, "\\.ppstream" TLD, "PPStream", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
{ ".pps.tv", NULL, "\\.pps\\.tv$", "PPStream", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
{ ".pps.tv", NULL, "\\.pps\\.tv$", "PPStream", NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_CATEGORY_STREAMING, NDPI_PROTOCOL_FUN },
|
||||||
@@ -8786,19 +9128,28 @@ static ndpi_protocol_match host_match[] = {
|
|||||||
{ "whispersystems.org", NULL, "whispersystems\\.org" TLD, "Signal", NDPI_PROTOCOL_SIGNAL, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
{ "whispersystems.org", NULL, "whispersystems\\.org" TLD, "Signal", NDPI_PROTOCOL_SIGNAL, NDPI_PROTOCOL_CATEGORY_CHAT, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
{ "musical.ly", NULL, "musical\\.ly" TLD, "TikTok", NDPI_PROTOCOL_TIKTOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
{ "musical.ly", NULL, "musical\\.ly" TLD, "TikTok", NDPI_PROTOCOL_TIKTOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
{ "muscdn.com", NULL, "muscndl\\.com" TLD, "TikTok", NDPI_PROTOCOL_TIKTOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
{ "muscdn.com", NULL, "muscndl\\.com" TLD, "TikTok", NDPI_PROTOCOL_TIKTOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
{ "byteoversea.com", NULL, "byteoversea\\.com" TLD, "TikTok", NDPI_PROTOCOL_TIKTOK, NDPI_PROTOCOL_CATEGORY_SOCIAL_NETWORK, NDPI_PROTOCOL_FUN },
|
||||||
|
|
||||||
|
{ "brasilbandalarga.com.br", NULL, "brasilbandalarga\\.com" TLD, "EAQ", NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
{ ".eaqbr.com.br", NULL, "\\.eaqbr\\.com" TLD, "EAQ", NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_CATEGORY_NETWORK, NDPI_PROTOCOL_ACCEPTABLE },
|
||||||
|
|
||||||
{ NULL, NULL, NULL, 0 }
|
{ NULL, NULL, NULL, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ******************************************************************** */
|
/* ******************************************************************** */
|
||||||
|
|
||||||
|
/*
|
||||||
|
IMPORTANT
|
||||||
|
|
||||||
|
Do NOT pur here strings that overlap with string in host_match[]
|
||||||
|
specified above
|
||||||
|
*/
|
||||||
static ndpi_category_match category_match[] = {
|
static ndpi_category_match category_match[] = {
|
||||||
{ ".edgecastcdn.net", "egdecastcdn" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
{ ".edgecastcdn.net", "egdecastcdn" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
||||||
{ ".hwcdn.net", "hwcdn" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
{ ".hwcdn.net", "hwcdn" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
||||||
{ ".llnwd.net", "llnwd" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
{ ".llnwd.net", "llnwd" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
||||||
{ ".llns.net", "llns" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
{ ".llns.net", "llns" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
||||||
{ ".fastly.net", "fastly" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
{ ".fastly.net", "fastly" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
||||||
{ ".akamaiedge.net", "akamaiedge" TLD, NDPI_PROTOCOL_CATEGORY_MEDIA },
|
|
||||||
{ ".vultr.com", "vultr" TLD, NDPI_PROTOCOL_CATEGORY_CLOUD },
|
{ ".vultr.com", "vultr" TLD, NDPI_PROTOCOL_CATEGORY_CLOUD },
|
||||||
{ "baidu.com", "baidu" TLD, NDPI_PROTOCOL_CATEGORY_WEB },
|
{ "baidu.com", "baidu" TLD, NDPI_PROTOCOL_CATEGORY_WEB },
|
||||||
{ "icq.com", "icq" TLD, NDPI_PROTOCOL_CATEGORY_CHAT },
|
{ "icq.com", "icq" TLD, NDPI_PROTOCOL_CATEGORY_CHAT },
|
||||||
@@ -8813,6 +9164,9 @@ static ndpi_category_match category_match[] = {
|
|||||||
{ ".playercdn.net", "\\.playercdn" TLD, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
{ ".playercdn.net", "\\.playercdn" TLD, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
||||||
{ "showmax.com", "showmax" TLD, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
{ "showmax.com", "showmax" TLD, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
||||||
{ "showmax.akamaized.net", "showmax\\.akamaized" TLD, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
{ "showmax.akamaized.net", "showmax\\.akamaized" TLD, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
||||||
|
{ "skyq.sky.com", "skyq\\.sky\\.com" TLD, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
||||||
|
{ "iptv.sky.", "iptv\\.sky\\." TLD, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
||||||
|
{ "pcdn.skycdn.", "pcdn\\.skycdn\\." TLD, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
||||||
|
|
||||||
/* Hulu Streaming services AS23286 */
|
/* Hulu Streaming services AS23286 */
|
||||||
{ "8.28.124.0/24", NULL, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
{ "8.28.124.0/24", NULL, NDPI_PROTOCOL_CATEGORY_STREAMING },
|
||||||
@@ -8925,5 +9279,3 @@ static const char *ndpi_en_impossible_bigrams[] = {
|
|||||||
"yj", "yq", "yv", "yz", "yw", "zb", "zc", "zg", "zh", "zj", "zn", "zq", "zs", "zx", "wh", "wk",
|
"yj", "yq", "yv", "yz", "yw", "zb", "zc", "zg", "zh", "zj", "zn", "zq", "zs", "zx", "wh", "wk",
|
||||||
"wb", "zk", "kp", "zk", "xy",
|
"wb", "zk", "kp", "zk", "xy",
|
||||||
NULL };
|
NULL };
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+752
-354
File diff suppressed because it is too large
Load Diff
+299
-146
File diff suppressed because it is too large
Load Diff
+674
-16
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ndpi_utils.c
|
* ndpi_utils.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,20 +21,19 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
#include "ndpi_config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "ahocorasick.h"
|
|
||||||
#include "libcache.h"
|
|
||||||
|
|
||||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_UNKNOWN
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_UNKNOWN
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
|
||||||
#include "ndpi_config.h"
|
#include "ndpi_config.h"
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
#include "ahocorasick.h"
|
||||||
|
#include "libcache.h"
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
@@ -48,6 +47,11 @@
|
|||||||
#include "third_party/include/ndpi_patricia.h"
|
#include "third_party/include/ndpi_patricia.h"
|
||||||
#include "third_party/include/ht_hash.h"
|
#include "third_party/include/ht_hash.h"
|
||||||
|
|
||||||
|
#include "third_party/include/libinjection.h"
|
||||||
|
#include "third_party/include/libinjection_sqli.h"
|
||||||
|
#include "third_party/include/libinjection_xss.h"
|
||||||
|
#include "third_party/include/rce_injection.h"
|
||||||
|
|
||||||
#define NDPI_CONST_GENERIC_PROTOCOL_NAME "GenericProtocol"
|
#define NDPI_CONST_GENERIC_PROTOCOL_NAME "GenericProtocol"
|
||||||
|
|
||||||
// #define MATCH_DEBUG 1
|
// #define MATCH_DEBUG 1
|
||||||
@@ -211,10 +215,11 @@ void ndpi_tdestroy(void *vrootp, void (*freefct)(void *))
|
|||||||
|
|
||||||
u_int8_t ndpi_net_match(u_int32_t ip_to_check,
|
u_int8_t ndpi_net_match(u_int32_t ip_to_check,
|
||||||
u_int32_t net,
|
u_int32_t net,
|
||||||
u_int32_t num_bits)
|
u_int32_t num_bits) {
|
||||||
{
|
|
||||||
u_int32_t mask = 0;
|
u_int32_t mask = 0;
|
||||||
|
|
||||||
|
num_bits &= 0x1F; /* Avoid overflows */
|
||||||
|
|
||||||
mask = ~(~mask >> num_bits);
|
mask = ~(~mask >> num_bits);
|
||||||
|
|
||||||
return(((ip_to_check & mask) == (net & mask)) ? 1 : 0);
|
return(((ip_to_check & mask) == (net & mask)) ? 1 : 0);
|
||||||
@@ -628,7 +633,6 @@ static int ndpi_is_valid_char(char c) {
|
|||||||
|
|
||||||
/* ******************************************************************** */
|
/* ******************************************************************** */
|
||||||
|
|
||||||
|
|
||||||
static int ndpi_find_non_eng_bigrams(struct ndpi_detection_module_struct *ndpi_struct,
|
static int ndpi_find_non_eng_bigrams(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
char *str) {
|
char *str) {
|
||||||
char s[3];
|
char s[3];
|
||||||
@@ -710,8 +714,10 @@ int ndpi_has_human_readeable_string(struct ndpi_detection_module_struct *ndpi_st
|
|||||||
|
|
||||||
/* ********************************** */
|
/* ********************************** */
|
||||||
|
|
||||||
char* ndpi_ssl_version2str(u_int16_t version) {
|
char* ndpi_ssl_version2str(u_int16_t version, u_int8_t *unknown_tls_version) {
|
||||||
static char v[8];
|
static char v[12];
|
||||||
|
|
||||||
|
*unknown_tls_version = 0;
|
||||||
|
|
||||||
switch(version) {
|
switch(version) {
|
||||||
case 0x0300: return("SSLv3");
|
case 0x0300: return("SSLv3");
|
||||||
@@ -719,16 +725,668 @@ char* ndpi_ssl_version2str(u_int16_t version) {
|
|||||||
case 0x0302: return("TLSv1.1");
|
case 0x0302: return("TLSv1.1");
|
||||||
case 0x0303: return("TLSv1.2");
|
case 0x0303: return("TLSv1.2");
|
||||||
case 0x0304: return("TLSv1.3");
|
case 0x0304: return("TLSv1.3");
|
||||||
case 0xfb1a: return("TLSv1.3 (Fizz)"); /* https://engineering.fb.com/security/fizz/ */
|
case 0XFB1A: return("TLSv1.3 (Fizz)"); /* https://engineering.fb.com/security/fizz/ */
|
||||||
case 0xfeff: return("DTLSv1.0");
|
case 0XFEFF: return("DTLSv1.0");
|
||||||
case 0xfefd: return("DTLSv1.2");
|
case 0XFEFD: return("DTLSv1.2");
|
||||||
}
|
}
|
||||||
|
|
||||||
if((version >= 0x7f00) && (version <= 0x7fff))
|
if((version >= 0x7f00) && (version <= 0x7fff))
|
||||||
return("TLSv1.3 (draft)");
|
return("TLSv1.3 (draft)");
|
||||||
|
|
||||||
snprintf(v, sizeof(v), "%04X", version);
|
*unknown_tls_version = 1;
|
||||||
|
snprintf(v, sizeof(v), "TLS (%04X)", version);
|
||||||
|
|
||||||
return(v);
|
return(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ***************************************************** */
|
||||||
|
|
||||||
|
void ndpi_patchIPv6Address(char *str) {
|
||||||
|
int i = 0, j = 0;
|
||||||
|
|
||||||
|
while(str[i] != '\0') {
|
||||||
|
if((str[i] == ':')
|
||||||
|
&& (str[i+1] == '0')
|
||||||
|
&& (str[i+2] == ':')) {
|
||||||
|
str[j++] = ':';
|
||||||
|
str[j++] = ':';
|
||||||
|
i += 3;
|
||||||
|
} else
|
||||||
|
str[j++] = str[i++];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(str[j] != '\0') str[j] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
/* ********************************** */
|
/* ********************************** */
|
||||||
|
|
||||||
|
void ndpi_user_pwd_payload_copy(u_int8_t *dest, u_int dest_len,
|
||||||
|
u_int offset,
|
||||||
|
const u_int8_t *src, u_int src_len) {
|
||||||
|
u_int i, j=0, k = dest_len-1;
|
||||||
|
|
||||||
|
for(i=offset; (i<src_len) && (j<=k); i++) {
|
||||||
|
if((j == k) || (src[i] < ' '))
|
||||||
|
break;
|
||||||
|
|
||||||
|
dest[j++] = src[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
dest[j <=k ? j : k] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
/* http://web.mit.edu/freebsd/head/contrib/wpa/src/utils/base64.c */
|
||||||
|
|
||||||
|
static const unsigned char base64_table[65] =
|
||||||
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* base64_decode - Base64 decode
|
||||||
|
* @src: Data to be decoded
|
||||||
|
* @len: Length of the data to be decoded
|
||||||
|
* @out_len: Pointer to output length variable
|
||||||
|
* Returns: Allocated buffer of out_len bytes of decoded data,
|
||||||
|
* or %NULL on failure
|
||||||
|
*
|
||||||
|
* Caller is responsible for freeing the returned buffer.
|
||||||
|
*/
|
||||||
|
u_char* ndpi_base64_decode(const u_char *src, size_t len, size_t *out_len) {
|
||||||
|
u_char dtable[256], *out, *pos, block[4], tmp;
|
||||||
|
size_t i, count, olen;
|
||||||
|
int pad = 0;
|
||||||
|
|
||||||
|
memset(dtable, 0x80, 256);
|
||||||
|
for (i = 0; i < sizeof(base64_table) - 1; i++)
|
||||||
|
dtable[base64_table[i]] = (u_char) i;
|
||||||
|
dtable['='] = 0;
|
||||||
|
|
||||||
|
count = 0;
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
if (dtable[src[i]] != 0x80)
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count == 0 || count % 4)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
olen = count / 4 * 3;
|
||||||
|
pos = out = ndpi_malloc(olen);
|
||||||
|
if (out == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
count = 0;
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
|
tmp = dtable[src[i]];
|
||||||
|
if (tmp == 0x80)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (src[i] == '=')
|
||||||
|
pad++;
|
||||||
|
block[count] = tmp;
|
||||||
|
count++;
|
||||||
|
if (count == 4) {
|
||||||
|
*pos++ = (block[0] << 2) | (block[1] >> 4);
|
||||||
|
*pos++ = (block[1] << 4) | (block[2] >> 2);
|
||||||
|
*pos++ = (block[2] << 6) | block[3];
|
||||||
|
count = 0;
|
||||||
|
if (pad) {
|
||||||
|
if (pad == 1)
|
||||||
|
pos--;
|
||||||
|
else if (pad == 2)
|
||||||
|
pos -= 2;
|
||||||
|
else {
|
||||||
|
/* Invalid padding */
|
||||||
|
ndpi_free(out);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
*out_len = pos - out;
|
||||||
|
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
char* ndpi_base64_encode(unsigned char const* bytes_to_encode, ssize_t in_len) {
|
||||||
|
ssize_t len = 0, ret_size;
|
||||||
|
char *ret;
|
||||||
|
int i = 0;
|
||||||
|
unsigned char char_array_3[3];
|
||||||
|
unsigned char char_array_4[4];
|
||||||
|
|
||||||
|
ret_size = ((in_len+2)/3)*4;
|
||||||
|
|
||||||
|
if((ret = (char*)ndpi_malloc(ret_size+1)) == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
while (in_len--) {
|
||||||
|
char_array_3[i++] = *(bytes_to_encode++);
|
||||||
|
if(i == 3) {
|
||||||
|
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
|
||||||
|
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
|
||||||
|
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
|
||||||
|
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||||
|
|
||||||
|
for(i = 0; i < 4; i++)
|
||||||
|
ret[len++] = base64_table[char_array_4[i]];
|
||||||
|
i = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(i) {
|
||||||
|
for(int j = i; j < 3; j++)
|
||||||
|
char_array_3[j] = '\0';
|
||||||
|
|
||||||
|
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
|
||||||
|
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
|
||||||
|
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
|
||||||
|
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||||
|
|
||||||
|
for(int j = 0; (j < i + 1); j++)
|
||||||
|
ret[len++] = base64_table[char_array_4[j]];
|
||||||
|
|
||||||
|
while((i++ < 3))
|
||||||
|
ret[len++] = '=';
|
||||||
|
}
|
||||||
|
|
||||||
|
ret[len++] = '\0';
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
int ndpi_flow2json(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
|
u_int8_t ip_version,
|
||||||
|
u_int8_t l4_protocol, u_int16_t vlan_id,
|
||||||
|
u_int32_t src_v4, u_int32_t dst_v4,
|
||||||
|
struct ndpi_in6_addr *src_v6, struct ndpi_in6_addr *dst_v6,
|
||||||
|
u_int16_t src_port, u_int16_t dst_port,
|
||||||
|
ndpi_protocol l7_protocol,
|
||||||
|
ndpi_serializer *serializer) {
|
||||||
|
char buf[64], src_name[32], dst_name[32];
|
||||||
|
|
||||||
|
if(ndpi_init_serializer(serializer, ndpi_serialization_format_json) == -1)
|
||||||
|
return(-1);
|
||||||
|
|
||||||
|
if(ip_version == 4) {
|
||||||
|
inet_ntop(AF_INET, &src_v4, src_name, sizeof(src_name));
|
||||||
|
inet_ntop(AF_INET, &dst_v4, dst_name, sizeof(dst_name));
|
||||||
|
} else {
|
||||||
|
inet_ntop(AF_INET6, src_v6, src_name, sizeof(src_name));
|
||||||
|
inet_ntop(AF_INET6, dst_v6, dst_name, sizeof(dst_name));
|
||||||
|
/* For consistency across platforms replace :0: with :: */
|
||||||
|
ndpi_patchIPv6Address(src_name), ndpi_patchIPv6Address(dst_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
ndpi_serialize_string_string(serializer, "src_ip", src_name);
|
||||||
|
ndpi_serialize_string_string(serializer, "dest_ip", dst_name);
|
||||||
|
if(src_port) ndpi_serialize_string_uint32(serializer, "src_port", src_port);
|
||||||
|
if(dst_port) ndpi_serialize_string_uint32(serializer, "dst_port", dst_port);
|
||||||
|
|
||||||
|
switch(l4_protocol) {
|
||||||
|
case IPPROTO_TCP:
|
||||||
|
ndpi_serialize_string_string(serializer, "proto", "TCP");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case IPPROTO_UDP:
|
||||||
|
ndpi_serialize_string_string(serializer, "proto", "UDP");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case IPPROTO_ICMP:
|
||||||
|
ndpi_serialize_string_string(serializer, "proto", "ICMP");
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
ndpi_serialize_string_uint32(serializer, "proto", l4_protocol);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
ndpi_serialize_start_of_block(serializer, "ndpi");
|
||||||
|
ndpi_serialize_string_string(serializer, "proto", ndpi_protocol2name(ndpi_struct, l7_protocol, buf, sizeof(buf)));
|
||||||
|
if(l7_protocol.category != NDPI_PROTOCOL_CATEGORY_UNSPECIFIED)
|
||||||
|
ndpi_serialize_string_string(serializer, "category", ndpi_category_get_name(ndpi_struct, l7_protocol.category));
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
|
||||||
|
if(flow == NULL) return(0);
|
||||||
|
|
||||||
|
switch(l7_protocol.master_protocol ? l7_protocol.master_protocol : l7_protocol.app_protocol) {
|
||||||
|
case NDPI_PROTOCOL_DHCP:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "dhcp");
|
||||||
|
ndpi_serialize_string_string(serializer, "fingerprint", flow->protos.dhcp.fingerprint);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_BITTORRENT:
|
||||||
|
{
|
||||||
|
u_int i, j, n = 0;
|
||||||
|
char bittorent_hash[32];
|
||||||
|
|
||||||
|
for(i=0, j = 0; j < sizeof(bittorent_hash)-1; i++) {
|
||||||
|
sprintf(&bittorent_hash[j], "%02x",
|
||||||
|
flow->protos.bittorrent.hash[i]);
|
||||||
|
|
||||||
|
j += 2, n += flow->protos.bittorrent.hash[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(n == 0) bittorent_hash[0] = '\0';
|
||||||
|
|
||||||
|
ndpi_serialize_start_of_block(serializer, "bittorrent");
|
||||||
|
ndpi_serialize_string_string(serializer, "hash", bittorent_hash);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_DNS:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "dns");
|
||||||
|
if(flow->host_server_name[0] != '\0')
|
||||||
|
ndpi_serialize_string_string(serializer, "query", (const char*)flow->host_server_name);
|
||||||
|
ndpi_serialize_string_uint32(serializer, "num_queries", flow->protos.dns.num_queries);
|
||||||
|
ndpi_serialize_string_uint32(serializer, "num_answers", flow->protos.dns.num_answers);
|
||||||
|
ndpi_serialize_string_uint32(serializer, "reply_code", flow->protos.dns.reply_code);
|
||||||
|
ndpi_serialize_string_uint32(serializer, "query_type", flow->protos.dns.query_type);
|
||||||
|
ndpi_serialize_string_uint32(serializer, "rsp_type", flow->protos.dns.rsp_type);
|
||||||
|
|
||||||
|
inet_ntop(AF_INET, &flow->protos.dns.rsp_addr, buf, sizeof(buf));
|
||||||
|
ndpi_serialize_string_string(serializer, "rsp_addr", buf);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_MDNS:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "mdns");
|
||||||
|
ndpi_serialize_string_string(serializer, "answer", flow->protos.mdns.answer);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_UBNTAC2:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "ubntac2");
|
||||||
|
ndpi_serialize_string_string(serializer, "version", flow->protos.ubntac2.version);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_KERBEROS:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "kerberos");
|
||||||
|
ndpi_serialize_string_string(serializer, "hostname", flow->protos.kerberos.hostname);
|
||||||
|
ndpi_serialize_string_string(serializer, "domain", flow->protos.kerberos.domain);
|
||||||
|
ndpi_serialize_string_string(serializer, "username", flow->protos.kerberos.username);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_TELNET:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "telnet");
|
||||||
|
ndpi_serialize_string_string(serializer, "username", flow->protos.telnet.username);
|
||||||
|
ndpi_serialize_string_string(serializer, "password", flow->protos.telnet.password);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_HTTP:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "http");
|
||||||
|
if(flow->host_server_name[0] != '\0')
|
||||||
|
ndpi_serialize_string_string(serializer, "hostname", (const char*)flow->host_server_name);
|
||||||
|
ndpi_serialize_string_string(serializer, "url", flow->http.url);
|
||||||
|
ndpi_serialize_string_uint32(serializer, "code", flow->http.response_status_code);
|
||||||
|
ndpi_serialize_string_string(serializer, "content_type", flow->http.content_type);
|
||||||
|
ndpi_serialize_string_string(serializer, "user_agent", flow->http.user_agent);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_MAIL_IMAP:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "imap");
|
||||||
|
ndpi_serialize_string_string(serializer, "user", flow->protos.ftp_imap_pop_smtp.username);
|
||||||
|
ndpi_serialize_string_string(serializer, "password", flow->protos.ftp_imap_pop_smtp.password);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_MAIL_POP:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "pop");
|
||||||
|
ndpi_serialize_string_string(serializer, "user", flow->protos.ftp_imap_pop_smtp.username);
|
||||||
|
ndpi_serialize_string_string(serializer, "password", flow->protos.ftp_imap_pop_smtp.password);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_MAIL_SMTP:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "smtp");
|
||||||
|
ndpi_serialize_string_string(serializer, "user", flow->protos.ftp_imap_pop_smtp.username);
|
||||||
|
ndpi_serialize_string_string(serializer, "password", flow->protos.ftp_imap_pop_smtp.password);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_FTP_CONTROL:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "ftp");
|
||||||
|
ndpi_serialize_string_string(serializer, "user", flow->protos.ftp_imap_pop_smtp.username);
|
||||||
|
ndpi_serialize_string_string(serializer, "password", flow->protos.ftp_imap_pop_smtp.password);
|
||||||
|
ndpi_serialize_string_uint32(serializer, "auth_failed", flow->protos.ftp_imap_pop_smtp.auth_failed);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_SSH:
|
||||||
|
ndpi_serialize_start_of_block(serializer, "ssh");
|
||||||
|
ndpi_serialize_string_string(serializer, "client_signature", flow->protos.ssh.client_signature);
|
||||||
|
ndpi_serialize_string_string(serializer, "server_signature", flow->protos.ssh.server_signature);
|
||||||
|
ndpi_serialize_string_string(serializer, "hassh_client", flow->protos.ssh.hassh_client);
|
||||||
|
ndpi_serialize_string_string(serializer, "hassh_server", flow->protos.ssh.hassh_server);
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NDPI_PROTOCOL_TLS:
|
||||||
|
if(flow->protos.stun_ssl.ssl.ssl_version) {
|
||||||
|
char notBefore[32], notAfter[32];
|
||||||
|
struct tm a, b, *before = NULL, *after = NULL;
|
||||||
|
u_int i, off;
|
||||||
|
u_int8_t unknown_tls_version;
|
||||||
|
char *version = ndpi_ssl_version2str(flow->protos.stun_ssl.ssl.ssl_version, &unknown_tls_version);
|
||||||
|
|
||||||
|
if(flow->protos.stun_ssl.ssl.notBefore)
|
||||||
|
before = gmtime_r((const time_t *)&flow->protos.stun_ssl.ssl.notBefore, &a);
|
||||||
|
if(flow->protos.stun_ssl.ssl.notAfter)
|
||||||
|
after = gmtime_r((const time_t *)&flow->protos.stun_ssl.ssl.notAfter, &b);
|
||||||
|
|
||||||
|
if(!unknown_tls_version) {
|
||||||
|
ndpi_serialize_start_of_block(serializer, "tls");
|
||||||
|
ndpi_serialize_string_string(serializer, "version", version);
|
||||||
|
ndpi_serialize_string_string(serializer, "client_requested_server_name",
|
||||||
|
flow->protos.stun_ssl.ssl.client_requested_server_name);
|
||||||
|
if(flow->protos.stun_ssl.ssl.server_names)
|
||||||
|
ndpi_serialize_string_string(serializer, "server_names", flow->protos.stun_ssl.ssl.server_names);
|
||||||
|
ndpi_serialize_string_string(serializer, "issuer", flow->protos.stun_ssl.ssl.server_organization);
|
||||||
|
|
||||||
|
if(before) {
|
||||||
|
strftime(notBefore, sizeof(notBefore), "%F %T", before);
|
||||||
|
ndpi_serialize_string_string(serializer, "notbefore", notBefore);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(after) {
|
||||||
|
strftime(notAfter, sizeof(notAfter), "%F %T", after);
|
||||||
|
ndpi_serialize_string_string(serializer, "notafter", notAfter);
|
||||||
|
}
|
||||||
|
ndpi_serialize_string_string(serializer, "ja3", flow->protos.stun_ssl.ssl.ja3_client);
|
||||||
|
ndpi_serialize_string_string(serializer, "ja3s", flow->protos.stun_ssl.ssl.ja3_server);
|
||||||
|
ndpi_serialize_string_uint32(serializer, "unsafe_cipher", flow->protos.stun_ssl.ssl.server_unsafe_cipher);
|
||||||
|
ndpi_serialize_string_string(serializer, "cipher", ndpi_cipher2str(flow->protos.stun_ssl.ssl.server_cipher));
|
||||||
|
|
||||||
|
if(flow->l4.tcp.tls.sha1_certificate_fingerprint[0] != '\0') {
|
||||||
|
for(i=0, off=0; i<20; i++) {
|
||||||
|
int rc = snprintf(&buf[off], sizeof(buf)-off,"%s%02X", (i > 0) ? ":" : "",
|
||||||
|
flow->l4.tcp.tls.sha1_certificate_fingerprint[i] & 0xFF);
|
||||||
|
|
||||||
|
if(rc <= 0) break; else off += rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
ndpi_serialize_string_string(serializer, "fingerprint", buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
ndpi_serialize_end_of_block(serializer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} /* switch */
|
||||||
|
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
const char* ndpi_tunnel2str(ndpi_packet_tunnel tt) {
|
||||||
|
switch(tt) {
|
||||||
|
case ndpi_no_tunnel:
|
||||||
|
return("No-Tunnel");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ndpi_gtp_tunnel:
|
||||||
|
return("GTP");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ndpi_capwap_tunnel:
|
||||||
|
return("CAPWAP");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ndpi_tzsp_tunnel:
|
||||||
|
return("TZSP");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ndpi_l2tp_tunnel:
|
||||||
|
return("L2TP");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return("");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
/*
|
||||||
|
/dv/vulnerabilities/xss_r/?name=%3Cscript%3Econsole.log%28%27JUL2D3WXHEGWRAFJE2PI7OS71Z4Z8RFUHXGNFLUFYVP6M3OL55%27%29%3Bconsole.log%28document.cookie%29%3B%3C%2Fscript%3E
|
||||||
|
/dv/vulnerabilities/sqli/?id=1%27+and+1%3D1+union+select+null%2C+table_name+from+information_schema.tables%23&Submit=Submit
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* https://www.rosettacode.org/wiki/URL_decoding#C */
|
||||||
|
static int ishex(int x) {
|
||||||
|
return(x >= '0' && x <= '9') || (x >= 'a' && x <= 'f') || (x >= 'A' && x <= 'F');
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
static int ndpi_url_decode(const char *s, char *out) {
|
||||||
|
char *o;
|
||||||
|
const char *end = s + strlen(s);
|
||||||
|
int c;
|
||||||
|
|
||||||
|
for(o = out; s <= end; o++) {
|
||||||
|
c = *s++;
|
||||||
|
if(c == '+') c = ' ';
|
||||||
|
else if(c == '%' && (!ishex(*s++)||
|
||||||
|
!ishex(*s++)||
|
||||||
|
!sscanf(s - 2, "%2x", (unsigned int*)&c)))
|
||||||
|
return(-1);
|
||||||
|
|
||||||
|
if(out) *o = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
return(o - out);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
static int ndpi_is_sql_injection(char* query) {
|
||||||
|
struct libinjection_sqli_state state;
|
||||||
|
|
||||||
|
size_t qlen = strlen(query);
|
||||||
|
libinjection_sqli_init(&state, query, qlen, FLAG_NONE);
|
||||||
|
|
||||||
|
return libinjection_is_sqli(&state);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
static int ndpi_is_xss_injection(char* query) {
|
||||||
|
size_t qlen = strlen(query);
|
||||||
|
return libinjection_xss(query, qlen);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
#ifdef HAVE_PCRE
|
||||||
|
|
||||||
|
static void ndpi_compile_rce_regex() {
|
||||||
|
const char *pcreErrorStr;
|
||||||
|
int pcreErrorOffset;
|
||||||
|
|
||||||
|
for(int i = 0; i < N_RCE_REGEX; i++) {
|
||||||
|
comp_rx[i] = (struct pcre_struct*)ndpi_malloc(sizeof(struct pcre_struct));
|
||||||
|
|
||||||
|
comp_rx[i]->compiled = pcre_compile(rce_regex[i], 0, &pcreErrorStr,
|
||||||
|
&pcreErrorOffset, NULL);
|
||||||
|
|
||||||
|
if(comp_rx[i]->compiled == NULL) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
NDPI_LOG_ERR(ndpi_str, "ERROR: Could not compile '%s': %s\n", rce_regex[i],
|
||||||
|
pcreErrorStr);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
comp_rx[i]->optimized = pcre_study(comp_rx[i]->compiled, 0, &pcreErrorStr);
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
if(pcreErrorStr != NULL) {
|
||||||
|
NDPI_LOG_ERR(ndpi_str, "ERROR: Could not study '%s': %s\n", rce_regex[i],
|
||||||
|
pcreErrorStr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
free((void *)pcreErrorStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ndpi_is_rce_injection(char* query) {
|
||||||
|
if (!initialized_comp_rx) {
|
||||||
|
ndpi_compile_rce_regex();
|
||||||
|
initialized_comp_rx = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int pcreExecRet;
|
||||||
|
int subStrVec[30];
|
||||||
|
|
||||||
|
for(int i = 0; i < N_RCE_REGEX; i++) {
|
||||||
|
unsigned int length = strlen(query);
|
||||||
|
|
||||||
|
pcreExecRet = pcre_exec(comp_rx[i]->compiled,
|
||||||
|
comp_rx[i]->optimized,
|
||||||
|
query, length, 0, 0, subStrVec, 30);
|
||||||
|
|
||||||
|
if (pcreExecRet >= 0) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#ifdef DEBUG
|
||||||
|
else {
|
||||||
|
switch(pcreExecRet) {
|
||||||
|
case PCRE_ERROR_NOMATCH:
|
||||||
|
NDPI_LOG_ERR(ndpi_str, "ERROR: String did not match the pattern\n");
|
||||||
|
break;
|
||||||
|
case PCRE_ERROR_NULL:
|
||||||
|
NDPI_LOG_ERR(ndpi_str, "ERROR: Something was null\n");
|
||||||
|
break;
|
||||||
|
case PCRE_ERROR_BADOPTION:
|
||||||
|
NDPI_LOG_ERR(ndpi_str, "ERROR: A bad option was passed\n");
|
||||||
|
break;
|
||||||
|
case PCRE_ERROR_BADMAGIC:
|
||||||
|
NDPI_LOG_ERR(ndpi_str, "ERROR: Magic number bad (compiled re corrupt?)\n");
|
||||||
|
break;
|
||||||
|
case PCRE_ERROR_UNKNOWN_NODE:
|
||||||
|
NDPI_LOG_ERR(ndpi_str, "ERROR: Something kooky in the compiled re\n");
|
||||||
|
break;
|
||||||
|
case PCRE_ERROR_NOMEMORY:
|
||||||
|
NDPI_LOG_ERR(ndpi_str, "ERROR: Ran out of memory\n");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
NDPI_LOG_ERR(ndpi_str, "ERROR: Unknown error\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t ushlen = sizeof(ush_commands) / sizeof(ush_commands[0]);
|
||||||
|
|
||||||
|
for(int i = 0; i < ushlen; i++) {
|
||||||
|
if(strstr(query, ush_commands[i]) != NULL) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t pwshlen = sizeof(pwsh_commands) / sizeof(pwsh_commands[0]);
|
||||||
|
|
||||||
|
for(int i = 0; i < pwshlen; i++) {
|
||||||
|
if(strstr(query, pwsh_commands[i]) != NULL) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ********************************** */
|
||||||
|
|
||||||
|
ndpi_url_risk ndpi_validate_url(char *url) {
|
||||||
|
char *orig_str = NULL, *str = NULL, *question_mark = strchr(url, '?');
|
||||||
|
ndpi_url_risk rc = ndpi_url_no_problem;
|
||||||
|
|
||||||
|
if(question_mark) {
|
||||||
|
char *tmp;
|
||||||
|
|
||||||
|
orig_str = str = ndpi_strdup(&question_mark[1]); /* Skip ? */
|
||||||
|
|
||||||
|
if(!str) goto validate_rc;
|
||||||
|
|
||||||
|
str = strtok_r(str, "&", &tmp);
|
||||||
|
|
||||||
|
while(str != NULL) {
|
||||||
|
char *value = strchr(str, '=');
|
||||||
|
char *decoded;
|
||||||
|
|
||||||
|
if(!value)
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
value = &value[1];
|
||||||
|
|
||||||
|
if(value[0] != '\0') {
|
||||||
|
if(!(decoded = (char*)ndpi_malloc(strlen(value)+1)))
|
||||||
|
break;
|
||||||
|
|
||||||
|
if(ndpi_url_decode(value, decoded) < 0) {
|
||||||
|
/* Invalid string */
|
||||||
|
} else if(decoded[0] != '\0') {
|
||||||
|
/* Valid string */
|
||||||
|
|
||||||
|
if(ndpi_is_xss_injection(decoded))
|
||||||
|
rc = ndpi_url_possible_xss;
|
||||||
|
else if(ndpi_is_sql_injection(decoded))
|
||||||
|
rc = ndpi_url_possible_sql_injection;
|
||||||
|
#ifdef HAVE_PCRE
|
||||||
|
else if(ndpi_is_rce_injection(decoded))
|
||||||
|
rc = ndpi_url_possible_rce_injection;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef URL_CHECK_DEBUG
|
||||||
|
printf("=>> [rc: %u] %s\n", rc, decoded);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
ndpi_free(decoded);
|
||||||
|
|
||||||
|
if(rc != ndpi_url_no_problem)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
str = strtok_r(NULL, "&", &tmp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
validate_rc:
|
||||||
|
if(orig_str) ndpi_free(orig_str);
|
||||||
|
return(rc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ******************************************************************** */
|
||||||
|
|
||||||
|
u_int8_t ndpi_is_protocol_detected(struct ndpi_detection_module_struct *ndpi_str,
|
||||||
|
ndpi_protocol proto) {
|
||||||
|
if((proto.master_protocol != NDPI_PROTOCOL_UNKNOWN)
|
||||||
|
|| (proto.app_protocol != NDPI_PROTOCOL_UNKNOWN)
|
||||||
|
|| (proto.category != NDPI_PROTOCOL_CATEGORY_UNSPECIFIED))
|
||||||
|
return(1);
|
||||||
|
else
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* afp.c
|
* afp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-11 by ipoque GmbH
|
* Copyright (C) 2009-11 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* aimini.c
|
* aimini.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* amazon_video.c
|
* amazon_video.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 by ntop.org
|
* Copyright (C) 2018-20 by ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -28,37 +28,36 @@
|
|||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
static void ndpi_check_amazon_video(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_check_amazon_video(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow) {
|
struct ndpi_flow_struct *flow) {
|
||||||
|
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG_DBG(ndpi_struct, "search Amazon Prime\n");
|
NDPI_LOG_DBG(ndpi_struct, "search Amazon Prime\n");
|
||||||
|
|
||||||
if((packet->tcp != NULL) &&
|
if(packet->payload_packet_len > 4) {
|
||||||
(packet->payload[0] == 0xFE &&
|
if((packet->tcp != NULL) &&
|
||||||
packet->payload[1] == 0xED &&
|
(packet->payload[0] == 0xFE &&
|
||||||
packet->payload[2] == 0xFA &&
|
packet->payload[1] == 0xED &&
|
||||||
packet->payload[3] == 0xCE))
|
packet->payload[2] == 0xFA &&
|
||||||
{
|
packet->payload[3] == 0xCE)) {
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found Amazon Video on TCP\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Amazon Video on TCP\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
} else if((packet->udp != NULL) &&
|
||||||
else if((packet->udp != NULL) &&
|
(packet->payload[0] == 0xDE &&
|
||||||
(packet->payload[0] == 0xDE &&
|
packet->payload[1] == 0xAD &&
|
||||||
packet->payload[1] == 0xAD &&
|
packet->payload[2] == 0xBE &&
|
||||||
packet->payload[2] == 0xBE &&
|
packet->payload[3] == 0xEF)) {
|
||||||
packet->payload[3] == 0xEF))
|
|
||||||
{
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found Amazon Video on UDP\n");
|
NDPI_LOG_INFO(ndpi_struct, "found Amazon Video on UDP\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMAZON_VIDEO, NDPI_PROTOCOL_UNKNOWN);
|
||||||
} else {
|
return;
|
||||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_amazon_video(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_amazon_video(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
{
|
struct ndpi_flow_struct *flow) {
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG_DBG(ndpi_struct, "search amazon_video\n");
|
NDPI_LOG_DBG(ndpi_struct, "search amazon_video\n");
|
||||||
@@ -69,8 +68,8 @@ void ndpi_search_amazon_video(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void init_amazon_video_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
void init_amazon_video_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
{
|
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
|
||||||
ndpi_set_bitmask_protocol_detection("AMAZON_VIDEO", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("AMAZON_VIDEO", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_AMAZON_VIDEO,
|
NDPI_PROTOCOL_AMAZON_VIDEO,
|
||||||
ndpi_search_amazon_video,
|
ndpi_search_amazon_video,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* amqp.c
|
* amqp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* applejuice.c
|
* applejuice.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* armagetron.c
|
* armagetron.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* flash.c
|
* flash.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* ftp.c
|
* ftp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* manolito.c
|
* manolito.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* popo.c
|
* popo.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* secondlife.c
|
* secondlife.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ayiya.c
|
* ayiya.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* battlefield.c
|
* battlefield.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* bgp.c
|
* bgp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-19 - ntop.org
|
* Copyright (C) 2016-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* bittorrent.c
|
* bittorrent.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -72,9 +72,7 @@ static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struc
|
|||||||
} else
|
} else
|
||||||
bt_hash = (const char*)&flow->packet.payload[28];
|
bt_hash = (const char*)&flow->packet.payload[28];
|
||||||
|
|
||||||
if(!ndpi_struct->disable_metadata_export) {
|
if(bt_hash) memcpy(flow->protos.bittorrent.hash, bt_hash, 20);
|
||||||
if(bt_hash) memcpy(flow->protos.bittorrent.hash, bt_hash, 20);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN);
|
||||||
@@ -376,19 +374,32 @@ static void ndpi_int_search_bittorrent_tcp(struct ndpi_detection_module_struct *
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static u_int8_t is_port(u_int16_t a, u_int16_t b, u_int16_t what) {
|
||||||
|
return(((what == a) || (what == b)) ? 1 : 0);
|
||||||
|
}
|
||||||
|
|
||||||
void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
char *bt_proto = NULL;
|
char *bt_proto = NULL;
|
||||||
|
|
||||||
/* This is broadcast */
|
/* This is broadcast */
|
||||||
if(packet->iph
|
if(packet->iph) {
|
||||||
&& (((packet->iph->saddr == 0xFFFFFFFF) || (packet->iph->daddr == 0xFFFFFFFF))
|
|
||||||
|| (packet->udp
|
if((packet->iph->saddr == 0xFFFFFFFF) || (packet->iph->daddr == 0xFFFFFFFF))
|
||||||
&& ((ntohs(packet->udp->source) == 3544) /* teredo.c */
|
goto exclude_bt;
|
||||||
|| (ntohs(packet->udp->dest) == 3544))))) {
|
|
||||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
|
||||||
return;
|
if(packet->udp) {
|
||||||
|
u_int16_t sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
|
||||||
|
|
||||||
|
if(is_port(sport, dport, 3544) /* teredo */
|
||||||
|
|| is_port(sport, dport, 5246) || is_port(sport, dport, 5247)/* CAPWAP */) {
|
||||||
|
exclude_bt:
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_BITTORRENT) {
|
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_BITTORRENT) {
|
||||||
@@ -397,8 +408,8 @@ void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
if((packet->tcp != NULL)
|
if((packet->tcp != NULL)
|
||||||
&& (packet->tcp_retransmission == 0 || packet->num_retried_bytes)) {
|
&& (packet->tcp_retransmission == 0 || packet->num_retried_bytes)) {
|
||||||
ndpi_int_search_bittorrent_tcp(ndpi_struct, flow);
|
ndpi_int_search_bittorrent_tcp(ndpi_struct, flow);
|
||||||
}
|
} else if(packet->udp != NULL) {
|
||||||
else if(packet->udp != NULL) {
|
/* UDP */
|
||||||
char *bt_search = "BT-SEARCH * HTTP/1.1\r\n";
|
char *bt_search = "BT-SEARCH * HTTP/1.1\r\n";
|
||||||
|
|
||||||
if((ntohs(packet->udp->source) < 1024)
|
if((ntohs(packet->udp->source) < 1024)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* btlib.c
|
* btlib.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
* Contributed by Vitaly Lavrov <vel21ripn@gmail.com>
|
* Contributed by Vitaly Lavrov <vel21ripn@gmail.com>
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
@@ -39,8 +39,10 @@ typedef unsigned long long int u_int64_t;
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#ifndef WIN32
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "btlib.h"
|
#include "btlib.h"
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
/*
|
||||||
|
* capwap.c
|
||||||
|
*
|
||||||
|
* Copyright (C) 2019 - ntop.org
|
||||||
|
*
|
||||||
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* nDPI is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "ndpi_protocol_ids.h"
|
||||||
|
|
||||||
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CAPWAP
|
||||||
|
|
||||||
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
#define NDPI_CAPWAP_CONTROL_PORT 5246
|
||||||
|
#define NDPI_CAPWAP_DATA_PORT 5247
|
||||||
|
|
||||||
|
|
||||||
|
static void ndpi_int_capwap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow) {
|
||||||
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CAPWAP, NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ************************************************** */
|
||||||
|
|
||||||
|
static void ndpi_search_setup_capwap(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow) {
|
||||||
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
u_int16_t sport, dport;
|
||||||
|
|
||||||
|
if(!packet->iph) {
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
|
||||||
|
|
||||||
|
if((dport == NDPI_CAPWAP_CONTROL_PORT)
|
||||||
|
&& (packet->iph->daddr == 0xFFFFFFFF)
|
||||||
|
&& (packet->payload_packet_len >= 16)
|
||||||
|
&& (packet->payload[0] == 0x0)
|
||||||
|
&& (packet->payload[8] == 6 /* Mac len */)
|
||||||
|
)
|
||||||
|
goto capwap_found;
|
||||||
|
|
||||||
|
if(((sport == NDPI_CAPWAP_CONTROL_PORT) || (dport == NDPI_CAPWAP_CONTROL_PORT))
|
||||||
|
&& ((packet->payload[0] == 0x0) || (packet->payload[0] == 0x1))
|
||||||
|
) {
|
||||||
|
u_int16_t msg_len, offset, to_add;
|
||||||
|
|
||||||
|
if(packet->payload[0] == 0x0)
|
||||||
|
offset = 13, to_add = 13;
|
||||||
|
else
|
||||||
|
offset = 15, to_add = 17;
|
||||||
|
|
||||||
|
msg_len = ntohs(*(u_int16_t*)&packet->payload[offset]);
|
||||||
|
|
||||||
|
if((msg_len+to_add) == packet->payload_packet_len)
|
||||||
|
goto capwap_found;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(
|
||||||
|
(((dport == NDPI_CAPWAP_DATA_PORT) && (packet->iph->daddr != 0xFFFFFFFF)) || (sport == NDPI_CAPWAP_DATA_PORT))
|
||||||
|
&& (packet->payload_packet_len >= 16)
|
||||||
|
&& (packet->payload[0] == 0x0)
|
||||||
|
) {
|
||||||
|
u_int8_t is_80211_data = (packet->payload[9] & 0x0C) >> 2;
|
||||||
|
|
||||||
|
|
||||||
|
if((sport == NDPI_CAPWAP_DATA_PORT) && (is_80211_data == 2 /* IEEE 802.11 Data */))
|
||||||
|
goto capwap_found;
|
||||||
|
else if(dport == NDPI_CAPWAP_DATA_PORT) {
|
||||||
|
u_int16_t msg_len = ntohs(*(u_int16_t*)&packet->payload[13]);
|
||||||
|
|
||||||
|
if((packet->payload[8] == 1 /* Mac len */)
|
||||||
|
|| (packet->payload[8] == 6 /* Mac len */)
|
||||||
|
|| (packet->payload[8] == 4 /* Wireless len */)
|
||||||
|
|| ((msg_len+15) == packet->payload_packet_len))
|
||||||
|
goto capwap_found;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
|
||||||
|
capwap_found:
|
||||||
|
ndpi_int_capwap_add_connection(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ndpi_search_capwap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
|
{
|
||||||
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
|
if(packet->udp && (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN))
|
||||||
|
ndpi_search_setup_capwap(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void init_capwap_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
|
{
|
||||||
|
ndpi_set_bitmask_protocol_detection("CAPWAP", ndpi_struct, detection_bitmask, *id,
|
||||||
|
NDPI_PROTOCOL_CAPWAP,
|
||||||
|
ndpi_search_capwap,
|
||||||
|
NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD,
|
||||||
|
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
|
ADD_TO_DETECTION_BITMASK);
|
||||||
|
|
||||||
|
*id += 1;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* checkmk.c
|
* checkmk.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* citrix.c
|
* citrix.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-19 - ntop.org
|
* Copyright (C) 2012-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -51,7 +51,7 @@ static void ndpi_check_citrix(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else if(payload_len > 4) {
|
} else if(payload_len > 22) {
|
||||||
char citrix_header[] = { 0x1a, 0x43, 0x47, 0x50, 0x2f, 0x30, 0x31 };
|
char citrix_header[] = { 0x1a, 0x43, 0x47, 0x50, 0x2f, 0x30, 0x31 };
|
||||||
|
|
||||||
if((memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0)
|
if((memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* collectd.c
|
* collectd.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2014-19 - ntop.org
|
* Copyright (C) 2014-20 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* crossfire.c
|
* crossfire.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-19 - ntop.org
|
* Copyright (C) 2012-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
+21
-30
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* dhcp.c
|
* dhcp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-19 - ntop.org
|
* Copyright (C) 2016-20 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
@@ -100,45 +100,36 @@ void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, stru
|
|||||||
|
|
||||||
if(msg_type <= 8) foundValidMsgType = 1;
|
if(msg_type <= 8) foundValidMsgType = 1;
|
||||||
} else if(id == 55 /* Parameter Request List / Fingerprint */) {
|
} else if(id == 55 /* Parameter Request List / Fingerprint */) {
|
||||||
if(!ndpi_struct->disable_metadata_export) {
|
u_int idx, offset = 0;
|
||||||
u_int idx, offset = 0;
|
|
||||||
|
|
||||||
for(idx = 0; idx < len && offset < sizeof(flow->protos.dhcp.fingerprint) - 2; idx++) {
|
for(idx = 0; idx < len && offset < sizeof(flow->protos.dhcp.fingerprint) - 2; idx++) {
|
||||||
#if 1
|
int rc = snprintf((char*)&flow->protos.dhcp.fingerprint[offset],
|
||||||
offset += snprintf((char*)&flow->protos.dhcp.fingerprint[offset],
|
sizeof(flow->protos.dhcp.fingerprint) - offset,
|
||||||
sizeof(flow->protos.dhcp.fingerprint) - offset,
|
"%s%u", (idx > 0) ? "," : "",
|
||||||
"%s%u", (idx > 0) ? "," : "", dhcp->options[i+2+idx] & 0xFF);
|
(unsigned int)dhcp->options[i+2+idx] & 0xFF);
|
||||||
#else
|
|
||||||
offset += snprintf((char*)&flow->protos.dhcp.fingerprint[offset],
|
|
||||||
sizeof(flow->protos.dhcp.fingerprint) - offset,
|
|
||||||
"%02X", dhcp->options[i+2+idx] & 0xFF);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
flow->protos.dhcp.fingerprint[sizeof(flow->protos.dhcp.fingerprint) - 1] = '\0';
|
if(rc < 0) break; else offset += rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
flow->protos.dhcp.fingerprint[sizeof(flow->protos.dhcp.fingerprint) - 1] = '\0';
|
||||||
} else if(id == 60 /* Class Identifier */) {
|
} else if(id == 60 /* Class Identifier */) {
|
||||||
if(!ndpi_struct->disable_metadata_export) {
|
char *name = (char*)&dhcp->options[i+2];
|
||||||
char *name = (char*)&dhcp->options[i+2];
|
int j = 0;
|
||||||
int j = 0;
|
|
||||||
|
|
||||||
j = ndpi_min(len, sizeof(flow->protos.dhcp.class_ident)-1);
|
j = ndpi_min(len, sizeof(flow->protos.dhcp.class_ident)-1);
|
||||||
strncpy((char*)flow->protos.dhcp.class_ident, name, j);
|
strncpy((char*)flow->protos.dhcp.class_ident, name, j);
|
||||||
flow->protos.dhcp.class_ident[j] = '\0';
|
flow->protos.dhcp.class_ident[j] = '\0';
|
||||||
}
|
|
||||||
} else if(id == 12 /* Host Name */) {
|
} else if(id == 12 /* Host Name */) {
|
||||||
if(!ndpi_struct->disable_metadata_export) {
|
char *name = (char*)&dhcp->options[i+2];
|
||||||
char *name = (char*)&dhcp->options[i+2];
|
int j = 0;
|
||||||
int j = 0;
|
|
||||||
|
|
||||||
#ifdef DHCP_DEBUG
|
#ifdef DHCP_DEBUG
|
||||||
NDPI_LOG_DBG2(ndpi_struct, "[DHCP] '%.*s'\n",name,len);
|
NDPI_LOG_DBG2(ndpi_struct, "[DHCP] '%.*s'\n",name,len);
|
||||||
// while(j < len) { printf( "%c", name[j]); j++; }; printf("\n");
|
// while(j < len) { printf( "%c", name[j]); j++; }; printf("\n");
|
||||||
#endif
|
#endif
|
||||||
j = ndpi_min(len, sizeof(flow->host_server_name)-1);
|
j = ndpi_min(len, sizeof(flow->host_server_name)-1);
|
||||||
strncpy((char*)flow->host_server_name, name, j);
|
strncpy((char*)flow->host_server_name, name, j);
|
||||||
flow->host_server_name[j] = '\0';
|
flow->host_server_name[j] = '\0';
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
i += len + 2;
|
i += len + 2;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* dhcpv6.c
|
* dhcpv6.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* directconnect.c
|
* directconnect.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* directdownloadlink.c
|
* directdownloadlink.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -56,7 +56,7 @@ u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
u_int16_t filename_start = 0;
|
u_int16_t filename_start = 0;
|
||||||
u_int8_t i = 1;
|
u_int16_t i = 1;
|
||||||
u_int16_t host_line_len_without_port;
|
u_int16_t host_line_len_without_port;
|
||||||
|
|
||||||
if (packet->payload_packet_len < 100) {
|
if (packet->payload_packet_len < 100) {
|
||||||
|
|||||||
+79
-53
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* dns.c
|
* dns.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-19 - ntop.org
|
* Copyright (C) 2012-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
// #define DNS_DEBUG 1
|
// #define DNS_DEBUG 1
|
||||||
|
|
||||||
|
static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||||
|
|
||||||
/* *********************************************** */
|
/* *********************************************** */
|
||||||
|
|
||||||
static u_int16_t get16(int *i, const u_int8_t *payload) {
|
static u_int16_t get16(int *i, const u_int8_t *payload) {
|
||||||
@@ -45,7 +47,9 @@ static u_int16_t get16(int *i, const u_int8_t *payload) {
|
|||||||
/* *********************************************** */
|
/* *********************************************** */
|
||||||
|
|
||||||
static u_int getNameLength(u_int i, const u_int8_t *payload, u_int payloadLen) {
|
static u_int getNameLength(u_int i, const u_int8_t *payload, u_int payloadLen) {
|
||||||
if(payload[i] == 0x00)
|
if(i >= payloadLen)
|
||||||
|
return(0);
|
||||||
|
else if(payload[i] == 0x00)
|
||||||
return(1);
|
return(1);
|
||||||
else if(payload[i] == 0xC0)
|
else if(payload[i] == 0xC0)
|
||||||
return(2);
|
return(2);
|
||||||
@@ -60,18 +64,19 @@ static u_int getNameLength(u_int i, const u_int8_t *payload, u_int payloadLen) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
allowed chars for dns names A-Z 0-9 _ -
|
allowed chars for dns names A-Z 0-9 _ -
|
||||||
Perl script for generation map:
|
Perl script for generation map:
|
||||||
my @M;
|
my @M;
|
||||||
for(my $ch=0; $ch < 256; $ch++) {
|
for(my $ch=0; $ch < 256; $ch++) {
|
||||||
$M[$ch >> 5] |= 1 << ($ch & 0x1f) if chr($ch) =~ /[a-z0-9_-]/i;
|
$M[$ch >> 5] |= 1 << ($ch & 0x1f) if chr($ch) =~ /[a-z0-9_-]/i;
|
||||||
}
|
}
|
||||||
print join(',', map { sprintf "0x%08x",$_ } @M),"\n";
|
print join(',', map { sprintf "0x%08x",$_ } @M),"\n";
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static uint32_t dns_validchar[8] = {
|
static uint32_t dns_validchar[8] =
|
||||||
0x00000000,0x03ff2000,0x87fffffe,0x07fffffe,0,0,0,0
|
{
|
||||||
};
|
0x00000000,0x03ff2000,0x87fffffe,0x07fffffe,0,0,0,0
|
||||||
|
};
|
||||||
|
|
||||||
/* *********************************************** */
|
/* *********************************************** */
|
||||||
|
|
||||||
@@ -83,6 +88,7 @@ static int search_valid_dns(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
memcpy(dns_header, (struct ndpi_dns_packet_header*)&flow->packet.payload[x],
|
memcpy(dns_header, (struct ndpi_dns_packet_header*)&flow->packet.payload[x],
|
||||||
sizeof(struct ndpi_dns_packet_header));
|
sizeof(struct ndpi_dns_packet_header));
|
||||||
|
|
||||||
dns_header->tr_id = ntohs(dns_header->tr_id);
|
dns_header->tr_id = ntohs(dns_header->tr_id);
|
||||||
dns_header->flags = ntohs(dns_header->flags);
|
dns_header->flags = ntohs(dns_header->flags);
|
||||||
dns_header->num_queries = ntohs(dns_header->num_queries);
|
dns_header->num_queries = ntohs(dns_header->num_queries);
|
||||||
@@ -133,58 +139,80 @@ static int search_valid_dns(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
/* This is a good reply: we dissect it both for request and response */
|
/* This is a good reply: we dissect it both for request and response */
|
||||||
|
|
||||||
/* Leave the statement below commented necessary in case of call to ndpi_get_partial_detection() */
|
/* Leave the statement below commented necessary in case of call to ndpi_get_partial_detection() */
|
||||||
/* if(ndpi_struct->dns_dont_dissect_response == 0) */ {
|
x++;
|
||||||
x++;
|
|
||||||
|
|
||||||
if(flow->packet.payload[x] != '\0') {
|
|
||||||
while((x < flow->packet.payload_packet_len)
|
|
||||||
&& (flow->packet.payload[x] != '\0')) {
|
|
||||||
x++;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if(flow->packet.payload[x] != '\0') {
|
||||||
|
while((x < flow->packet.payload_packet_len)
|
||||||
|
&& (flow->packet.payload[x] != '\0')) {
|
||||||
x++;
|
x++;
|
||||||
}
|
}
|
||||||
|
|
||||||
x += 4;
|
x++;
|
||||||
|
}
|
||||||
|
|
||||||
if(dns_header->num_answers > 0) {
|
x += 4;
|
||||||
u_int16_t rsp_type;
|
|
||||||
u_int16_t num;
|
|
||||||
|
|
||||||
for(num = 0; num < dns_header->num_answers; num++) {
|
if(dns_header->num_answers > 0) {
|
||||||
u_int16_t data_len;
|
u_int16_t rsp_type;
|
||||||
|
u_int16_t num;
|
||||||
|
|
||||||
if((x+6) >= flow->packet.payload_packet_len) {
|
for(num = 0; num < dns_header->num_answers; num++) {
|
||||||
break;
|
u_int16_t data_len;
|
||||||
}
|
|
||||||
|
|
||||||
if((data_len = getNameLength(x, flow->packet.payload, flow->packet.payload_packet_len)) == 0) {
|
if((x+6) >= flow->packet.payload_packet_len) {
|
||||||
break;
|
break;
|
||||||
} else
|
}
|
||||||
x += data_len;
|
|
||||||
|
|
||||||
rsp_type = get16(&x, flow->packet.payload);
|
if((data_len = getNameLength(x, flow->packet.payload, flow->packet.payload_packet_len)) == 0) {
|
||||||
flow->protos.dns.rsp_type = rsp_type;
|
break;
|
||||||
|
} else
|
||||||
|
x += data_len;
|
||||||
|
|
||||||
/* here x points to the response "class" field */
|
if((x+2) >= flow->packet.payload_packet_len) {
|
||||||
if((x+12) <= flow->packet.payload_packet_len) {
|
break;
|
||||||
x += 6;
|
}
|
||||||
data_len = get16(&x, flow->packet.payload);
|
rsp_type = get16(&x, flow->packet.payload);
|
||||||
|
flow->protos.dns.rsp_type = rsp_type;
|
||||||
|
|
||||||
if(((x + data_len) <= flow->packet.payload_packet_len)
|
/* here x points to the response "class" field */
|
||||||
&& (((rsp_type == 0x1) && (data_len == 4)) /* A */
|
if((x+12) <= flow->packet.payload_packet_len) {
|
||||||
|
x += 6;
|
||||||
|
data_len = get16(&x, flow->packet.payload);
|
||||||
|
|
||||||
|
if((x + data_len) <= flow->packet.payload_packet_len) {
|
||||||
|
// printf("[rsp_type: %u][data_len: %u]\n", rsp_type, data_len);
|
||||||
|
|
||||||
|
if(rsp_type == 0x05 /* CNAME */) {
|
||||||
|
x += data_len;
|
||||||
|
continue; /* Skip CNAME */
|
||||||
|
}
|
||||||
|
|
||||||
|
if((((rsp_type == 0x1) && (data_len == 4)) /* A */
|
||||||
#ifdef NDPI_DETECTION_SUPPORT_IPV6
|
#ifdef NDPI_DETECTION_SUPPORT_IPV6
|
||||||
|| ((rsp_type == 0x1c) && (data_len == 16)) /* AAAA */
|
|| ((rsp_type == 0x1c) && (data_len == 16)) /* AAAA */
|
||||||
#endif
|
#endif
|
||||||
)) {
|
)) {
|
||||||
memcpy(&flow->protos.dns.rsp_addr, flow->packet.payload + x, data_len);
|
memcpy(&flow->protos.dns.rsp_addr, flow->packet.payload + x, data_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if((flow->packet.detected_protocol_stack[0] == NDPI_PROTOCOL_DNS)
|
||||||
|
|| (flow->packet.detected_protocol_stack[1] == NDPI_PROTOCOL_DNS)) {
|
||||||
|
/* Request already set the protocol */
|
||||||
|
// flow->extra_packets_func = NULL; /* Removed so the caller can keep dissecting DNS flows */
|
||||||
|
} else {
|
||||||
|
/* We missed the request */
|
||||||
|
u_int16_t s_port = flow->packet.udp ? ntohs(flow->packet.udp->source) : ntohs(flow->packet.tcp->source);
|
||||||
|
|
||||||
|
ndpi_set_detected_protocol(ndpi_struct, flow,
|
||||||
|
(s_port == 5355) ? NDPI_PROTOCOL_LLMNR : NDPI_PROTOCOL_DNS,
|
||||||
|
NDPI_PROTOCOL_UNKNOWN);
|
||||||
|
}
|
||||||
} else
|
} else
|
||||||
return(1 /* invalid */);
|
return(1 /* invalid */);
|
||||||
}
|
}
|
||||||
@@ -199,18 +227,13 @@ static int search_dns_again(struct ndpi_detection_module_struct *ndpi_struct, st
|
|||||||
/* possibly dissect the DNS reply */
|
/* possibly dissect the DNS reply */
|
||||||
ndpi_search_dns(ndpi_struct, flow);
|
ndpi_search_dns(ndpi_struct, flow);
|
||||||
|
|
||||||
if(flow->protos.dns.num_answers > 0) {
|
|
||||||
/* stop extra processing */
|
|
||||||
return(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Possibly more processing */
|
/* Possibly more processing */
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *********************************************** */
|
/* *********************************************** */
|
||||||
|
|
||||||
void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
static void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
int payload_offset;
|
int payload_offset;
|
||||||
u_int8_t is_query;
|
u_int8_t is_query;
|
||||||
u_int16_t s_port = 0, d_port = 0;
|
u_int16_t s_port = 0, d_port = 0;
|
||||||
@@ -261,8 +284,11 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
if(j && j < max_len) flow->host_server_name[j++] = '.';
|
if(j && j < max_len) flow->host_server_name[j++] = '.';
|
||||||
|
|
||||||
while(j < max_len && cl != 0) {
|
while(j < max_len && cl != 0) {
|
||||||
|
u_int32_t shift;
|
||||||
|
|
||||||
c = flow->packet.payload[off++];
|
c = flow->packet.payload[off++];
|
||||||
flow->host_server_name[j++] = (dns_validchar[c >> 5] & (1 << (c & 0x1f))) ? c : '_';
|
shift = ((u_int32_t) 1) << (c & 0x1f);
|
||||||
|
flow->host_server_name[j++] = tolower((dns_validchar[c >> 5] & shift) ? c : '_');
|
||||||
cl--;
|
cl--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -289,7 +315,7 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
|||||||
/* Report if this is a DNS query or reply */
|
/* Report if this is a DNS query or reply */
|
||||||
flow->protos.dns.is_query = is_query;
|
flow->protos.dns.is_query = is_query;
|
||||||
|
|
||||||
if(is_query && (ndpi_struct->dns_dont_dissect_response == 0) && (flow->check_extra_packets == 0)) {
|
if(is_query) {
|
||||||
/* In this case we say that the protocol has been detected just to let apps carry on with their activities */
|
/* In this case we say that the protocol has been detected just to let apps carry on with their activities */
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, ret.app_protocol, ret.master_protocol);
|
ndpi_set_detected_protocol(ndpi_struct, flow, ret.app_protocol, ret.master_protocol);
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* dofus.c
|
* dofus.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* drda.c
|
* drda.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-19 - ntop.org
|
* Copyright (C) 2012-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* eaq.c
|
* eaq.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-19 - ntop.org
|
* Copyright (C) 2015-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* fasttrack.c
|
* fasttrack.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -37,47 +37,48 @@ static void ndpi_int_fasttrack_add_connection(struct ndpi_detection_module_struc
|
|||||||
|
|
||||||
void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
NDPI_LOG_DBG(ndpi_struct, "search FASTTRACK\n");
|
NDPI_LOG_DBG(ndpi_struct, "search FASTTRACK\n");
|
||||||
|
|
||||||
if ( (packet->payload != NULL)
|
if ( (packet->payload != NULL)
|
||||||
&& (packet->payload_packet_len > 6)
|
&& (packet->payload_packet_len > 6)
|
||||||
&& (ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a)) {
|
&& (ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a)) {
|
||||||
NDPI_LOG_DBG2(ndpi_struct, "detected 0d0a at the end of the packet\n");
|
NDPI_LOG_DBG2(ndpi_struct, "detected 0d0a at the end of the packet\n");
|
||||||
|
|
||||||
if (memcmp(packet->payload, "GIVE ", 5) == 0 && packet->payload_packet_len >= 8) {
|
if (memcmp(packet->payload, "GIVE ", 5) == 0 && packet->payload_packet_len >= 8) {
|
||||||
u_int16_t i;
|
u_int16_t i;
|
||||||
for (i = 5; i < (packet->payload_packet_len - 2); i++) {
|
for (i = 5; i < (packet->payload_packet_len - 2); i++) {
|
||||||
// make shure that the argument to GIVE is numeric
|
// make shure that the argument to GIVE is numeric
|
||||||
if (!(packet->payload[i] >= '0' && packet->payload[i] <= '9')) {
|
if (!(packet->payload[i] >= '0' && packet->payload[i] <= '9')) {
|
||||||
goto exclude_fasttrack;
|
goto exclude_fasttrack;
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found FASTTRACK\n");
|
|
||||||
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (packet->payload_packet_len > 50 && memcmp(packet->payload, "GET /", 5) == 0) {
|
|
||||||
u_int8_t a = 0;
|
|
||||||
NDPI_LOG_DBG2(ndpi_struct, "detected GET /. \n");
|
|
||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
|
||||||
for (a = 0; a < packet->parsed_lines; a++) {
|
|
||||||
if ((packet->line[a].len > 17 && memcmp(packet->line[a].ptr, "X-Kazaa-Username: ", 18) == 0)
|
|
||||||
|| (packet->line[a].len > 23 && memcmp(packet->line[a].ptr, "User-Agent: PeerEnabler/", 24) == 0)) {
|
|
||||||
NDPI_LOG_INFO(ndpi_struct,
|
|
||||||
"found FASTTRACK X-Kazaa-Username: || User-Agent: PeerEnabler/\n");
|
|
||||||
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exclude_fasttrack:
|
NDPI_LOG_INFO(ndpi_struct, "found FASTTRACK\n");
|
||||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (packet->payload_packet_len > 50 && memcmp(packet->payload, "GET /", 5) == 0) {
|
||||||
|
u_int16_t a = 0;
|
||||||
|
NDPI_LOG_DBG2(ndpi_struct, "detected GET /. \n");
|
||||||
|
|
||||||
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
|
for (a = 0; a < packet->parsed_lines; a++) {
|
||||||
|
if ((packet->line[a].len > 17 && memcmp(packet->line[a].ptr, "X-Kazaa-Username: ", 18) == 0)
|
||||||
|
|| (packet->line[a].len > 23 && memcmp(packet->line[a].ptr, "User-Agent: PeerEnabler/", 24) == 0)) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct,
|
||||||
|
"found FASTTRACK X-Kazaa-Username: || User-Agent: PeerEnabler/\n");
|
||||||
|
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exclude_fasttrack:
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* fiesta.c
|
* fiesta.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* fix.c
|
* fix.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-19 - ntop.org
|
* Copyright (C) 2017-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* florensia.c
|
* florensia.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
+212
-552
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* ftp_data.c
|
* ftp_data.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-19 - ntop.org
|
* Copyright (C) 2016-20 - ntop.org
|
||||||
*
|
*
|
||||||
* The signature is based on the Libprotoident library.
|
* The signature is based on the Libprotoident library.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* git.c
|
* git.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-19 - ntop.org
|
* Copyright (C) 2012-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* gnutella.c
|
* gnutella.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* gtp.c
|
* gtp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* guildwars.c
|
* guildwars.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* halflife2_and_mods.c
|
* halflife2_and_mods.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* hangout.c
|
* hangout.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-19 - ntop.org
|
* Copyright (C) 2012-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
+169
-156
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* http.c
|
* http.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -28,54 +28,112 @@
|
|||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
static void ndpi_int_http_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow,
|
struct ndpi_flow_struct *flow);
|
||||||
u_int16_t category) {
|
|
||||||
#ifdef DEBUG
|
/* *********************************************** */
|
||||||
printf("[%s] [http_dont_dissect_response: %u]->> %s\n", __FUNCTION__,
|
|
||||||
ndpi_struct->http_dont_dissect_response, flow->http.response_status_code);
|
static int ndpi_search_http_tcp_again(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow) {
|
||||||
|
ndpi_search_http_tcp(ndpi_struct, flow);
|
||||||
|
|
||||||
|
#ifdef HTTP_DEBUG
|
||||||
|
printf("=> %s()\n", __FUNCTION__);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
|
if((flow->host_server_name[0] != '\0') && (flow->http.response_status_code != 0)) {
|
||||||
/* This is HTTP and it is not a sub protocol (e.g. skype or dropbox) */
|
/* stop extra processing */
|
||||||
|
flow->extra_packets_func = NULL; /* We're good now */
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
ndpi_search_tcp_or_udp(ndpi_struct, flow);
|
/* Possibly more processing */
|
||||||
|
return(1);
|
||||||
|
}
|
||||||
|
|
||||||
/* If no custom protocol has been detected */
|
/* *********************************************** */
|
||||||
if(flow->guessed_host_protocol_id != NDPI_PROTOCOL_UNKNOWN) {
|
|
||||||
ndpi_int_reset_protocol(flow);
|
|
||||||
flow->http_upper_protocol = flow->guessed_host_protocol_id, flow->http_lower_protocol = NDPI_PROTOCOL_HTTP;
|
|
||||||
} else
|
|
||||||
flow->http_upper_protocol = NDPI_PROTOCOL_HTTP, flow->http_lower_protocol = NDPI_PROTOCOL_UNKNOWN;
|
|
||||||
|
|
||||||
if(ndpi_struct->http_dont_dissect_response)
|
/* https://www.freeformatter.com/mime-types-list.html */
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, flow->http_upper_protocol, flow->http_lower_protocol);
|
static ndpi_protocol_category_t ndpi_http_check_content(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
else {
|
struct ndpi_flow_struct *flow) {
|
||||||
flow->detected_protocol_stack[0] = NDPI_PROTOCOL_UNKNOWN, flow->detected_protocol_stack[1] = NDPI_PROTOCOL_UNKNOWN;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
flow->packet.detected_protocol_stack[0] = NDPI_PROTOCOL_UNKNOWN, flow->packet.detected_protocol_stack[1] = NDPI_PROTOCOL_UNKNOWN;
|
|
||||||
|
if(packet->content_line.len > 0) {
|
||||||
|
u_int app_len = sizeof("application");
|
||||||
|
|
||||||
|
if(packet->content_line.len > app_len) {
|
||||||
|
if(ndpi_strncasestr((const char *)&packet->content_line.ptr[app_len], "mpeg",
|
||||||
|
packet->content_line.len-app_len) != NULL) {
|
||||||
|
flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_STREAMING;
|
||||||
|
return(flow->category);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if((!ndpi_struct->http_dont_dissect_response) && (flow->http.response_status_code == 0)) {
|
switch(packet->content_line.ptr[0]) {
|
||||||
flow->http_upper_protocol = flow->detected_protocol_stack[0], flow->http_lower_protocol = flow->detected_protocol_stack[1];
|
case 'a':
|
||||||
flow->detected_protocol_stack[0] = NDPI_PROTOCOL_UNKNOWN, flow->detected_protocol_stack[1] = NDPI_PROTOCOL_UNKNOWN;
|
if(strncasecmp((const char *)packet->content_line.ptr, "audio",
|
||||||
flow->packet.detected_protocol_stack[0] = NDPI_PROTOCOL_UNKNOWN, flow->packet.detected_protocol_stack[1] = NDPI_PROTOCOL_UNKNOWN;
|
ndpi_min(packet->content_line.len, 5)) == 0)
|
||||||
|
flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_MEDIA;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'v':
|
||||||
|
if(strncasecmp((const char *)packet->content_line.ptr, "video",
|
||||||
|
ndpi_min(packet->content_line.len, 5)) == 0)
|
||||||
|
flow->guessed_category = flow->category = NDPI_PROTOCOL_CATEGORY_MEDIA;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flow->http_detected = 1, flow->guessed_category = category;
|
return(flow->category);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* *********************************************** */
|
||||||
|
|
||||||
|
static void ndpi_int_http_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow,
|
||||||
|
u_int16_t http_protocol,
|
||||||
|
ndpi_protocol_category_t category) {
|
||||||
|
#ifdef HTTP_DEBUG
|
||||||
|
printf("=> %s()\n", __FUNCTION__);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(flow->extra_packets_func && (flow->guessed_host_protocol_id == NDPI_PROTOCOL_UNKNOWN))
|
||||||
|
return; /* Nothing new to add */
|
||||||
|
|
||||||
|
/* This is HTTP and it is not a sub protocol (e.g. skype or dropbox) */
|
||||||
|
ndpi_search_tcp_or_udp(ndpi_struct, flow);
|
||||||
|
|
||||||
|
/* If no custom protocol has been detected */
|
||||||
|
if((flow->guessed_host_protocol_id == NDPI_PROTOCOL_UNKNOWN) || (http_protocol != NDPI_PROTOCOL_HTTP))
|
||||||
|
flow->guessed_host_protocol_id = http_protocol;
|
||||||
|
|
||||||
|
category = ndpi_http_check_content(ndpi_struct, flow);
|
||||||
|
ndpi_int_reset_protocol(flow);
|
||||||
|
ndpi_set_detected_protocol(ndpi_struct, flow, flow->guessed_host_protocol_id, NDPI_PROTOCOL_HTTP);
|
||||||
|
|
||||||
|
/* This is necessary to inform the core to call this dissector again */
|
||||||
|
flow->check_extra_packets = 1;
|
||||||
|
flow->max_extra_packets_to_check = 5;
|
||||||
|
flow->extra_packets_func = ndpi_search_http_tcp_again;
|
||||||
|
flow->http_detected = 1, flow->guessed_category = flow->category = category;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ************************************************************* */
|
||||||
|
|
||||||
static void rtsp_parse_packet_acceptline(struct ndpi_detection_module_struct
|
static void rtsp_parse_packet_acceptline(struct ndpi_detection_module_struct
|
||||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
if(packet->accept_line.len >= 28 && memcmp(packet->accept_line.ptr, "application/x-rtsp-tunnelled", 28) == 0) {
|
if((packet->accept_line.len >= 28)
|
||||||
|
&& (memcmp(packet->accept_line.ptr, "application/x-rtsp-tunnelled", 28) == 0)) {
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found RTSP accept line\n");
|
NDPI_LOG_INFO(ndpi_struct, "found RTSP accept line\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTSP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTSP, NDPI_PROTOCOL_CATEGORY_MEDIA);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************* */
|
||||||
|
|
||||||
static void setHttpUserAgent(struct ndpi_detection_module_struct *ndpi_struct,
|
static void setHttpUserAgent(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow, char *ua) {
|
struct ndpi_flow_struct *flow, char *ua) {
|
||||||
if ( !strcmp(ua, "Windows NT 5.0")) ua = "Windows 2000";
|
if ( !strcmp(ua, "Windows NT 5.0")) ua = "Windows 2000";
|
||||||
@@ -91,59 +149,50 @@ static void setHttpUserAgent(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
* https://github.com/ua-parser/uap-core/blob/master/regexes.yaml */
|
* https://github.com/ua-parser/uap-core/blob/master/regexes.yaml */
|
||||||
|
|
||||||
//printf("==> %s\n", ua);
|
//printf("==> %s\n", ua);
|
||||||
if(!ndpi_struct->disable_metadata_export) {
|
snprintf((char*)flow->protos.http.detected_os,
|
||||||
snprintf((char*)flow->protos.http.detected_os, sizeof(flow->protos.http.detected_os), "%s", ua);
|
sizeof(flow->protos.http.detected_os), "%s", ua);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parseHttpSubprotocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
/* ************************************************************* */
|
||||||
|
|
||||||
|
static void ndpi_http_parse_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow) {
|
||||||
if((flow->l4.tcp.http_stage == 0) || (flow->http.url && flow->http_detected)) {
|
if((flow->l4.tcp.http_stage == 0) || (flow->http.url && flow->http_detected)) {
|
||||||
char *double_col = strchr((char*)flow->host_server_name, ':');
|
char *double_col = strchr((char*)flow->host_server_name, ':');
|
||||||
ndpi_protocol_match_result ret_match;
|
|
||||||
|
|
||||||
if(double_col) double_col[0] = '\0';
|
if(double_col) double_col[0] = '\0';
|
||||||
|
|
||||||
/**
|
ndpi_match_hostname_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP,
|
||||||
NOTE
|
(char *)flow->host_server_name,
|
||||||
If http_dont_dissect_response = 1 dissection of HTTP response
|
strlen((const char *)flow->host_server_name));
|
||||||
mime types won't happen
|
|
||||||
*/
|
|
||||||
ndpi_match_host_subprotocol(ndpi_struct, flow, (char *)flow->host_server_name,
|
|
||||||
strlen((const char *)flow->host_server_name),
|
|
||||||
&ret_match,
|
|
||||||
NDPI_PROTOCOL_HTTP);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************* */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
NOTE
|
NOTE
|
||||||
ndpi_parse_packet_line_info is in ndpi_main.c
|
ndpi_parse_packet_line_info is in ndpi_main.c
|
||||||
*/
|
*/
|
||||||
static void check_content_type_and_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
static void check_content_type_and_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow) {
|
struct ndpi_flow_struct *flow) {
|
||||||
|
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
if((!ndpi_struct->http_dont_dissect_response) && flow->http_detected && (flow->http.response_status_code != 0)) {
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_UNKNOWN);
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, flow->http_upper_protocol, flow->http_lower_protocol);
|
|
||||||
#ifdef DEBUG
|
if(flow->http_detected && (flow->http.response_status_code != 0))
|
||||||
printf("[%s] [http_dont_dissect_response: %u]->> %s\n",
|
|
||||||
__FUNCTION__, ndpi_struct->http_dont_dissect_response, flow->http.response_status_code);
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(NDPI_PROTOCOL_1KXUN) || defined(NDPI_PROTOCOL_IQIYI)
|
#if defined(NDPI_PROTOCOL_1KXUN) || defined(NDPI_PROTOCOL_IQIYI)
|
||||||
/* PPStream */
|
/* PPStream */
|
||||||
if(flow->l4.tcp.ppstream_stage > 0 && flow->iqiyi_counter == 0) {
|
if(flow->l4.tcp.ppstream_stage > 0 && flow->iqiyi_counter == 0) {
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found PPStream\n");
|
NDPI_LOG_INFO(ndpi_struct, "found PPStream\n");
|
||||||
/* ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM); */
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM,
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_PPSTREAM, NDPI_PROTOCOL_HTTP);
|
NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_CATEGORY_STREAMING);
|
||||||
}
|
} else if(flow->iqiyi_counter > 0) {
|
||||||
else if(flow->iqiyi_counter > 0) {
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found iQiyi\n");
|
NDPI_LOG_INFO(ndpi_struct, "found iQiyi\n");
|
||||||
/* ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_IQIYI); */
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IQIYI,
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IQIYI, NDPI_PROTOCOL_HTTP);
|
NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_CATEGORY_STREAMING);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -151,14 +200,10 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
/* 1KXUN */
|
/* 1KXUN */
|
||||||
if(flow->kxun_counter > 0) {
|
if(flow->kxun_counter > 0) {
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found 1kxun\n");
|
NDPI_LOG_INFO(ndpi_struct, "found 1kxun\n");
|
||||||
/* ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_1KXUN); */
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_1KXUN, NDPI_PROTOCOL_CATEGORY_STREAMING);
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_1KXUN, NDPI_PROTOCOL_HTTP);
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Leave the statement below commented necessary in case of call to ndpi_get_partial_detection() */
|
|
||||||
|
|
||||||
/* if(!ndpi_struct->http_dont_dissect_response) */ {
|
|
||||||
if((flow->http.url == NULL)
|
if((flow->http.url == NULL)
|
||||||
&& (packet->http_url_name.len > 0)
|
&& (packet->http_url_name.len > 0)
|
||||||
&& (packet->host_line.len > 0)) {
|
&& (packet->host_line.len > 0)) {
|
||||||
@@ -198,18 +243,6 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if((flow->http.content_type == NULL) && (packet->content_line.len > 0)) {
|
|
||||||
int len = packet->content_line.len + 1;
|
|
||||||
|
|
||||||
flow->http.content_type = ndpi_malloc(len);
|
|
||||||
if(flow->http.content_type) {
|
|
||||||
strncpy(flow->http.content_type, (char*)packet->content_line.ptr,
|
|
||||||
packet->content_line.len);
|
|
||||||
flow->http.content_type[packet->content_line.len] = '\0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(packet->user_agent_line.ptr != NULL && packet->user_agent_line.len != 0) {
|
if(packet->user_agent_line.ptr != NULL && packet->user_agent_line.len != 0) {
|
||||||
/**
|
/**
|
||||||
Format examples:
|
Format examples:
|
||||||
@@ -267,14 +300,24 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
setHttpUserAgent(ndpi_struct, flow, token);
|
setHttpUserAgent(ndpi_struct, flow, token);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if((packet->user_agent_line.len > 14) && (memcmp(ua, "netflix-ios-app", 15) == 0)) {
|
||||||
else if(memcmp(ua, "netflix-ios-app", 15) == 0) {
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found netflix\n");
|
NDPI_LOG_INFO(ndpi_struct, "found netflix\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NETFLIX);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_NETFLIX, NDPI_PROTOCOL_CATEGORY_STREAMING);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(flow->http.user_agent == NULL) {
|
||||||
|
int len = packet->user_agent_line.len + 1;
|
||||||
|
|
||||||
|
flow->http.user_agent = ndpi_malloc(len);
|
||||||
|
if(flow->http.user_agent) {
|
||||||
|
strncpy(flow->http.user_agent, (char*)packet->user_agent_line.ptr,
|
||||||
|
packet->user_agent_line.len);
|
||||||
|
flow->http.user_agent[packet->user_agent_line.len] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
NDPI_LOG_DBG2(ndpi_struct, "User Agent Type line found %.*s\n",
|
NDPI_LOG_DBG2(ndpi_struct, "User Agent Type line found %.*s\n",
|
||||||
packet->user_agent_line.len, packet->user_agent_line.ptr);
|
packet->user_agent_line.len, packet->user_agent_line.ptr);
|
||||||
}
|
}
|
||||||
@@ -286,36 +329,21 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
NDPI_LOG_DBG2(ndpi_struct, "HOST line found %.*s\n",
|
NDPI_LOG_DBG2(ndpi_struct, "HOST line found %.*s\n",
|
||||||
packet->host_line.len, packet->host_line.ptr);
|
packet->host_line.len, packet->host_line.ptr);
|
||||||
|
|
||||||
/* call ndpi_match_host_subprotocol to see if there is a match with known-host HTTP subprotocol */
|
|
||||||
if((ndpi_struct->http_dont_dissect_response) || flow->http_detected) {
|
|
||||||
ndpi_protocol_match_result ret_match;
|
|
||||||
|
|
||||||
ndpi_match_host_subprotocol(ndpi_struct, flow,
|
|
||||||
(char*)packet->host_line.ptr,
|
|
||||||
packet->host_line.len,
|
|
||||||
&ret_match,
|
|
||||||
NDPI_PROTOCOL_HTTP);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Copy result for nDPI apps */
|
/* Copy result for nDPI apps */
|
||||||
if(!ndpi_struct->disable_metadata_export) {
|
len = ndpi_min(packet->host_line.len, sizeof(flow->host_server_name)-1);
|
||||||
len = ndpi_min(packet->host_line.len, sizeof(flow->host_server_name)-1);
|
strncpy((char*)flow->host_server_name, (char*)packet->host_line.ptr, len);
|
||||||
strncpy((char*)flow->host_server_name, (char*)packet->host_line.ptr, len);
|
flow->host_server_name[len] = '\0';
|
||||||
flow->host_server_name[len] = '\0';
|
flow->extra_packets_func = NULL; /* We're good now */
|
||||||
}
|
|
||||||
|
|
||||||
flow->server_id = flow->dst;
|
flow->server_id = flow->dst;
|
||||||
|
|
||||||
if(packet->forwarded_line.ptr) {
|
if(packet->forwarded_line.ptr) {
|
||||||
len = ndpi_min(packet->forwarded_line.len, sizeof(flow->protos.http.nat_ip)-1);
|
len = ndpi_min(packet->forwarded_line.len, sizeof(flow->protos.http.nat_ip)-1);
|
||||||
if(!ndpi_struct->disable_metadata_export) {
|
strncpy((char*)flow->protos.http.nat_ip, (char*)packet->forwarded_line.ptr, len);
|
||||||
strncpy((char*)flow->protos.http.nat_ip, (char*)packet->forwarded_line.ptr, len);
|
flow->protos.http.nat_ip[len] = '\0';
|
||||||
flow->protos.http.nat_ip[len] = '\0';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ndpi_struct->http_dont_dissect_response)
|
ndpi_http_parse_subprotocol(ndpi_struct, flow);
|
||||||
parseHttpSubprotocol(ndpi_struct, flow);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
check result of host subprotocol detection
|
check result of host subprotocol detection
|
||||||
@@ -339,7 +367,7 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if((flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)
|
if((flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)
|
||||||
&& ((ndpi_struct->http_dont_dissect_response) || flow->http_detected)
|
&& (flow->http_detected)
|
||||||
&& (packet->http_origin.len > 0)) {
|
&& (packet->http_origin.len > 0)) {
|
||||||
ndpi_protocol_match_result ret_match;
|
ndpi_protocol_match_result ret_match;
|
||||||
|
|
||||||
@@ -354,15 +382,15 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_HTTP) {
|
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_HTTP) {
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found HTTP/%s\n",
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP/%s\n",
|
||||||
ndpi_get_proto_name(ndpi_struct, packet->detected_protocol_stack[0]));
|
ndpi_get_proto_name(ndpi_struct, packet->detected_protocol_stack[0]));
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, packet->detected_protocol_stack[0]);
|
ndpi_int_http_add_connection(ndpi_struct, flow, packet->detected_protocol_stack[0], NDPI_PROTOCOL_CATEGORY_WEB);
|
||||||
return; /* We have identified a sub-protocol so we're done */
|
return; /* We have identified a sub-protocol so we're done */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if(!ndpi_struct->http_dont_dissect_response && flow->http_detected)
|
if(flow->http_detected)
|
||||||
parseHttpSubprotocol(ndpi_struct, flow);
|
ndpi_http_parse_subprotocol(ndpi_struct, flow);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(flow->guessed_protocol_id == NDPI_PROTOCOL_UNKNOWN)
|
if(flow->guessed_protocol_id == NDPI_PROTOCOL_UNKNOWN)
|
||||||
@@ -382,7 +410,18 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
NDPI_LOG_DBG2(ndpi_struct, "Content Type line found %.*s\n",
|
NDPI_LOG_DBG2(ndpi_struct, "Content Type line found %.*s\n",
|
||||||
packet->content_line.len, packet->content_line.ptr);
|
packet->content_line.len, packet->content_line.ptr);
|
||||||
|
|
||||||
if((ndpi_struct->http_dont_dissect_response) || flow->http_detected) {
|
if((flow->http.content_type == NULL) && (packet->content_line.len > 0)) {
|
||||||
|
int len = packet->content_line.len + 1;
|
||||||
|
|
||||||
|
flow->http.content_type = ndpi_malloc(len);
|
||||||
|
if(flow->http.content_type) {
|
||||||
|
strncpy(flow->http.content_type, (char*)packet->content_line.ptr,
|
||||||
|
packet->content_line.len);
|
||||||
|
flow->http.content_type[packet->content_line.len] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(flow->http_detected) {
|
||||||
ndpi_protocol_match_result ret_match;
|
ndpi_protocol_match_result ret_match;
|
||||||
|
|
||||||
ndpi_match_content_subprotocol(ndpi_struct, flow,
|
ndpi_match_content_subprotocol(ndpi_struct, flow,
|
||||||
@@ -391,13 +430,17 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, packet->detected_protocol_stack[0]);
|
ndpi_int_http_add_connection(ndpi_struct, flow, packet->detected_protocol_stack[0], NDPI_PROTOCOL_CATEGORY_WEB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************* */
|
||||||
|
|
||||||
static void check_http_payload(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
static void check_http_payload(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||||
/* Add here your paylod code check */
|
/* Add here your paylod code check */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************************* */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Functions to check whether the packet begins with a valid http request
|
* Functions to check whether the packet begins with a valid http request
|
||||||
* @param ndpi_struct
|
* @param ndpi_struct
|
||||||
@@ -434,7 +477,7 @@ static u_int16_t http_request_url_offset(struct ndpi_detection_module_struct *nd
|
|||||||
packet->payload_packet_len);
|
packet->payload_packet_len);
|
||||||
|
|
||||||
/* Check first char */
|
/* Check first char */
|
||||||
if(!strchr(http_fs,packet->payload[0])) return 0;
|
if(!packet->payload_packet_len || !strchr(http_fs,packet->payload[0])) return 0;
|
||||||
/**
|
/**
|
||||||
FIRST PAYLOAD PACKET FROM CLIENT
|
FIRST PAYLOAD PACKET FROM CLIENT
|
||||||
**/
|
**/
|
||||||
@@ -490,7 +533,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
flow->http.response_status_code = 0; /* Out of range */
|
flow->http.response_status_code = 0; /* Out of range */
|
||||||
}
|
}
|
||||||
|
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -528,7 +571,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
</cross-domain-policy>
|
</cross-domain-policy>
|
||||||
*/
|
*/
|
||||||
ookla_found:
|
ookla_found:
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_OOKLA, NDPI_PROTOCOL_CATEGORY_WEB);
|
||||||
|
|
||||||
if(ndpi_struct->ookla_cache == NULL)
|
if(ndpi_struct->ookla_cache == NULL)
|
||||||
ndpi_struct->ookla_cache = ndpi_lru_cache_init(1024);
|
ndpi_struct->ookla_cache = ndpi_lru_cache_init(1024);
|
||||||
@@ -592,32 +635,12 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
goto ookla_found;
|
goto ookla_found;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for additional field introduced by Steam */
|
|
||||||
int x = 1;
|
|
||||||
if(packet->line[x].len >= 11 && (memcmp(packet->line[x].ptr, "x-steam-sid", 11)) == 0) {
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found STEAM\n");
|
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_STEAM);
|
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for additional field introduced by Facebook */
|
|
||||||
x = 1;
|
|
||||||
while(packet->line[x].len != 0) {
|
|
||||||
if(packet->line[x].len >= 12 && (memcmp(packet->line[x].ptr, "X-FB-SIM-HNI", 12)) == 0) {
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found FACEBOOK\n");
|
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_FACEBOOK);
|
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
x++;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(NDPI_PROTOCOL_1KXUN) || defined(NDPI_PROTOCOL_IQIYI)
|
#if defined(NDPI_PROTOCOL_1KXUN) || defined(NDPI_PROTOCOL_IQIYI)
|
||||||
/* check PPStream protocol or iQiyi service
|
/* check PPStream protocol or iQiyi service
|
||||||
(iqiyi is delivered by ppstream) */
|
(iqiyi is delivered by ppstream) */
|
||||||
// substring in url
|
// substring in url
|
||||||
if(ndpi_strnstr((const char*) &packet->payload[filename_start], "iqiyi.com", (packet->payload_packet_len - filename_start)) != NULL) {
|
if(ndpi_strnstr((const char*) &packet->payload[filename_start], "iqiyi.com",
|
||||||
|
(packet->payload_packet_len - filename_start)) != NULL) {
|
||||||
if(flow->kxun_counter == 0) {
|
if(flow->kxun_counter == 0) {
|
||||||
flow->l4.tcp.ppstream_stage++;
|
flow->l4.tcp.ppstream_stage++;
|
||||||
flow->iqiyi_counter++;
|
flow->iqiyi_counter++;
|
||||||
@@ -659,14 +682,14 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
if((packet->http_url_name.len > 7)
|
if((packet->http_url_name.len > 7)
|
||||||
&& (!strncmp((const char*) packet->http_url_name.ptr, "http://", 7))) {
|
&& (!strncmp((const char*) packet->http_url_name.ptr, "http://", 7))) {
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found HTTP_PROXY\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP_PROXY\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_PROXY);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_PROXY, NDPI_PROTOCOL_CATEGORY_WEB);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(filename_start == 8 && (memcmp(packet->payload, "CONNECT ", 8) == 0)) {
|
if(filename_start == 8 && (memcmp(packet->payload, "CONNECT ", 8) == 0)) {
|
||||||
/* nathan@getoffmalawn.com */
|
/* nathan@getoffmalawn.com */
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found HTTP_CONNECT\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP_CONNECT\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_CONNECT);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP_CONNECT, NDPI_PROTOCOL_CATEGORY_WEB);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -681,17 +704,11 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
in 99.99% of the cases is like that.
|
in 99.99% of the cases is like that.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if(ndpi_struct->http_dont_dissect_response) {
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_CATEGORY_WEB);
|
||||||
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) /* No subprotocol found */
|
flow->http_detected = 1;
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found HTTP\n");
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
"HTTP START Found, we will look further for the response...\n");
|
||||||
} else {
|
flow->l4.tcp.http_stage = packet->packet_direction + 1; // packet_direction 0: stage 1, packet_direction 1: stage 2
|
||||||
flow->http_detected = 1;
|
|
||||||
NDPI_LOG_DBG2(ndpi_struct,
|
|
||||||
"HTTP START Found, we will look further for the response...\n");
|
|
||||||
flow->l4.tcp.http_stage = packet->packet_direction + 1; // packet_direction 0: stage 1, packet_direction 1: stage 2
|
|
||||||
}
|
|
||||||
|
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -715,7 +732,8 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_OOKLA);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_OOKLA);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
At first check, if this is for sure a response packet (in another direction. If not, if HTTP is detected do nothing now and return,
|
At first check, if this is for sure a response packet
|
||||||
|
(in another direction. If not, if HTTP is detected do nothing now and return,
|
||||||
otherwise check the second packet for the HTTP request
|
otherwise check the second packet for the HTTP request
|
||||||
*/
|
*/
|
||||||
if((flow->l4.tcp.http_stage - packet->packet_direction) == 1) { /* Expected a response package */
|
if((flow->l4.tcp.http_stage - packet->packet_direction) == 1) { /* Expected a response package */
|
||||||
@@ -749,7 +767,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
&& memcmp(&packet->line[0].ptr[packet->line[0].len - 9], " HTTP/1.", 8) == 0) {
|
&& memcmp(&packet->line[0].ptr[packet->line[0].len - 9], " HTTP/1.", 8) == 0) {
|
||||||
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found HTTP\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_CATEGORY_WEB);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
|
|
||||||
NDPI_LOG_DBG2(ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
@@ -771,7 +789,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
if((packet->parsed_lines == 1) && (packet->packet_direction == 1 /* server -> client */)) {
|
if((packet->parsed_lines == 1) && (packet->packet_direction == 1 /* server -> client */)) {
|
||||||
/* In Apache if you do "GET /\n\n" the response comes without any header */
|
/* In Apache if you do "GET /\n\n" the response comes without any header */
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found HTTP. (apache)\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP. (apache)\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_CATEGORY_WEB);
|
||||||
check_content_type_and_change_protocol(ndpi_struct, flow);
|
check_content_type_and_change_protocol(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -779,7 +797,7 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
/* If we already detected the HTTP request, we can add the connection and then check for the sub-protocol */
|
/* If we already detected the HTTP request, we can add the connection and then check for the sub-protocol */
|
||||||
if(flow->http_detected) {
|
if(flow->http_detected) {
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found HTTP\n");
|
NDPI_LOG_INFO(ndpi_struct, "found HTTP\n");
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP);
|
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_HTTP, NDPI_PROTOCOL_CATEGORY_WEB);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Parse packet line and we look for the subprotocols */
|
/* Parse packet line and we look for the subprotocols */
|
||||||
@@ -799,10 +817,10 @@ static void ndpi_check_http_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
/* ********************************* */
|
||||||
struct ndpi_flow_struct *flow) {
|
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
|
||||||
|
|
||||||
|
static void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
|
struct ndpi_flow_struct *flow) {
|
||||||
/* Break after 20 packets. */
|
/* Break after 20 packets. */
|
||||||
if(flow->packet_counter > 20) {
|
if(flow->packet_counter > 20) {
|
||||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
@@ -810,10 +828,6 @@ void ndpi_search_http_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
NDPI_LOG_DBG(ndpi_struct, "search HTTP\n");
|
NDPI_LOG_DBG(ndpi_struct, "search HTTP\n");
|
||||||
ndpi_check_http_tcp(ndpi_struct, flow);
|
ndpi_check_http_tcp(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
@@ -850,8 +864,7 @@ char* ndpi_get_http_content_type(struct ndpi_detection_module_struct *ndpi_mod,
|
|||||||
|
|
||||||
|
|
||||||
void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
|
void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
|
||||||
NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
NDPI_PROTOCOL_BITMASK *detection_bitmask) {
|
||||||
{
|
|
||||||
ndpi_set_bitmask_protocol_detection("HTTP",ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("HTTP",ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_HTTP,
|
NDPI_PROTOCOL_HTTP,
|
||||||
ndpi_search_http_tcp,
|
ndpi_search_http_tcp,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* http_activesync.c
|
* http_activesync.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* iax.c
|
* iax.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* icecast.c
|
* icecast.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -36,7 +36,7 @@ static void ndpi_int_icecast_add_connection(struct ndpi_detection_module_struct
|
|||||||
void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
u_int8_t i;
|
u_int16_t i;
|
||||||
|
|
||||||
NDPI_LOG_DBG(ndpi_struct, "search icecast\n");
|
NDPI_LOG_DBG(ndpi_struct, "search icecast\n");
|
||||||
|
|
||||||
|
|||||||
@@ -2,45 +2,63 @@
|
|||||||
* iec60870-5-104.c
|
* iec60870-5-104.c
|
||||||
* Extension for industrial 104 protocol recognition
|
* Extension for industrial 104 protocol recognition
|
||||||
*
|
*
|
||||||
* Created by Cesar HM
|
* Created by Cesar HM <cesar91hoyos@gmail.com>
|
||||||
|
*
|
||||||
|
* Copyright (C) 2019 - ntop.org
|
||||||
|
*
|
||||||
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
*
|
||||||
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* nDPI is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ndpi_protocol_ids.h"
|
#include "ndpi_protocol_ids.h"
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_104
|
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_IEC60870
|
||||||
|
|
||||||
void ndpi_search_104_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_search_iec60870_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow) {
|
struct ndpi_flow_struct *flow) {
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
NDPI_LOG_DBG(ndpi_struct, "search 104\n");
|
u_int16_t iec104_port = htons(2404); // port used by IEC60870
|
||||||
u_int16_t iec104_port = htons(2404); // port used by 104
|
|
||||||
|
|
||||||
/* Check connection over TCP */
|
/* Check connection over TCP */
|
||||||
|
NDPI_LOG_DBG(ndpi_struct, "search IEC60870\n");
|
||||||
|
|
||||||
if(packet->tcp) {
|
if(packet->tcp) {
|
||||||
/* The start byte of 104 is 0x68
|
/* The start byte of 104 is 0x68
|
||||||
* The usual port: 2404
|
* The usual port: 2404
|
||||||
*/
|
*/
|
||||||
if ( packet->payload[0] == 0x68 &&
|
if((packet->payload[0] == 0x68) &&
|
||||||
((packet->tcp->dest == iec104_port) || (packet->tcp->source == iec104_port)) ){
|
((packet->tcp->dest == iec104_port) || (packet->tcp->source == iec104_port)) ){
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found 104\n");
|
NDPI_LOG_INFO(ndpi_struct, "found 104\n");
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_104, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_IEC60870, NDPI_PROTOCOL_UNKNOWN);
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
}
|
||||||
|
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void init_104_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
void init_104_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
|
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
|
||||||
|
ndpi_set_bitmask_protocol_detection("IEC60870", ndpi_struct, detection_bitmask, *id,
|
||||||
ndpi_set_bitmask_protocol_detection("104", ndpi_struct, detection_bitmask, *id,
|
NDPI_PROTOCOL_IEC60870,
|
||||||
NDPI_PROTOCOL_104,
|
ndpi_search_iec60870_tcp,
|
||||||
ndpi_search_104_tcp,
|
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
||||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* ipp.c
|
* ipp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* irc.c
|
* irc.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -492,9 +492,10 @@ void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||||
} else {
|
} else {
|
||||||
flow->l4.tcp.irc_3a_counter++;
|
flow->l4.tcp.irc_3a_counter++;
|
||||||
|
packet->parsed_lines = 0;
|
||||||
}
|
}
|
||||||
for (i = 0; i < packet->parsed_lines; i++) {
|
for (i = 0; i < packet->parsed_lines; i++) {
|
||||||
if (packet->line[i].ptr[0] == ':') {
|
if ((packet->line[i].len > 0) && packet->line[i].ptr[0] == ':') {
|
||||||
flow->l4.tcp.irc_3a_counter++;
|
flow->l4.tcp.irc_3a_counter++;
|
||||||
if (flow->l4.tcp.irc_3a_counter == 7) { /* ':' == 0x3a */
|
if (flow->l4.tcp.irc_3a_counter == 7) { /* ':' == 0x3a */
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found irc. 0x3a. seven times.");
|
NDPI_LOG_INFO(ndpi_struct, "found irc. 0x3a. seven times.");
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* jabber.c
|
* jabber.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* kakaotalk_voice.c
|
* kakaotalk_voice.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-19 - ntop.org
|
* Copyright (C) 2015-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This module is free software: you can redistribute it and/or modify
|
* This module is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
+366
-28
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* kerberos.c
|
* kerberos.c
|
||||||
*
|
*
|
||||||
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -28,53 +28,391 @@
|
|||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
/* #define KERBEROS_DEBUG 1 */
|
||||||
|
|
||||||
|
#define KERBEROS_PORT 88
|
||||||
|
|
||||||
static void ndpi_int_kerberos_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
static void ndpi_int_kerberos_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow)
|
struct ndpi_flow_struct *flow) {
|
||||||
{
|
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS, NDPI_PROTOCOL_UNKNOWN);
|
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_KERBEROS, NDPI_PROTOCOL_UNKNOWN);
|
||||||
NDPI_LOG_DBG(ndpi_struct, "trace KERBEROS\n");
|
NDPI_LOG_DBG(ndpi_struct, "trace KERBEROS\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ************************************************* */
|
||||||
|
|
||||||
void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
{
|
struct ndpi_flow_struct *flow) {
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
u_int16_t sport = packet->tcp ? ntohs(packet->tcp->source) : ntohs(packet->udp->source);
|
||||||
|
u_int16_t dport = packet->tcp ? ntohs(packet->tcp->dest) : ntohs(packet->udp->dest);
|
||||||
|
|
||||||
NDPI_LOG_DBG(ndpi_struct, "search KERBEROS\n");
|
if((sport != KERBEROS_PORT) && (dport != KERBEROS_PORT)) {
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* I have observed 0a,0c,0d,0e at packet->payload[19/21], maybe there are other possibilities */
|
NDPI_LOG_DBG(ndpi_struct, "search KERBEROS\n");
|
||||||
if (packet->payload_packet_len >= 4 && ntohl(get_u_int32_t(packet->payload, 0)) == packet->payload_packet_len - 4) {
|
|
||||||
if (packet->payload_packet_len > 19 &&
|
|
||||||
packet->payload[14] == 0x05 &&
|
|
||||||
(packet->payload[19] == 0x0a ||
|
|
||||||
packet->payload[19] == 0x0c || packet->payload[19] == 0x0d || packet->payload[19] == 0x0e)) {
|
|
||||||
ndpi_int_kerberos_add_connection(ndpi_struct, flow);
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
#ifdef KERBEROS_DEBUG
|
||||||
if (packet->payload_packet_len > 21 &&
|
printf("\n[Kerberos] Process packet [len: %u]\n", packet->payload_packet_len);
|
||||||
packet->payload[16] == 0x05 &&
|
#endif
|
||||||
(packet->payload[21] == 0x0a ||
|
|
||||||
packet->payload[21] == 0x0c || packet->payload[21] == 0x0d || packet->payload[21] == 0x0e)) {
|
|
||||||
ndpi_int_kerberos_add_connection(ndpi_struct, flow);
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
if(flow->kerberos_buf.pktbuf != NULL) {
|
||||||
|
u_int missing = flow->kerberos_buf.pktbuf_maxlen - flow->kerberos_buf.pktbuf_currlen;
|
||||||
|
|
||||||
|
if(packet->payload_packet_len <= missing) {
|
||||||
|
memcpy(&flow->kerberos_buf.pktbuf[flow->kerberos_buf.pktbuf_currlen], packet->payload, packet->payload_packet_len);
|
||||||
|
flow->kerberos_buf.pktbuf_currlen += packet->payload_packet_len;
|
||||||
|
|
||||||
|
if(flow->kerberos_buf.pktbuf_currlen == flow->kerberos_buf.pktbuf_maxlen) {
|
||||||
|
packet->payload = (u_int8_t *)flow->kerberos_buf.pktbuf;
|
||||||
|
packet->payload_packet_len = flow->kerberos_buf.pktbuf_currlen;
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos] Packet is now full: processing\n");
|
||||||
|
#endif
|
||||||
|
} else {
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos] Missing %u bytes: skipping\n",
|
||||||
|
flow->kerberos_buf.pktbuf_maxlen - flow->kerberos_buf.pktbuf_currlen);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* I have observed 0a,0c,0d,0e at packet->payload[19/21], maybe there are other possibilities */
|
||||||
|
if(packet->payload_packet_len >= 4) {
|
||||||
|
u_int32_t kerberos_len, expected_len;
|
||||||
|
u_int16_t base_offset = 0;
|
||||||
|
|
||||||
|
if(packet->tcp) {
|
||||||
|
kerberos_len = ntohl(get_u_int32_t(packet->payload, 0)),
|
||||||
|
expected_len = packet->payload_packet_len - 4;
|
||||||
|
base_offset = 4;
|
||||||
|
} else
|
||||||
|
base_offset = 0, kerberos_len = expected_len = packet->payload_packet_len;
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos] [Kerberos len: %u][expected_len: %u]\n", kerberos_len, expected_len);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(kerberos_len < 12000) {
|
||||||
|
/*
|
||||||
|
Kerberos packets might be too long for a TCP packet
|
||||||
|
so it could be split across two packets. Instead of
|
||||||
|
rebuilding the stream we use a heuristic approach
|
||||||
|
*/
|
||||||
|
if(kerberos_len > expected_len) {
|
||||||
|
if(packet->tcp) {
|
||||||
|
if(flow->kerberos_buf.pktbuf == NULL) {
|
||||||
|
flow->kerberos_buf.pktbuf = (char*)ndpi_malloc(kerberos_len+4);
|
||||||
|
|
||||||
|
if(flow->kerberos_buf.pktbuf != NULL) {
|
||||||
|
flow->kerberos_buf.pktbuf_maxlen = kerberos_len+4;
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos] Allocated %u bytes\n", flow->kerberos_buf.pktbuf_maxlen);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(flow->kerberos_buf.pktbuf != NULL) {
|
||||||
|
if(packet->payload_packet_len <= flow->kerberos_buf.pktbuf_maxlen) {
|
||||||
|
memcpy(flow->kerberos_buf.pktbuf, packet->payload, packet->payload_packet_len);
|
||||||
|
flow->kerberos_buf.pktbuf_currlen = packet->payload_packet_len;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
|
||||||
|
return;
|
||||||
|
} else if(kerberos_len == expected_len) {
|
||||||
|
if(packet->payload_packet_len > 128) {
|
||||||
|
u_int16_t koffset, i;
|
||||||
|
|
||||||
|
for(i=8; i<16; i++)
|
||||||
|
if((packet->payload[base_offset+i] == 0x03)
|
||||||
|
&& (packet->payload[base_offset+i+1] == 0x02)
|
||||||
|
&& (packet->payload[base_offset+i+2] == 0x01)
|
||||||
|
&& (packet->payload[base_offset+i+3] != 0x05)
|
||||||
|
)
|
||||||
|
break;
|
||||||
|
|
||||||
|
koffset = base_offset + i + 3;
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos] [msg-type: 0x%02X/%u][koffset: %u]\n",
|
||||||
|
packet->payload[koffset], packet->payload[koffset], koffset);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(((packet->payload[koffset] == 0x0A)
|
||||||
|
|| (packet->payload[koffset] == 0x0C)
|
||||||
|
|| (packet->payload[koffset] == 0x0D)
|
||||||
|
|| (packet->payload[koffset] == 0x0E))) {
|
||||||
|
u_int16_t koffsetp, body_offset, pad_len;
|
||||||
|
u_int8_t msg_type = packet->payload[koffset];
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos] Packet found 0x%02X/%u\n", msg_type, msg_type);
|
||||||
|
#endif
|
||||||
|
if(msg_type != 0x0d) /* TGS-REP */ {
|
||||||
|
/* Process only on requests */
|
||||||
|
if(packet->payload[koffset+1] == 0xA3) {
|
||||||
|
if(packet->payload[koffset+3] == 0x30)
|
||||||
|
pad_len = packet->payload[koffset+4];
|
||||||
|
else {
|
||||||
|
/* Long pad */
|
||||||
|
pad_len = packet->payload[koffset+2];
|
||||||
|
for(i=3; i<10; i++) if(packet->payload[koffset+i] == pad_len) break;
|
||||||
|
|
||||||
|
pad_len = (packet->payload[koffset+i+1] << 8) + packet->payload[koffset+i+2];
|
||||||
|
koffset += i-2;
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
pad_len = 0;
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("pad_len=0x%02X/%u\n", pad_len, pad_len);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(pad_len > 0) {
|
||||||
|
koffsetp = koffset + 2;
|
||||||
|
for(i=0; i<4; i++) if(packet->payload[koffsetp] != 0x30) koffsetp++; /* ASN.1 */
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("koffsetp=%u [%02X %02X] [byte 0 must be 0x30]\n", koffsetp, packet->payload[koffsetp], packet->payload[koffsetp+1]);
|
||||||
|
#endif
|
||||||
|
} else
|
||||||
|
koffsetp = koffset;
|
||||||
|
|
||||||
|
body_offset = koffsetp + 1 + pad_len;
|
||||||
|
|
||||||
|
for(i=0; i<10 && body_offset < packet->payload_packet_len; i++)
|
||||||
|
if(packet->payload[body_offset] != 0x05) body_offset++; /* ASN.1 */
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("body_offset=%u [%02X %02X] [byte 0 must be 0x05]\n", body_offset, packet->payload[body_offset], packet->payload[body_offset+1]);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if(msg_type == 0x0A) /* AS-REQ */ {
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos] Processing AS-REQ\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
if(body_offset < packet->payload_packet_len) {
|
||||||
|
u_int16_t name_offset;
|
||||||
|
|
||||||
|
name_offset = body_offset + 13;
|
||||||
|
for(i=0; i<20; i++) if(packet->payload[name_offset] != 0x1b) name_offset++; /* ASN.1 */
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("name_offset=%u [%02X %02X] [byte 0 must be 0x1b]\n", name_offset, packet->payload[name_offset], packet->payload[name_offset+1]);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(name_offset < packet->payload_packet_len) {
|
||||||
|
u_int cname_len;
|
||||||
|
|
||||||
|
name_offset += 1;
|
||||||
|
if(packet->payload[name_offset+1] < ' ') /* Isn't printable ? */
|
||||||
|
name_offset++;
|
||||||
|
|
||||||
|
if(packet->payload[name_offset+1] == 0x1b)
|
||||||
|
name_offset += 2;
|
||||||
|
|
||||||
|
cname_len = packet->payload[name_offset];
|
||||||
|
|
||||||
|
if((cname_len+name_offset) < packet->payload_packet_len) {
|
||||||
|
u_int realm_len, realm_offset;
|
||||||
|
char cname_str[48];
|
||||||
|
u_int8_t num_cname = 0;
|
||||||
|
|
||||||
|
while(++num_cname <= 2) {
|
||||||
|
if(cname_len > sizeof(cname_str)-1)
|
||||||
|
cname_len = sizeof(cname_str)-1;
|
||||||
|
|
||||||
|
strncpy(cname_str, (char*)&packet->payload[name_offset+1], cname_len);
|
||||||
|
cname_str[cname_len] = '\0';
|
||||||
|
for(i=0; i<cname_len; i++) cname_str[i] = tolower(cname_str[i]);
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[AS-REQ][s/dport: %u/%u][Kerberos Cname][len: %u][%s]\n", sport, dport, cname_len, cname_str);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(((strcmp(cname_str, "host") == 0) || (strcmp(cname_str, "ldap") == 0)) && (packet->payload[name_offset+1+cname_len] == 0x1b)) {
|
||||||
|
name_offset += cname_len + 2;
|
||||||
|
cname_len = packet->payload[name_offset];
|
||||||
|
} else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
realm_offset = cname_len + name_offset + 3;
|
||||||
|
|
||||||
|
/* if cname does not end with a $ then it's a username */
|
||||||
|
if(cname_len && cname_str[cname_len-1] == '$') {
|
||||||
|
cname_str[cname_len-1] = '\0';
|
||||||
|
snprintf(flow->protos.kerberos.hostname, sizeof(flow->protos.kerberos.hostname), "%s", cname_str);
|
||||||
|
} else
|
||||||
|
snprintf(flow->protos.kerberos.username, sizeof(flow->protos.kerberos.username), "%s", cname_str);
|
||||||
|
|
||||||
|
for(i=0; i<14; i++) if(packet->payload[realm_offset] != 0x1b) realm_offset++; /* ASN.1 */
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("realm_offset=%u [%02X %02X] [byte 0 must be 0x1b]\n", realm_offset, packet->payload[realm_offset], packet->payload[realm_offset+1]);
|
||||||
|
#endif
|
||||||
|
realm_offset += 1;
|
||||||
|
//if(num_cname == 2) realm_offset++;
|
||||||
|
realm_len = packet->payload[realm_offset];
|
||||||
|
|
||||||
|
if((realm_offset+realm_len) < packet->payload_packet_len) {
|
||||||
|
char realm_str[48];
|
||||||
|
|
||||||
|
if(realm_len > sizeof(realm_str)-1)
|
||||||
|
realm_len = sizeof(realm_str)-1;
|
||||||
|
|
||||||
|
realm_offset += 1;
|
||||||
|
|
||||||
|
strncpy(realm_str, (char*)&packet->payload[realm_offset], realm_len);
|
||||||
|
realm_str[realm_len] = '\0';
|
||||||
|
for(i=0; i<realm_len; i++) realm_str[i] = tolower(realm_str[i]);
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[AS-REQ][Kerberos Realm][len: %u][%s]\n", realm_len, realm_str);
|
||||||
|
#endif
|
||||||
|
snprintf(flow->protos.kerberos.domain, sizeof(flow->protos.kerberos.domain), "%s", realm_str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if(msg_type == 0x0c) /* TGS-REQ */ {
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos] Processing TGS-REQ\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(body_offset < packet->payload_packet_len) {
|
||||||
|
u_int name_offset, padding_offset = body_offset + 4;
|
||||||
|
|
||||||
|
name_offset = padding_offset;
|
||||||
|
for(i=0; i<14; i++) if(packet->payload[name_offset] != 0x1b) name_offset++; /* ASN.1 */
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("name_offset=%u [%02X %02X] [byte 0 must be 0x1b]\n", name_offset, packet->payload[name_offset], packet->payload[name_offset+1]);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(name_offset < packet->payload_packet_len) {
|
||||||
|
u_int realm_len;
|
||||||
|
|
||||||
|
name_offset++;
|
||||||
|
realm_len = packet->payload[name_offset];
|
||||||
|
|
||||||
|
if((realm_len+name_offset) < packet->payload_packet_len) {
|
||||||
|
char realm_str[48];
|
||||||
|
|
||||||
|
if(realm_len > sizeof(realm_str)-1)
|
||||||
|
realm_len = sizeof(realm_str)-1;
|
||||||
|
|
||||||
|
name_offset += 1;
|
||||||
|
|
||||||
|
strncpy(realm_str, (char*)&packet->payload[name_offset], realm_len);
|
||||||
|
realm_str[realm_len] = '\0';
|
||||||
|
for(i=0; i<realm_len; i++) realm_str[i] = tolower(realm_str[i]);
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[TGS-REQ][s/dport: %u/%u][Kerberos Realm][len: %u][%s]\n", sport, dport, realm_len, realm_str);
|
||||||
|
#endif
|
||||||
|
snprintf(flow->protos.kerberos.domain, sizeof(flow->protos.kerberos.domain), "%s", realm_str);
|
||||||
|
|
||||||
|
/* If necessary we can decode sname */
|
||||||
|
|
||||||
|
if(flow->kerberos_buf.pktbuf) ndpi_free(flow->kerberos_buf.pktbuf);
|
||||||
|
flow->kerberos_buf.pktbuf = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(packet->udp)
|
||||||
|
ndpi_int_kerberos_add_connection(ndpi_struct, flow);
|
||||||
|
|
||||||
|
/* We set the protocol in the response */
|
||||||
|
if(flow->kerberos_buf.pktbuf != NULL) {
|
||||||
|
ndpi_free(flow->kerberos_buf.pktbuf);
|
||||||
|
flow->kerberos_buf.pktbuf = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} else if(msg_type == 0x0d) /* TGS-REP */ {
|
||||||
|
u_int16_t pad_data_len, cname_offset;
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos] Processing TGS-REP\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
koffsetp = koffset + 4;
|
||||||
|
pad_data_len = packet->payload[koffsetp];
|
||||||
|
/* Skip realm already filled in request */
|
||||||
|
cname_offset = pad_data_len + koffsetp + 15;
|
||||||
|
|
||||||
|
if(cname_offset < packet->payload_packet_len) {
|
||||||
|
u_int8_t cname_len = packet->payload[cname_offset];
|
||||||
|
|
||||||
|
if((cname_offset+cname_offset) < packet->payload_packet_len) {
|
||||||
|
char cname_str[48];
|
||||||
|
|
||||||
|
if(cname_len > sizeof(cname_str)-1)
|
||||||
|
cname_len = sizeof(cname_str)-1;
|
||||||
|
|
||||||
|
strncpy(cname_str, (char*)&packet->payload[cname_offset+1], cname_len);
|
||||||
|
cname_str[cname_len] = '\0';
|
||||||
|
for(i=0; i<cname_len; i++) cname_str[i] = tolower(cname_str[i]);
|
||||||
|
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[TGS-REP][s/dport: %u/%u][Kerberos Cname][len: %u][%s]\n",
|
||||||
|
sport, dport, cname_len, cname_str);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(cname_len && cname_str[cname_len-1] == '$') {
|
||||||
|
cname_str[cname_len-1] = '\0';
|
||||||
|
snprintf(flow->protos.kerberos.hostname, sizeof(flow->protos.kerberos.hostname), "%s", cname_str);
|
||||||
|
} else
|
||||||
|
snprintf(flow->protos.kerberos.username, sizeof(flow->protos.kerberos.username), "%s", cname_str);
|
||||||
|
|
||||||
|
ndpi_int_kerberos_add_connection(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(packet->payload_packet_len > 21 &&
|
||||||
|
packet->payload[16] == 0x05 &&
|
||||||
|
(packet->payload[21] == 0x0a ||
|
||||||
|
packet->payload[21] == 0x0c || packet->payload[21] == 0x0d || packet->payload[21] == 0x0e)) {
|
||||||
|
ndpi_int_kerberos_add_connection(ndpi_struct, flow);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
#ifdef KERBEROS_DEBUG
|
||||||
|
printf("[Kerberos][s/dport: %u/%u] Skipping packet: too long [kerberos_len: %u]\n",
|
||||||
|
sport, dport, kerberos_len);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(flow->protos.kerberos.domain[0] != '\0')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void init_kerberos_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
void init_kerberos_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
{
|
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
|
||||||
ndpi_set_bitmask_protocol_detection("Kerberos", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("Kerberos", ndpi_struct, detection_bitmask, *id,
|
||||||
NDPI_PROTOCOL_KERBEROS,
|
NDPI_PROTOCOL_KERBEROS,
|
||||||
ndpi_search_kerberos,
|
ndpi_search_kerberos,
|
||||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_OR_UDP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
||||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||||
ADD_TO_DETECTION_BITMASK);
|
ADD_TO_DETECTION_BITMASK);
|
||||||
|
|
||||||
*id += 1;
|
*id += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* kontiki.c
|
* kontiki.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* ldap.c
|
* ldap.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||||
* Copyright (C) 2011-19 - ntop.org
|
* Copyright (C) 2011-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
/*
|
|
||||||
* line.c
|
|
||||||
*
|
|
||||||
* Copyright (C) 2019 - ntop.org
|
|
||||||
*
|
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* nDPI is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#include "ndpi_protocol_ids.h"
|
|
||||||
|
|
||||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_LINE
|
|
||||||
|
|
||||||
#include "ndpi_api.h"
|
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_line_report_protocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
|
||||||
/* printf("-> payload_len=%u\n", flow->packet.payload_packet_len); */
|
|
||||||
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found line\n");
|
|
||||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_LINE, NDPI_PROTOCOL_LINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
void ndpi_search_line(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
|
||||||
|
|
||||||
NDPI_LOG_DBG(ndpi_struct, "search line\n");
|
|
||||||
|
|
||||||
if (packet->iph) {
|
|
||||||
/* 125.209.252.xxx */
|
|
||||||
if (((ntohl(packet->iph->saddr) & 0xFFFFFF00 /* 255.255.255.0 */) == 0x7DD1FC00) ||
|
|
||||||
((ntohl(packet->iph->daddr) & 0xFFFFFF00 /* 255.255.255.0 */) == 0x7DD1FC00)) {
|
|
||||||
if ((packet->payload_packet_len == 110) && (flow->packet.payload[0] == 0xB6) &&
|
|
||||||
(flow->packet.payload[1] == 0x18) && (flow->packet.payload[2] == 0x00) &&
|
|
||||||
(flow->packet.payload[3] == 0x6A)) {
|
|
||||||
ndpi_line_report_protocol(ndpi_struct, flow);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((packet->payload_packet_len == 46 && ntohl(get_u_int32_t(packet->payload, 0)) == 0xb6130006) ||
|
|
||||||
(packet->payload_packet_len == 8 && ntohl(get_u_int32_t(packet->payload, 0)) == 0xb6070004) ||
|
|
||||||
(packet->payload_packet_len == 16 && ntohl(get_u_int32_t(packet->payload, 0)) == 0xb609000c)) {
|
|
||||||
ndpi_line_report_protocol(ndpi_struct, flow);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void init_line_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
|
||||||
{
|
|
||||||
ndpi_set_bitmask_protocol_detection("Line", ndpi_struct, detection_bitmask, *id, NDPI_PROTOCOL_LINE,
|
|
||||||
ndpi_search_line, NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD,
|
|
||||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK);
|
|
||||||
|
|
||||||
*id += 1;
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* list.c
|
* list.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-19 - ntop.org
|
* Copyright (C) 2017-20 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* lotus_notes.c
|
* lotus_notes.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-19 - ntop.org
|
* Copyright (C) 2012-20 - ntop.org
|
||||||
*
|
*
|
||||||
* nDPI is free software: you can redistribute it and/or modify
|
* nDPI is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* mail_imap.c
|
* mail_imap.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-19 - ntop.org
|
* Copyright (C) 2016-20 - ntop.org
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include "ndpi_api.h"
|
#include "ndpi_api.h"
|
||||||
|
|
||||||
|
/* #define IMAP_DEBUG 1*/
|
||||||
|
|
||||||
static void ndpi_int_mail_imap_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
static void ndpi_int_mail_imap_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
@@ -45,16 +46,20 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
NDPI_LOG_DBG(ndpi_struct, "search IMAP_IMAP\n");
|
NDPI_LOG_DBG(ndpi_struct, "search IMAP_IMAP\n");
|
||||||
|
|
||||||
if (flow->l4.tcp.mail_imap_starttls == 2) {
|
#ifdef IMAP_DEBUG
|
||||||
|
printf("%s() [%s]\n", __FUNCTION__, packet->payload);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if(flow->l4.tcp.mail_imap_starttls == 2) {
|
||||||
NDPI_LOG_DBG2(ndpi_struct, "starttls detected\n");
|
NDPI_LOG_DBG2(ndpi_struct, "starttls detected\n");
|
||||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MAIL_IMAP);
|
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_MAIL_IMAP);
|
||||||
NDPI_DEL_PROTOCOL_FROM_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TLS);
|
NDPI_DEL_PROTOCOL_FROM_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_TLS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet->payload_packet_len >= 4 && ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a) {
|
if(packet->payload_packet_len >= 4 && ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a) {
|
||||||
// the DONE command appears without a tag
|
// the DONE command appears without a tag
|
||||||
if (packet->payload_packet_len == 6 && ((packet->payload[0] == 'D' || packet->payload[0] == 'd')
|
if(packet->payload_packet_len == 6 && ((packet->payload[0] == 'D' || packet->payload[0] == 'd')
|
||||||
&& (packet->payload[1] == 'O' || packet->payload[1] == 'o')
|
&& (packet->payload[1] == 'O' || packet->payload[1] == 'o')
|
||||||
&& (packet->payload[2] == 'N' || packet->payload[2] == 'n')
|
&& (packet->payload[2] == 'N' || packet->payload[2] == 'n')
|
||||||
&& (packet->payload[3] == 'E' || packet->payload[3] == 'e'))) {
|
&& (packet->payload[3] == 'E' || packet->payload[3] == 'e'))) {
|
||||||
@@ -62,37 +67,37 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (flow->l4.tcp.mail_imap_stage < 4) {
|
if(flow->l4.tcp.mail_imap_stage < 4) {
|
||||||
// search for the first space character (end of the tag)
|
// search for the first space character (end of the tag)
|
||||||
while (i < 20 && i < packet->payload_packet_len) {
|
while (i < 20 && i < packet->payload_packet_len) {
|
||||||
if (i > 0 && packet->payload[i] == ' ') {
|
if(i > 0 && packet->payload[i] == ' ') {
|
||||||
space_pos = i;
|
space_pos = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!((packet->payload[i] >= 'a' && packet->payload[i] <= 'z') ||
|
if(!((packet->payload[i] >= 'a' && packet->payload[i] <= 'z') ||
|
||||||
(packet->payload[i] >= 'A' && packet->payload[i] <= 'Z') ||
|
(packet->payload[i] >= 'A' && packet->payload[i] <= 'Z') ||
|
||||||
(packet->payload[i] >= '0' && packet->payload[i] <= '9') || packet->payload[i] == '*' || packet->payload[i] == '.')) {
|
(packet->payload[i] >= '0' && packet->payload[i] <= '9') || packet->payload[i] == '*' || packet->payload[i] == '.')) {
|
||||||
goto imap_excluded;
|
goto imap_excluded;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (space_pos == 0 || space_pos == (packet->payload_packet_len - 1)) {
|
if(space_pos == 0 || space_pos == (packet->payload_packet_len - 1)) {
|
||||||
goto imap_excluded;
|
goto imap_excluded;
|
||||||
}
|
}
|
||||||
// now walk over a possible mail number to the next space
|
// now walk over a possible mail number to the next space
|
||||||
i++;
|
i++;
|
||||||
if (i < packet->payload_packet_len && (packet->payload[i] >= '0' && packet->payload[i] <= '9')) {
|
if(i < packet->payload_packet_len && (packet->payload[i] >= '0' && packet->payload[i] <= '9')) {
|
||||||
while (i < 20 && i < packet->payload_packet_len) {
|
while (i < 20 && i < packet->payload_packet_len) {
|
||||||
if (i > 0 && packet->payload[i] == ' ') {
|
if(i > 0 && packet->payload[i] == ' ') {
|
||||||
space_pos = i;
|
space_pos = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!(packet->payload[i] >= '0' && packet->payload[i] <= '9')) {
|
if(!(packet->payload[i] >= '0' && packet->payload[i] <= '9')) {
|
||||||
goto imap_excluded;
|
goto imap_excluded;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (space_pos == 0 || space_pos == (packet->payload_packet_len - 1)) {
|
if(space_pos == 0 || space_pos == (packet->payload_packet_len - 1)) {
|
||||||
goto imap_excluded;
|
goto imap_excluded;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -103,23 +108,23 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
/* command = &(packet->payload[command_start]); */
|
/* command = &(packet->payload[command_start]); */
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((command_start + 3) < packet->payload_packet_len) {
|
if((command_start + 3) < packet->payload_packet_len) {
|
||||||
if ((packet->payload[command_start] == 'O' || packet->payload[command_start] == 'o')
|
if((packet->payload[command_start] == 'O' || packet->payload[command_start] == 'o')
|
||||||
&& (packet->payload[command_start + 1] == 'K' || packet->payload[command_start + 1] == 'k')
|
&& (packet->payload[command_start + 1] == 'K' || packet->payload[command_start + 1] == 'k')
|
||||||
&& packet->payload[command_start + 2] == ' ') {
|
&& packet->payload[command_start + 2] == ' ') {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
if (flow->l4.tcp.mail_imap_starttls == 1)
|
if(flow->l4.tcp.mail_imap_starttls == 1)
|
||||||
flow->l4.tcp.mail_imap_starttls = 2;
|
flow->l4.tcp.mail_imap_starttls = 2;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'U' || packet->payload[command_start] == 'u')
|
} else if((packet->payload[command_start] == 'U' || packet->payload[command_start] == 'u')
|
||||||
&& (packet->payload[command_start + 1] == 'I' || packet->payload[command_start + 1] == 'i')
|
&& (packet->payload[command_start + 1] == 'I' || packet->payload[command_start + 1] == 'i')
|
||||||
&& (packet->payload[command_start + 2] == 'D' || packet->payload[command_start + 2] == 'd')) {
|
&& (packet->payload[command_start + 2] == 'D' || packet->payload[command_start + 2] == 'd')) {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((command_start + 10) < packet->payload_packet_len) {
|
if((command_start + 10) < packet->payload_packet_len) {
|
||||||
if ((packet->payload[command_start] == 'C' || packet->payload[command_start] == 'c')
|
if((packet->payload[command_start] == 'C' || packet->payload[command_start] == 'c')
|
||||||
&& (packet->payload[command_start + 1] == 'A' || packet->payload[command_start + 1] == 'a')
|
&& (packet->payload[command_start + 1] == 'A' || packet->payload[command_start + 1] == 'a')
|
||||||
&& (packet->payload[command_start + 2] == 'P' || packet->payload[command_start + 2] == 'p')
|
&& (packet->payload[command_start + 2] == 'P' || packet->payload[command_start + 2] == 'p')
|
||||||
&& (packet->payload[command_start + 3] == 'A' || packet->payload[command_start + 3] == 'a')
|
&& (packet->payload[command_start + 3] == 'A' || packet->payload[command_start + 3] == 'a')
|
||||||
@@ -133,8 +138,8 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((command_start + 8) < packet->payload_packet_len) {
|
if((command_start + 8) < packet->payload_packet_len) {
|
||||||
if ((packet->payload[command_start] == 'S' || packet->payload[command_start] == 's')
|
if((packet->payload[command_start] == 'S' || packet->payload[command_start] == 's')
|
||||||
&& (packet->payload[command_start + 1] == 'T' || packet->payload[command_start + 1] == 't')
|
&& (packet->payload[command_start + 1] == 'T' || packet->payload[command_start + 1] == 't')
|
||||||
&& (packet->payload[command_start + 2] == 'A' || packet->payload[command_start + 2] == 'a')
|
&& (packet->payload[command_start + 2] == 'A' || packet->payload[command_start + 2] == 'a')
|
||||||
&& (packet->payload[command_start + 3] == 'R' || packet->payload[command_start + 3] == 'r')
|
&& (packet->payload[command_start + 3] == 'R' || packet->payload[command_start + 3] == 'r')
|
||||||
@@ -148,36 +153,71 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((command_start + 5) < packet->payload_packet_len) {
|
if((command_start + 5) < packet->payload_packet_len) {
|
||||||
if ((packet->payload[command_start] == 'L' || packet->payload[command_start] == 'l')
|
if((packet->payload[command_start] == 'L' || packet->payload[command_start] == 'l')
|
||||||
&& (packet->payload[command_start + 1] == 'O' || packet->payload[command_start + 1] == 'o')
|
&& (packet->payload[command_start + 1] == 'O' || packet->payload[command_start + 1] == 'o')
|
||||||
&& (packet->payload[command_start + 2] == 'G' || packet->payload[command_start + 2] == 'g')
|
&& (packet->payload[command_start + 2] == 'G' || packet->payload[command_start + 2] == 'g')
|
||||||
&& (packet->payload[command_start + 3] == 'I' || packet->payload[command_start + 3] == 'i')
|
&& (packet->payload[command_start + 3] == 'I' || packet->payload[command_start + 3] == 'i')
|
||||||
&& (packet->payload[command_start + 4] == 'N' || packet->payload[command_start + 4] == 'n')) {
|
&& (packet->payload[command_start + 4] == 'N' || packet->payload[command_start + 4] == 'n')) {
|
||||||
|
/* xxxx LOGIN "username" "password" */
|
||||||
|
char str[256], *item;
|
||||||
|
u_int len = packet->payload_packet_len > sizeof(str) ? sizeof(str) : packet->payload_packet_len;
|
||||||
|
|
||||||
|
strncpy(str, (const char*)packet->payload, len);
|
||||||
|
str[len] = '\0';
|
||||||
|
|
||||||
|
item = strchr(str, '"');
|
||||||
|
if(item) {
|
||||||
|
char *column;
|
||||||
|
|
||||||
|
item++;
|
||||||
|
column = strchr(item, '"');
|
||||||
|
|
||||||
|
if(column) {
|
||||||
|
column[0] = '\0';
|
||||||
|
snprintf(flow->protos.ftp_imap_pop_smtp.username,
|
||||||
|
sizeof(flow->protos.ftp_imap_pop_smtp.username),
|
||||||
|
"%s", item);
|
||||||
|
|
||||||
|
column = strchr(&column[1], '"');
|
||||||
|
if(column) {
|
||||||
|
item = &column[1];
|
||||||
|
column = strchr(item, '"');
|
||||||
|
|
||||||
|
if(column) {
|
||||||
|
column[0] = '\0';
|
||||||
|
snprintf(flow->protos.ftp_imap_pop_smtp.password,
|
||||||
|
sizeof(flow->protos.ftp_imap_pop_smtp.password),
|
||||||
|
"%s", item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'F' || packet->payload[command_start] == 'f')
|
} else if((packet->payload[command_start] == 'F' || packet->payload[command_start] == 'f')
|
||||||
&& (packet->payload[command_start + 1] == 'E' || packet->payload[command_start + 1] == 'e')
|
&& (packet->payload[command_start + 1] == 'E' || packet->payload[command_start + 1] == 'e')
|
||||||
&& (packet->payload[command_start + 2] == 'T' || packet->payload[command_start + 2] == 't')
|
&& (packet->payload[command_start + 2] == 'T' || packet->payload[command_start + 2] == 't')
|
||||||
&& (packet->payload[command_start + 3] == 'C' || packet->payload[command_start + 3] == 'c')
|
&& (packet->payload[command_start + 3] == 'C' || packet->payload[command_start + 3] == 'c')
|
||||||
&& (packet->payload[command_start + 4] == 'H' || packet->payload[command_start + 4] == 'h')) {
|
&& (packet->payload[command_start + 4] == 'H' || packet->payload[command_start + 4] == 'h')) {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'F' || packet->payload[command_start] == 'f')
|
} else if((packet->payload[command_start] == 'F' || packet->payload[command_start] == 'f')
|
||||||
&& (packet->payload[command_start + 1] == 'L' || packet->payload[command_start + 1] == 'l')
|
&& (packet->payload[command_start + 1] == 'L' || packet->payload[command_start + 1] == 'l')
|
||||||
&& (packet->payload[command_start + 2] == 'A' || packet->payload[command_start + 2] == 'a')
|
&& (packet->payload[command_start + 2] == 'A' || packet->payload[command_start + 2] == 'a')
|
||||||
&& (packet->payload[command_start + 3] == 'G' || packet->payload[command_start + 3] == 'g')
|
&& (packet->payload[command_start + 3] == 'G' || packet->payload[command_start + 3] == 'g')
|
||||||
&& (packet->payload[command_start + 4] == 'S' || packet->payload[command_start + 4] == 's')) {
|
&& (packet->payload[command_start + 4] == 'S' || packet->payload[command_start + 4] == 's')) {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'C' || packet->payload[command_start] == 'c')
|
} else if((packet->payload[command_start] == 'C' || packet->payload[command_start] == 'c')
|
||||||
&& (packet->payload[command_start + 1] == 'H' || packet->payload[command_start + 1] == 'h')
|
&& (packet->payload[command_start + 1] == 'H' || packet->payload[command_start + 1] == 'h')
|
||||||
&& (packet->payload[command_start + 2] == 'E' || packet->payload[command_start + 2] == 'e')
|
&& (packet->payload[command_start + 2] == 'E' || packet->payload[command_start + 2] == 'e')
|
||||||
&& (packet->payload[command_start + 3] == 'C' || packet->payload[command_start + 3] == 'c')
|
&& (packet->payload[command_start + 3] == 'C' || packet->payload[command_start + 3] == 'c')
|
||||||
&& (packet->payload[command_start + 4] == 'K' || packet->payload[command_start + 4] == 'k')) {
|
&& (packet->payload[command_start + 4] == 'K' || packet->payload[command_start + 4] == 'k')) {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'S' || packet->payload[command_start] == 's')
|
} else if((packet->payload[command_start] == 'S' || packet->payload[command_start] == 's')
|
||||||
&& (packet->payload[command_start + 1] == 'T' || packet->payload[command_start + 1] == 't')
|
&& (packet->payload[command_start + 1] == 'T' || packet->payload[command_start + 1] == 't')
|
||||||
&& (packet->payload[command_start + 2] == 'O' || packet->payload[command_start + 2] == 'o')
|
&& (packet->payload[command_start + 2] == 'O' || packet->payload[command_start + 2] == 'o')
|
||||||
&& (packet->payload[command_start + 3] == 'R' || packet->payload[command_start + 3] == 'r')
|
&& (packet->payload[command_start + 3] == 'R' || packet->payload[command_start + 3] == 'r')
|
||||||
@@ -186,8 +226,8 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((command_start + 12) < packet->payload_packet_len) {
|
if((command_start + 12) < packet->payload_packet_len) {
|
||||||
if ((packet->payload[command_start] == 'A' || packet->payload[command_start] == 'a')
|
if((packet->payload[command_start] == 'A' || packet->payload[command_start] == 'a')
|
||||||
&& (packet->payload[command_start + 1] == 'U' || packet->payload[command_start + 1] == 'u')
|
&& (packet->payload[command_start + 1] == 'U' || packet->payload[command_start + 1] == 'u')
|
||||||
&& (packet->payload[command_start + 2] == 'T' || packet->payload[command_start + 2] == 't')
|
&& (packet->payload[command_start + 2] == 'T' || packet->payload[command_start + 2] == 't')
|
||||||
&& (packet->payload[command_start + 3] == 'H' || packet->payload[command_start + 3] == 'h')
|
&& (packet->payload[command_start + 3] == 'H' || packet->payload[command_start + 3] == 'h')
|
||||||
@@ -203,8 +243,8 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((command_start + 9) < packet->payload_packet_len) {
|
if((command_start + 9) < packet->payload_packet_len) {
|
||||||
if ((packet->payload[command_start] == 'N' || packet->payload[command_start] == 'n')
|
if((packet->payload[command_start] == 'N' || packet->payload[command_start] == 'n')
|
||||||
&& (packet->payload[command_start + 1] == 'A' || packet->payload[command_start + 1] == 'a')
|
&& (packet->payload[command_start + 1] == 'A' || packet->payload[command_start + 1] == 'a')
|
||||||
&& (packet->payload[command_start + 2] == 'M' || packet->payload[command_start + 2] == 'm')
|
&& (packet->payload[command_start + 2] == 'M' || packet->payload[command_start + 2] == 'm')
|
||||||
&& (packet->payload[command_start + 3] == 'E' || packet->payload[command_start + 3] == 'e')
|
&& (packet->payload[command_start + 3] == 'E' || packet->payload[command_start + 3] == 'e')
|
||||||
@@ -217,26 +257,26 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((command_start + 4) < packet->payload_packet_len) {
|
if((command_start + 4) < packet->payload_packet_len) {
|
||||||
if ((packet->payload[command_start] == 'L' || packet->payload[command_start] == 'l')
|
if((packet->payload[command_start] == 'L' || packet->payload[command_start] == 'l')
|
||||||
&& (packet->payload[command_start + 1] == 'S' || packet->payload[command_start + 1] == 's')
|
&& (packet->payload[command_start + 1] == 'S' || packet->payload[command_start + 1] == 's')
|
||||||
&& (packet->payload[command_start + 2] == 'U' || packet->payload[command_start + 2] == 'u')
|
&& (packet->payload[command_start + 2] == 'U' || packet->payload[command_start + 2] == 'u')
|
||||||
&& (packet->payload[command_start + 3] == 'B' || packet->payload[command_start + 3] == 'b')) {
|
&& (packet->payload[command_start + 3] == 'B' || packet->payload[command_start + 3] == 'b')) {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'L' || packet->payload[command_start] == 'l')
|
} else if((packet->payload[command_start] == 'L' || packet->payload[command_start] == 'l')
|
||||||
&& (packet->payload[command_start + 1] == 'I' || packet->payload[command_start + 1] == 'i')
|
&& (packet->payload[command_start + 1] == 'I' || packet->payload[command_start + 1] == 'i')
|
||||||
&& (packet->payload[command_start + 2] == 'S' || packet->payload[command_start + 2] == 's')
|
&& (packet->payload[command_start + 2] == 'S' || packet->payload[command_start + 2] == 's')
|
||||||
&& (packet->payload[command_start + 3] == 'T' || packet->payload[command_start + 3] == 't')) {
|
&& (packet->payload[command_start + 3] == 'T' || packet->payload[command_start + 3] == 't')) {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'N' || packet->payload[command_start] == 'n')
|
} else if((packet->payload[command_start] == 'N' || packet->payload[command_start] == 'n')
|
||||||
&& (packet->payload[command_start + 1] == 'O' || packet->payload[command_start + 1] == 'o')
|
&& (packet->payload[command_start + 1] == 'O' || packet->payload[command_start + 1] == 'o')
|
||||||
&& (packet->payload[command_start + 2] == 'O' || packet->payload[command_start + 2] == 'o')
|
&& (packet->payload[command_start + 2] == 'O' || packet->payload[command_start + 2] == 'o')
|
||||||
&& (packet->payload[command_start + 3] == 'P' || packet->payload[command_start + 3] == 'p')) {
|
&& (packet->payload[command_start + 3] == 'P' || packet->payload[command_start + 3] == 'p')) {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'I' || packet->payload[command_start] == 'i')
|
} else if((packet->payload[command_start] == 'I' || packet->payload[command_start] == 'i')
|
||||||
&& (packet->payload[command_start + 1] == 'D' || packet->payload[command_start + 1] == 'd')
|
&& (packet->payload[command_start + 1] == 'D' || packet->payload[command_start + 1] == 'd')
|
||||||
&& (packet->payload[command_start + 2] == 'L' || packet->payload[command_start + 2] == 'l')
|
&& (packet->payload[command_start + 2] == 'L' || packet->payload[command_start + 2] == 'l')
|
||||||
&& (packet->payload[command_start + 3] == 'E' || packet->payload[command_start + 3] == 'e')) {
|
&& (packet->payload[command_start + 3] == 'E' || packet->payload[command_start + 3] == 'e')) {
|
||||||
@@ -244,8 +284,8 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((command_start + 6) < packet->payload_packet_len) {
|
if((command_start + 6) < packet->payload_packet_len) {
|
||||||
if ((packet->payload[command_start] == 'S' || packet->payload[command_start] == 's')
|
if((packet->payload[command_start] == 'S' || packet->payload[command_start] == 's')
|
||||||
&& (packet->payload[command_start + 1] == 'E' || packet->payload[command_start + 1] == 'e')
|
&& (packet->payload[command_start + 1] == 'E' || packet->payload[command_start + 1] == 'e')
|
||||||
&& (packet->payload[command_start + 2] == 'L' || packet->payload[command_start + 2] == 'l')
|
&& (packet->payload[command_start + 2] == 'L' || packet->payload[command_start + 2] == 'l')
|
||||||
&& (packet->payload[command_start + 3] == 'E' || packet->payload[command_start + 3] == 'e')
|
&& (packet->payload[command_start + 3] == 'E' || packet->payload[command_start + 3] == 'e')
|
||||||
@@ -253,7 +293,7 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
&& (packet->payload[command_start + 5] == 'T' || packet->payload[command_start + 5] == 't')) {
|
&& (packet->payload[command_start + 5] == 'T' || packet->payload[command_start + 5] == 't')) {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'E' || packet->payload[command_start] == 'e')
|
} else if((packet->payload[command_start] == 'E' || packet->payload[command_start] == 'e')
|
||||||
&& (packet->payload[command_start + 1] == 'X' || packet->payload[command_start + 1] == 'x')
|
&& (packet->payload[command_start + 1] == 'X' || packet->payload[command_start + 1] == 'x')
|
||||||
&& (packet->payload[command_start + 2] == 'I' || packet->payload[command_start + 2] == 'i')
|
&& (packet->payload[command_start + 2] == 'I' || packet->payload[command_start + 2] == 'i')
|
||||||
&& (packet->payload[command_start + 3] == 'S' || packet->payload[command_start + 3] == 's')
|
&& (packet->payload[command_start + 3] == 'S' || packet->payload[command_start + 3] == 's')
|
||||||
@@ -261,7 +301,7 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
&& (packet->payload[command_start + 5] == 'S' || packet->payload[command_start + 5] == 's')) {
|
&& (packet->payload[command_start + 5] == 'S' || packet->payload[command_start + 5] == 's')) {
|
||||||
flow->l4.tcp.mail_imap_stage += 1;
|
flow->l4.tcp.mail_imap_stage += 1;
|
||||||
saw_command = 1;
|
saw_command = 1;
|
||||||
} else if ((packet->payload[command_start] == 'A' || packet->payload[command_start] == 'a')
|
} else if((packet->payload[command_start] == 'A' || packet->payload[command_start] == 'a')
|
||||||
&& (packet->payload[command_start + 1] == 'P' || packet->payload[command_start + 1] == 'p')
|
&& (packet->payload[command_start + 1] == 'P' || packet->payload[command_start + 1] == 'p')
|
||||||
&& (packet->payload[command_start + 2] == 'P' || packet->payload[command_start + 2] == 'p')
|
&& (packet->payload[command_start + 2] == 'P' || packet->payload[command_start + 2] == 'p')
|
||||||
&& (packet->payload[command_start + 3] == 'E' || packet->payload[command_start + 3] == 'e')
|
&& (packet->payload[command_start + 3] == 'E' || packet->payload[command_start + 3] == 'e')
|
||||||
@@ -274,16 +314,23 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (saw_command == 1) {
|
if(saw_command == 1) {
|
||||||
if (flow->l4.tcp.mail_imap_stage == 3 || flow->l4.tcp.mail_imap_stage == 5) {
|
if((flow->l4.tcp.mail_imap_stage == 3)
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found MAIL_IMAP\n");
|
|| (flow->l4.tcp.mail_imap_stage == 5)
|
||||||
ndpi_int_mail_imap_add_connection(ndpi_struct, flow);
|
|| (flow->l4.tcp.mail_imap_stage == 7)
|
||||||
|
) {
|
||||||
|
if((flow->protos.ftp_imap_pop_smtp.username[0] != '\0')
|
||||||
|
|| (flow->l4.tcp.mail_imap_stage >= 7)) {
|
||||||
|
NDPI_LOG_INFO(ndpi_struct, "found MAIL_IMAP\n");
|
||||||
|
ndpi_int_mail_imap_add_connection(ndpi_struct, flow);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (packet->payload_packet_len > 1 && packet->payload[packet->payload_packet_len - 1] == ' ') {
|
if(packet->payload_packet_len > 1 && packet->payload[packet->payload_packet_len - 1] == ' ') {
|
||||||
NDPI_LOG_DBG2(ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"maybe a split imap command -> need next packet and imap_stage is set to 4.\n");
|
"maybe a split imap command -> need next packet and imap_stage is set to 4.\n");
|
||||||
flow->l4.tcp.mail_imap_stage = 4;
|
flow->l4.tcp.mail_imap_stage = 4;
|
||||||
@@ -294,7 +341,7 @@ void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
// skip over possible authentication hashes etc. that cannot be identified as imap commands or responses
|
// skip over possible authentication hashes etc. that cannot be identified as imap commands or responses
|
||||||
// if the packet count is low enough and at least one command or response was seen before
|
// if the packet count is low enough and at least one command or response was seen before
|
||||||
if ((packet->payload_packet_len >= 2 && ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a)
|
if((packet->payload_packet_len >= 2 && ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a)
|
||||||
&& flow->packet_counter < 6 && flow->l4.tcp.mail_imap_stage >= 1) {
|
&& flow->packet_counter < 6 && flow->l4.tcp.mail_imap_stage >= 1) {
|
||||||
NDPI_LOG_DBG2(ndpi_struct,
|
NDPI_LOG_DBG2(ndpi_struct,
|
||||||
"no imap command or response but packet count < 6 and imap stage >= 1 -> skip\n");
|
"no imap command or response but packet count < 6 and imap stage >= 1 -> skip\n");
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user