Skip to content

Commit 006ca11

Browse files
badcharsclaude
andcommitted
feat: add amass provider + fix subfinder timeout
- Add OWASP amass as second enum provider (passive mode) - enum stage now runs subfinder + amass in parallel, merges & deduplicates - Subfinder timeout now configurable via config (default: 30 min) - Amass timeout configurable (default: 30 min) - If amass binary not found, gracefully skips (subfinder-only fallback) - Updated Dockerfile, config.example.yaml, README Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a0763ee commit 006ca11

8 files changed

Lines changed: 79 additions & 13 deletions

File tree

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ RUN go install github.com/projectdiscovery/subfinder/v2/cmd/subfinder@latest &&
1919
go install github.com/projectdiscovery/httpx/cmd/httpx@latest && \
2020
go install github.com/projectdiscovery/tlsx/cmd/tlsx@latest && \
2121
go install github.com/projectdiscovery/naabu/v2/cmd/naabu@latest && \
22-
go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
22+
go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest && \
23+
go install github.com/owasp-amass/amass/v4/...@master
2324

2425
# ── Stage 3: Final image ──
2526
FROM ubuntu:24.04

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<p align="center">
2-
<img src="https://img.shields.io/badge/Go-1.25-00ADD8?style=flat-square&logo=go&logoColor=white" alt="Go">
2+
<img src="https://img.shields.io/badge/Go-1.24-00ADD8?style=flat-square&logo=go&logoColor=white" alt="Go">
33
<img src="https://img.shields.io/badge/Docker-Ready-2496ED?style=flat-square&logo=docker&logoColor=white" alt="Docker">
44
<img src="https://img.shields.io/badge/License-MIT-green?style=flat-square" alt="License">
55
<img src="https://img.shields.io/badge/CDP-Chromium-4285F4?style=flat-square&logo=googlechrome&logoColor=white" alt="CDP">
6-
<img src="https://img.shields.io/badge/Providers-12-blueviolet?style=flat-square" alt="Providers">
6+
<img src="https://img.shields.io/badge/Providers-13-blueviolet?style=flat-square" alt="Providers">
77
<img src="https://img.shields.io/badge/DSL_Rules-60+-orange?style=flat-square" alt="DSL Rules">
88
</p>
99

@@ -53,7 +53,7 @@ recon0 run target.com
5353
|
5454
v
5555
┌────────────────────────────────────────────────────────────────────────────┐
56-
│ 1. ENUM subfinder Passive subdomain enumeration │
56+
│ 1. ENUM subfinder+amass Passive subdomain enumeration │
5757
│ 2. RESOLVE dnsx ◄── DNS gate: 0 results = stop │
5858
│ 3. PROBE httpx + tlsx HTTP probing, tech fingerprint, TLS │
5959
│ 4. CRAWL cdpcrawl Headless Chrome + HAR + JS capture │
@@ -117,6 +117,7 @@ go install github.com/projectdiscovery/httpx/cmd/httpx@latest
117117
go install github.com/projectdiscovery/tlsx/cmd/tlsx@latest
118118
go install github.com/projectdiscovery/naabu/v2/cmd/naabu@latest
119119
go install github.com/projectdiscovery/nuclei/v3/cmd/nuclei@latest
120+
go install github.com/owasp-amass/amass/v4/...@master
120121

121122
# Run
122123
./recon0 run target.com
@@ -146,6 +147,7 @@ $ recon0 providers
146147

