예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         _client = ConnectionClientEx.Instance;
     }
 }
예제 #2
0
 public void Dispose()
 {
     if (_connectionClient != null)
     {
         _connectionClient.Dispose();
     }
     _instance = null;
 }
예제 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     var user = UserManager.GetUser(User.Identity.Name);
     if (user.ProviderUserKey != null) UserId = (Int32)user.ProviderUserKey;
     _client = ConnectionClientEx.Instance;
     if (User.IsInRole("FileManager") && !User.IsInRole("Administrator") && !User.IsInRole("User"))
     {
         Response.Redirect("~/Pages/Malware/Malwares.aspx");
     }
 }
예제 #4
0
        public MainForm()
        {
            InitializeComponent();
            Application.ApplicationExit += ApplicationApplicationExit;

            _server = new ConnectionServer();
            _server.OnConnectionServerEvent += OnServerEvent;

            _client = ConnectionClientEx.Instance;
            _client.OnConnectionClientExEvent += OnClientEvent;

            tbDb.Text = DbManager.GetConnectionStatus() ? "connected" : "not connected";

            tbTime_1.Text = DateTime.Now.ToString("yyyy-MM-dd HH':'mm':'ss");
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "*** | Добавление новой ЛИР";
            _client = ConnectionClientEx.Instance;

            if (Master != null) ((MainMaster)Master).SetMenuFile("~/App_Data/SideMenu/Information/InformationMenu.xml");

            ddList.DataSource = VmManager.GetVmSystemDescriptionList();
            ddList.DataBind();

            if (!IsPostBack)
            {
                _userId = (Int32)UserManager.GetUser(User.Identity.Name).ProviderUserKey;
            }
        }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         _client = ConnectionClientEx.Instance;
         var user = UserManager.GetUser(User.Identity.Name);
         if (user != null)
         {
             if (user.ProviderUserKey != null) UserId = (Int32)user.ProviderUserKey;
         }
         else
         {
             Response.Redirect("~/Account/Login.aspx");
         }
     }
 }
예제 #7
0
 public static void AnalyzeReceived(Packet packet, ConnectionClientEx client)
 {
     _client = client;
     switch (packet.Type)
     {
         case PacketType.ANS_VM_START:       OnReceiveVmStart(packet.GetParameters()); break;
         case PacketType.ANS_VM_STOP:        OnReceiveVmStop(packet.GetParameters()); break;
         case PacketType.ANS_VM_STATUS:      OnReceiveVmStatus(packet.GetParameters()); break;
         case PacketType.ANS_VM_CREATE:      OnReceiveVmCreate(packet.GetParameters()); break;
         case PacketType.ANS_LOAD_MALWARE:   OnReceiveMalwareLoad(packet.GetParameters()); break;
         case PacketType.ANS_SET_TARGET:     OnReceiveSetTarget(packet.GetParameters()); break;
         case PacketType.ANS_REPORT:         OnReceiveReport(packet.GetParameters()); break;
         case PacketType.ANS_SET_OBJECT:     OnReceiveSetObject(packet.GetParameters()); break;
         case PacketType.ANS_VM_READY:       OnReceiveVmReady(packet.GetParameters()); break;
         case PacketType.ANS_VM_COMPLETE:    OnReceiveVmComplete(packet.GetParameters()); break;
         case PacketType.ANS_LOAD_TRAFFIC:   OnReceiveLoadTraffic(packet.GetParameters()); break;
         case PacketType.ANS_VM_NEWCREATE: OnReceiveVmCreateEvent(packet.GetParameters()); break;
     }
 }
예제 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "ВПО";
            _client = ConnectionClientEx.Instance;
            _settings = ConnectionManager.LoadSettings();

            if (!User.IsInRole("Administrator"))
            {
                if (!User.IsInRole("FileManager"))
                {
                    btnDownload.ClientVisible = false;
                }
            }
            if (Master != null) ((MainMaster)Master).SetMenuFile("~/App_Data/SideMenu/Malware/MalwareMenu.xml");

            _userId = (Int32)UserManager.GetUser(User.Identity.Name).ProviderUserKey;

            //gridViewMalware.Settings.ShowHeaderFilterButton = true;
            //gridViewMalware.KeyFieldName = "Id";

            //foreach (var column in
            //    gridViewMalware.Columns.Cast<object>().Where(column => column.GetType() == typeof(GridViewDataColumn)))
            //{
            //    ((GridViewDataColumn)column).Settings.HeaderFilterMode = HeaderFilterMode.List;
            //}

            //if (!IsPostBack)
            //{
            //    UpdateTableView();
            //    DbManager.OnTableUpdated += OnTableUpdated;
            //}
            UpdateTableView();
        }
