Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop yielding network in certain normalizers #3420

Merged
merged 7 commits into from
Sep 4, 2024
1 change: 0 additions & 1 deletion boefjes/boefjes/plugins/kat_crt_sh/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def run(input_ooi: dict, raw: bytes) -> Iterable[NormalizerOutput]:
current = fqdn.lstrip(".")

network = Network(name="internet")
yield network
network_reference = network.reference

unique_domains = set()
Expand Down
1 change: 0 additions & 1 deletion boefjes/boefjes/plugins/kat_nmap_tcp/normalize.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def run(input_ooi: dict, raw: bytes) -> Iterable[NormalizerOutput]:

# Relevant network object is received from the normalizer_meta.
network = Network(name=input_ooi["network"]["name"])
yield network

netblock_ref = None
if "NetBlock" in input_ooi["object_type"]:
Expand Down
2 changes: 1 addition & 1 deletion boefjes/tests/test_nmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class NmapTest(TestCase):
def test_normalizer(self):
input_ooi = IPAddressV4(network=Network(name="internet").reference, address="134.209.85.72")
output = list(run(input_ooi.serialize(), get_dummy_data("raw/nmap_mispoes.xml")))
self.assertEqual(16, len(output))
self.assertEqual(15, len(output))
for i, out in enumerate(output[:-1]):
if out.object_type == "IPPort" and output[i + 1].object_type == "Service":
if out.port == 80:
Expand Down