public SipPacketHandler(PacketHandler mainPacketHandler, IUdpPayloadProtocolFinder udpPayloadProtocolFinder = null)
     : base(mainPacketHandler)
 {
     //this.endPointCandidates = new PopularityList<Tuple<System.Net.IPAddress, System.Net.IPAddress>, ushort>(100);
     this.callEndPoints            = new PopularityList <string, List <Tuple <System.Net.IPAddress, ushort, FiveTuple> > >(100);
     this.udpPayloadProtocolFinder = udpPayloadProtocolFinder;
 }
 public KerberosPacketHandler(PacketHandler mainPacketHandler, IUdpPayloadProtocolFinder udpPayloadProtocolFinder = null)
     : base(mainPacketHandler)
 {
     this.udpPayloadProtocolFinder = udpPayloadProtocolFinder;
     //this.ticketPrimitivesList = new PopularityList<int, TicketPrimitives>(100);
     this.saltList = new PopularityList <int, string>(100);
 }
예제 #3
0
 //10.000 simultaneous sessions might a good (high) value
 //each session will consume ~30kB
 public SessionHandler(Int32 maxSimultaneousSessions, Configuration config)
 {
     this.upcomingSessionsList    = new PopularityList <String, ISession>(maxSimultaneousSessions);
     this.establishedSessionsList = new PopularityList <String, ISession>(maxSimultaneousSessions);
     this.establishedSessionsList.PopularityLost += this.establishedSessionsList_PopularityLost;
     this.config = config;
 }
        public RtpPacketHandler(PacketHandler mainPacketHandler)
            : base(mainPacketHandler)
        {
            this.audioStreams = new PopularityList <Tuple <System.Net.IPAddress, ushort, System.Net.IPAddress, ushort, RtpPayloadType>, AudioStream>(MAX_AUDIO_STREAMS);
            //this.NewRtpEndPoints = new System.Collections.Concurrent.ConcurrentQueue<Tuple<System.Net.IPAddress, System.Net.IPAddress, ushort>>();

            this.audioStreams.PopularityLost += (t, a) => a.Dispose();//will remove the associated temp file
        }
 public void Reset()
 {
     foreach (var audioStream in this.audioStreams.GetValueEnumerator())
     {
         audioStream.Dispose();
     }
     this.audioStreams = new PopularityList <Tuple <System.Net.IPAddress, ushort, System.Net.IPAddress, ushort, RtpPayloadType>, AudioStream>(MAX_AUDIO_STREAMS);
 }
        public SmbCommandPacketHandler(PacketHandler mainPacketHandler)
            : base(mainPacketHandler)
        {
            this.parsedTypes = new HashSet <Type>(this.ParsedType.GetNestedTypes());//hopefully this should include everything that implements Packets.SmbPacket.AbstractSmbCommand
            this.parsedTypes.Add(this.ParsedType);

            //this.smbAssemblers=new SortedList<string, NetworkMiner.FileTransfer.FileStreamAssembler>();
            this.smbSessionPopularityList = new PopularityList <string, SmbSession>(100);
        }
예제 #7
0
        public Smb2PacketHandler(PacketHandler mainPacketHandler)
            : base(mainPacketHandler)
        {
            this.fileSegmentAssemblerList = new PopularityList <string, FileTransfer.FileSegmentAssembler>(100);
            this.requestCache             = new PopularityList <string, Smb2Command>(100);
            this.fileIdFilenameMap        = new PopularityList <string, string>(1000);

            this.fileOutputDirectory = System.IO.Path.GetDirectoryName(mainPacketHandler.OutputDirectory);
        }
 private FileSegmentAssembler(string fileOutputDirectory, string filePath, string uniqueFileId, FileTransfer.FileStreamAssemblerList fileStreamAssemblerList, PopularityList <string, PacketParser.FileTransfer.FileSegmentAssembler> parentAssemblerList, FileStreamTypes fileStreamType, string details, string serverHostname)
 {
     this.fileOutputDirectory = fileOutputDirectory;
     //this.fileTransferIsServerToClient = fileTransferIsServerToClient;
     this.filePath                = filePath;
     this.uniqueFileId            = uniqueFileId;
     this.parentAssemblerList     = parentAssemblerList;
     this.fileStreamAssemblerList = fileStreamAssemblerList;
     this.fileStreamType          = fileStreamType;
     this.details        = details;
     this.serverHostname = serverHostname;
 }
