Esempio n. 1
0
 def test_uri_encode(self):
     """
     Test uri_encode.
     """
     data = " "
     res = utils.uri_encode(data)
     self.assertEqual(res, "%20")
Esempio n. 2
0
    def payload_match(self, get_req):
        """
        Match parsed GET request for a
        possible web shell payload.

        Args:
            get_req (str): GET request on which to perform
                           payload string matching

        Raises:
            None

        Returns:
            TYPE: bool
        """
        for req in get_req:
            for payload in self.payloads:
                payload = payload.strip(" ").strip("\n")
                if (payload in req or utils.uri_encode(payload) in req):
                    return True
Esempio n. 3
0
    def payload_match(self,url):
        """
               Match parsed URL from a GET Request to
               possible SSRF payload.

               Args:
                   url (str): url on which to perform
                                  payload string matching

               Raises:
                   None

               Returns:
                   TYPE: bool
               """
        for payloads in self.payloads:
            payload=payloads.strip(" ").strip("\n")
            if (payload in url
                    or utils.uri_encode(payload) in url):
                return True