Recon

From Steffen025/pai-opencode · View interactive version

Recon is an AI agent skill from the GitHub repository Steffen025/pai-opencode. Security reconnaissance. USE WHEN recon, reconnaissance, bug bounty, attack surface. SkillSearch('recon') for docs.

How to use this skill

Skill file

Customization

Before executing, check for user customizations at:

~/.opencode/PAI/USER/SKILLCUSTOMIZATIONS/Recon/

If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.

recon

Infrastructure and Network Reconnaissance

Purpose

Technical reconnaissance of network infrastructure including domains, IP addresses, netblocks, and ASNs. Combines passive intelligence gathering with authorized active scanning to map attack surfaces and identify assets.

Voice Notification

When executing a workflow, do BOTH:

  1. Send voice notification:

```bash

curl -s -X POST http://localhost:8888/notify \

-H "Content-Type: application/json" \

-d '{"message": "Running the WORKFLOWNAME workflow from the Recon skill"}' \

> /dev/null 2>&1 &

```

  1. Output text notification:

```

Running the WorkflowName workflow from the Recon skill...

```

When to Use This Skill

Core Triggers - Use this skill when user says:

Direct Recon Requests

Infrastructure & Network Mapping

IP & Domain Investigation

ASN & Netblock Research

Passive vs Active Recon

Use Case Indicators

Relationship with Other Security Skills

OSINT → recon (Common Pattern):

recon → webassessment:

Workflow Integration:

// OSINT skill discovers company infrastructure
const domains = await osintFindCompanyDomains("Acme Corp");

// Calls recon skill to map technical details
const infraMap = await reconDomain(domains[0]);

// Recon identifies web apps
const webApps = infraMap.subdomains.filter(s => s.hasHTTP);

// Calls web assessment for testing
await webAssessment(webApps);

Core Capabilities

Passive Reconnaissance (No Authorization Required)

Active Reconnaissance (Requires Explicit Authorization)

CRITICAL AUTHORIZATION REQUIREMENTS:

Active reconnaissance MUST have:

  1. Explicit user confirmation for each active scan
  2. Documented authorization (pentest engagement, bug bounty program, owned assets)
  3. Scope validation (ensure target is in-scope)
  4. Rate limiting (respectful scanning, no DoS)
  5. Session logging (record all active recon for audit trail)

Default behavior is PASSIVE ONLY. Always confirm before active techniques.

Available Workflows

1. `PassiveRecon.md` - Safe Reconnaissance

Non-intrusive intelligence gathering using public sources:

Input: Domain, IP, or netblock

Output: Passive intelligence report

Authorization: None required

2. `IpRecon.md` - IP Address Investigation

Comprehensive IP address reconnaissance:

Input: Single IP address

Output: IP reconnaissance report

Authorization: Required for active scanning

3. `DomainRecon.md` - Domain Investigation

Full domain mapping and enumeration:

Input: Domain name

Output: Domain reconnaissance report

Authorization: Required for active subdomain probing

4. `NetblockRecon.md` - CIDR Range Scanning

Network range reconnaissance:

Input: CIDR notation (e.g., 192.168.1.0/24)

Output: Netblock scan report

Authorization: Required for active scanning

5. `AsnRecon.md` - Autonomous System Investigation

ASN and BGP reconnaissance:

Input: ASN number (e.g., AS15169)

Output: ASN mapping report

Authorization: None required (passive data)

Tool Integration

Primary Tools

IPInfo API (ipinfo.io)

System Tools (always available)

MCP Tools (security profile required)

Future Tool Integration

Shodan (when API key added)

Censys (when API key added)

SecurityTrails (when API key added)

VirusTotal (when API key added)

TypeScript Utilities

Located in tools/ directory:

ipinfo-client.ts

dns-utils.ts

whois-parser.ts

cidr-utils.ts

cert-transparency.ts

report-generator.ts

Output Formats

IP Reconnaissance Report

# IP Reconnaissance: 1.2.3.4

## Summary
- IP: 1.2.3.4
- Organization: Example Corp
- ASN: AS12345
- Location: San Francisco, CA, US
- ISP: Example Hosting

