Example #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/./')
Example #2
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/./')
 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/./')
Example #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/./')
Example #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')
Example #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')