147148
Provider Stage Status Binary
148149
──────────────────────────────────────────────────
150+
amass enum enabled /usr/local/bin/amass
149151
subfinder enum enabled /usr/local/bin/subfinder
150152
dnsx resolve enabled /usr/local/bin/dnsx
151153
httpx probe enabled /usr/local/bin/httpx
@@ -229,6 +231,7 @@ recon0 status --remote 10.0.0.5:9090
229231
| Provider | Stage | Tool | Purpose |
230232
|----------|-------|------|---------|
231233
| `subfinder` | enum | [subfinder](https://github.com/projectdiscovery/subfinder) | Passive subdomain enumeration from 100+ sources |
234+
| `amass` | enum | [amass](https://github.com/owasp-amass/amass) | OWASP subdomain enumeration — DNS, scraping, certificates, APIs |
232235
| `dnsx` | resolve | [dnsx](https://github.com/projectdiscovery/dnsx) | DNS resolution, A/AAAA/CNAME records, takeover checks |
233236
| `httpx` | probe | [httpx](https://github.com/projectdiscovery/httpx) | HTTP probing, status codes, tech fingerprinting, CDN detection |
234237
| `tlsx` | probe | [tlsx](https://github.com/projectdiscovery/tlsx) | TLS certificate extraction, SAN enumeration, expiry checks |

config.example.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ api:
3434
providers:
3535
subfinder:
3636
enabled: true
37-
# all: true # use all passive sources
38-
# recursive: true # recursive enumeration
37+
timeout: 30 # minutes — per-source HTTP timeout
38+
# all: true # use all passive sources
39+
# recursive: true # recursive enumeration
40+
41+
amass:
42+
enabled: true
43+
timeout: 30 # minutes — overall enumeration timeout
44+
# amass runs in passive mode (-passive) alongside subfinder
45+
# both run in parallel, results are merged and deduplicated
3946

4047
dnsx:
4148
enabled: true

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/badchars/recon0
22

3-
go 1.23.0
3+
go 1.24
44

55
require (
66
github.com/chromedp/cdproto v0.0.0-20250724212937-08a3db8b4327

internal/config/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ func Defaults() *Config {
7272
Listen: "0.0.0.0",
7373
},
7474
Providers: map[string]ProviderConfig{
75-
"subfinder": {Enabled: boolPtr(true)},
75+
"subfinder": {Enabled: boolPtr(true), Extra: map[string]any{"timeout": 30}},
76+
"amass": {Enabled: boolPtr(true), Extra: map[string]any{"timeout": 30}},
7677
"dnsx": {Enabled: boolPtr(true)},
7778
"httpx": {Enabled: boolPtr(true), Extra: map[string]any{"ports": []any{80, 443, 8080, 8443, 8000, 8888, 3000, 5000, 9090}}},
7879
"tlsx": {Enabled: boolPtr(true)},

internal/pipeline/stage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ var Stages = []Stage{
1414
{
1515
Name: "enum",
1616
Desc: "Subdomain enumeration",
17-
Providers: []string{"subfinder"},
18-
Parallel: false,
17+
Providers: []string{"subfinder", "amass"},
18+
Parallel: true,
1919
},
2020
{
2121
Name: "resolve",

internal/provider/amass.go

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package provider
2+
3+
import (
4+
"context"
5+
"fmt"
6+
"os/exec"
7+
"strconv"
8+
9+
"github.com/badchars/recon0/internal/config"
10+
)
11+
12+
type Amass struct{}
13+
14+
func (a *Amass) Name() string { return "amass" }
15+
func (a *Amass) Stage() string { return "enum" }
16+
func (a *Amass) OutputType() string { return "subdomains" }
17+
func (a *Amass) Check() error { return CheckBinary("amass") }
18+
19+
func (a *Amass) Run(ctx context.Context, opts *RunOpts) (*Result, error) {
20+
extra := opts.Config
21+
timeout := config.GetInt(extra, "timeout", 30) // minutes
22+
23+
args := []string{
24+
"enum",
25+
"-passive",
26+
"-df", opts.Input,
27+
"-timeout", strconv.Itoa(timeout),
28+
"-o", opts.Output,
29+
}
30+
31+
if config.GetBool(extra, "silent", true) {
32+
args = append(args, "-silent")
33+
}
34+
35+
cmd := exec.CommandContext(ctx, "amass", args...)
36+
errFile, err := OpenLogFile(opts.LogDir, "amass")
37+
if err == nil {
38+
defer errFile.Close()
39+
cmd.Stderr = errFile
40+
}
41+
42+
if err := cmd.Run(); err != nil {
43+
return &Result{OutputFile: opts.Output}, fmt.Errorf("amass: %w", err)
44+
}
45+
46+
count := LineCount(opts.Output)
47+
return &Result{
48+
Count: count,
49+
OutputFile: opts.Output,
50+
}, nil
51+
}
52+
53+
func init() { Register(&Amass{}) }

internal/provider/subfinder.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@ func (s *Subfinder) OutputType() string { return "subdomains" }
1717
func (s *Subfinder) Check() error { return CheckBinary("subfinder") }
1818

1919
func (s *Subfinder) Run(ctx context.Context, opts *RunOpts) (*Result, error) {
20+
extra := opts.Config
21+
timeout := config.GetInt(extra, "timeout", 30) // minutes, subfinder default
22+
2023
args := []string{
2124
"-dL", opts.Input,
2225
"-all",
2326
"-recursive",
2427
"-t", strconv.Itoa(opts.Res.ThreadsHeavy),
25-
"-timeout", strconv.Itoa(int(opts.Res.TimeoutScan.Seconds())),
28+
"-timeout", strconv.Itoa(timeout),
2629
"-o", opts.Output,
2730
}
2831

29-
// Config overrides
30-
extra := opts.Config
3132
if config.GetBool(extra, "silent", true) {
3233
args = append(args, "-silent")
3334
}

0 commit comments

Comments
 (0)