80 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
x-stp c64aa32dbd Merge branch 'dev' of github.com:x-stp/subfinder into feat/submd-dev
# Conflicts:
#	pkg/passive/sources.go
#	pkg/passive/sources_test.go
2026-04-09 09:29:37 +02:00
x-stp ae1c9a6e32 feat: intro sub.md passive sub dm source
Works anonymously out of the box; can work with api for more parallel req
2026-04-09 08:32:04 +02:00
Pontus Lindblom 4d9e07828b Remove dead facebook source (#1727) (#1732)
The Meta CT API has been discontinued.
2026-03-20 23:40:42 +01:00
Charles Wong 240305b985 test: add edge case coverage for resolveSourceRateLimit
- PerSourceExceedsGlobal: per-source limit > global should be honoured
  (verifies sourceRateLimitOrDefault returns source, not global)
- CaseInsensitive: source names stored lowercase must match mixed-case
  lookups (documents and verifies the ToLower normalization contract)
2026-03-11 09:21:31 -07:00
Charles Wong cf0b8017c4 test: remove dead math.MaxUint32 no-op and unused math import
Per CodeRabbit nitpick: the blank identifier assignment and math import
in TestBuildMultiRateLimiter_UnlimitedWhenNoLimits served no purpose.
The test already verifies correct behavior via NoError + NotNil assertions.
2026-03-11 09:12:06 -07:00
Charles Wong cca10d8c9c fix: initialize CustomRateLimit maps to prevent nil map panic
CodeRabbit identified that the zero-valued CustomRateLimit struct
left Custom.Map and CustomDuration.Map as nil, which could cause
a panic when resolveSourceRateLimit calls .Get() on these maps.

Mirror the initialization pattern from runner.go by explicitly
creating the underlying maps.
2026-03-11 04:06:42 -07:00
Charles Wong 6f0e11ef05 refactor: rename misleading test per review feedback 2026-03-10 14:09:07 -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 ab19329f86 Merge branch 'dev' into fix/sources-in-alphabetical-order
Resolve conflict by adding urlscan source in alphabetical order.
2026-02-04 15:04:45 +03:00
Jigardjain 675be65d47 test: skip flaky sources in TestSourcesWithoutKeys
Add leakix, reconeer, and sitedossier to ignored sources list:
- leakix: now requires API key (returns 401)
- reconeer: now requires API key (returns 401)
- sitedossier: flaky, returns no results in CI
2026-01-30 17:57:10 +05:30
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
PontusLindblom b71a21bd9b Sort sources alphabetically
Ensure the order of -ls matches provider-config.yaml to
avoid confusion when comparing them.
2026-01-29 18:04:58 +01: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 fe41f49040 add reconeer 2026-01-04 15:56:45 +03:00
nohehf 322a4336ed Merge branch 'dev' into main 2025-12-19 17:33:49 +01:00
nohehf e2d7ecfd14 fix: tests 2025-12-19 17:06:04 +01:00
Doğan Can Bakır 692e30a592 add thc 2025-12-18 12:24:51 +03:00
nohehf e7738aa6bd feat: merklemap source 2025-12-16 16:35:04 +01:00
Doğan Can Bakır 074497b536 add profundis 2025-12-08 10:31:36 +03:00
Nakul Bharti deccd62f59 fix:context cancellation sources (#1680)
* fix: context cancellation for the major sources

* fix: handle context cancellation for the minor sources

* fix: handle context cancellation for the minor sources
2025-12-04 23:04:40 +05:30
Bohdan Turkynewych 3ba0a308fa Add domainsproject to sources tests 2025-10-20 16:47:21 -04:00
Bohdan Turkynewych 02ea9f8e45 New source: DomainsProject 2025-10-20 16:29:34 -04:00
Doğan Can Bakır bc7edda8b6 remove hunter 2025-10-20 11:31:10 +03:00
Dogan Can Bakir 7396f0db4b Merge pull request #1647 from projectdiscovery/add_onhype
add onhype
2025-10-20 10:50:29 +03:00
Doğan Can Bakır 8117b1acf3 add windvane 2025-10-16 14:56:57 +03:00
Doğan Can Bakır 7823d41dd1 fix typo 2025-10-02 13:35:06 +03:00
Dogan Can Bakir fa6ceaaf53 Merge branch 'dev' into add_onhype 2025-10-01 13:57:22 +03:00
Mzack9999 c292a9c595 ignoring flaky threatcrowd 2025-09-24 20:44:14 +02:00
Doğan Can Bakır e5bcc681d1 add onhype 2025-09-22 16:00:01 +03:00
ben 90f4c00d8c Adds the "driftnet" source.
Updates the httpRequestWrapper() function to allow 204 responses.
2025-07-17 12:30:36 +01: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 76050f3e6c Simplified Binary Edge source
- Binary Edge is recursive
- v1/v2 API detection
- Same code to get subdomains for V1 and V2
2020-09-21 19:55:22 +02:00
bauthard 9aa9f46783 release preparation 2020-09-21 16:37:22 +05:30
Víctor 896dfb36f3 Merge branch 'master' into riddler.io 2020-09-18 19:58:16 +02:00
bauthard 68bece6962 Merge pull request #314 from vzamanillo/threatbook-source
Implemented ThreatBook source
2020-09-18 20:00:02 +05:30
bauthard ae0882e818 Merge pull request #313 from vzamanillo/cebaidu-source
Implemented cebaidu source
2020-09-18 19:20:19 +05:30
bauthard 1ee1e3cad4 Merge pull request #312 from vzamanillo/robtex-suorce
Implemented robtex source
2020-09-18 19:18:16 +05:30
bauthard 93301e8da0 Merge pull request #311 from vzamanillo/ximcx-source
Implemented ximcx source
2020-09-18 19:05:49 +05:30
Víctor Zamanillo 69977466d8 Removed entrust source
Due to this https://github.com/projectdiscovery/subfinder/pull/274#issuecomment-661283604.

Looks like it is not working due to maintenance but it does not work from months ago
2020-09-15 13:22:54 +02:00
Víctor Zamanillo 3883cf0e6d Added riddler.io source 2020-09-15 13:07:46 +02:00
Víctor Zamanillo 8b83c0516a Implemented ThreatBook source 2020-09-13 21:55:31 +02:00
Víctor Zamanillo fdd6235eb6 Implemented cebaidu source 2020-09-13 21:22:42 +02:00
Víctor Zamanillo 0518d130d2 Implemented robtex source 2020-09-13 19:52:34 +02:00
Víctor Zamanillo 38224122b0 Implemented ximcx source 2020-09-13 11:29:02 +02:00
Víctor Zamanillo c19c46c216 Implemented Anubis source 2020-09-13 11:02:49 +02:00
Ice3man543 750c3e6e7d Added recursive, all flags. More tuning of process 2020-08-11 22:50:58 +05:30
Ice3man543 45b0439cae Added chaos data source for scraping 2020-08-11 21:56:58 +05:30
Sepehrdad Sh 57321804f2 add recon.dev as new source 2020-08-11 14:42:06 +00:00