Beispiel #1
0
        private void OKClick(object sender, EventArgs e)
        {
            _testFile.LoginBeforeTests   = _checkLoginBeforeEachTest.Checked;
            _testFile.TestOnlyParameters = _checkTestOnlyParameters.Checked;
            int numThreads;

            if (int.TryParse(_textNumThreads.Text, out numThreads))
            {
                _testFile.NumberOfThreads = numThreads;
            }
            _testFile.PatternEntityExclusion      = _textPatternEntityExclusion.Text;
            _testFile.PatternRequestExclusion     = _textPatternRequestExclusion.Text;
            _testFile.PatternOfFirstRequestToTest = _textPatternOfFirstTestRequest.Text;
            _testFile.GenerateAllEncodings        = _checkGenerateAllEncodings.Checked;
            _testFile.Save();
            this.Hide();
        }
        public void CustomTestProxy_TestJSValidation()
        {
            MockProxy mockSite = new MockProxy();
            string    testReq  = "GET /r1?p1=test HTTP/1.1\r\n";

            mockSite.MockSite.AddRequestResponse(testReq, "HTTP/1.1 200 OK\r\n\r\nFound user test");
            mockSite.Start();

            CustomTestsFile testFile = GetCustomTestFile();

            var tests = testFile.GetCustomTests();

            tests.Clear();
            tests.Add("PathTraversal",
                      new CustomTestDef("PathTraversal", "Path Traversal",
                                        "$original/" + MockTestController.PATH_TRAVERSAL,
                                        "$js_code=function Callback(response){var found = false; if(response.indexOf('root')>-1) found=true; return found;}"));

            testFile.SetCustomTests(tests);
            testFile.Save();

            TrafficViewerFile  testDataStore      = new TrafficViewerFile();
            MockTestController mockTestController = new MockTestController(mockSite.MockSite);

            var targetList = new Dictionary <string, AttackTarget>();

            targetList.Add("r1", new AttackTarget("r1", "Enabled", "r1"));
            testFile.SetAttackTargetList(targetList);
            DriveByAttackProxy testProxy = new DriveByAttackProxy(mockTestController, testFile, testDataStore);

            testProxy.Start();


            SendRequestThroughTestProxy(testReq, testProxy, mockSite);


            Thread.Sleep(100);

            testProxy.Stop();

            Assert.IsTrue(mockTestController.IssuesFound.ContainsKey("p1"));
        }
Beispiel #3
0
 private void SaveCurrent()
 {
     _testFile.SetMultiValueOption(CUSTOM_TESTS, _grid.GetValues());
     _testFile.Save();
 }
Beispiel #4
0
 private void _buttonOK_Click(object sender, EventArgs e)
 {
     _testFile.SetMultiStepList(_multiStepsGrid.GetValues());
     _testFile.Save();
     this.Hide();
 }
Beispiel #5
0
 private void _buttonOK_Click(object sender, EventArgs e)
 {
     _testFile.SetAttackTargetList(_attackTargetListGrid.GetValues());
     _testFile.Save();
     this.Hide();
 }