Skip to content

Commit 3fe36f8

Browse files
committed
misc: small fix or general refactoring i did not bother commenting
1 parent 2d6847d commit 3fe36f8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

examples/web_vulnerability_scanner/http-req.py

+9-6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
url = args.url if not args.url[-1] == '/' else args.url[:-1]
2121

2222
# escape the query string if present
23+
main = path
2324
if '?' in path:
2425
main, querystr = path.split('?', 1)
2526
quoted = []
@@ -33,9 +34,11 @@
3334

3435
r = requests.get(f"{url}{path}", headers=headers, timeout=15)
3536

36-
print()
37-
print(f"HTTP/{r.raw.version/10} {r.raw.status} {r.raw.reason}")
38-
for k, v in r.raw.headers.items():
39-
print(f"{k}: {v}")
40-
print(r.text)
41-
print()
37+
if r.raw.status == 200:
38+
print(f"HTTP/{r.raw.version/10} {r.raw.status} {r.raw.reason}")
39+
for k, v in r.raw.headers.items():
40+
print(f"{k}: {v}")
41+
print(r.text)
42+
43+
else:
44+
print(f"Page {main} : {r.raw.reason}")

examples/web_vulnerability_scanner/task.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ guidance:
1616
- Enumerate pages and folders that are relevant for fingerprinting first.
1717
- Build and collect memories with details about the web server and the various technologies used.
1818
- Understand the structure of the website and the technology used before starting the attacks.
19+
- If a page returns a "not found" error stop requesting it and try another page.
1920

2021
# the agent toolbox
2122
functions:

0 commit comments

Comments
 (0)