tcpports.vbs
' -----------------
' Declare variables
' -----------------
Set Sout = WScript.Stdout
 
' -----------------------
' Check usage & arguments
' -----------------------
if WScript.Arguments.Count <> 1 then
	Sout.Writeline   "Usage: tcpport <filename>"
	WScript.Quit
end if
 
ArgFile     = WScript.Arguments.Item(0)
 
 
Set UnsniffDB = CreateObject("Unsniff.Database")
UnsniffDB.Open(ArgFile)
 
 
Set PacketStore    = UnsniffDB.PacketIndex
PacketCount	   = PacketStore.Count
 
Dim FName
For I = 0 To PacketCount-1
	Set Packet = PacketStore(I)
	For Each  Layer In Packet.Layers
	If Layer.Name = "TCP" Then
		Set Fields = Layer.Fields
		For Each Field In Fields
			FName = Field.Name
			If FName = "Src Port" Then  
				Sout.Write   Field.Value &  vbTab
			ElseIf FName = "Dest Port" Then
				Sout.Write   "--> " & Field.Value 
			End If		
		Next
		Sout.Write vbCrLf
	End If
	Next
Next
 
UnsniffDB.Close()
unsniff/samples/tcpports/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