115 Commits

Author SHA1 Message Date
Dogan Can Bakir 2a8ce2f3e6 feat: add shodanct passive source (#1796)
* feat: add shodanct passive source

* fix lint

---------

Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
2026-06-16 15:24:59 +02:00
Dwi Siswanto 4a45eedd9b chore(runner): bump version to v2.14.0
Signed-off-by: Dwi Siswanto <git@dw1.io>
2026-04-25 16:36:27 +07:00
Charles Wong c1ce78eac9 fix(ratelimit): honour -rl global fallback and -rls duration (#1434)
Two bugs in rate limit handling:

1. Global -rl flag was ignored for sources without a per-source override.
   Only sources explicitly listed in -rls got rate-limited; all others
   ran unlimited, defeating the purpose of -rl.

2. Per-source duration from -rls (e.g. hackertarget=2/m) was silently
   dropped. runner.go stored MaxCount but discarded Duration, so all
   sources defaulted to per-second regardless of the /m or /s suffix.

Root cause: runner.go converted goflags.RateLimitMap → CustomRateLimit
but only copied MaxCount. buildMultiRateLimiter only checked per-source
limits, never falling back to the global rate.

Changes:
- Add CustomDuration field to CustomRateLimit struct
- Store both MaxCount and Duration from -rls in runner.go
- Add resolveSourceRateLimit() with clear priority:
  per-source > global > unlimited
- Guard against nil rateLimit in buildMultiRateLimiter
- Add 9 unit tests covering all combinations

Fixes #1434
2026-03-10 09:47:09 -07:00
Doğan Can Bakır 13e5db7500 bump version 2026-03-05 14:48:23 +03:00
Jigardjain 978addb8bd feat: add URLScan.io as passive subdomain source
Add URLScan.io as a new passive subdomain enumeration source with full
pagination support and robust rate limiting handling.

Features:
- Fetches subdomains from URLScan.io Search API
- Implements cursor-based pagination using search_after parameter
- Extracts domains from task.domain, task.url, page.domain, page.url fields
- Requires API key (free tier available at urlscan.io)

Rate Limiting:
- Conservative pagination delay (10s between pages) to respect strict burst limits
- Exponential backoff retry logic for 429/503 responses
- Respects X-Rate-Limit-Reset-After header for dynamic backoff
- Limited to 5 pages max (500 results) to avoid quota exhaustion

Configuration:
- Max 5 pages per enumeration (configurable via maxPages constant)
- 100 results per page (configurable via maxPerPage constant)
- 2 retry attempts for rate-limited requests
- 20 second initial backoff, doubles on each retry

Changes:
- pkg/subscraping/sources/urlscan/urlscan.go: New URLScan source implementation
- pkg/passive/sources.go: Register URLScan source
- pkg/passive/sources_test.go: Add URLScan to test lists
- pkg/runner/options.go: Add urlscan to source options
- .github/workflows/build-test.yml: Add URLSCAN_API_KEY secret

Closes: Feature request for URLScan.io integration
2026-01-30 17:02:44 +05:30
Mzack9999 4bba544dfe Merge branch 'dev' into feature/request-tracking-stats 2026-01-07 18:07:37 +04:00
Doğan Can Bakır 1ca2a67f92 add optional API key support for sources
- add KeyRequirement enum with three states: NoKey, OptionalKey, RequiredKey
- add KeyRequirement() method to Source interface
- update config generation to include optional sources
- update env var loading for optional sources
- update source listing with ~ marker for optional sources
- mark hackertarget, leakix, reconeer as OptionalKey
- fix hackertarget and reconeer to work without API key

closes #1695
2026-01-05 15:00:59 +03:00
Doğan Can Bakır e96320ec38 add request tracking to -stats flag
Adds request counting to all sources to help users monitor API usage
and debug quota consumption issues like #1562.

Changes:
- Add Requests field to Statistics struct
- Track HTTP requests in all 53 sources
- Display request count in stats output

Closes #1698
2026-01-05 14:14:20 +03:00
Doğan Can Bakır 8eacfb143a bump version 2026-01-05 11:42:17 +03:00
Dogan Can Bakir e5a61a6db7 Merge branch 'dev' into 1576_add_apikey_support_for_hackertarget 2026-01-04 22:26:01 +07:00
Doğan Can Bakır 79a426007b bump version 2025-12-18 15:28:48 +03:00
Doğan Can Bakır c83e0b62b4 bump version 2025-11-21 13:09:54 +09:00
sunnyraindy d5255517a3 refactor: use strings.Builder to improve performance
Signed-off-by: sunnyraindy <sunnyraindy@outlook.com>
2025-11-11 23:06:17 +08:00
Tarun Koyalwar 3cb054d976 Add wildcard certificate detection in JSON output (#1665)
* Add wildcard certificate detection in JSON output

This commit implements wildcard certificate detection for subdomains that
are covered by wildcard certificates (e.g., *.example.com). When sources
return results containing wildcard patterns, the subdomain is now marked
with a wildcard_certificate field in JSON output mode.

Key changes:
- Added WildcardCertificate field to HostEntry and Result structs
- Detection logic: checks if result.Value contains "*.subdomain" pattern
- Propagates wildcard flag through resolution pipeline
- JSON output includes wildcard_certificate field (omitted if false)
- Updates version to v2.9.1-dev
- Fix .goreleaser.yml 386 architecture quoting
- Add /subfinder to .gitignore

Note: wildcard_certificate field is not included when using -cs flag to
avoid breaking changes to the library API.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix wildcard certificate flag propagation with -nW flag

Fixed a bug where the wildcard_certificate field was being lost when using
the -nW flag (DNS resolution with wildcard filtering). The issue occurred
because when multiple sources find the same subdomain, only the first
occurrence is sent to the resolution pool. If a later source marks the
subdomain as having a wildcard certificate, that information was stored
in uniqueMap but never propagated to foundResults.

Solution: After resolution completes, merge wildcard certificate information
from uniqueMap into foundResults. This ensures that if any source marked a
subdomain as having a wildcard certificate, that flag is preserved in the
final output.

This ensures consistent behavior - wildcard_certificate field appears in
JSON output regardless of whether -nW flag is used.

Validation:
- Without -nW: api.nuclei.sh shows wildcard_certificate:true ✓
- With -nW: api.nuclei.sh shows wildcard_certificate:true ✓

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-11-05 21:49:07 +05:30
Mukesh Sai Kumar 50bbe41385 Add missing domain field 2025-10-01 22:23:24 +05:30
Mukesh Sai Kumar 7e6ad51181 Handle case when RemoveWildcard is true 2025-10-01 21:32:23 +05:30
Mukesh Sai Kumar 2097be5c70 Call ResultCallback sooner 2025-10-01 21:07:10 +05:30
Mzack9999 e9338c217b using envutil 2025-09-24 20:19:34 +02:00
Doğan Can Bakır 0ed6faf8f2 add env var support for config files 2025-09-24 13:46:52 +03:00
Doğan Can Bakır 92ee44cb13 bump version 2025-09-16 14:27:54 +03:00
Doğan Can Bakır e3af027548 add api key support for hackertarget 2025-07-23 19:06:56 +03:00
Mikel Olasagasti Uranga 6867e076f1 refactor: move v2 module code to root directory for cleaner structure
Keeps module path as github.com/projectdiscovery/subfinder/v2 to
preserve import compatibility.

Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
2025-07-10 15:27:42 +02:00
Mzack9999 7d89b5facb go mod v2 fix 2020-09-24 19:02:02 +02:00
Víctor Zamanillo acd9e1a0a5 Fixed incorrect total sources count on list sources 2020-09-21 21:32:07 +02:00
Víctor Zamanillo 63d74bdfad We move to Robtex PRO API
Change the use from free API to PRO with an API key because free is (strictly) rate limited and does not offer any profit.
2020-09-21 20:34:42 +02:00
bauthard 9aa9f46783 release preparation 2020-09-21 16:37:22 +05:30
Ice3man e6323fbad8 Update config.go 2020-09-21 13:16:22 +05:30
bauthard 68bece6962 Merge pull request #314 from vzamanillo/threatbook-source
Implemented ThreatBook source
2020-09-18 20:00:02 +05:30
Víctor Zamanillo e15deefb0b Use default resolvers if no resolvers are found
Fixes #321
2020-09-15 21:46:54 +02:00
Víctor Zamanillo 8b83c0516a Implemented ThreatBook source 2020-09-13 21:55:31 +02:00
bauthard 5eee0870e1 release update 2020-09-09 16:12:26 +05:30
Sepehrdad Sh 84663dd4df recon.dev: fix token 2020-09-04 13:57:57 +00:00
bauthard 3e201d1e64 version update 2020-08-25 01:42:37 +05:30
bauthard cfef9d28c9 json flag update 2020-08-25 01:42:09 +05:30
bauthard 19bdef235a version update 2020-08-23 21:35:39 +05:30
Víctor Zamanillo fdd216a57f Use of POST http constant instead of string literal 2020-08-19 09:09:07 +02:00
Víctor Zamanillo 8c30eb386c Automatic file extension on multiple domain enumeration 2020-08-17 18:12:50 +02:00
Víctor Zamanillo bc39ad28c5 Fixed err return 2020-08-17 18:12:21 +02:00
Víctor Zamanillo 6f3cb22b6a The outputfile is the absolute path + create intermediate dirs 2020-08-17 17:49:14 +02:00
Víctor Zamanillo 6650e3665a We always put results with format even if no verbose option is set 2020-08-16 21:35:29 +02:00
Víctor Zamanillo b1044303cb Do not write source on plain text hosts file 2020-08-16 21:33:45 +02:00
Víctor Zamanillo af1a775c46 Better jsonResult initialization 2020-08-16 21:22:03 +02:00
Víctor Zamanillo 885a6752b7 Unique hostEntry declaration 2020-08-16 21:18:08 +02:00
Víctor Zamanillo 5b276221b6 Implements #245 2020-08-16 17:52:12 +02:00
Víctor Zamanillo 5c685f0f59 Removed automatic extensions based on output type
The user should declare the explicit filename
2020-08-16 17:52:05 +02:00
Víctor Zamanillo 0196aa7195 New ouputter 2020-08-16 17:52:00 +02:00
bauthard 02e084dab2 version update 2020-08-13 12:24:36 +05:30
bauthard c54554c3d6 version update 2020-08-12 00:00:10 +05:30
Ice3man543 ee137df6d9 Show count also on non-verbose config 2020-08-11 23:24:42 +05:30
Ice3man543 2f28f350a8 Golangci lint pls work :P 2020-08-11 23:22:47 +05:30