18 Commits

Author SHA1 Message Date
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
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 8c30eb386c Automatic file extension on multiple domain enumeration 2020-08-17 18:12:50 +02:00
Víctor Zamanillo 7cac6136df Fixed should rewrite http.NewRequestWithContext (noctx) 2020-07-22 17:45:42 +02:00
Víctor Zamanillo 736dff1c64 Fixed misspellings (misspell) 2020-07-22 15:35:01 +02:00
Ice3man543 e6b664c243 Bug Fix: changed output directory mechanism 2020-01-21 22:34:30 +05:30
Ice3man543 be571ae567 Fixed single file output 2020-01-10 15:45:54 +05:30
Ice3man543 e2c852c101 Made resolving truly optional, added streaming results + misc 2019-12-07 10:05:22 +05:30
Ice3man543 b58f2c5ca0 Changed URLs to point to new repo 2019-12-05 16:11:06 +05:30
Ice3man543 d5f1d8d662 Added validations on subdomains 2019-12-05 01:23:34 +05:30
Ice3man543 1e0f666618 Minor fix 2019-12-04 21:22:17 +05:30
Ice3man543 d940f8deb6 Use , instead of :, fixed filenames 2019-12-04 21:21:38 +05:30
Ice3man543 146b7e4aa7 More flexibility 2019-12-04 21:06:44 +05:30
Ice3man543 fd8ce67f85 Added multiple domain support 2019-12-04 20:30:59 +05:30
Ice3man543 d63994fc6f Single domain working runner with outputs,etc 2019-12-04 20:21:52 +05:30
Ice3man543 0fed315c74 Making the project runnable 2019-12-03 23:42:45 +05:30
Ice3man543 06bfd8a087 Added new runner package, configs, yaml, etc 2019-12-03 16:47:19 +05:30