ETTERFILTER(8) System Manager's Manual ETTERFILTER(8) (NAME) etterfilter - ettercap (SYNOPSIS) etterfilter [OPTIONS] FILE (DESCRIPTION) etterfilter JIT ettercap(8) . ettercap . ettercap . (OPTIONS) (GENERAL OPTIONS) -o, --output . filter.ef . -t, --test . etterfilter . <<>> . -d, --debug . ( etterfilter -ddd ...). -w, --suppress-warnings . . (STANDARD OPTIONS) -v, --version . -h, --help . (SCRIPTS SYNTAX) . if . if if/else . C if ({}) . : if ( . ( . : if (conditions) { } func(args...); if . || () && () . : if (tcp.src == 21 && search(DATA.data, "ettercap")) { } . . && . : && || . : if (ip.proto == UDP || ip.proto == TCP && tcp.src == 80) { } if (ip.proto == TCP && tcp.src == 80 || ip.proto == UDP) { } udp http . tcp . if . etterfilter IP ip.proto IPv4 IPv6 ipv6.nh. L4 ip.proto / ipv6.nh . L3 eth.proto . : if (eth.proto == IP && ip.proto == TCP && tcp.dst == 80 || tcp.src == 80) { } if (eth.proto == IP6 && ipv6.nh == TCP && tcp.dst == 80 || tcp.src == 80) { } if (tcp.dst == 80 || tcp.src == 80) { } http IPv4 http IPv6 . http IP . (;) . == ip . ip ( '192.168.0.7' '2001:db8::2'). <<>> (<) <<>> (>) << >> (<=) << >> (>=) . (lvalue) ( ). : if (DATA.data + 20 == "ettercap" && ip.ttl > 16) { } = (lvalue) ( ). (rvalue) . : ip.ttl = 0xff; DATA.data + 7 = "ettercap NG"; (inc) (dec) . += -= . . : ip.ttl += 5; etter.filter.examples . (OFFSET DEFINITION) . . L iso/osi O S . . 'vp + n' . . 'name.field.subfield' . ip.ttl Time To Live IP . . 'ip.ttl + 1' ip.proto IP IP . etterfilter IPv6 IPv4 IPv6 ipv6.nh . etterfilter.tbl . . etterfilter.tbl . (SCRIPTS FUNCTIONS) search(where, what) what where . DATA.data DECODED.data . DATA ( TCP UDP) / (dissectors) . SSH DECODED.data data . what . . : search(DATA.data, "\x41\x42\x43") regex(where, regex) regex where (true) . DECODED.data DATA.data search regex . : regex . : regex(DECODED.data, ".*login.*") pcre_regex(where, pcre_regex ... ) (Perl Compatible Regular Expression) . DATA DECODED DATA . . . . . n$ . ( pcre_regex(DATA.data, "^var1=([:digit:]*)&var2=([:digit:]*)", "var1=$2&var2=$1") var1 var2 ). : pcre ettercap libpcre . pcre libpcre . -w . : pcre_regex(DATA.data, ".*foo$") pcre_regex(DATA.data, "([^ ]*) bar ([^ ]*)", "foo $1 $2") replace(what, with) what with . . DATA.data . DECODED.data . : replace("ethercap", "ettercap") replace("\x00\x00\xa2", "\x00\x01\xa2") inject(what) what . DATA.data . inject() drop() . . log() what inject() . : inject("./fake_packet") log(what, where) what where . . -L ettercap etterlog(8) . where EC_UID ( etter.conf(5) ). : log(DECODED.data, "/tmp/interesting.log") msg(message) (User Messages) . . : msg("Packet filtered successfully") drop() << >> . . : drop() kill() ( ). TCP RST . UDP ICMP PORT UNREACHABLE . : kill() exec(command) . . . (fork) (asynchronous) . : exec("/bin/cat /tmp/foo >> /tmp/bar") execinject(command) inject . DATA.data . execinject() drop() . . : execinject("/bin/cat /tmp/foo") execreplace(command) replace . stdin . DATA.data . . : execreplace("tr A-Z a-z") random(where, offset, length) length where . length where length . offset where . where DATA.data DECODED.data ip.src tcp.dst . : random(DATA.data, 0, 16) random(ipv6.src, 8, 8) (data) . ( ) IPv6 IPv6 . exit() . 'if' . : exit() (EXAMPLES) etterfilter . etterfilter filter.ecf -o filter.ef filter.ecf filter.ef (ORIGINAL AUTHORS) Alberto Ornaghi (ALoR) Marco Valleri (NaGA) (PROJECT STEWARDS) Emilio Escobar (exfil) Eric Milam (Brav0Hax) (OFFICIAL DEVELOPERS) Mike Ryan (justfalter) Gianfranco Costamagna (LocutusOfBorg) Antonio Collarino (sniper) Ryan Linn Jacob Baines (CONTRIBUTORS) Dhiru Kholia (kholia) Alexander Koeppe (koeppea) Martin Bos (PureHate) Enrique Sanchez Gisle Vanem Johannes Bauer Daten (Bryan Schneiders) (SEE ALSO) etter.filter.examples ettercap(8) etterlog(8) etter.conf(5) ettercap_curses(8) ettercap_plugins(8) ettercap-pkexec(8) ettercap 0.8.4.1 ETTERFILTER(8)