Matching small packets using tcng
Hi.
Does anyone know how to create a rule using tcng that functions like this iptables rule?
iptables -t mangle -A PREROUTING -p tcp --dport 22 --syn -m \
state --state NEW -m length --length 40:68 -j MARK --set-mark 22
I tried defining something like this, but it seems to incorrectly specify a length constraint:
class( <$ack> )
if ip_hl = 0x5 &&
(ip_len & 0xffc0) &&
(raw[33].b >> 4) & 1;
Thanks!
Signature · 8 lines
Jason Boxman Perl Programmer / *NIX Systems Administrator Shimberg Center for Affordable Housing | University of Florida http://edseek.com/ - Linux and FOSS stuff _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 5 lines · Jason Boxman
Hi.
Does anyone know how to create a rule using tcng that functions like this iptables rule?
<snip>
Quoted 4 lines
class( <$ack> )
ifip_hl=0x5&&
(ip_len&0xffc0) &&
(raw[33].b >> 4) & 1;
The correct rule appears to be:
if ip_hl = 0x5 &&
! (ip_len & 0xffc0) &&
(raw[33].b >> 4) & 0xff
Using '&& tcp_ACK' didn't seem to have the desired effect.
Quoted 1 line
Thanks!
Signature · 8 lines
Jason Boxman Perl Programmer / *NIX Systems Administrator Shimberg Center for Affordable Housing | University of Florida http://edseek.com/ - Linux and FOSS stuff _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/