示例#1
0
        static void Firewall_AccessDenied(string username, string app, string protocol, string source, string destination, string direction)
        {
            try
            {
                if (!Firewall.Apps.Contains(app))
                {
                    if (!SettingsManager.Silence)
                    {
                        Firewall.Apps.Add(app);
                        KavprotVoice.SpeakAsync("Would you like to allow this network access");
                        DevComponents.DotNetBar.TaskDialogInfo inf = new DevComponents.DotNetBar.TaskDialogInfo();
                        inf.DialogButtons = DevComponents.DotNetBar.eTaskDialogButton.Yes | DevComponents.DotNetBar.eTaskDialogButton.No;

                        inf.Title          = "Firewall Rule";
                        inf.Text           = "An application is trying to connect to a remote host (" + destination + ") via " + protocol + " protocol. \n " + Path.GetFileName(app) + "\n do you want to authorize this connection?";
                        inf.TaskDialogIcon = DevComponents.DotNetBar.eTaskDialogIcon.Exclamation;
                        inf.Header         = "Application Connection";
                        inf.FooterText     = "Kavprot smart security";
                        inf.DialogColor    = DevComponents.DotNetBar.eTaskDialogBackgroundColor.Silver;

                        DevComponents.DotNetBar.eTaskDialogResult dl = DevComponents.DotNetBar.TaskDialog.Show(inf);

                        if (dl == DevComponents.DotNetBar.eTaskDialogResult.Yes)
                        {
                            Firewall.Add("AllowAll", app);
                        }
                        else
                        {
                            Firewall.Add("DenyAll", app);
                        }
                    }
                    else
                    {
                        Firewall.Apps.Add(app);
                        if (!Scanner.CheckReputation(app))
                        {
                            Firewall.Add("AllowAll", app);
                        }
                        else
                        {
                            Firewall.Add("DenyAll", app);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                AntiCrash.LogException(ex);
            }
            finally
            {
            }
        }
示例#2
0
        public static DevComponents.DotNetBar.eTaskDialogResult NewDrive(DriveInfo drv)
        {
            KavprotVoice.SpeakAsync("New Drive detected. would you like to scan it ?");
            AVEngine.EventsManager.CallNewDriveConnected();
            DevComponents.DotNetBar.TaskDialogInfo inf = new DevComponents.DotNetBar.TaskDialogInfo();
            inf.DialogButtons = DevComponents.DotNetBar.eTaskDialogButton.Yes | DevComponents.DotNetBar.eTaskDialogButton.No;

            inf.Title          = "New drive Detected (" + drv.Name + ") " + drv.VolumeLabel;
            inf.Text           = "New Drive detected do you want to scan it";
            inf.TaskDialogIcon = DevComponents.DotNetBar.eTaskDialogIcon.Exclamation;
            inf.Header         = "New Drive Connected";
            inf.FooterText     = "Kavprot smart security";
            inf.DialogColor    = DevComponents.DotNetBar.eTaskDialogBackgroundColor.Silver;

            DevComponents.DotNetBar.eTaskDialogResult dl = DevComponents.DotNetBar.TaskDialog.Show(inf);
            return(dl);
        }