Sponsored Content
Top Forums Shell Programming and Scripting write a script to parse some tcpdump output Post 302284319 by fedora on Thursday 5th of February 2009 09:41:30 AM
Old 02-05-2009
thanks a lot!

Never thought about this way. Digging more awk guides now Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To parse through the file and print output using awk or sed script

suppose if u have a file like that Hen ABCCSGSGSGJJJJK 15 Cock ABCCSGGGSGIJJJL 15 * * * * * * : * * * . * * * : Hen CFCDFCSDFCDERTF 30 Cock CHCDFCSDHCDEGFI 30 * . * * * * * * * : * * :* : : . The output shud be where there is : and . It shud... (4 Replies)
Discussion started by: cdfd123
4 Replies

2. Shell Programming and Scripting

analyzing tcpdump output

hello, i have a lot of pcap files (tcpdump output) that i want to compare. every tcpdump output has two file, server and client. what i want to do is: 1. take timestamp, source address, destination address, and packet id from each file (server and client) 2. find the packets sent from... (0 Replies)
Discussion started by: slumpia
0 Replies

3. Shell Programming and Scripting

Perl script to parse output and print it comma separated

I need to arrange output of SQL query into a comma separated format and I'm struggling with processing the output... The output is something like this: <Attribute1 name><x amount of white spaces><Atribute value> <Attribute2 name><x amount of white spaces><Atribute value> <Attribute3... (2 Replies)
Discussion started by: Juha
2 Replies

4. Shell Programming and Scripting

Script to parse TOP output for Excel

I'd like to parse TOP output file containing data like the below, and then be able to import the parsed file in to Excel where I can easily generate graphs. Ideally, the output would have a single column for each value in the output. Any thoughts on how to get started with this, or a better... (3 Replies)
Discussion started by: NoMasVentanas
3 Replies

5. Shell Programming and Scripting

Write Awk output to a file , inside script.

Hi, Can anyone please help me with this issue. I have a Awk command which take file as input, and provides the output having multiple lines, its working in command mode, but not if i plug it in script. #!/bin/ksh infile=a.txt outfile=b.txt awk ' BEGIN{ FS=OFS="|";ORS = "\n";... (1 Reply)
Discussion started by: sp999
1 Replies

6. Shell Programming and Scripting

Write output to a file using Korn shell script

All, Can anyone please help me with the below scenario in korn shell script. Can anyone please give me some hints to proceed on this. I have a Flat file of the below format. Input file format:... (1 Reply)
Discussion started by: sp999
1 Replies

7. Shell Programming and Scripting

tcpdump script to parse "packers captured" details

I want a script that would do as:- a) gives me packet capture account for each time it runs. b) be able to run at a particular time for specific period time duration (1 min). c) for each time it runs it saves the time / day. Is there a way where i can capture the details as seen in the... (2 Replies)
Discussion started by: lazerz
2 Replies

8. Shell Programming and Scripting

How to write this script:- check output word and send a mail?

Hi Guys, I am not Good at scripting. I need to write a script such that if output of command shows the particular word in output then send mail to abc@compay.com -bash-3.2$ ps -ef | grep bpbkar root 6040 1 0 13:05:19 ? 0:00 bpbkar -r 2678400 -ru root -dt 47395 -to 0... (20 Replies)
Discussion started by: manalisharmabe
20 Replies

9. Cybersecurity

Need Help with this TCPDUMP output...

Hello everyone, so I'm getting this tcpdump, and it looks like..quite a mess... Can anyone decipher this? I can tell that one IP is requesting DNS info? but I'm having trouble finding out what some of the fields actually mean.. 19:44:50.707637 IP 66.81.1.252.53 > 64.147.113.139.28638: 52313... (4 Replies)
Discussion started by: Lost in Cyberia
4 Replies

10. Shell Programming and Scripting

Need a script to parse data and output to csv

I am not too savvy with arrays and am assuming that what I am looking for needs arrays. This is my requirement. So I have the raw data that gets updated to a log as shown below StudentInfo: FullInfo = { Address = Newark Age = 20 Name= John } StudentInfo:... (2 Replies)
Discussion started by: sidnow
2 Replies
ipftest(1)						      General Commands Manual							ipftest(1)

