infrascan is an Infrastructure and Wireless signal scanning and enumeration tool that provides security teams with data-rich insights into infrastructure resources and targets. It follows the CLI Development Conventions for attack stage organization and implements discover, enumerate, and pentest capabilities.
The tool follows the standard CLI Development Conventions with clear separation by attack stages:
-
Discover Stage (
internal/discover/)- Passive reconnaissance and information gathering
- Target fingerprinting without direct interaction
-
Enumerate Stage (
internal/enumerate/)- Deep inspection of discovered targets
-
Pentest Stage (
internal/pentest/)- Attack surface mapping
-
Discovery Module (
internal/discover/)- Wireless Access Point discovery
-
Enumeration Module (
internal/enumerate/) -
Penetration Testing Module (
internal/pentest/)
root.go- Main CLI setup with Cobradiscover.go- Discovery command implementationsenumerate.go- Enumeration command implementationspentest.go- Penetration testing command implementations
- Fern-generated Go types and clients
- Infrascan data definitions and structures
- API interfaces for type safety
- Language: Go
- Module: github.com/Method-Security/infrascan
- CLI Framework: Cobra
- Type Generation: Fern
- Testing: Standard Go testing + external API integration tests
- Wireless Access Point: WAP discovery, and enumeration
- Follow the CLI Development Conventions for attack stage organization
- Use
<stage>Cmdin camelCase for top-level commands (e.g.,discoverCmd) - Use
<stage><Component>Cmdfor subcommands (e.g.,discoverDomainCmd) - Implement Run functions with action verbs (e.g.,
RunWAPDiscovery)
- Use kebab-case for CLI flags:
--target-ssid - Use camelCase when extracting flags:
targetSSID, err := cmd.Flags().GetString("target-ssid") - Always check errors when extracting flags:
if err != nil { a.OutputSignal.AddError(err) return }
- Use
.GetStringSlicefor slice inputs with plural flag names - Mark required flags explicitly:
_ = cmd.MarkFlagRequired("target")
- Repository organized by attack stage (
discover,enumerate,pentest) - Mirror naming between
fern/definition/<stage>/<component>.yml,internal/<stage>/<component>.go, andcmd/<stage>.go - Use subdirectories for complex components, flat files for simple ones
if err != nil {
a.OutputSignal.AddError(err)
return
}- MANDATORY: Every CLI command with output must have a corresponding Fern report structure
- Three-Part Structure Pattern: All commands must define:
# 1. Config type for input parameters <Stage><Component>Config: properties: # Infrascan-specific configuration parameters target: string # 2. Result type for output data <Stage><Component>Result: properties: # Infrascan-specific result data wirelessAccessPoints: optional<list<WAPInfo>> # 3. Report type wrapping config, result, and errors <Stage><Component>Report: properties: config: <Stage><Component>Config result: <Stage><Component>Result errors: optional<list<string>>
- Infrascan Example Implementation:
TODO
- Infrascan-Specific Types: Include Infrascan-specific enums and objects:
TODO
- Type Organization: Follow the CLI Development Conventions type ordering:
- ENUMs (e.g.,
DataSource) - Common Objects (e.g.,
WAPInfo) - Config Types (e.g.,
DiscoverWAPConfig) - Result Types (e.g.,
DiscoverWAPResult) - Report Types (e.g.,
DiscoverWAPReport)
- ENUMs (e.g.,
a.OutputSignal.Content = reportTODO
# MANDATORY: Run after completing TODOs to ensure code can be merged
./godelw verify
# Build the binary
./godelw build- Follow CLI Development Conventions for new commands
- Use Fern definitions for type safety
- Implement proper rate limiting and error handling
- Test with various target types and scenarios
- Follow existing patterns for consistency
- CRITICAL: Always run
./godelw verifyafter TODO completion before merging
/cmd/- CLI command implementations/internal/<stage>/- OSINT capability implementations/fern/definition/- Fern API definitions/generated/go/- Generated Go code/configs/- Configuration files and wordlists/docs/- Documentation
- Follow CLI Development Conventions exactly
- Implement comprehensive error handling and rate limiting
- Handle sensitive data appropriately
- Always end files with a single newline