Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
Convert Url params to dict
Browse files Browse the repository at this point in the history
  • Loading branch information
knassar702 committed Oct 31, 2021
1 parent 34c53af commit 3ee3182
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions modules/python/scan.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from typing import Union
from urllib.parse import urlparse
from urllib.parse import urlparse , parse_qsl
from logging import getLogger
from core.libs import Http
from requests.models import Response
from core.libs import random_str
from core.libs import random_str , post_data
from yaml import safe_load
from secrets import token_bytes
from base64 import b64encode
Expand All @@ -30,9 +30,14 @@ def open_yaml_file(self, file_name: str, add_path: bool):
def send_request(self, method: str, url: str, second_url: Union[str, None] = None) -> Response:
if method == 'GET':
return self.http.send(method, url)

params = dict(parse_qsl(urlparse(url).query))
if second_url is not None:
return self.http.send(method, second_url.split('?')[0], body = urlparse(url).query)
return self.http.send(method, url.split('?')[0], body = urlparse(url).query)
print(params)
return self.http.send(method, second_url.split('?')[0], body = params)
#print(params)
#print(5)
return self.http.send(method, url.split('?')[0], body = params)

def transform_path_to_module_import(self, path: str) -> str:
path = path.replace('/','.').replace('\\','.').strip()
Expand Down

0 comments on commit 3ee3182

Please sign in to comment.