NAME
ipftest - test packet filter rules with arbitrary input. SYNOPSIS
ipftest [ -6bCdDoRvx ] [ -F input-format ] [ -i <filename> ] [ -I interface ] [ -l <filename> ] [ -N <filename> ] [ -P <filename> ] [ -r <filename> ] [ -S <ip_address> ] [ -T <optionlist> ] DESCRIPTION
ipftest is provided for the purpose of being able to test a set of filter rules without having to put them in place, in operation and pro- ceed to test their effectiveness. The hope is that this minimises disruptions in providing a secure IP environment. ipftest will parse any standard ruleset for use with ipf, ipnat and/or ippool and apply input, returning output as to the result. However, ipftest will return one of three values for packets passed through the filter: pass, block or nomatch. This is intended to give the opera- tor a better idea of what is happening with packets passing through their filter ruleset. At least one of -N, -P or -r must be specified. OPTIONS
-6 Use IPv6. -b Cause the output to be a brief summary (one-word) of the result of passing the packet through the filter; either "pass", "block" or "nomatch". This is used in the regression testing. -C Force the checksums to be (re)calculated for all packets being input into ipftest. This may be necessary if pcap files from tcpdump are being fed in where there are partial checksums present due to hardware offloading. -d Turn on filter rule debugging. Currently, this only shows you what caused the rule to not match in the IP header checking (addresses/netmasks, etc). -D Dump internal tables before exiting. This excludes log messages. -F This option is used to select which input format the input file is in. The following formats are available: etherfind, hex, pcap, snoop, tcpdump,text. etherfind The input file is to be text output from etherfind. The text formats which are currently supported are those which result from the following etherfind option combinations: etherfind -n etherfind -n -t hex The input file is to be hex digits, representing the binary makeup of the packet. No length correction is made, if an incor- rect length is put in the IP header. A packet may be broken up over several lines of hex digits, a blank line indicating the end of the packet. It is possible to specify both the interface name and direction of the packet (for filtering purposes) at the start of the line using this format: [direction,interface] To define a packet going in on le0, we would use [in,le0] - the []'s are required and part of the input syntax. pcap The input file specified by -i is a binary file produced using libpcap (i.e., tcpdump version 3). Packets are read from this file as being input (for rule purposes). An interface maybe specified using -I. snoop The input file is to be in "snoop" format (see RFC 1761). Packets are read from this file and used as input from any inter- face. This is perhaps the most useful input type, currently. tcpdump The input file is to be text output from tcpdump. The text formats which are currently supported are those which result from the following tcpdump option combinations: tcpdump -n tcpdump -nq tcpdump -nqt tcpdump -nqtt tcpdump -nqte text The input file is in ipftest text input format. This is the default if no -F argument is specified. The format used is as follows: "in"|"out" "on" if ["tcp"|"udp"|"icmp"] srchost[,srcport] dsthost[,destport] [FSRPAU] This allows for a packet going "in" or "out" of an interface (if) to be generated, being one of the three main protocols (option- ally), and if either TCP or UDP, a port parameter is also expected. If TCP is selected, it is possible to (optionally) supply TCP flags at the end. Some examples are: # a UDP packet coming in on le0 in on le0 udp 10.1.1.1,2210 10.2.1.5,23 # an IP packet coming in on le0 from localhost - hmm :) in on le0 localhost 10.4.12.1 # a TCP packet going out of le0 with the SYN flag set. out on le0 tcp 10.4.12.1,2245 10.1.1.1,23 S -i <filename> Specify the filename from which to take input. Default is stdin. -I <interface> Set the interface name (used in rule matching) to be the name supplied. This is useful where it is not otherwise possible to asso- ciate a packet with an interface. Normal "text packets" can override this setting. -l <filename> Dump log messages generated during testing to the specified file. -N <filename> Specify the filename from which to read NAT rules in ipnat(5) format. -o Save output packets that would have been written to each interface in a file /tmp/interface_name in raw format. -P <filename> Read IP pool configuration information in ippool(5) format from the specified file. -r <filename> Specify the filename from which to read filter rules in ipf(5) format. -R Don't attempt to convert IP addresses to hostnames. -S <ip_address> The IP address specified with this option is used by ipftest to determine whether a packet should be treated as "input" or "output". If the source address in an IP packet matches then it is considered to be inbound. If it does not match then it is considered to be outbound. This is primarily for use with tcpdump (pcap) files where there is no in/out information saved with each packet. -T <optionlist> This option simulates the run-time changing of IPFilter kernel variables available with the -T option of ipf. The optionlist param- eter is a comma separated list of tuning commands. A tuning command is either "list" (retrieve a list of all variables in the ker- nel, their maximum, minimum and current value), a single variable name (retrieve its current value) and a variable name with a fol- lowing assignment to set a new value. See ipf(8) for examples. -v Verbose mode. This provides more information about which parts of rule matching the input packet passes and fails. -x Print a hex dump of each packet before printing the decoded contents. SEE ALSO
ipf(5), ipf(8), tcpdump(8), BUGS
Not all of the input formats are sufficiently capable of introducing a wide enough variety of packets for them to be all useful in testing. ipftest(1)
All times are GMT -4. The time now is 06:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy