Skip to content

A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.

feat: httpx tool

dextmorgnd72f9347b9a1
diff --git a/flowsint-api/app/scanners/websites/to_webtech.py b/flowsint-api/app/scanners/websites/to_webtech.py
new file mode 100644
index 00000000..e69de29b
diff --git a/flowsint-api/app/tools/network/asnmap.py b/flowsint-api/app/tools/network/asnmap.py
index a6b1e749..8924dc3a 100644
--- a/flowsint-api/app/tools/network/asnmap.py
+++ b/flowsint-api/app/tools/network/asnmap.py
@@ -58,7 +58,7 @@ class AsnmapTool(DockerTool):
flag = flags[type]
try:
# Use the -target argument as asnmap expects
- result = super().launch(f"{flag} {item} -silent -json ")
+ result = super().launch(f"{flag} {item} -silent -json")
if result and result != "":
return json.loads(result)
else:
diff --git a/flowsint-api/app/tools/network/httpx.py b/flowsint-api/app/tools/network/httpx.py
new file mode 100644
index 00000000..48610f4c
--- /dev/null
+++ b/flowsint-api/app/tools/network/httpx.py
@@ -0,0 +1,76 @@
+import json
+from typing import Any, List
+from app.tools.dockertool import DockerTool
+from app.utils import is_valid_domain
+
+class HttpxTool(DockerTool):
+ image = "projectdiscovery/httpx"
+ default_tag = "latest"
+
+ def __init__(self):
+ super().__init__(self.image, self.default_tag)
+
+ @classmethod
+ def name(cls) -> str:
+ return "httpx"
+
+ @classmethod
+ def description(cls) -> str:
+ return "An HTTP toolkit that probes services, web servers, and other valuable metadata."
+
+ @classmethod
+ def category(cls) -> str:
+ return "Web technologies enumeration"
+
+ def install(self) -> None:
+ super().install()
+
+ def version(self) -> str:
+ try:
+ output = self.client.containers.run(
+ image=self.image,
+ command="--version",
+ remove=True,
+ stderr=True,
+ stdout=True
+ )
+ output_str = output.decode()
+ import re
+ match = re.search(r'(v[\d\.]+)', output_str)
+ version = match.group(1) if match else "unknown"
+ return version
+ except Exception as e:
+ return f"unknown (error: {str(e)})"
+
+
+ def update(self) -> None:
+ # Pull the latest image
+ self.install()
+
+ def is_installed(self) -> bool:
+ return super().is_installed()
+
+ def launch(self, target: str, args: List[str]| None = None) -> Any:
+ if args is None:
+ args = []
+ args_str = ' '.join(args) if args else ''
+ command = f"-u {target} {args_str} -json -silent"
+ result = super().launch(command)
+
+ # Handle empty result
+ if not result or result.strip() == "":
+ return []
+
+ # Handle multiple JSON lines (one per result)
+ lines = result.strip().split('\n')
+ results = []
+
+ for line in lines:
+ line = line.strip()
+ if line:
+ try:
+ results.append(json.loads(line))
+ except json.JSONDecodeError as e:
+ raise e
+ return results
+
diff --git a/flowsint-api/app/tools/network/subfinder.py b/flowsint-api/app/tools/network/subfinder.py
index fffe0105..ef69cfef 100644
--- a/flowsint-api/app/tools/network/subfinder.py
+++ b/flowsint-api/app/tools/network/subfinder.py
@@ -1,4 +1,4 @@
-from typing import Any
+from typing import Any, List
from app.tools.dockertool import DockerTool
from app.utils import is_valid_domain
@@ -50,12 +50,11 @@ class SubfinderTool(DockerTool):
def is_installed(self) -> bool:
return super().is_installed()
- def launch(self, domain: str) -> Any:
+ def launch(self, domain: str, args:List[str]) -> Any:
subdomains: set[str] = set()
- command = f"-d {domain}"
+ command = f"-d {domain} {' '.join(args)}"
result = super().launch(command)
for sub in result.split("\n"):
- print(sub)
if is_valid_domain(sub) and sub.endswith(domain) and sub != domain and not sub.startswith("."):
subdomains.add(sub)
return list(subdomains)
diff --git a/flowsint-api/tests/tools/network/httpx.py b/flowsint-api/tests/tools/network/httpx.py
new file mode 100644
index 00000000..5e746acb
--- /dev/null
+++ b/flowsint-api/tests/tools/network/httpx.py
@@ -0,0 +1,40 @@
+import re
+from typing import List
+from app.tools.network.httpx import HttpxTool
+
+tool = HttpxTool()
+
+def test_name():
+ assert tool.name() == "httpx"
+
+def test_description():
+ assert tool.description() == "An HTTP toolkit that probes services, web servers, and other valuable metadata."
+
+def test_category():
+ assert tool.category() == "Web technologies enumeration"
+
+def test_image():
+ assert tool.get_image() == "projectdiscovery/httpx"
+
+def test_install():
+ tool.install()
+ assert tool.is_installed() == True
+
+def test_version():
+ tool.install()
+ version = tool.version()
+ # Check that version follows the expected format: v followed by digits and dots
+ assert re.match(r'^v[\d\.]+$', version)
+
+def test_launch():
+ assert True
+ results = tool.launch("https://alliage.io")
+ print(results)
+ assert isinstance(results, List)
+
+def test_launch_unreached_host():
+ assert True
+ results = tool.launch("https://this-is-not-a-valid-domain.local")
+ assert isinstance(results, List)
+ assert len(results) == 0
+
\ No newline at end of file
diff --git a/flowsint-app/src/renderer/src/components/graphs/graph-panel.tsx b/flowsint-app/src/renderer/src/components/graphs/graph-panel.tsx
index e94475b8..f9cfb439 100644
--- a/flowsint-app/src/renderer/src/components/graphs/graph-panel.tsx
+++ b/flowsint-app/src/renderer/src/components/graphs/graph-panel.tsx
@@ -128,7 +128,7 @@ const GraphPanel = ({ graphData, isLoading, isRefetching }: GraphPanelProps) =>
<WallEditor isRefetching={isRefetching} isLoading={loading} />
)} */}
{/* <Graph /> */}
- {nodes?.length > 100 ? (
+ {nodes?.length > 500 ? (
<Graph />
) : (
view === "force" ? <GraphReactForce /> :