## DNS
- Reverse DNS: server.example.com
- Additional PTR: ...

## Network Information
- CIDR: 1.2.3.0/24
- Netblock Owner: Example Corp
- Abuse Contact: abuse@example.com

## Services (Passive)
- Certificates: 3 certificates found
- Historical DNS: ...

## Services (Active - Authorized)
- Open Ports: 22, 80, 443
- Services: SSH (OpenSSH 8.2), HTTP (nginx 1.20.1), HTTPS
- Technologies: nginx, OpenSSH

## Recommendations
- Further investigation areas
- Related assets
- Security observations

Domain Reconnaissance Report

# Domain Reconnaissance: example.com

## Summary
- Domain: example.com
- Registrar: Example Registrar
- Registration: 2010-01-15
- Expiry: 2026-01-15

## DNS Records
### A Records
- 1.2.3.4
- 5.6.7.8

### MX Records
- 10 mail.example.com

## Subdomains
- www.example.com (1.2.3.4)
- api.example.com (1.2.3.5)
- admin.example.com (1.2.3.6)

## Email Security
- SPF: Configured
- DMARC: Configured
- DKIM: Configured

## Technologies
- Web Server: nginx
- Framework: React
- CDN: Cloudflare

## Recommendations
- Interesting subdomains: admin.example.com, api.example.com
- Attack surface: 15 web applications identified

Reports saved to:

MCP Profile Requirements

For passive recon: No special MCP profile needed

For active recon: Requires security MCP profile

# Switch to security profile
~/.opencode/MCPs/swap-mcp security

# Restart Claude Code to apply
# Then run active reconnaissance

Security profile includes:

Ethical and Legal Considerations

CRITICAL RULES:

  1. Authorization First - Never perform active scanning without explicit authorization
  2. Scope Validation - Ensure targets are in-scope for testing
  3. Rate Limiting - Respectful scanning, no DoS or aggressive techniques
  4. Documentation - Log all recon activities with timestamps and authorization
  5. Responsible Disclosure - If vulnerabilities found, follow responsible disclosure
  6. No Destructive Testing - Reconnaissance only, no exploitation

Authorization Types:

Never scan:

When in doubt: Ask for explicit confirmation and documented authorization.

Usage Examples

Example 1: Passive Domain Recon

User: "Do passive recon on example.com"

Assistant: Activating recon skill with passive-recon workflow.
     Target: example.com
     Mode: Passive only (no active scanning)

     [Performs WHOIS, DNS, cert transparency, IPInfo]
     [Generates report in scratchpad]

     Report: ~/.opencode/MEMORY/WORK/{current_work}/scratch/recon-example-com/

Example 2: IP Investigation with Active Scan

User: "Investigate IP 1.2.3.4 - I own this server"

Assistant: Activating recon skill with ip-recon workflow.
     Target: 1.2.3.4

     Authorization check: You confirmed this is an owned asset.
     Proceeding with passive + active reconnaissance.

     [Performs IPInfo, reverse DNS, WHOIS, port scan, service detection]
     [Generates comprehensive report]

     Report: Open ports found (22, 80, 443)
             Services: SSH, HTTP, HTTPS
             Technologies: nginx 1.20.1, OpenSSH 8.2

Example 3: Integration with OSINT

User: "Do OSINT on Acme Corp and map their infrastructure"

Assistant: Activating OSINT skill...
     Found domains: acme.com, acmecorp.com, acme.io

     Now calling recon for infrastructure mapping...

     [Recon skill maps each domain]
     [Discovers subdomains, IPs, netblocks]
     [Creates comprehensive infrastructure map]

     Report: Complete OSINT + Infrastructure report
             15 domains, 47 subdomains, 3 netblocks identified

Workflow Selection Logic

Automatic workflow selection based on input:

User can override:

"Use passive-recon workflow on 1.2.3.4"
"Run domain-recon on example.com with active scanning"

Success Criteria

Passive Recon Success:

Active Recon Success:

Related Documentation

Security Skills:

Tool Documentation:

Best Practices:


Remember: Start passive, confirm authorization before going active, document everything, and be respectful of target systems.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.