|
NAMEyafMeta2Pcap - YAF PCAP Metadata File Parser and PCAP CreatorSYNOPSISyafMeta2Pcap [--pcap-meta-file META_FILE_PATTERN] [--pcap PCAP_FILE_PATTERN] [--caplist CAP_FILE_NAME] [--metalist META_FILE_NAME] [--out OUTPUT_SPECIFIER] [--hash FLOW_KEY_HASH] [--time FLOW_START_MILLISECONDS] [--etime FLOW_END_MILLISECONDS] [--packets NUM_PACKETS] [--yaf-program PATH_TO_YAF] [--verbose] DESCRIPTIONyaf has several PCAP export options available. yaf will create a pipe-delimited file that contains information to assemble a PCAP file for any particular flow. yafMeta2Pcap parses the metadata file created by yaf and creates a PCAP file for the given flow identified by the flow key hash and start time.yafMeta2Pcap has the ability to read IPFIX from getFlowKeyHash on stdin to avoid typing the flow key hash and start time on the command line. yafMeta2Pcap will accept the first 2 records from getFlowKeyHash. If the first 2 records have the same start time, yafMeta2Pcap will sum the values for packetTotalCount to determine the total number of packets to search for (to account for uniflows). yafMeta2Pcap will only search for the first hash and start time it receives. See below for examples for using IPFIX input. OPTIONSThe following options are required for yafMeta2Pcap to create the PCAP file.
ExamplesIn the following examples, the dollar sign ("$") represents the shell prompt. The text after the dollar sign represents the command line. Lines have been wrapped for improved readability, and the back slash ("\") is used to indicate a wrapped line.The following example shows how to run yaf,
getFlowKeyHash, and yafMeta2Pcap to create a PCAP for a given
flow.
$ yaf --in /data/some_large_file.pcap --out /data/ipfix.yaf \ --pcap-meta-file /tmp/pcap-info $ getFlowKeyHash --sip4 10.10.25.11 --dip4 10.10.26.12 --sport 1586 \ --dport 80 --protocol 6 --vlan 3 --date 2011-03-21 \ --time 16:15:54.256 sIP| dIP|sPort|dPort|pro| vlan| hash| ms 10.10.25.11| 10.10.26.12| 1586| 80| 6| 3| 100819735| 1300724154256 FILE PATH: 256/100819735-2011321161554_0.pcap $ yafMeta2Pcap --pcap-meta-file /tmp/pcap-info20150107141533_00000.meta \ --pcap /data/some_large_file.pcap \ --out /data/my-new-pcap.pcap \ --hash 100819735 --time 1300724154 The following example shows how to run getFlowKeyHash directly to yafMeta2Pcap and use environment variables. $ export YAF_PCAP_META_FILE=/tmp/pcap-info20150107141533_00000.meta $ export YAF_CAPLIST=/tmp/yafcaplist.txt $ getFlowKeyHash --sip4 10.10.25.11 --dip4 10.10.26.12 --sport 1586 \ --dport 80 --protocol 6 --vlan 3 --date 2011-03-21 \ --time 16:15:54.256 -I | yafMeta2Pcap -o /data/my-new-pcap -n 10 The following example demonstrates how to use SiLK tools with getFlowKeyHash and yafMeta2Pcap. This assumes the appropriate environment variables are set. $ rwfilter --application=80 --pass-dest=stdout --max-pass-records=2 file.rw | \ rwsilk2ipfix | getFlowKeyHash -I | yafMeta2Pcap -o /data/mynewpcap.pcap The following example shows how to configure yaf to create rolling PCAP files and use yafMeta2Pcap to create a PCAP for a specific flow. $ yaf --in eth0 --out localhost --ipfix tcp --ipfix-port 18000 \ --pcap-meta-file /tmp/pcap-info --pcap /data/pcap \ --live pcap --index-pcap $ getFlowKeyHash --sip4 10.10.25.11 --dip4 10.10.26.12 --sport 1586 \ --dport 80 --protocol 6 --vlan 3 --date 2011-03-21 \ --time 16:15:54.256 sIP| dIP|sPort|dPort|pro| vlan| hash| ms 10.10.25.11| 10.10.26.12| 1586| 80| 6| 3| 100819735| 1300724154256 FILE PATH: 256/100819735-2011321161554_0.pcap $ yafMeta2Pcap --pcap-meta-file /tmp/pcap-info20150107141533_00000.meta \ --out /data/my-new-pcap.pcap \ --hash 100819735 --time 1300724154 The following example shows how to run yaf creating rolling PCAP files and use yafMeta2Pcap to create a PCAP file for a particular flow. $ yaf --in eth0 --out localhost --ipfix tcp --ipfix-port 18000 \ --pcap-meta-file /tmp/pcap-info --pcap /data/pcap \ --live pcap $ yafMeta2Pcap --pcap-meta-file="/tmp/pcap-info*"\ -o /data/new.pcap \ --hash 100819735 --time 1300724154 The following example shows how to run yaf over a list of pcap files and use yafMeta2Pcap to create a PCAP for a specific flow $ yaf --in /tmp/caplist.txt --out /tmp/yaffile.yaf \ --pcap-meta-file /tmp/pcap-info --caplist $ yafMeta2Pcap --caplist /tmp/caplist.txt -o flow.pcap \ --hash 100819735 --time 1300724154 \ --pcap-meta-file "/tmp/pcap-info*" -v Found 1 packets that match criteria. Known IssuesIf the pcap-meta-file was generated in a way that it has the form:hash | stime | path_to_pcap and an OUTPUT_SPECIFIER is provided to --out, yafMeta2Pcap creates a temporary file with the PCAP file names that contain the flow it is searching for. This temporary file is placed in /tmp by default, but the location can be configured through the use of the TMPDIR environment variable. The temporary file is deleted upon termination of yafMeta2Pcap. Bug reports may be sent directly to the Network Situational Awareness team at <netsa-help@cert.org>. AUTHORSEmily Sarneso and the CERT/CC Engineering Team, <http://www.cert.org/netsa>.SEE ALSOyaf(1), getFlowKeyHash(1)
Visit the GSP FreeBSD Man Page Interface. |