tcpports2.vbs
'
'	PRINT TCP Src / Dest Ports by using the Find method
'
Dim Sout
Set Sout = WScript.Stdout
 
if WScript.Arguments.Count <> 1 then
	Sout.Writeline   "Usage: tcpport2 <filename>"
	WScript.Quit
end if
 
Set Sout = WScript.Stdout
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 FldSrcPort = Layer.FindField ("Src Port")
		Set FldDestPort = Layer.FindField ("Dest Port")
		Sout.Write   "s:" & FldSrcPort.Value &  vbTab & _
			     "d:" & FldDestPort.Value & vbCrLf
 
 
	End If
	Next
Next
 
UnsniffDB.Close()
unsniff/samples/tcpports2/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