You are not logged in.

#1 2021-05-21 07:27:01

light9876
Member
Registered: 2020-01-05
Posts: 131

[SOLVED] Iptables blocking ignores strings containing '.'

On my LineageOS phone, I use the following rule to block a certain app from accessing adult websites:

sh -c 'iptables -A OUTPUT -m owner --uid-owner 10114 -m string --string ".xxx" --algo kmp -j REJECT'

But I just noticed that on archlinux, any rule with '.' in it, does not work, for example:

sudo iptables -A OUTPUT -j DROP -m string --string ".mobi" --algo kmp

whereas any rule not containing '.' works okay ( for example this one matches www.randomsite.mobi or www.mymobile.com )

sudo iptables -A OUTPUT -j DROP -m string --string "mobi" --algo kmp

Last edited by light9876 (2021-10-16 19:04:31)

Offline

#2 2021-10-16 19:04:21

light9876
Member
Registered: 2020-01-05
Posts: 131

Re: [SOLVED] Iptables blocking ignores strings containing '.'

I eventually solved this by using a transparent proxy.

Offline

Board footer

Powered by FluxBB