Skip to content
BreachPilot

Attack Modules — Overview

Pre-packaged exploit payloads the AI can call. Single-source discovery via pkgutil.iter_modules (registry.py:21).

Base types (base.py)

SymbolKindLineNotes
ModuleContextdataclass13Input to run(ctx); fields below
ModuleResultdataclass75Typed shape; to_dict()/to_result(d) adapters
AttackModuleABC23615+ subclasses via registry
ApplicabilityReportdataclass46{score, reasons, penalties}
ModuleStatusLiteral42`info

ModuleContext fields (base.py:13):

FieldTypeDefaultPurpose
target_ipstrrequiredTarget
target_os`strNone`
serviceslist[dict][]{service, port, version}
cveslist[str][]CVE ids
workspacePathexploit_workspacePer-attempt dir
credentials / parameters / config...[]/{}/NonePost-exploit + config
sessions/findings/hypotheses/evidence_refs......Capability-upgrade compact state
access_achieved / privilege_level / phase......Runtime gating

ModuleResult (base.py:75) carries status, module, script, note, suggested_command/msf, shell_type, privilege_level, credentials_found, evidence/references, failure_class, retryable, confidence, produced_artifacts, follow_ups, unlocked_capabilities, extra. to_dict() drops empty optionals; to_result(d) adapts legacy dict returns, merging credentialscredentials_found (base.py:169).

AttackModule (base.py:236)

AttributeTypeDefaultNotes
namestr""Unique id
descriptionstr""
target_serviceslist[str][]Service names
target_portslist[int][]Ports
required_cveslist[str][]CVEs
target_versionsdict[str,list[str]]{}Version pattern bonus +25
target_os_hintlist[str][]OS gate +30
destructive_icsboolfalseRequires ics.allow_write && destructive_ics
requires / produceslist[str][]Artifact composition
read_onlyboolfalseDoesn't mutate target
coststrmedium
phase_hintstr""Advisory

Methods: applicability(ctx)→int (base.py:285 – 0-100, ICS gate first, then +30 per service, +20 per port, +40 per CVE, +25 version bonus, +30 OS hint, capped 100), applicability_explain(ctx)→ApplicabilityReport (:345), capability_record()→dict (:399), run(ctx)→dict abstract, _info_result(ctx, note, evidence, references, …) (:426), generate_python_script(ctx), generate_dynamic_script(ctx, mutator) (:469 – uses PayloadCrafter via registry._module_primary_service for write/read coherence), to_json().

Module families (15 files, verified via modules/ glob)

FileModules (all verified via AST)Count
ad.pyADCSEnum, BloodHoundCollect, ResponderRelay, GoldenTicket, SMBSigningCheck5
auth_creds.pyCredentialSpray, PasswordSpray, HashCrack, ASREPRoast, Kerberoasting, DCSyncAttack, ADLDAPEnum7
crypto_jwt.pyJWTTamper1
deserialize.pyDeserializeAttack1
detection.pyDetectionCoverageProbe, LogSourceEnum, OPSECPostureReport3
ics_iot.pyModbusEnum, DNP3Enum, S7Enum, BACnetEnum, HMIDefaultCred, IoTDefaultCred, ModbusWriteCoil, ModbusWriteRegister, S7PlcStop, S7PlcStart10
network_smb.pySMBGhost, EternalBlue, SMBRelay, SMBNullSession, PassTheHash, DumpHashes6
orchestrator_phases.pyTokenImpersonation, ServiceMisconfiguration, LateralMovement, ValidateFinding, LocalExploitSuggester5
persistence.pyLinuxPersistence, WindowsPersistence, WebShellPersistence3
privesc.pyLinuxPrivescCheck, WindowsPrivescCheck, SUIDEnumeration, KernelExploitCheck, ContainerBreakout, CloudPrivesc, K8sPrivesc, IMDSExploit, DockerSockEscape, S3BucketTakeover10
services.pyRDPBlueKeep, FTPAnonymous, RedisExploit, ElasticsearchExploit, LDAPAnonymous, RDPExploit6
ssh.pySSHBruteForce, RegreSSHion, OpenSSHCVECheck3
supply_chain.pyExposedVCS, CICDMisconfig, DependencyConfusion, ArtifactExposure, SupplyChainRecon5
synthesis.pyCVEToExploit, DiffPatchAnalysis, FuzzToExploit, WeaponizedExploit4
web.pyLog4jRCE, BasicAuthBuster, APIFuzzer, WebShellUpload, SQLInjection, XSSScanner, SSTIProbe, GraphQLIntrospect, RaceRequest, TimingOracle, RequestSmuggling, SSRFProbe, XXEProbe, LFITraversal14

Total: ~83 module classes across 15 files (verified via AST walk). See registry.md for discovery/ranking.

Capability metadata (base.py:279-399 + registry.py:221-239)

requires/produces name artifact kinds (credentials, foothold, admin_priv, hash_artifact, user_list, …) via _artifact_present (base.py:58). capability_record() is the machine-readable superset of to_json() for query_capabilities/get_capability_details; find_producers(artifact_kind) / missing_prerequisites(mod, ctx) in registry.py.

ICS destructive gate

destructive_ics=True (4 write modules in ics_iot.py: ModbusWriteCoil/WriteRegister, S7PlcStop/Start) → applicability returns 0 unless tools.attack_modules.modules.ics_iot._ics_write_allowed() (ics.allow_write && ics.destructive_ics). run() also re-checks defense-in-depth.

Config keys

KeyEffect
ics.allow_write / destructive_icsWrite ICS visibility
adaptive_exploits.enabled / max_mutationsgenerate_dynamic_script
memory.semantic_enabledCross-mission learning in mutator
recon.*exploit_search sources (NVD etc. separate)

Tests

FileVerifiedCovers
tests/test_attack_modules.pyyesapplicability, score caps, to_json
tests/test_attack_modules_api.pyyesMCP run_attack_module wiring
tests/test_new_modules.pyyesweb.py new modules (XSS/SSTI etc.)
tests/test_module_lint.pyyesname uniqueness, required fields
tests/test_version_aware_ranking.pyyestarget_versions +25
tests/test_module_capability_metadata_a.pyyescapability_record + find_producers
tests/test_module_capability_metadata_b.pyyesrequires/produces semantics
tests/test_ics_iot_modules.py / test_ics_exploit.pyyesICS gate + scripts
tests/test_persistence_modules.pyyesPersistence scripts
tests/test_supply_chain_modules.pyyesSupply-chain recon
tests/test_ssrf_xxe_lfi_modules.pyyesSSRF/XXE/LFI
tests/test_detection_modules.pyyesDetection coverage
source: repo docs (build sync)Edit this page on GitHub →