(
target: str,
timeout: int,
is_parallel: bool = False,
json_output: bool = False,
)
| 451 | |
| 452 | |
| 453 | async def _handle_username( |
| 454 | target: str, |
| 455 | timeout: int, |
| 456 | is_parallel: bool = False, |
| 457 | json_output: bool = False, |
| 458 | ) -> None: |
| 459 | if is_parallel: |
| 460 | print(f"[*] Username scan (parallel): {target}", file=sys.stderr) |
| 461 | username_result, paste_result = await asyncio.gather( |
| 462 | run_username_osint(username=target, timeout_seconds=timeout), |
| 463 | run_paste_osint(query=target), |
| 464 | ) |
| 465 | if json_output: |
| 466 | _emit_json( |
| 467 | [ |
| 468 | format_tool_result("search_username", target, username_result), |
| 469 | format_tool_result("search_paste", target, paste_result), |
| 470 | ] |
| 471 | ) |
| 472 | else: |
| 473 | _print_result_labeled("search_username", username_result) |
| 474 | _print_result_labeled("search_paste", paste_result) |
| 475 | else: |
| 476 | print(f"[*] Username scan: {target}", file=sys.stderr) |
| 477 | print(f"[*] Timeout: {timeout}s\n", file=sys.stderr) |
| 478 | result = await run_username_osint(username=target, timeout_seconds=timeout) |
| 479 | if json_output: |
| 480 | _emit_json(format_tool_result("search_username", target, result)) |
| 481 | else: |
| 482 | _print_result(result) |
| 483 | |
| 484 | |
| 485 | async def _handle_shodan( |
no test coverage detected