linux - iptable rule to drop packet with a specific substring in payload -


I am trying to write rules to leave any packet, even if it is outgoing, incoming or forwarded, Which is a specific TCP or sub string in udp payload, how do I do it?

You will need a kernel compiled with Netfilter "String Match Support" enabled.

Then you can

  iptables -A INPUT -m string - ALBA bm - string "test" - J drop IPTable - A output - M string - LLM BM - String "Test" - J Drop IPTable - A forward-M string - LLM BM - String "Test" - J Drop  

Check the result

  Iptables -l  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -