Skip to content

Commit

Permalink
feat: integrated interesting URIs plugin into IP&URI finder plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke committed Jan 14, 2025
1 parent ab95ac5 commit 59e8dec
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 156 deletions.
Empty file.
Empty file.
105 changes: 0 additions & 105 deletions src/plugins/analysis/interesting_uris/code/interesting_uris.py

This file was deleted.

Empty file.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from analysis.plugin import AnalysisPluginV0
from analysis.plugin.compat import AnalysisBasePluginAdapterMixin

from ..internal.interesting_uris import find_interesting_uris

if TYPE_CHECKING:
from io import FileIO

Expand All @@ -41,6 +43,7 @@ class Schema(BaseModel):
ips_v4: List[IpAddress]
ips_v6: List[IpAddress]
uris: List[str]
interesting_uris: List[str]

def __init__(self):
self.ip_and_uri_finder = CommonAnalysisIPAndURIFinder()
Expand All @@ -54,7 +57,7 @@ def __init__(self):
metadata=self.MetaData(
name='ip_and_uri_finder',
description='Search file for IP addresses and URIs based on regular expressions.',
version=Version(1, 1, 0),
version=Version(1, 2, 0),
Schema=self.Schema,
mime_whitelist=[
'text/plain',
Expand All @@ -79,6 +82,7 @@ def analyze(self, file_handle: FileIO, virtual_file_path: dict[str, list[str]],
ips_v4=[IpAddress(address=ip, location=self.find_geo_location(ip)) for ip in ip_v4_results],
ips_v6=[IpAddress(address=ip, location=self.find_geo_location(ip)) for ip in ip_v6_results],
uris=uris,
interesting_uris=find_interesting_uris([*ip_v4_results, *uris]),
)

def find_geo_location(self, ip_address: str) -> Location | None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
<td>
{% if key == "ips_v4" %}IPv4
{% elif key == "ips_v6" %}IPv6
{% else %}URI{% endif %}
{% elif key == "uris" %}URI
{% else %}Interesting URIs{% endif %}
</td>
<td class="p-0">
<ul class="list-group p-0 mb-0" style="width: 100%;">
Expand Down

0 comments on commit 59e8dec

Please sign in to comment.