예제 #9
0
            internal SmbSession(System.Net.IPAddress serverIP, ushort serverTcpPort, System.Net.IPAddress clientIP, ushort clientTcpPort)
            {
                this.serverIP      = serverIP;
                this.serverTcpPort = serverTcpPort;
                this.clientIP      = clientIP;
                this.clientTcpPort = clientTcpPort;

                this.lastReferencedFileIdPerTreeMux = new SortedList <uint, ushort>();
                this.lastReferencedFileIdPerPidMux  = new SortedList <uint, ushort>();


                this.fileIdAssemblerList = new PopularityList <ushort, FileTransfer.FileStreamAssembler>(100);
            }
        internal FileStreamAssemblerList(PacketHandler packetHandler, int maxPoolSize, string fileOutputDirectory)
            : base(maxPoolSize)
        {
            this.packetHandler = packetHandler;

            this.decompressGzipStreams = true;//this should be a setting that can be changed in an option-menu.

            //this.applicationExecutableDirectory=System.IO.Path.GetDirectoryName(applicationExecutableDirectory);
            this.fileOutputDirectory = System.IO.Path.GetDirectoryName(fileOutputDirectory);
            //this.masterFileSegmentAssembler = new FileSegmentAssembler(this.fileOutputDirectory, )
            //this.partialFileAssemblerDictionary = new Dictionary<string, PartialFileAssembler>();
            this.partialFileAssemblerList = new PopularityList <string, PartialFileAssembler>(QUEUE_SIZE);
            this.fileStreamAssemblerQueue = new PopularityList <string, Queue <FileStreamAssembler> >(QUEUE_SIZE);
        }
예제 #11
0
            internal SmbSession(System.Net.IPAddress serverIP, ushort serverTcpPort, System.Net.IPAddress clientIP, ushort clientTcpPort)
            {
                this.serverIP      = serverIP;
                this.serverTcpPort = serverTcpPort;
                this.clientIP      = clientIP;
                this.clientTcpPort = clientTcpPort;

                this.lastReferencedFileIdPerTreeMux = new SortedList <uint, ushort>();
                this.lastReferencedFileIdPerPidMux  = new SortedList <uint, ushort>();


                this.fileIdAssemblerList = new PopularityList <ushort, FileTransfer.FileStreamAssembler>(100);
                this.fileIdAssemblerList.PopularityLost        += FileIdAssemblerList_PopularityLost;
                this.fileIdSegmentAssemblerList                 = new PopularityList <ushort, FileTransfer.FileSegmentAssembler>(100);
                this.fileIdSegmentAssemblerList.PopularityLost += FileIdSegmentAssemblerList_PopularityLost;

                this.lastTreeConnectAndXRequestPathPerUserMux = new PopularityList <int, string>(100);
                this.treePathList = new PopularityList <ushort, string>(100);
            }
