Community discussions

MikroTik App
 
awarmanf
just joined
Topic Author
Posts: 15
Joined: Thu Apr 03, 2008 2:04 pm

match content of packets (hex values)

Mon Apr 26, 2010 12:29 pm

Can I match content of packets with hex values without using layer7 ?
I want to match packets with containing hex values of "16030100410100003d0301".
On linux, I use iptables to match those packets with this rule:
iptables -I FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST,PSH ACK,PSH -m string --to 256 --hex-string '|16030100410100003d0301|' --algo bm -j LOG --log-prefix "ULTRASURF: "
And it works perfectly.

On the mikrotik I fill in the content of the mangle rule with this "0x16030100410100003d0301" (without quotes) but it doesn't work.

Thanks in advance.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7056
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: match content of packets (hex values)

Mon Apr 26, 2010 2:19 pm

You can try content as follows:
[admin@MikroTik] /ip firewall mangle> add chain=prerouting content="\16\03\01\00"
 
awarmanf
just joined
Topic Author
Posts: 15
Joined: Thu Apr 03, 2008 2:04 pm

Re: match content of packets (hex values)

Thu Apr 29, 2010 8:46 am

You can try content as follows:
[admin@MikroTik] /ip firewall mangle> add chain=prerouting content="\16\03\01\00"
Sory, that rule is not working.

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], lubara and 161 guests