Ejemplo n.º 1
0
    def test_json_mutant_create_mutants_not(self):
        freq = JSONPostDataRequest(URL('http://www.w3af.com/?id=3'))
        freq.set_dc('a=1&b=foo')

        generated_mutants = JSONMutant.create_mutants(freq, self.payloads, [],
                                                      False, self.fuzzer_config)

        self.assertEqual(len(generated_mutants), 0, generated_mutants)
Ejemplo n.º 2
0
    def test_json_mutant_create_mutants_not(self):
        freq = JSONPostDataRequest(URL('http://www.w3af.com/?id=3'))
        freq.set_dc('a=1&b=foo')

        generated_mutants = JSONMutant.create_mutants(freq, self.payloads, [],
                                                      False,
                                                      self.fuzzer_config)

        self.assertEqual(len(generated_mutants), 0, generated_mutants)
Ejemplo n.º 3
0
    def test_json_mutant_create_mutants(self):
        freq = JSONPostDataRequest(URL('http://www.w3af.com/?id=3'))
        freq.set_dc({"a": "b", "c": "d"})

        generated_mutants = JSONMutant.create_mutants(freq, self.payloads, [],
                                                      False, self.fuzzer_config)

        self.assertEqual(len(generated_mutants), 4, generated_mutants)

        m0 = generated_mutants[0]
        self.assertEqual(m0.get_data(), '{"a": "abc", "c": "d"}')

        m1 = generated_mutants[1]
        self.assertEqual(m1.get_data(), '{"a": "53", "c": "d"}')

        m2 = generated_mutants[2]
        self.assertEqual(m2.get_data(), '{"a": "b", "c": "abc"}')

        m3 = generated_mutants[3]
        self.assertEqual(m3.get_data(), '{"a": "b", "c": "53"}')
Ejemplo n.º 4
0
    def test_json_mutant_create_mutants(self):
        freq = JSONPostDataRequest(URL('http://www.w3af.com/?id=3'))
        freq.set_dc({"a": "b", "c": "d"})

        generated_mutants = JSONMutant.create_mutants(freq, self.payloads, [],
                                                      False,
                                                      self.fuzzer_config)

        self.assertEqual(len(generated_mutants), 4, generated_mutants)

        m0 = generated_mutants[0]
        self.assertEqual(m0.get_data(), '{"a": "abc", "c": "d"}')

        m1 = generated_mutants[1]
        self.assertEqual(m1.get_data(), '{"a": "53", "c": "d"}')

        m2 = generated_mutants[2]
        self.assertEqual(m2.get_data(), '{"a": "b", "c": "abc"}')

        m3 = generated_mutants[3]
        self.assertEqual(m3.get_data(), '{"a": "b", "c": "53"}')