예제 #12
0
 public SmtpPacketHandler(PacketHandler mainPacketHandler)
     : base(mainPacketHandler)
 {
     this.smtpSessionList = new PopularityList <NetworkTcpSession, SmtpSession>(100);//max 100 simultaneous SMTP sessions
 }
 public RtpPacketHandler(PacketHandler mainPacketHandler)
     : base(mainPacketHandler)
 {
     this.audioStreams = new PopularityList <Tuple <System.Net.IPAddress, ushort, System.Net.IPAddress, ushort, RtpPayloadType>, AudioStream>(MAX_AUDIO_STREAMS);
     //this.NewRtpEndPoints = new System.Collections.Concurrent.ConcurrentQueue<Tuple<System.Net.IPAddress, System.Net.IPAddress, ushort>>();
 }
 public ImapPacketHandler(PacketHandler mainPacketHandler) : base(mainPacketHandler)
 {
     this.lastCommand = new PopularityList <NetworkTcpSession, ImapPacket.ClientCommand>(100);
     this.serverToClientEmailReassemblers = new PopularityList <NetworkTcpSession, System.IO.MemoryStream>(100);
     this.clientToServerEmailReassemblers = new PopularityList <NetworkTcpSession, System.IO.MemoryStream>(100);
 }
예제 #15
0
 public TlsRecordPacketHandler(PacketHandler mainPacketHandler)
     : base(mainPacketHandler)
 {
     this.tlsRecordFragmentCache = new PopularityList <FiveTuple, Tuple <List <Packets.TlsRecordPacket>, List <Packets.TlsRecordPacket> > >(100);
 }
예제 #16
0
 public IrcPacketHandler(PacketHandler mainPacketHandler)
     : base(mainPacketHandler)
 {
     this.ircSessionList = new PopularityList <NetworkTcpSession, IrcSession>(1000);
 }
 public TlsRecordPacketHandler(PacketHandler mainPacketHandler)
     : base(mainPacketHandler)
 {
     this.tlsRecordFragmentCache = new PopularityList <FiveTuple, Tuple <List <Packets.TlsRecordPacket>, List <Packets.TlsRecordPacket> > >(100);
     this.ja3Fingerprints        = Fingerprints.Ja3FingerprintDictionaryFactory.CreateDictionary(base.MainPacketHandler.FingerprintsPath + "ja3fingerprint.json");
 }
예제 #18
0
 public SocksPacketHandler(PacketHandler mainPacketHandler) : base(mainPacketHandler)
 {
     this.socksConnectIpPorts = new PopularityList <NetworkTcpSession, KeyValuePair <System.Net.IPAddress, ushort> >(64);//64 parallell SOCKS sessions should be enough for everyone ;)
 }
        internal FileSegmentAssembler(string fileOutputDirectory, NetworkTcpSession networkTcpSession, bool transferIsClientToServer, string filePath, string uniqueFileId, FileTransfer.FileStreamAssemblerList fileStreamAssemblerList, PopularityList <string, PacketParser.FileTransfer.FileSegmentAssembler> parentAssemblerList, FileStreamTypes fileStreamType, string details, string serverHostname)
            : this(fileOutputDirectory, filePath, uniqueFileId, fileStreamAssemblerList, parentAssemblerList, fileStreamType, details, serverHostname)
        {
            //this.fileOutputDirectory = fileOutputDirectory;

            //this.networkTcpSession = networkTcpSession;
            this.fiveTuple = networkTcpSession.Flow.FiveTuple;
            this.transferIsClientToServer = transferIsClientToServer;
        }
예제 #20
0
 public Pop3PacketHandler(PacketHandler mainPacketHandler) : base(mainPacketHandler)
 {
     this.pop3LastCommand   = new PopularityList <NetworkTcpSession, Pop3Packet.ClientCommand>(100);
     this.pop3Credentials   = new PopularityList <NetworkTcpSession, NetworkCredential>(100);
     this.emailReassemblers = new PopularityList <NetworkTcpSession, Utils.StreamReassembler>(100);
 }
 public NtlmSspPacketHandler(PacketHandler mainPacketHandler)
     : base(mainPacketHandler)
 {
     this.ntlmChallengeList = new PopularityList <int, string>(20);
 }
