Bash Script for Collecting URLs of Target Domains Using Multiple Tools

Listen to this Post

In the realm of cybersecurity, gathering intelligence about a target domain is crucial. A well-crafted Bash script can automate the process of collecting URLs using various tools like Waymore, Katana, Hakrawler, Anew, Crawley, Gau/gauplus, and Cariddi. Below is a practice-verified Bash script that leverages these tools to gather URLs from a target domain.

#!/bin/bash

<h1>Define the target domain</h1>

TARGET_DOMAIN="example.com"

<h1>Create a directory to store the results</h1>

mkdir -p results

<h1>Use Waymore to collect URLs</h1>

waymore -u "$TARGET_DOMAIN" -o results/waymore.txt

<h1>Use Katana to collect URLs</h1>

katana -u "$TARGET_DOMAIN" -o results/katana.txt

<h1>Use Hakrawler to collect URLs</h1>

hakrawler -url "$TARGET_DOMAIN" -plain -output results/hakrawler.txt

<h1>Use Anew to merge and deduplicate results</h1>

cat results/waymore.txt results/katana.txt results/hakrawler.txt | anew results/merged.txt

<h1>Use Crawley to collect URLs</h1>

crawley -u "$TARGET_DOMAIN" -o results/crawley.txt

<h1>Use Gau/gauplus to collect URLs</h1>

gau "$TARGET_DOMAIN" | anew results/gau.txt

<h1>Use Cariddi to collect URLs</h1>

cariddi -u "$TARGET_DOMAIN" -o results/cariddi.txt

<h1>Final merge and deduplication</h1>

cat results/merged.txt results/crawley.txt results/gau.txt results/cariddi.txt | anew results/final_urls.txt

echo "URL collection completed. Results saved in results/final_urls.txt"

You Should Know:

  • Waymore: A tool designed to collect URLs from various sources.
  • Katana: A powerful web crawling tool that can be used to discover URLs.
  • Hakrawler: A simple and fast web crawler that can be used to gather URLs.
  • Anew: A tool to merge and deduplicate lists of URLs.
  • Crawley: Another web crawling tool that can be used to collect URLs.
  • Gau/gauplus: Tools to fetch known URLs from AlienVault’s Open Threat Exchange, Wayback Machine, and Common Crawl.
  • Cariddi: A tool to collect URLs and endpoints from a target domain.

What Undercode Say:

In the ever-evolving field of cybersecurity, automating repetitive tasks like URL collection can save valuable time and resources. The Bash script provided above is a practical example of how to leverage multiple tools to gather comprehensive intelligence about a target domain. By combining the strengths of tools like Waymore, Katana, Hakrawler, and others, you can ensure a thorough and efficient URL collection process. This script can be further customized to include additional tools or to refine the output based on specific requirements. Always remember to use such tools responsibly and within the bounds of legal and ethical guidelines.

For more information on the tools used in this script, you can visit their respective GitHub repositories:
Waymore
Katana
Hakrawler
Anew
Crawley
Gau
Cariddi

References:

Reported By: Shivam Dhingra – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅Featured Image