| 164 | } |
| 165 | |
| 166 | func runTargets(urls []string) { |
| 167 | lastHostRun := make(map[string]time.Time) |
| 168 | |
| 169 | for _, target := range urls { |
| 170 | target = strings.TrimSpace(target) |
| 171 | if target == "" { |
| 172 | continue |
| 173 | } |
| 174 | |
| 175 | if hostDelayMs > 0 { |
| 176 | if parsed, err := url.Parse(target); err == nil && parsed.Host != "" { |
| 177 | if lastRun, ok := lastHostRun[parsed.Host]; ok { |
| 178 | waitFor := time.Duration(hostDelayMs)*time.Millisecond - time.Since(lastRun) |
| 179 | if waitFor > 0 { |
| 180 | time.Sleep(waitFor) |
| 181 | } |
| 182 | } |
| 183 | lastHostRun[parsed.Host] = time.Now() |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | requester(target, proxy, userAgent, reqHeaders, bypassIP, folder, httpMethod, verbose, technique, nobanner, rateLimit, timeout, redirect, randomAgent) |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | // readURLsFromInput checks if the input is a file path containing URLs. |
| 192 | // If it is, returns all URLs from the file. Otherwise returns the input as a single URL. |