Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xSteph Pentest ai Builtin Scanners

From Leeroopedia
Knowledge Sources
Domains Network_Security, Web_Security, Reconnaissance
Last Updated 2026-10-23 00:00 GMT

Overview

Concrete tool for built-in no-dependency security scanning of ports, HTTP headers, SSL/TLS, DNS, paths, and leaked secrets, provided by the pentest-ai engine.

Description

The scanners module provides a set of async scanner functions that work out-of-the-box without any external security tools installed. They provide immediate value on first install: scan_ports for TCP port scanning, scan_http_headers for security header analysis, check_ssl for TLS configuration, check_dns for DNS enumeration, scan_paths for common path discovery, and scan_secrets_in_response for leaked credential detection. Each scanner returns findings in the standard pentest-ai finding dict format.

Usage

Import these functions when you need to run quick no-dependency scans against a target. They are used by the orchestrator and agent loop as the baseline scanning layer that runs before external tools are invoked.

Code Reference

Source Location

Signature

async def scan_ports(target: str, ports: list[int] | None = None, timeout: float = 2.0) -> list[dict[str, Any]]: ...
async def scan_http_headers(target: str) -> list[dict[str, Any]]: ...
async def check_ssl(target: str, port: int = 443) -> list[dict[str, Any]]: ...
async def check_dns(target: str) -> list[dict[str, Any]]: ...
async def scan_paths(target: str) -> list[dict[str, Any]]: ...
async def scan_secrets_in_response(target: str) -> list[dict[str, Any]]: ...

Import

from engine.scanners import scan_ports, scan_http_headers, check_ssl, check_dns, scan_paths, scan_secrets_in_response

I/O Contract

Inputs

Name Type Required Description
target str Yes Hostname, IP, or URL to scan
ports None No Custom port list (default: 26 common ports)
timeout float No Connection timeout in seconds (default: 2.0)
port int No SSL port (default: 443)

Outputs

Name Type Description
findings list[dict] Standard finding dicts with title, severity, category, evidence, tool_source

Usage Examples

Port Scan

import asyncio
from engine.scanners import scan_ports

# Scan default ports
findings = asyncio.run(scan_ports("example.com"))

# Scan specific ports
findings = asyncio.run(scan_ports("10.0.0.1", ports=[22, 80, 443, 8080]))
for f in findings:
    print(f"  [{f['severity']}] {f['title']}")

HTTP Header Security Check

import asyncio
from engine.scanners import scan_http_headers

findings = asyncio.run(scan_http_headers("example.com"))
for f in findings:
    print(f"  [{f['severity']}] {f['title']}")
    if f.get("remediation"):
        print(f"    Fix: {f['remediation']}")

Common Path Discovery

import asyncio
from engine.scanners import scan_paths

findings = asyncio.run(scan_paths("https://example.com"))
for f in findings:
    print(f"  [{f['severity']}] {f['title']}")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment