Exemplo n.º 1
0
        private void GetResponseHeaders()
        {
            try
            {
                HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(txtURL.Text);
                myRequest.Method = "GET";
                HttpWebResponse     myResponse = (HttpWebResponse)myRequest.GetResponse();
                WebHeaderCollection myHeaders  = myResponse.Headers;
                txtReport.Text = "Adres: " + txtURL.Text;
                txtReport.AppendText(Environment.NewLine);
                txtReport.AppendText(Environment.NewLine);
                txtReport.AppendText("Title Information:");
                txtReport.AppendText(Environment.NewLine);

                __HTTTPAttack_ a = new __HTTTPAttack_(txtURL.Text);
                a.LoadFromSettings(false);
                a.SendRequest();
                txtReport.AppendText(a.ReturnResponseHeaders());
                this.DocumentText = a.DocumentText;
                this.addAttack(a);

                progressBar1.Value += 100;
            }
            catch
            {
                this.SetNotfictaion("URL incorrect or unreachable");
            }
        }