' prcookie.vbs
'	Prints information about cookies sent and received from 
'	all servers. Run this offline on a capture file
' Usage: prcookie <capture-file-name>
Dim Con
Set Con= WScript.Stdout
if WScript.Arguments.Count <> 1 then
	Con.WriteLine   "Usage: prcookie <filename>"
end if
ArgFile     = WScript.Arguments.Item(0)
Set UnsniffDB = CreateObject("Unsniff.Database")
Set PacketStore    = UnsniffDB.PacketIndex
Dim HTTPLayer
Dim Cookie
PktCount = PacketStore.Count
For I  = 0 To PktCount-1 
	Set Packet = PacketStore(I)
	Set HTTPLayer = Packet.FindLayer("HTTP")
	If Not HTTPLayer Is Nothing Then
		Set Host = HTTPLayer.FindField("Host")
		If Not Host Is Nothing Then
			Con.WriteLine "---------------------------------"
			Con.WriteLine "Host = " & Host.Value 
		End If
		Set Cookie = HTTPLayer.FindField("Cookie")
		If Not Cookie Is Nothing Then
			Con.WriteLine "Cookie = " & Cookie.Value 
		End If
		Set SetCookie = HTTPLayer.FindField("Set-Cookie")
		If Not SetCookie Is Nothing Then
			Con.WriteLine "Set Cookie = " & SetCookie.Value
		End If
	End If
unsniff/samples/prcookie/vbs.txt · Last modified: 2014/09/11 23:23 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki