Exemple #1
0
 def test_check_case09(self):
     is_vuln = IsVulnerableHelper(200, 301, re.compile('def'),
                                  re.compile('xyz'), re.compile('spam'))
     url = URL('http://moth/')
     http_response = HTTPResponse(301, 'hello world abc def', Headers(),
                                  url, url)
     self.assertTrue( is_vuln.check(http_response) )
Exemple #2
0
 def test_check_case09(self):
     is_vuln = IsVulnerableHelper(200, 301, re.compile('def'),
                                  re.compile('xyz'), re.compile('spam'))
     url = URL('http://moth/')
     http_response = HTTPResponse(301, 'hello world abc def', Headers(),
                                  url, url)
     self.assertTrue(is_vuln.check(http_response))
Exemple #3
0
 def test_check_case02(self):
     is_vuln = IsVulnerableHelper(re.compile('xyz'), None, None, None, None)
     url = URL('http://moth/')
     http_response = HTTPResponse(200, 'hello world abc def', Headers(),
                                  url, url)
     self.assertFalse(is_vuln.check(http_response))
Exemple #4
0
 def test_checks_only_response_code_case04(self):
     is_vuln = IsVulnerableHelper(re.compile('a'), re.compile('b'), None,
                                  None, None)
     self.assertFalse(is_vuln.checks_only_response_code())
Exemple #5
0
 def test_checks_only_response_code_case02(self):
     is_vuln = IsVulnerableHelper(200, 302, None, None, None)
     self.assertTrue(is_vuln.checks_only_response_code())
Exemple #6
0
 def test_check_case05(self):
     is_vuln = IsVulnerableHelper(200, 301, None, None, None)
     url = URL('http://moth/')
     http_response = HTTPResponse(301, 'hello world abc def', Headers(),
                                  url, url)
     self.assertTrue(is_vuln.check(http_response))
Exemple #7
0
 def test_check_case02(self):
     is_vuln = IsVulnerableHelper(re.compile('xyz'), None, None, None, None)
     url = URL('http://moth/')
     http_response = HTTPResponse(200, 'hello world abc def', Headers(),
                                  url, url)
     self.assertFalse( is_vuln.check(http_response) )
Exemple #8
0
 def test_checks_only_response_code_case04(self):
     is_vuln = IsVulnerableHelper(re.compile('a'), re.compile('b'),
                                  None, None, None)
     self.assertFalse( is_vuln.checks_only_response_code() )
Exemple #9
0
 def test_checks_only_response_code_case02(self):
     is_vuln = IsVulnerableHelper(200, 302, None, None, None)
     self.assertTrue( is_vuln.checks_only_response_code() )
Exemple #10
0
 def test_check_case05(self):
     is_vuln = IsVulnerableHelper(200, 301, None, None, None)
     url = URL('http://moth/')
     http_response = HTTPResponse(301, 'hello world abc def', Headers(),
                                  url, url)
     self.assertTrue( is_vuln.check(http_response) )