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

Environment:0xSteph Pentest ai aiohttp

From Leeroopedia
Knowledge Sources
Domains Infrastructure, HTTP
Last Updated 2026-10-23 14:00 GMT

Overview

aiohttp >= 3.9 async HTTP client environment required by oracle verification, capsule replay, and probe execution modules that perform live HTTP requests during engagement verification.

Description

This environment provides the aiohttp async HTTP client library used by pentest-ai's verification and probing subsystems. The `Verifier.verify_candidate` and `stamp_oracle_verdicts` functions create `aiohttp.ClientSession` instances to re-run exploit attempts against live targets. Oracle builders in `engine/oracles.py` use the session to perform differential privilege checks, replay attacks, and OAST callback verification.

aiohttp is a core dependency (not optional) because verification is the heart of pentest-ai's "earned verdict" philosophy — every finding must be re-proven against the live target before it is surfaced as verified.

Usage

Use this environment when:

  • Running oracle verification that makes live HTTP requests (differential, replay, OAST)
  • Replaying proof capsules against a target
  • Executing MCP probe tools that perform HTTP requests
  • Running chain capsule build and replay operations

System Requirements

Category Requirement Notes
OS Linux, macOS, Windows Same as Environment:0xSteph_Pentest_ai_Python_3_10_Plus
Hardware Any modern CPU Network I/O bound, not CPU bound
Network Target must be reachable Verification requires live HTTP access to the engagement target

Dependencies

System Packages

Python Packages

  • `aiohttp` >= 3.9

Credentials

No additional credentials. Targets are accessed using credentials captured during the engagement (stored in `WorkingMemory.captured_auth`).

Quick Install

# aiohttp is a core dependency; included in the base install
pip install -e .

Code Evidence

aiohttp dependency from `pyproject.toml:51`:

"aiohttp>=3.9",

aiohttp session usage in `engine/verifier.py:238-245`:

import aiohttp

async with aiohttp.ClientSession() as session:
    for finding in findings:
        oracle = build_oracle_from_finding(finding, session, intensity)
        if oracle is None:
            continue
        receipt = await verifier.verify_candidate(
            engagement_id=engagement_id,
            finding_id=fid,
            oracle=oracle,
        )

Common Errors

Error Message Cause Solution
`aiohttp.ClientConnectorError` Target unreachable or connection refused Verify target is in scope and reachable; check network/firewall
`TimeoutError during oracle verify` Target slow to respond Increase tool timeout via ScanProfile or reduce intensity
`RuntimeError: Session is closed` aiohttp session used after `async with` exit Ensure all oracle calls happen inside the `async with aiohttp.ClientSession()` block

Compatibility Notes

  • Proxy support: Respects `PTAI_UPSTREAM_PROXY` env var for proxy-routed verification requests.
  • Scope enforcement: All aiohttp requests in oracle paths are subject to ScopeEnforcer checks; out-of-scope requests are blocked before the session sends them.
  • Async-only: aiohttp is used exclusively in async contexts (`async def`); synchronous callers must use `httpx` or `requests` instead.

Related Pages

Page Connections

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