Want to block this URL STRING with IPTABLES. Need to know specific command.
"GET /affiliate/5/campaigns?api_key=duO5gVw3s0&affiliate_id=67647&format=json HTTP/1.0" 404 785 "-" "Dalvik/1.6.0 (Linux; U; Android 4.4.4; XT1032 Build/KXB21.14-L1.40)"
Want to use this to block it. I just want to block the URL path. Its not working though any tips?
iptables -A INPUT -m string --algo bm --string "GET /affiliate/5/campaigns?api_key=duO5gVw3s0&affiliate_id=67647&format=json" -j DROP
FATAL: Could not load /lib/modules/2.6.32-042stab108.1/modules.dep: No such file or directory
iptables -L
and make sure the strings match exactly. If they do, then consider starting with a shorter string to make sure the principle works, then extending it to see where it stops working. Also make sure there isn't an earlier rule in iptables that is permitting the traffic and bypassing this rule.dmesg
if not.