({ inputs, params }, context)
| 315 | description: 'Passive subdomain enumeration tool (Subfinder).', |
| 316 | }, |
| 317 | async execute({ inputs, params }, context) { |
| 318 | const parsedParams = parameterSchema.parse(params); |
| 319 | const { |
| 320 | domain: legacyDomain, |
| 321 | threads, |
| 322 | timeout, |
| 323 | maxEnumerationTime, |
| 324 | rateLimit, |
| 325 | allSources, |
| 326 | recursive, |
| 327 | customFlags, |
| 328 | } = parsedParams; |
| 329 | |
| 330 | const trimmedCustomFlags = |
| 331 | typeof customFlags === 'string' && customFlags.length > 0 ? customFlags : null; |
| 332 | const customFlagArgs = trimmedCustomFlags ? splitCliArgs(trimmedCustomFlags) : []; |
| 333 | |
| 334 | // Collect domains from both inputs and legacy parameter |
| 335 | const values = new Set<string>(); |
| 336 | const addValue = (value: string | string[] | undefined) => { |
| 337 | if (Array.isArray(value)) { |
| 338 | value.forEach((item) => { |
| 339 | const trimmed = item.trim(); |
| 340 | if (trimmed.length > 0) { |
| 341 | values.add(trimmed); |
| 342 | } |
| 343 | }); |
| 344 | return; |
| 345 | } |
| 346 | if (typeof value === 'string') { |
| 347 | const trimmed = value.trim(); |
| 348 | if (trimmed.length > 0) { |
| 349 | values.add(trimmed); |
| 350 | } |
| 351 | } |
| 352 | }; |
| 353 | |
| 354 | addValue(inputs.domains); |
| 355 | addValue(legacyDomain); |
| 356 | |
| 357 | const domains = Array.from(values); |
| 358 | const domainCount = domains.length; |
| 359 | |
| 360 | const providerConfig = |
| 361 | typeof inputs.providerConfig === 'string' && inputs.providerConfig.trim().length > 0 |
| 362 | ? inputs.providerConfig |
| 363 | : undefined; |
| 364 | |
| 365 | if (domainCount === 0) { |
| 366 | context.logger.info('[Subfinder] Skipping execution because no domains were provided.'); |
| 367 | return { |
| 368 | subdomains: [], |
| 369 | results: [], |
| 370 | rawOutput: '', |
| 371 | domainCount: 0, |
| 372 | subdomainCount: 0, |
| 373 | }; |
| 374 | } |
nothing calls this directly
no test coverage detected