예제 #9
0
 public ResearchTimeChecker(ConnectionClientEx client)
 {
     _client = client;
     _threadingTimer = new Timer(Check, null, 0, 1000);
 }
예제 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "*** | История исследований";
            _client = ConnectionClientEx.Instance;

            if (Master != null) ((MainMaster)Master).SetMenuFile("~/App_Data/SideMenu/Research/ResearchMenu.xml");

            gridViewMalware.Settings.ShowHeaderFilterButton = true;
            gridViewMalware.KeyFieldName = "Id";

            foreach (var column in gridViewMalware.Columns)
            {
                if (column.GetType() == typeof(GridViewDataColumn))
                {
                    ((GridViewDataColumn)column).Settings.HeaderFilterMode = HeaderFilterMode.List;
                }
            }

            if (!IsPostBack)
            {
                ReportManager.ClearAllReports(); // Убрать потом!!!
                UpdateTableView();
            }
        }
예제 #11
0
        void Application_Start(object sender, EventArgs e)
        {
            SandboxTheme.ThemesProviderEx.Register();
                Application.Add("ApplicationTitle", "web-console");
                MLogger.LogTo(Level.TRACE, false, "---------------------------------------------------------------");
                MLogger.LogTo(Level.TRACE, false, "Application " + Application.Get("ApplicationTitle") + "started");
                DevExpress.Web.ASPxClasses.ASPxWebControl.CallbackError += Application_Error;

                _restrictions   = new List<String> {"Content", "Scripts", "Error"};

                if (DbManager.GetConnectionStatus())
                {
                    MLogger.LogTo(Level.TRACE, false, "Database connection: success");
                    _settings = ConnectionManager.LoadSettings();

                    _client = ConnectionClientEx.Instance;
                    _client.OnConnectionClientExEvent += OnConnectionClientEvent;
                    _client.Start(_settings.RemoteHost, _settings.RemotePort, _settings.Reconnect);

                    _checker = new ResearchTimeChecker(_client);
                    _checker.StartCheck();
                }
                else
                {
                    MLogger.LogTo(Level.FATAL, false, "Database connection: error");
                }

                /*_worker = Worker.Instance;
                _worker.OnWorkerEvent += OnWorkerEvent;
                if (_worker.DbStatus)
                {
                    MLogger.LogTo(Level.TRACE, false, "Database connection: success");

                    //_checker = new ResearchTimeChecker(_client);
                    //_checker.StartCheck();
                }
                else
                {
                    MLogger.LogTo(Level.FATAL, false, "Database connection: error");
                }*/
        }
예제 #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     var user = UserManager.GetUser(User.Identity.Name);
     if (user.ProviderUserKey != null) UserId = (Int32)user.ProviderUserKey;
     _client = ConnectionClientEx.Instance;
 }
예제 #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Title = "*** | Управление ВПО";
            _client = ConnectionClientEx.Instance;
            _settings = ConnectionManager.LoadSettings();

            if (!User.IsInRole("Administrator"))
            {
                if (!User.IsInRole("FileManager"))
                {
                    Response.Redirect("~/Account/Login.aspx");
                }
            }
            if (Master != null) ((MainMaster)Master).SetMenuFile("~/App_Data/SideMenu/Malware/MalwareMenu.xml");

            _userId = (Int32)UserManager.GetUser(User.Identity.Name).ProviderUserKey;

            gridViewMalware.Settings.ShowHeaderFilterButton = true;
            gridViewMalware.KeyFieldName = "Id";

            foreach (var column in
                gridViewMalware.Columns.Cast<object>().Where(column => column.GetType() == typeof(GridViewDataColumn)))
            {
                ((GridViewDataColumn)column).Settings.HeaderFilterMode = HeaderFilterMode.List;
            }

            if (!IsPostBack)
            {
                UpdateTableView();
                DbManager.OnTableUpdated += OnTableUpdated;
            }
        }