- prcookie.vbs
' 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>"
WScript.Quit
end if
ArgFile = WScript.Arguments.Item(0)
Set UnsniffDB = CreateObject("Unsniff.Database")
UnsniffDB.OpenForRead(ArgFile)
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
Next
UnsniffDB.Close()