desperado618
MIS
Below is a sample VPN packet that has fixed byte positions with a space delimiter. I would like to print the "type" and "value" matches to the screen. For example. Using the packet below i would like to print the following:
enc type is 3des
hash type is sha1
auth type is preshare
group type is modp1024
life type is sec
lifeduration is 0348
Any information would be greaty appreciated.
Also I would like this done with a bash script.
14:28:20.032075 172.26.60.3.500 > 172.26.70.2.500: [udp sum ok] isakmp 1.0 msgid 00000000
cookie 0b47e3d3f56281ff->0000000000000000: phase 1 I ident:
(sa: doi=ipsec situation=identity
(p: #1 protoid=isakmp transform=1
(t: #1 id=ike (type=enc value=3des)(type=hash value=sha1)
(type=group desc value=modp1024)(type=auth value=preshared)
(type=lifetype value=sec)(type=lifeduration value=0384))))
What ive tried:
Im still fairly new to scripting and tried greping the contents which works when there is only 1 type/value. I believe a CASE command or possibly an if/else/then would work but im not certain how to designate the byte position or delimiter for the output since there is no limit to the number of TYPES that can be included.
enc type is 3des
hash type is sha1
auth type is preshare
group type is modp1024
life type is sec
lifeduration is 0348
Any information would be greaty appreciated.
Also I would like this done with a bash script.
14:28:20.032075 172.26.60.3.500 > 172.26.70.2.500: [udp sum ok] isakmp 1.0 msgid 00000000
cookie 0b47e3d3f56281ff->0000000000000000: phase 1 I ident:
(sa: doi=ipsec situation=identity
(p: #1 protoid=isakmp transform=1
(t: #1 id=ike (type=enc value=3des)(type=hash value=sha1)
(type=group desc value=modp1024)(type=auth value=preshared)
(type=lifetype value=sec)(type=lifeduration value=0384))))
What ive tried:
Im still fairly new to scripting and tried greping the contents which works when there is only 1 type/value. I believe a CASE command or possibly an if/else/then would work but im not certain how to designate the byte position or delimiter for the output since there is no limit to the number of TYPES that can be included.