예제 #1
0
 public void Clear()
 {
     AuditSec.Speak("", true, false, null);
     IDBox.Text  = "";
     KeyBox.Text = "";
     resetUser();
 }
예제 #2
0
 private void browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
 {
     try
     {
         if (e.Url.ToString().ToLower().Equals(BlankPage.ToLower()))
         {
             URLBox.ForeColor = System.Drawing.SystemColors.InactiveCaptionText;
             string additionalHeaderInfo = "Authorization: Basic "
                                           + Convert.ToBase64String(Encoding.ASCII.GetBytes("MyUsername" + ":" + "MyPassword"))
                                           + System.Environment.NewLine;
             browser.Navigate(new Uri(URLBox.Text), null, null, additionalHeaderInfo);
         }
         else
         {
             OutputBox.Text = "";
             extract();
             AuditSec.Speak(OutputBox.Text, true, false, null);
             URLBox.ForeColor = System.Drawing.Color.DarkGreen;
         }
     }
     catch (Exception ee)
     {
         URLBox.ForeColor = System.Drawing.Color.Red;
         Console.WriteLine("Error after the document completed: " + ee.ToString());
     }
 }
예제 #3
0
 void speakBitlocker()
 {
     if (KeyBox.Text.Length > 0)
     {
         AuditSec.Speak("The recovery key is:\n"
                        + (spellBitLocker(KeyBox.Text) + ".").Replace(", .", "."), true, false, null /*AuditSec.TTSReplace*/);
     }
 }
예제 #4
0
        private void OUBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Stop.Visible)
            {
                Stop.PerformClick();
            }
            dptBox.Items.Clear();
            dptBox.Text = "";
            dptBox.Items.Add("");
            usersInfo.Clear();
            if (domainBox.Text.Length == 0)
            {
                return;
            }

            setEnableGUI(false);
            statusLabel.Text = "Listing the Dpts and Workstations...";
            Cursor.Current   = Cursors.WaitCursor;
            try
            {
                DirectoryEntry de = ((Domain)domainBox.SelectedItem).GetDirectoryEntry(), ou = null;
                foreach (DirectoryEntry de_ in de.Children)
                {
                    if (de_.Properties["name"].Value.ToString().Equals(OUBox.Text))
                    {
                        ou = de = de_; break;
                    }
                }

                usersInfo.FindAll(de);

                statusLabel.Text = "Found " + usersInfo.getUsersCount() + " user" + (usersInfo.getUsersCount() > 1 ? "s" : "")
                                   + " in " + domainBox.Text + "/" + OUBox.Text + "/" + dptBox.Text + "    Click the Play button.";

                string speech = "Found " + usersInfo.getUsersCount() + " user" + (usersInfo.getUsersCount() > 1 ? "s" : "")
                                + " in " + Regex.Replace(Regex.Replace(domainBox.Text.ToUpper(), @"([^.]*)\..*", "$1"), "(.)", "$1.")
                                + " " + OUBox.Text.ToLower()
                                + " " + Regex.Replace(dptBox.Text.ToUpper(), "(.)", "$1.") + ".";

                if (firstOUBox_SelectedIndexChanged)
                {
                    AuditSec.Speak(speech, false, false, null);
                    firstOUBox_SelectedIndexChanged = false;
                }
                else
                {
                    speak(speech);
                }
            }
            catch (Exception ee)
            {
                Console.WriteLine(ee.ToString());
            }
            Cursor.Current = Cursors.Default;
            setEnableGUI(true);
        }
예제 #5
0
        public Unlocker()
        {
            InitializeComponent();
            this.Text += " v" + AuditSec.curver;
            AuditSec.Speak("Welcome to A.D. account unlocker.", false, false, AuditSec.TTSReplace);


            Console.WriteLine("Opening domain... ");
            try
            {
                DomainCollection dc      = Forest.GetCurrentForest().Domains;
                Domain[]         domains = new Domain[dc.Count]; dc.CopyTo(domains, 0);
                domainBox.Items.AddRange(domains);

                domainBox.Text = Domain.GetCurrentDomain().Name;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }


            string me = new DirectorySearcher("(&(ObjectClass=user)(sAMAccountName="
                                              + UserPrincipal.Current.SamAccountName + "))")
                        .FindOne().GetDirectoryEntry().Properties["DistinguishedName"].Value.ToString();

            foreach (string s in me.Split(',').Reverse())
            {
                string[] t = s.Split(new char[] { '=' }, 2);
                if (t[0].Equals("OU"))
                {
                    OUBox.Text = t[1]; break;
                }
            }

            Console.WriteLine("Setting masks... ");
            if (AuditSec.settings.oumask != null && AuditSec.settings.oumask.Length > 0)
            {
                OUMaskBox.Text = AuditSec.settings.oumask;
            }
            sm0 = OUMaskBox.Text;

            speakWorker.RunWorkerAsync();
            actionsWorker.RunWorkerAsync();
            new Thread(new ThreadStart(delegate
            {
                Thread.Sleep(1000);

//                Console.WriteLine("Loading configuration files... ");

                Invoke(new picpwDelegate(setpicpw));

                Invoke(new welcomeButtonDelegate(welcomeButtonPerformClick));
            })).Start();
        }
예제 #6
0
        private void browser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            try
            {
                if (e.Url.ToString().ToLower().Equals(BlankPage.ToLower()))
                {
                    Console.WriteLine("\n\n\n\nLoading..." + KeyID);

                    //browser.Url = new Uri(KeyRecoveryPage);

                    string additionalHeaderInfo = "Authorization: Basic "
                                                  + Convert.ToBase64String(Encoding.ASCII.GetBytes("MyUsername" + ":" + "MyPassword"))
                                                  + System.Environment.NewLine;
                    browser.Navigate(new Uri(KeyRecoveryPage), null, null, additionalHeaderInfo);

                    submit = false;
                }
                else if (!submit)
                {
                    Console.WriteLine("\n\n\n\nSubmitting..." + KeyID);
                    //printHtml();
                    resetUser();
                    setElement("ctl00_content_DomainNameTextBox", user.Split(new char[] { '\\' })[0]);
                    setElement("ctl00_content_UserNameTextBox", user.Split(new char[] { '\\' })[1]);
                    setElement("ctl00_content_KeyIdTextBox", KeyID);
                    setElement("ctl00_content_ReasonCodeSelect", reasons[8]);
                    clickElement("ctl00_content_SubmitButton");
                    submit = true;
                }
                else
                {
                    //printHtml();
                    string RecoveryKey = getElement("ctl00_content_KeyReturnFieldInvisible");
                    Console.WriteLine("\n\n\n\nLoaded. " + RecoveryKey);
                    KeyBox.Text = RecoveryKey == null ? "" : RecoveryKey;
                    if (KeyBox.Text.Length > 0)
                    {
                        speakBitlocker();
                    }
                    else
                    {
                        AuditSec.Speak("Recovery Key not found.", true, false, null);
                        MessageBox.Show("Recovery Key not found.",
                                        "Bitlocker Drive Recovery");
                    }
                }
            }
            catch (Exception ee)
            {
                Console.WriteLine("Error after the document completed: " + ee.ToString());
            }
        }
예제 #7
0
 void speak(string x)
 {
     speechs.Clear();
     AuditSec.Speak(x, true, false, null);
 }