flow-tools-examples.1

来自「netflow,抓包」· 1 代码 · 共 286 行

1
286
字号
...\" $Header: /usr/src/docbook-to-man/cmd/RCS/docbook-to-man.sh,v 1.3 1996/06/17 03:36:49 fld Exp $...\"...\"	transcript compatibility for postscript use....\"...\"	synopsis:  .P! <file.ps>...\".de P!\\&..fl			\" force out current output buffer\\!%PB\\!/showpage{}def...\" the following is from Ken Flowers -- it prevents dictionary overflows\\!/tempdict 200 dict def tempdict begin.fl			\" prolog.sy cat \\$1\" bring in postscript file...\" the following line matches the tempdict above\\!end % tempdict %\\!PE\\!..sp \\$2u	\" move below the image...de pF.ie     \\*(f1 .ds f1 \\n(.f.el .ie \\*(f2 .ds f2 \\n(.f.el .ie \\*(f3 .ds f3 \\n(.f.el .ie \\*(f4 .ds f4 \\n(.f.el .tm ? font overflow.ft \\$1...de fP.ie     !\\*(f4 \{\.	ft \\*(f4.	ds f4\"'	br \}.el .ie !\\*(f3 \{\.	ft \\*(f3.	ds f3\"'	br \}.el .ie !\\*(f2 \{\.	ft \\*(f2.	ds f2\"'	br \}.el .ie !\\*(f1 \{\.	ft \\*(f1.	ds f1\"'	br \}.el .tm ? font underflow...ds f1\".ds f2\".ds f3\".ds f4\".ta 8n 16n 24n 32n 40n 48n 56n 64n 72n .TH "\fBflow-tools-examples\fP" "1".SH "NAME"\fBflow-tools-examples\fP \(em Example usage of flow-tools\&..SH "EXAMPLE - Configuring Cisco IOS Router".PPNetFlow is configured on each input interface, then global commands areused to specify the export destination\&.  To ensure a consistant sourceaddress address Loopback0 is configured as the export source\&..PP.nf\f(CWip cef distributedip flow-export version 5 origin-asip flow-export destination 10\&.0\&.0\&.100 5004ip flow-export source Loopback0interface Loopback0 ip address 10\&.1\&.1\&.1 255\&.255\&.255\&.255interface FastEthernet0/1/0  ip address 10\&.0\&.0\&.1 255\&.255\&.255\&.0 no ip directed-broadcast ip route-cache flow ip route-cache distributed\fR.fi.PP Many other options exist such as aggregated NetFlow and sampled NetFlow whichare detailed at \fI (link to URL http://www.cisco.com) \fR\&..SH "EXAMPLE - Configuring Cisco CatIOS Switch".PPSome Cisco Catalyst switches support a different implementation of NetFlowthat is performed on the supervisor\&.  With the cache based forwarding modelwhich is implemented in the Catalyst 55xx with Route Switch Module (RSM)and NetFlow Feature Card (NFFC), the RSM processes the first flow and theremaining packets in the flow are forwarded by the Supervisor\&.  This isalso implemented in the early versions of the 65xx with MSFC\&.  Thedeterministic forwarding model used in the 65xx with MSFC2 do not useNetFlow to determine the forwarding path, the flow cache is only usedfor statistics as in the current IOS implementations\&.  In all of of the above configurations flow exports arrive from both the RSM/MSFC andthe Supervisor engines as distinct streams\&.  In the worst cast the RSMexports in version 5 and the Supervisor exports in version 7\&.Fortunately flow-capture and flow-receive can sort all this out by processing flows from both sources and converting them to a common export format\&..PPThe router side running IOS is configured identically to the examplegiven above\&.  The CatIOS NetFlow Data Export configuration follows:.PP.PP.nf\f(CWset mls flow fullset mls nde version 7set mls nde 10\&.0\&.0\&.1 9800set mls nde enable\fR.fi.PP.PPWhen the 65xx is running in Native mode, from a users perspective the switch is only running IOS\&..PPMore detailed examples can be found on Cisco\&'s web site \fI (link to URL http://www.cisco.com) \fR\&..SH "EXAMPLE - Configuring Juniper Router".PPJuniper supports flow exports by the routing engine sampling packetheaders and aggregating them into flows\&.  Packet sampling is done by defining a firewall filter to accept and sample all traffic, applying that rule to the interface, then configuring the samplingforwarding option\&..PP.nf\f(CWinterfaces {    ge-0/3/0 {        unit 0 {            family inet {                filter {                    input all;                    output all;                }                address 10\&.0\&.0\&.1/24;            }        }    }firewall {    filter all {        term all {            then {                sample;                accept;            }        }    }}forwarding-options {    sampling {        input {            family inet {                rate 100;            }        }        output {            cflowd 10\&.0\&.0\&.100 {                port 9800;                version 5;            }        }    }}\fR.fi.PP.PPOther options exist such as aggregated flows which are detailed at \fI (link to URL http://www.juniper.net) \fR\&..SH "EXAMPLE - Network topology and \fBflow\&.acl\fP".PPThe network topology and flow\&.acl will be used for many of the examplesthat follow\&.  Flows are collected and stored in \fB/flows/R\fP\&..PP.nf                        ISP-A       ISP-B                         +           +                          +         +            IP=10\&.1\&.2\&.1/24 +       + IP=10\&.1\&.1\&.1/24                 ifIndex=2  +     +  ifIndex=1       interface=serial1/1   +   +   interface=serial0/0                             -----                             | R | Campus Router                             -----                             +   +           IP=10\&.1\&.4\&.1/24   +     +   IP=10\&.1\&.3\&.1/24                ifIndex=4  +       +  ifIndex=3    interface=Ethernet1/1 +         + interface=Ethernet0/0                         +           +                       Sales      Marketing.fi.PP.nf\f(CWip access-list standard sales permit 10\&.1\&.4\&.0 0\&.0\&.0\&.255ip access-list standard not_sales deny 10\&.1\&.4\&.0 0\&.0\&.0\&.255ip access-list standard marketing permit 10\&.1\&.3\&.0 0\&.0\&.0\&.255ip access-list standard not_marketing deny 10\&.1\&.3\&.0 0\&.0\&.0\&.255ip access-list standard campus permit 10\&.1\&.4\&.0 0\&.0\&.0\&.255ip access-list standard campus permit 10\&.1\&.3\&.0 0\&.0\&.0\&.255ip access-list standard not_campus deny 10\&.1\&.4\&.0 0\&.0\&.0\&.255ip access-list standard not_campus deny 10\&.1\&.3\&.0 0\&.0\&.0\&.255ip access-list standard evil_hacket permit host 10\&.6\&.6\&.6ip access-list standard spoofer permit host 10\&.9\&.9\&.9ip access-list standard multicast 224\&.0\&.0\&.0 15\&.255\&.255\&.255\fR.fi.PP.SH "EXAMPLE - Finding spoofed addresses".PPA common problem on the Internet is the use of "spoofed" (addressesthat are not assigned to an organization) for use in DoS attacks or compromising servers that rely on the source IP address for authentication\&..PPDisplay all flow records that originate from the campus and are sentto the Internet but are not using legal addresses\&..PP\fBflow-cat /flows/R | flow-filter -Snot_campus -I1,2 | flow-print\fP.PPSummary of the destinations of the internally spoofed addresses sorted by octets\&..PP\fBflow-cat /flows/R | flow-filter -Snot_campus -I1,2 | flow-stat -f8 -S2\fP.PPSummary of the sources of the internally spoofed addresses sorted by flows\&..PP\fBflow-cat /flows/R | flow-filter -Snot_campus -I1,2 | flow-stat -f9 -S1\fP.PPSummary of the internally spoofed sources and destination pairs sorted by packets\&..PP\fBflow-cat /flows/R | flow-filter -Snot_campus -I1,2 | flow-stat -f10 -S4\fP.PPDisplay all flow records that originate external to the campus that havecampus addresses\&.  Many times these can be attackers trying to exploit hostbased authentication mechanisms like unix r* commands\&.  Another commonsource is mobile clients which send packets with their campus addressesbefore obtaining a valid IP\&..PP\fBflow-cat /flows/R | flow-filter -Scampus -i1,2 | flow-print\fP.PPSummary of the destinations of the externally spoofed addresses sorted by octets\&..PP\fBflow-cat /flows/R | flow-filter -Scampus -i1,2 | flow-stat -f8 -S2\fP.SH "EXAMPLE - Locate hosts using or running services".PPFind all SMTP servers active during the collection periodthat have established connections to the Internet\&.  Summarize sortedby octets\&..PP\fBflow-cat /flows/R | flow-filter -I1,2 -P25 | flow-stat -f9 -S2\fP.PPFind all outbound NNTP connections to the Internet\&.  Summarize with sourceand destination IP sorted by octets\&..PP\fBflow-cat /flows/R | flow-filter -I1,2 -P119 | flow-stat -f10 -S3\fP.PPFind all inbound NNTP connections to the Internet\&.  Summarize with sourceand destination IP sorted by octets\&..PP\fBflow-cat /flows/R | flow-filter -i1,2 -P119 | flow-stat -f10 -S3\fP.SH "EXAMPLE - Multicast usage".PPSummarize Multicast S,G where sources are on campus\&..PP\fBflow-cat /flows/R | flow-filter -Dmulticast -I1,2 | flow-stat -f10 -S3\fP.PPSummarize Multicast S,G where sources are off campus\&..PP\fBflow-cat /flows/R | flow-filter -Dmulticast -i1,2 | flow-stat -f10 -S3\fP.SH "EXAMPLE - Find scanners".PPFind SMTP scanners with flow-dscan\&.  This will also find SMTP clients whichtry to contact many servers\&.  This behavior is characterized by a recent Microsoft worm\&..PP.PP.nf\fBtouch dscan\&.suppress\&.src dscan\&.suppress\&.dst\fP \fBflow-cat /flows/R | flow-filter -P25 | flow-dscan -b\fP.fi.SH "AUTHOR".PPMark Fullmer maf@splintered\&.net.SH "SEE ALSO".PP\fBflow-tools\fP(1)...\" created by instant / docbook-to-man, Sat 08 Jun 2002, 23:41

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?