示例#1
0
        public bool CheckCondition(SessionHandler oSessionHandler)
        {
            DateTime dateForFilter = DateTime.Now;

            dateForFilter = dateForFilter.AddDays(-3);
            DataTable dt = AnalyzerManager.ProxydbObj.GetTableFromDB("select * from PacketDetails where starttime >" + "'" + dateForFilter.Date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'", "proxyloghar");

            if (dt.Rows.Count <= 0)
            {
                return(false);
            }
            Queue <SessionHandler> tempBuffer = PacketCreator.CreatePackets(dt);

            foreach (SessionHandler innnerSessionHandler in tempBuffer)
            {
                if (File.Exists(oSessionHandler.ClientName))
                {
                    if (ComputeFileMD5(oSessionHandler.ClientName) == GetMd5Hash(innnerSessionHandler.ResponseRawData))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
示例#2
0
        public static void ProcessMessage(string message)
        {
            int    primaryKey = int.Parse(message);
            bool   isRowExist = true;
            string rowCheck   = "select * from Request INNER JOIN Response ON Response.request_id =" + primaryKey + "  AND Response.request_id = Request.dbid";

            while (isRowExist)
            {
                if (AnalyzerManager.ProxydbObj.CheckRowExist(rowCheck))
                {
                    isRowExist = false;
                }
            }

            DataTable dt = AnalyzerManager.ProxydbObj.GetTableFromDB(rowCheck, "PacketDetails");

            if (dt == null || dt.Rows.Count <= 0)
            {
                return;
            }
            Queue <SessionHandler> tempQue  = PacketCreator.CreatePackets(dt);
            SessionHandler         oSession = tempQue.FirstOrDefault();

            if (oSession != null)
            {
                AlertsProcessor.ProcessPacket(oSession);
            }
        }