public void Init(HttpApplication context) { var cfg = Config.GetConfig(); _HoneypotService = new HoneypotService(cfg.AccessKey, cfg.TestFailure); _DisallowedVisitorTypes = cfg.DisallowedVisitorTypes; context.BeginRequest += BeginRequest; }
public int UpdateVisitorType(VisitorTypes p_VisitorType) { MySqlParameter[] parameters = new MySqlParameter[] { new MySqlParameter("p_VisitortypeId", p_VisitorType.VisitortypeId), new MySqlParameter("p_VisitorTypeDescription", p_VisitorType.VisitorTypeDescription) }; return(MySQLDB.MySQLDBHelper.ExecuteNonQuery("UpdateVisitorTypes", CommandType.StoredProcedure, parameters)); }
public int InsertVisitorType(VisitorTypes p_VisitorType) { int result = 0; MySqlParameter[] parameters = new MySqlParameter[] { new MySqlParameter("p_VisitorTypeDescription", p_VisitorType.VisitorTypeDescription), new MySqlParameter("p_result", MySqlDbType.Int32, 2, ParameterDirection.Output, false, 1, 1, "Out", DataRowVersion.Default, result) }; return(MySQLDB.MySQLDBHelper.ExecuteNonQuery("AddVisitorTypes", CommandType.StoredProcedure, parameters)); }
public List <VisitorTypes> SelectVisitorTypes(int currentUserType, int deploymentId) { List <VisitorTypes> VisitorTypesCol = new List <VisitorTypes>(); DataTable dt = MySQLDB.MySQLDBHelper.ExecuteSelectCommand("GetVisitortypes", CommandType.StoredProcedure); VisitorTypes objVisitorType = null; foreach (DataRow dr in dt.Rows) { objVisitorType = new VisitorTypes(); objVisitorType.VisitortypeId = Convert.ToInt32(dr["VisitortypeId"].ToString()); objVisitorType.VisitorTypeDescription = dr["VisitorTypeDescription"].ToString(); VisitorTypesCol.Add(objVisitorType); } dt.Clear(); dt.Dispose(); return(VisitorTypesCol); }
/// <summary> /// Convert the result IP into readable values /// </summary> /// <param name="entry">IP address result from Project Honeypot</param> private void Init(IPAddress entry) { byte[] arr = entry.GetAddressBytes(); if (arr[0] != 127) { throw new ArgumentException("The IP address (" + entry.ToString() + ") was not a valid blacklist response."); } _LastActivity = new TimeSpan((int)arr[1], 0, 0, 0); _ThreatScore = (int)arr[2]; if (arr[3] > 7) { throw new ArgumentException("The IP address (" + entry.ToString() + ") contained an invalid vistor type."); } _Type = (VisitorTypes)arr[3]; }
public VisitorTypes SelectVisitorTypeByID(int p_VisitortypeId) { MySqlParameter[] parameters = new MySqlParameter[] { new MySqlParameter("p_VisitortypeId", p_VisitortypeId) }; DataTable dt = MySQLDB.MySQLDBHelper.ExecuteSelectCommand("GetVisitortypeByID", CommandType.StoredProcedure, parameters); VisitorTypes objVisitorType = null; if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; objVisitorType = new VisitorTypes(); objVisitorType.VisitortypeId = Convert.ToInt32(dr["VisitortypeId"].ToString()); objVisitorType.VisitorTypeDescription = dr["VisitorTypeDescription"].ToString(); } dt.Clear(); dt.Dispose(); return(objVisitorType); }
private BlacklistResponse() { _LastActivity = new TimeSpan(); _ThreatScore = 0; _Type = VisitorTypes.Unknown; }
public int ModifyVisitorType(VisitorTypes p_VisitorType) { return(objVisitorTypeDBA.UpdateVisitorType(p_VisitorType)); }
public int AddVisitorType(VisitorTypes p_VisitorType) { return(objVisitorTypeDBA.InsertVisitorType(p_VisitorType)); }