예제 #22
0
        internal FileSegmentAssembler(string fileOutputDirectory, bool transferIsClientToServer, string filePath, string uniqueFileId, FileTransfer.FileStreamAssemblerList fileStreamAssemblerList, PopularityList <string, PacketParser.FileTransfer.FileSegmentAssembler> parentAssemblerList, FileStreamTypes fileStreamType, string details, FiveTuple fiveTuple, string serverHostname)
            : this(fileOutputDirectory, filePath, uniqueFileId, fileStreamAssemblerList, parentAssemblerList, fileStreamType, details, serverHostname)
        {
            this.fiveTuple = fiveTuple;
            this.transferIsClientToServer = transferIsClientToServer;

            /*
             * this.sourceHost = sourceHost;
             * this.destinationHost = destinationHost;
             * this.sourcePort = sourcePort;
             * this.destinationPort = destinationPort;
             */
        }
예제 #23
0
 FileSegmentAssemblerHandler(string fileOutputDirectory, FileStreamAssemblerList fileStreamAssemblerList) {
     this.fileOutputDirectory = fileOutputDirectory;
     this.fileStreamAssemblerList = fileStreamAssemblerList;
     this.assemblerList = new PopularityList<string, FileSegmentAssembler>(100);//100 simultaneous partial downloads allowed
 }
예제 #24
0
 public SmbCommandPacketHandler(PacketHandler mainPacketHandler)
     : base(mainPacketHandler)
 {
     //this.smbAssemblers=new SortedList<string, NetworkMiner.FileTransfer.FileStreamAssembler>();
     this.smbSessionPopularityList = new PopularityList <string, SmbSession>(100);
 }
예제 #25
0
        internal FileSegmentAssembler(string fileOutputDirectory, NetworkTcpSession networkTcpSession, bool transferIsClientToServer, string filePath, string uniqueFileId, FileTransfer.FileStreamAssemblerList fileStreamAssemblerList, PopularityList <string, PacketParser.FileTransfer.FileSegmentAssembler> parentAssemblerList, FileStreamTypes fileStreamType, string details, string serverHostname)
            : this(fileOutputDirectory, filePath, uniqueFileId, fileStreamAssemblerList, parentAssemblerList, fileStreamType, details, serverHostname)
        {
            //this.fileOutputDirectory = fileOutputDirectory;

            //this.networkTcpSession = networkTcpSession;
            this.fiveTuple = networkTcpSession.Flow.FiveTuple;
            this.transferIsClientToServer = transferIsClientToServer;

            /*
             * if (this.fileTransferIsServerToClient) {
             *  this.sourceHost = networkTcpSession.ServerHost;
             *  this.destinationHost = networkTcpSession.ClientHost;
             *  this.sourcePort = networkTcpSession.ServerTcpPort;
             *  this.destinationPort = networkTcpSession.ClientTcpPort;
             * }
             * else {
             *  this.sourceHost = networkTcpSession.ClientHost;
             *  this.destinationHost = networkTcpSession.ServerHost;
             *  this.sourcePort = networkTcpSession.ClientTcpPort;
             *  this.destinationPort = networkTcpSession.ServerTcpPort;
             * }*/

            /*
             * this.filePath = filePath;
             * this.uniqueFileId = uniqueFileId;
             * this.parentAssemblerList = parentAssemblerList;
             * this.fileStreamAssemblerList = fileStreamAssemblerList;
             * this.fileStreamType = fileStreamType;
             * this.details = details;
             */
        }
 //public FtpPacketHandler(NetworkMinerForm parentForm, FileTransfer.FileStreamAssemblerPool fileStreamAssemblerPool, SortedList<NetworkCredential, NetworkCredential> credentialList): base(parentForm) {
 public FtpPacketHandler(PacketHandler mainPacketHandler) : base(mainPacketHandler)
 {
     this.ftpSessionList          = new PopularityList <NetworkTcpSession, FtpSession>(100);//max 100 simultaneous FTP control sessions
     this.pendingFileTransferList = new PopularityList <string, PendingFileTransfer>(20);
 }
예제 #27
0
 public TftpPacketHandler(PacketHandler mainPacketHandler)
     : base(mainPacketHandler)
 {
     this.tftpSessionBlksizeList = new PopularityList <string, ushort>(100);
 }