Skip to content

Commit

Permalink
Use HTTPArchive/wappalyzer project for mod_wapp
Browse files Browse the repository at this point in the history
  • Loading branch information
devl00p committed Aug 12, 2024
1 parent 9e41223 commit 78c72e5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions tests/attack/test_mod_wapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,10 @@ async def test_multi_detection():
)
)

# Now let's mock wapiti-scanner/webappanalyzer. Wappalyzer files are split over the first character of software names.
# Now let's mock wapiti-scanner/wappalyzerfork. Wappalyzer files are split over the 1st character of software names.
for letter, filename in [("m", "mysql.json"), ("p", "php.json"), ("w", "wordpress.json")]:
respx.get(
f"https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/src/technologies/{letter}.json"
f"https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/src/technologies/{letter}.json"
).mock(
return_value=httpx.Response(
status_code=200,
Expand All @@ -440,22 +440,22 @@ async def test_multi_detection():
)

# Give an empty dict for all uninteresting files
respx.get(url__startswith="https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/src/techno").mock(
respx.get(url__startswith="https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/src/techno").mock(
return_value=httpx.Response(
status_code=200,
json={},
)
)

respx.get("https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/src/categories.json").mock(
respx.get("https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/src/categories.json").mock(
return_value=httpx.Response(
status_code=200,
content=(fixture_folder / "categories.json").open("rb").read(),
headers={"Content-Type": "application/json"}
)
)

respx.get("https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/src/groups.json").mock(
respx.get("https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/src/groups.json").mock(
return_value=httpx.Response(
status_code=200,
content=(fixture_folder / "groups.json").open("rb").read(),
Expand Down
10 changes: 5 additions & 5 deletions tests/cli/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ async def test_update_without_modules(mock_update):
@mock.patch("wapitiCore.main.wapiti.Wapiti.update")
async def test_update_with_wapp_url(mock_update):
"""Ensure that no module should be updated when no module is requested."""
testargs = ["wapiti", "--update", "-m", "wapp", "--wapp-url", "https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/"]
testargs = ["wapiti", "--update", "-m", "wapp", "--wapp-url", "https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/"]
with mock.patch.object(sys, 'argv', testargs):
with pytest.raises(SystemExit):
await wapiti_main()
Expand Down Expand Up @@ -366,7 +366,7 @@ async def test_mod_wapp_is_set(mock_is_mod_wapp_or_update_set, _, __):
"wapiti",
"--url", "http://testphp.vulnweb.com/",
"-m", "wapp",
"--wapp-url", "https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/"
"--wapp-url", "https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/"
]

with mock.patch.object(sys, "argv", testargs):
Expand All @@ -384,7 +384,7 @@ async def test_mod_wapp_is_not_set(mock_is_mod_wapp_or_update_set, _, __):
"wapiti",
"--url", "http://testphp.vulnweb.com/",
"-m", "xss",
"--wapp-url", "https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/"
"--wapp-url", "https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/"
]

with mock.patch.object(sys, "argv", testargs):
Expand Down Expand Up @@ -437,7 +437,7 @@ async def test_is_valid_url(mock_is_valid_url, _, __):
"wapiti",
"--url", "http://testphp.vulnweb.com/",
"-m", "wapp",
"--wapp-url", "https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/"
"--wapp-url", "https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/"
]

with mock.patch.object(sys, "argv", testargs):
Expand All @@ -455,7 +455,7 @@ async def test_is_not_valid_url(mock_is_valid_url, _, __):
"wapiti",
"--url", "http://testphp.vulnweb.com/",
"-m", "wapp",
"--wapp-url", "http::raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/"
"--wapp-url", "http::raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/"
]

with mock.patch.object(sys, "argv", testargs):
Expand Down
2 changes: 1 addition & 1 deletion wapitiCore/attack/attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def cms(self):

@property
def wapp_url(self):
return self.options.get("wapp_url", "https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/")
return self.options.get("wapp_url", "https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/")

@property
def wapp_dir(self):
Expand Down
2 changes: 1 addition & 1 deletion wapitiCore/main/wapiti.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async def wapiti_main():
attack_options = {
"level": args.level,
"timeout": args.timeout,
"wapp_url": "https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/main/"
"wapp_url": "https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/main/"
}
wap.set_attack_options(attack_options)
try:
Expand Down
2 changes: 1 addition & 1 deletion wapitiCore/wappalyzer/wappalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def __init__(self, message):
class ApplicationData:
"""
Store application database.
For instance https://raw.githubusercontent.com/wapiti-scanner/webappanalyzer/master/src/technologies/.
For instance https://raw.githubusercontent.com/wapiti-scanner/wappalyzerfork/master/src/technologies/.
"""

def __init__(self, categories_file_path=None, groups_file_path=None, technologies_file_path=None):
Expand Down

0 comments on commit 78c72e5

Please sign in to comment.