export3.vbs
' 
' export3 - Exports selected individual packets to a PCAP file
'

 
' -----------------------
' Check usage & arguments
' -----------------------
Set Sout = WScript.StdOut
 
if WScript.Arguments.Count <> 3 then
	Sout.WriteLine "Usage: export3 <packets-csv> <from-filename> <to-filename>"
	WScript.Quit
end if
 
PacketsCSV    = WScript.Arguments.Item(0)
FromFile      = WScript.Arguments.Item(1)
ToFile        = WScript.Arguments.Item(2)
 
Set FromDB = CreateObject("Unsniff.Database")
Set FSO	   = CreateObject("Scripting.FileSystemObject")
 
 
FromDB.Open(FromFile)
 
Dim PktIdxArray 
PktIdxArray = Split(PacketsCSV, ",", -1, 1)
 
'
' Save the specified packets to the target DB
'
Set Packets = FromDB.PacketIndex
 
FromDB.BeginExport "libpcap", ToFile
 
For I = 0 To UBound ( PktIdxArray) 
	Set Packet  = Packets(I)
	FromDB.ExportPacket Packet
Next
 
FromDB.EndExport
 
FromDB.Close()
 
Sout.WriteLine "Exported selected packets to " & ToFile
unsniff/samples/export3/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