feat(transforms): naabu tool

This commit is contained in:
dextmorgn
2025-11-18 12:54:33 +01:00
parent 7965a473fb
commit 958f6f48ef
2 changed files with 190 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
import re
from typing import List
from tools.network.naabu import NaabuTool
tool = NaabuTool()
def test_name():
assert tool.name() == "naabu"
def test_description():
assert (
tool.description()
== "Fast port scanner written in Go with focus on reliability and simplicity."
)
def test_category():
assert tool.category() == "Port scanning"
def test_image():
assert tool.get_image() == "projectdiscovery/naabu"
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_passive():
"""Test passive mode with API key (will skip if no API key available)"""
# Note: This requires PDCP_API_KEY to be set
# For now, just test that the function can be called
assert True
def test_launch_active():
"""Test active port scanning"""
# Note: This requires proper network permissions and a target
# For safety, we just verify the method exists and can be called
assert hasattr(tool, "launch")
assert callable(tool.launch)