-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Jan Klopper <[email protected]> Co-authored-by: Jeroen Dekkers <[email protected]>
- Loading branch information
1 parent
ccb1d2c
commit 555c261
Showing
24 changed files
with
257 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import json | ||
from collections.abc import Iterable | ||
|
||
from Wappalyzer import Wappalyzer, WebPage | ||
|
||
from boefjes.job_models import NormalizerMeta | ||
from octopoes.models import OOI, Reference | ||
from octopoes.models.ooi.dns.zone import Hostname | ||
from octopoes.models.ooi.network import Network | ||
from octopoes.models.ooi.software import Software, SoftwareInstance | ||
|
||
|
||
def run(normalizer_meta: NormalizerMeta, raw: bytes | str) -> Iterable[OOI]: | ||
pk = normalizer_meta.raw_data.boefje_meta.input_ooi | ||
tokenized_hostname = Reference.from_str(pk).tokenized["website"]["hostname"] | ||
hostname = Hostname( | ||
network=Network(name=tokenized_hostname["network"]["name"]).reference, name=tokenized_hostname["name"] | ||
) | ||
raw_respsone, body = raw.split(b"\n\n", 1) | ||
response_object = json.loads(raw_respsone) | ||
url = response_object["response"]["url"] | ||
|
||
headers = response_object["response"]["headers"] | ||
body = body.decode(response_object.get("encoding") or "utf-8", "replace") | ||
|
||
wappalyzer = Wappalyzer.latest() | ||
web_page = WebPage(url, body, headers) | ||
results = wappalyzer.analyze_with_versions_and_categories(web_page) | ||
|
||
for name, data in results.items(): | ||
software = Software(name=name, version=data["versions"].pop(0)) | ||
software_instance = SoftwareInstance(ooi=hostname.reference, software=software.reference) | ||
yield from [software, software_instance] |
4 changes: 2 additions & 2 deletions
4
...gins/kat_website_software/normalizer.json → ...es/plugins/kat_wappalyzer/normalizer.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{ | ||
"id": "312b968d-0453-48fd-8e7b-ecfcb757dc7e", | ||
"raw_data": { | ||
"id": "e20e3de6-4305-4344-bfcf-a8b9ecc76ccd", | ||
"boefje_meta": { | ||
"id": "a8d1830b-3e2e-4dab-928e-4493a9710ff1", | ||
"boefje": { | ||
"id": "webpage-analysis" | ||
}, | ||
"organization": "_dev", | ||
"input_ooi": "HTTPResource|internet|134.209.85.72|tcp|443|https|internet|mispo.es|https|internet|mispo.es|443|/", | ||
"arguments": { | ||
"input": { | ||
"object_type": "HTTPResource", | ||
"scan_profile": "reference=Reference('HTTPResource|internet|134.209.85.72|tcp|443|https|internet|mispo.es|https|internet|mispo.es|443|/') level=4 scan_profile_type='inherited'", | ||
"primary_key": "HTTPResource|internet|134.209.85.72|tcp|443|https|internet|mispo.es|https|internet|mispo.es|443|/", | ||
"website": { | ||
"ip_service": { | ||
"ip_port": { | ||
"address": { | ||
"network": { | ||
"name": "internet" | ||
}, | ||
"address": "134.209.85.72" | ||
}, | ||
"protocol": "tcp", | ||
"port": "443" | ||
}, | ||
"service": { | ||
"name": "https" | ||
} | ||
}, | ||
"hostname": { | ||
"network": { | ||
"name": "internet" | ||
}, | ||
"name": "mispo.es" | ||
} | ||
}, | ||
"web_url": { | ||
"scheme": "https", | ||
"netloc": { | ||
"network": { | ||
"name": "internet" | ||
}, | ||
"name": "mispo.es" | ||
}, | ||
"port": "443", | ||
"path": "/" | ||
}, | ||
"redirects_to": "None" | ||
} | ||
} | ||
}, | ||
"mime_types": [ | ||
{ | ||
"value": "openkat-http/response" | ||
} | ||
] | ||
}, | ||
"normalizer": { | ||
"id": "kat_wappalyzer_normalize", | ||
"version": null | ||
} | ||
} |
Oops, something went wrong.