Exemplo n.º 1
0
    def test_log(self):
        random_str = tutil.random_string(12)
        webvulnscan.log.log(0, random_str, random_str)
        print_logs()

        output = sys.stdout.getvalue().strip()
        self.assertNotEqual(output, "")

        webvulnscan.log.log(0, random_str, random_str)
        print_logs()

        output = sys.stdout.getvalue().strip()
        self.assertNotEqual(output, "")
Exemplo n.º 2
0
    def test_log(self):
        random_str = tutil.random_string(12)
        webvulnscan.log.log(0, random_str, random_str)
        print_logs()

        output = sys.stdout.getvalue().strip()
        self.assertNotEqual(output, "")

        webvulnscan.log.log(0, random_str, random_str)
        print_logs()

        output = sys.stdout.getvalue().strip()
        self.assertNotEqual(output, "")
Exemplo n.º 3
0
    def test_activated_gzip(self):
        default_page = Page("/", "<html></html>", {"Content-Encoding": "GZIP"},
                            200)

        class GzippedSite(tutil.ClientSite):
            def download_page(self, url, parameters=None,
                              remember_visited=None):
                return default_page

        webvulnscan.attacks.breach(default_page, GzippedSite())
        print_logs()

        output = sys.stdout.getvalue().strip()
        self.assertNotEqual(output, "")
Exemplo n.º 4
0
    def test_activated_gzip(self):
        default_page = Page("/", "<html></html>", {"Content-Encoding": "GZIP"},
                            200)

        class GzippedSite(tutil.ClientSite):
            def download_page(self,
                              url,
                              parameters=None,
                              remember_visited=None):
                return default_page

        webvulnscan.attacks.breach(default_page, GzippedSite())
        print_logs()

        output = sys.stdout.getvalue().strip()
        self.assertNotEqual(output, "")