Comments (6)
Seems you can remove a single entry with:
echo "-drop_domain_blacklist:RISK_DOMAIN_domain.com" > /proc/net/xt_ndpi/host_proto
Interestingly when running the command with "-" prefix repeatedly, it will add and remove the entry:
echo "-drop_domain_blacklist:RISK_DOMAIN_domain.com" > /proc/net/xt_ndpi/host_proto
cat /proc/net/xt_ndpi/host_proto | grep "drop_domain_blacklist:RISK_DOMAIN_domain.com"
drop_domain_blacklist:RISK_DOMAIN_domain.com
echo "-drop_domain_blacklist:RISK_DOMAIN_domain.com" > /proc/net/xt_ndpi/host_proto
cat /proc/net/xt_ndpi/host_proto | grep "drop_domain_blacklist:RISK_DOMAIN_domain.com"
echo "-drop_domain_blacklist:RISK_DOMAIN_domain.com" > /proc/net/xt_ndpi/host_proto
cat /proc/net/xt_ndpi/host_proto | grep "drop_domain_blacklist:RISK_DOMAIN_domain.com"
drop_domain_blacklist:RISK_DOMAIN_domain.com
Is there a way to remove multiple entries with a single command?
echo "reset" > /proc/net/xt_ndpi/host_proto, seems to reset all not just custom host_proto.
from ndpi.
See 3deea54
from ndpi.
Thank you.
from ndpi.
On further investigation the following doesn't actually cause all domains to match:
echo "add_custom drop_domain_blacklist" > /proc/net/xt_ndpi/proto
echo "drop_domain_blacklist:RISK_DOMAIN_test.com" > /proc/net/xt_ndpi/host_proto
iptables -I FORWARD -m ndpi --all --risk 27 -j DROP
It causes all defined in /proc/net/xt_ndpi/host_proto to match:
cat /proc/net/xt_ndpi/host_proto | grep -w .google.
Google:.google.,.gstatic.com,gstatic.com,ggpht.com,.goog
cat /proc/net/xt_ndpi/host_proto | grep -w centos
cat /proc/net/xt_ndpi/host_proto | grep -w drop_domain_blacklist
drop_domain_blacklist:RISK_DOMAIN_test.com
host www.google.com
;; connection timed out; no servers could be reached
host www.centos.org
www.centos.org has address 52.56.83.118
host test.com
;; connection timed out; no servers could be reached
echo "reset" > /proc/net/xt_ndpi/host_proto
echo "drop_domain_blacklist:RISK_DOMAIN_test.com" > /proc/net/xt_ndpi/host_proto
cat /proc/net/xt_ndpi/host_proto | grep -w .google.
cat /proc/net/xt_ndpi/host_proto | grep -w centos
cat /proc/net/xt_ndpi/host_proto | grep -w drop_domain_blacklist
drop_domain_blacklist:RISK_DOMAIN_test.com
host www.google.com
www.google.com has address 216.58.223.132
host www.centos.org
www.centos.org has address 52.56.83.11
host test.com
;; connection timed out; no servers could be reached
from ndpi.
Works as expected if matched directly instead of via risk:
echo "add_custom drop_domain_blacklist" > /proc/net/xt_ndpi/proto
echo "drop_domain_blacklist:test.com" > /proc/net/xt_ndpi/host_proto
iptables -I FORWARD -m ndpi --proto drop_domain_blacklist -j DROP
It causes only hosts defined in custom proto to match:
cat /proc/net/xt_ndpi/host_proto | grep -w .google.
Google:.google.,.gstatic.com,gstatic.com,ggpht.com,.goog
cat /proc/net/xt_ndpi/host_proto | grep -w centos
cat /proc/net/xt_ndpi/host_proto | grep -w drop_domain_blacklist
drop_domain_blacklist:test.com
host www.google.com
www.google.com has address 216.58.223.132
host www.centos.org
www.centos.org has address 52.56.83.118
host test.com
;; connection timed out; no servers could be reached
from ndpi.
Additional observation is that all configured host_proto are logged with R=27 in Flowinfo log.
from ndpi.
Related Issues (20)
- Risk add command doesn't match actual rule. HOT 5
- protocol line and linecall not recognised by iptables HOT 2
- modify iptables extension for better performance HOT 5
- Policy Based Routing does not work. HOT 10
- New build issues of master HOT 1
- Валятся тесты из папки tests после сборки HOT 1
- Question about Flow Risk HOT 4
- No pkg-config --variable=xtlibdir xtables HOT 3
- Typo in main.c (acctounting instead of accounting) HOT 1
- Linux 6.6: build errors HOT 10
- Kernel panic when syncing conntrack entries with conntrackd HOT 5
- All defined host protocols match risk id 27 (Risky Domain Name) HOT 7
- bittorrent.c: detected write beyond size of field HOT 1
- ndpi_network_list.c.inc can no longer be compiled after merge HOT 2
- Question about echo command HOT 1
- Seeking Advice on Updating nDPI on VPS Servers HOT 1
- unresolved symbol __aarch64_ldadd8_sync on aarch64 HOT 4
- Inconsistent BitTorrent Filtering with nDPI HOT 4
- Handling large host_proto lists HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ndpi.