Exemplo n.º 1
0
    def test_add_to_url_with_path(self):
        sr = self_reference()

        u = URL("http://www.w3af.com/abc/")
        r = HTTPRequest(u)

        self.assertEqual(sr.modify_request(r).url_object.url_string, u"http://www.w3af.com/./abc/./")
Exemplo n.º 2
0
 def test_send_mangled(self):
     xurllib = ExtendedUrllib()
     
     xurllib.set_evasion_plugins([self_reference(), ])
     url = URL('http://moth/')
     
     http_response = xurllib.GET(url)
     self.assertEqual(http_response.get_url().url_string,
                      u'http://moth/./')
Exemplo n.º 3
0
    def test_add_to_url_with_path(self):
        sr = self_reference()

        u = URL('http://www.w3af.com/abc/')
        r = HTTPRequest(u)

        self.assertEqual(
            sr.modify_request(r).url_object.url_string,
            u'http://www.w3af.com/./abc/./')
Exemplo n.º 4
0
    def test_send_mangled(self):
        xurllib = ExtendedUrllib()

        xurllib.set_evasion_plugins([
            self_reference(),
        ])
        url = URL('http://moth/')

        http_response = xurllib.GET(url)
        self.assertEqual(http_response.get_url().url_string, u'http://moth/./')
Exemplo n.º 5
0
    def test_add_to_url_with_qs(self):
        sr = self_reference()

        u = URL("http://www.w3af.com/abc/def.htm?id=1")
        r = HTTPRequest(u)

        self.assertEqual(sr.modify_request(r).url_object.url_string, u"http://www.w3af.com/./abc/./def.htm?id=1")

        #
        #    The plugins should not modify the original request
        #
        self.assertEqual(u.url_string, u"http://www.w3af.com/abc/def.htm?id=1")
Exemplo n.º 6
0
    def test_add_to_url_with_qs(self):
        sr = self_reference()

        u = URL('http://www.w3af.com/abc/def.htm?id=1')
        r = HTTPRequest(u)

        self.assertEqual(
            sr.modify_request(r).url_object.url_string,
            u'http://www.w3af.com/./abc/./def.htm?id=1')

        #
        #    The plugins should not modify the original request
        #
        self.assertEqual(u.url_string, u'http://www.w3af.com/abc/def.htm?id=1')