[
  {
    "path": "README.md",
    "content": "### Updated Documentation for crt.sh v2.0\n\nThe **v2.0** version of the script, now named `crt_v2.sh`, introduces significant improvements in performance, reliability, and documentation. Below are the updated instructions for setting up and using both the original script `crt.sh` and the new `crt_v2.sh`:\n\n---\n\n## crt.sh and crt_v2.sh\n\nThese bash scripts are designed to simplify saving and parsing output from the [crt.sh](https://crt.sh) website, allowing for easy integration with tools like `httpx` for further analysis.\n\n### Usage Overview\n\n**crt.sh**: The original version of the script with basic functionality.\n\n**crt_v2.sh**: The enhanced version (v2.0) with improved performance, better error handling, and comprehensive documentation.\n\n### Installation and Setup\n\n#### Step 1: Clone the Repository and Set Permissions\n\nTo install the scripts, clone the repository from GitHub and set the appropriate execution permissions.\n\n```bash\ngit clone https://github.com/az7rb/crt.sh.git && cd crt.sh/\nchmod +x crt.sh crt_v2.sh\n```\n\n#### Step 2: Display Help and Options\n\nTo view the usage options and get started with either script:\n\nFor the original script:\n\n```bash\n./crt.sh -h\n```\n\nFor the updated script:\n\n```bash\n./crt_v2.sh -h\n```\n\n### Example Usage\n\n**Original Script**:\n```bash\n./crt.sh -d hackerone.com | httpx\n```\n\n**Updated Script (v2.0)**:\n```bash\n./crt_v2.sh -d hackerone.com | httpx\n```\n\nBoth commands will enumerate subdomains for `hackerone.com` and output them in a format ready to be piped into other tools like `httpx`.\n\n### Notes:\n\n- **crt_v2.sh** is the recommended version due to its enhanced features and reliability.\n- **Output**: Both scripts will save the enumerated subdomains to a specified output file, making the data ready for further processing or use with other tools.\n\n### Screenshot\n\nFor a quick visual guide, refer to the screenshot below:\n\n![Help Screenshot](https://raw.githubusercontent.com/az7rb/crt.sh/main/Screenshot/Screenshot_Help.png)\n\n---\n### Additional Resources\n\nDon't forget to visit [BugBountyzip](https://github.com/BugBountyzip) for more tools and resources.\n\nHappy hunting! 🎯\n"
  },
  {
    "path": "crt.sh",
    "content": "#!/bin/bash\n\necho \"\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|      ..| search crt.sh v1.1 |..     |\n+   site : crt.sh Certificate Search  +\n|            Twitter: az7rb           |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\t\"\n\t\n\tHelp()\n{\n   # Display Help\n   echo \"Options:\"\n   echo \"\"\n   echo \"-h     Help\"\n   echo \"-d     Search Domain Name       | Example: $0 -d hackerone.com\"\n   echo \"-o     Search Organization Name | Example: $0 -o hackerone+inc\"\n   echo \"\"\n}\n\n\t# Request the Search  with Domain Name\n\tDomain() {\n\trequestsearch=\"$(curl -s \"https://crt.sh?q=%.$req&output=json\")\"\n\t\t \n\t\t\t echo $requestsearch > req.txt\n\t\t\t cat req.txt | jq \".[].common_name,.[].name_value\"| cut -d'\"' -f2 | sed 's/\\\\n/\\n/g' | sed 's/\\*.//g'| sed -r 's/([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4})//g' |sort | uniq > output/domain.$req.txt\n\t\t\t rm req.txt\n\t\t\t echo \"\"\n\t\t\t cat output/domain.$req.txt\n\t\t\t echo \"\"\n\t\t\t echo -e \"\\e[32m[+]\\e[0m Total Save will be \\e[31m\"$(cat output/domain.$req.txt | wc -l)\"\\e[0m Domain only\"\n\t\t\t echo -e \"\\e[32m[+]\\e[0m Output saved in output/domain.$req.txt\"\n}\t\t \n    # Request the Search with Organization Name\n\tOrganization() {\n\trequestsearch=\"$(curl -s \"https://crt.sh?q=$req&output=json\")\"\n\t\t \n\t\t\t echo $requestsearch > req.txt\n\t\t\t cat req.txt | jq \".[].common_name\"| cut -d'\"' -f2 | sed 's/\\\\n/\\n/g' | sed 's/\\*.//g'| sed -r 's/([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4})//g' |sort | uniq > output/org.$req.txt\n\t\t\t rm req.txt\n\t\t\t echo \"\"\n\t\t\t cat output/org.$req.txt\n\t\t\t echo \"\"\n\t\t\t echo -e \"\\e[32m[+]\\e[0m Total Save will be \\e[31m\"$(cat output/org.$req.txt | wc -l)\"\\e[0m Domain only\"\n\t\t\t echo -e \"\\e[32m[+]\\e[0m Output saved in output/org.$req.txt\"\n}\t\n\nif [ -z $1 ]\n        then\n                Help\n                exit\n        else\n                req=$2\n                \nfi\n\nwhile getopts \"h|d|o|\" option; do\n   case $option in\n      h) # display Help\n         Help\n         ;;\n      d) # Search Domain Name\n\t Domain\n         ;;\n      o) # Search Organization Name\n\t Organization\n         ;;\n     *) # Invalid option\n          Help\n          ;;\n\t\t \n   esac\ndone\n"
  },
  {
    "path": "crt_v2.sh",
    "content": "#!/bin/bash\n\n# Display banner\necho \"\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n|      ..| search crt.sh v 2.0 |..    |\n+   site : crt.sh Certificate Search  +\n|            Twitter: az7rb           |\n+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\"\n\n# Function: Help\n# Purpose: Display the help message with usage instructions.\nHelp() {\n    echo \"Options:\"\n    echo \"\"\n    echo \"-h     Help\"\n    echo \"-d     Search Domain Name       | Example: $0 -d hackerone.com\"\n    echo \"-o     Search Organization Name | Example: $0 -o hackerone+inc\"\n    echo \"\"\n}\n\n# Function: CleanResults\n# Purpose: Clean and filter the results by removing unwanted characters and duplicates.\n# - Converts escaped newlines to actual newlines.\n# - Removes wildcard characters (*).\n# - Filters out email addresses.\n# - Sorts the results and removes duplicates.\nCleanResults() {\n    sed 's/\\\\n/\\n/g' | \\\n    sed 's/\\*.//g' | \\\n    sed -r 's/([A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4})//g' | \\\n    sort | uniq\n}\n\n# Function: Domain\n# Purpose: Search for certificates associated with a specific domain name.\n# - Sends a request to crt.sh with the specified domain.\n# - Processes the JSON response to extract common names and domain values.\n# - Cleans and filters the results using CleanResults function.\n# - Saves the results to an output file and displays them.\nDomain() {\n    # Check if the domain name is provided\n    if [ -z \"$req\" ]; then\n        echo \"Error: Domain name is required.\"\n        exit 1\n    fi\n    \n    # Perform the search request to crt.sh\n    response=$(curl -s \"https://crt.sh?q=%.$req&output=json\")\n    \n    # Check if the response is empty\n    if [ -z \"$response\" ]; then\n        echo \"No results found for domain $req\"\n        exit 1\n    fi\n    \n    # Process the response, clean it, and store the results\n    results=$(echo \"$response\" | jq -r \".[].common_name,.[].name_value\" | CleanResults)\n    \n    # Check if there are any valid results after cleaning\n    if [ -z \"$results\" ]; then\n        echo \"No valid results found.\"\n        exit 1\n    fi\n    \n    # Define the output file name based on the domain\n    output_file=\"output/domain.$req.txt\"\n    \n    # Save the results to the output file\n    echo \"$results\" > \"$output_file\"\n    \n    # Display the results and summary\n    echo \"\"\n    echo \"$results\"\n    echo \"\"\n    echo -e \"\\e[32m[+]\\e[0m Total Save will be \\e[31m$(echo \"$results\" | wc -l)\\e[0m Domain only\"\n    echo -e \"\\e[32m[+]\\e[0m Output saved in $output_file\"\n}\n\n# Function: Organization\n# Purpose: Search for certificates associated with a specific organization name.\n# - Sends a request to crt.sh with the specified organization name.\n# - Processes the JSON response to extract common names.\n# - Cleans and filters the results using CleanResults function.\n# - Saves the results to an output file and displays them.\nOrganization() {\n    # Check if the organization name is provided\n    if [ -z \"$req\" ]; then\n        echo \"Error: Organization name is required.\"\n        exit 1\n    fi\n    \n    # Perform the search request to crt.sh\n    response=$(curl -s \"https://crt.sh?q=$req&output=json\")\n    \n    # Check if the response is empty\n    if [ -z \"$response\" ]; then\n        echo \"No results found for organization $req\"\n        exit 1\n    fi\n    \n    # Process the response, clean it, and store the results\n    results=$(echo \"$response\" | jq -r \".[].common_name\" | CleanResults)\n    \n    # Check if there are any valid results after cleaning\n    if [ -z \"$results\" ]; then\n        echo \"No valid results found.\"\n        exit 1\n    fi\n    \n    # Define the output file name based on the organization name\n    output_file=\"output/org.$req.txt\"\n    \n    # Save the results to the output file\n    echo \"$results\" > \"$output_file\"\n    \n    # Display the results and summary\n    echo \"\"\n    echo \"$results\"\n    echo \"\"\n    echo -e \"\\e[32m[+]\\e[0m Total Save will be \\e[31m$(echo \"$results\" | wc -l)\\e[0m Domain only\"\n    echo -e \"\\e[32m[+]\\e[0m Output saved in $output_file\"\n}\n\n# Main Script Logic\n\n# If no arguments are provided, display the help message\nif [ -z \"$1\" ]; then\n    Help\n    exit\nfi\n\n# Parse command-line options using getopts\nwhile getopts \"h:d:o:\" option; do\n    case $option in\n        h) # Display help\n            Help\n            ;;\n        d) # Search for domain name\n            req=$OPTARG\n            Domain\n            ;;\n        o) # Search for organization name\n            req=$OPTARG\n            Organization\n            ;;\n        *) # Invalid option, display help\n            Help\n            ;;\n    esac\ndone\n"
  },
  {
    "path": "output/domain.hackerone.com.txt",
    "content": "api.hackerone.com\ndocs.hackerone.com\nenorekcah.com\nevents.hackerone.com\ngo.hackerone.com\ngslink.hackerone.com\nhackerone.com\ninfo.hackerone.com\nlinks.hackerone.com\nmta-sts.forwarding.hackerone.com\nmta-sts.hackerone.com\nmta-sts.managed.hackerone.com\nssl105537.cloudflaressl.com\nssl333694.cloudflaressl.com\nssl383280.cloudflaressl.com\nssl383281.cloudflaressl.com\nssl383282.cloudflaressl.com\nssl3995.cloudflare.com\nssl4565.cloudflare.com\nssl581117.cloudflaressl.com\nssl581118.cloudflaressl.com\nssl581119.cloudflaressl.com\nsupport.hackerone.com\nwww.hackerone.com\n"
  },
  {
    "path": "output/org.hackerone+inc.txt",
    "content": "attjira.inverselink.com\nbd1.inverselink.com\nbd2.inverselink.com\nbd3.inverselink.com\nci.inverselink.com\nci-production.inverselink.com\nenorekcah.com\nerrors.hackerone.net\nevents.hackerone.com\ngitaly.code-pdx1.inverselink.com\ngo.hacker.one\ngo.inverselink.com\nhacker.one\nhackerone.com\nhackerone-ext-content.com\nhackerone-user-content.com\ninfo.hacker.one\ninfo.hackerone.com\nkibana.inverselink.com\nlinks.hackerone.com\nlogstash.inverselink.com\nlooker.inverselink.com\nma.hacker.one\npayments-production.inverselink.com\nphabricator.inverselink.com\nproteus.inverselink.com\nsentry.inverselink.com\nsignatures.hacker.one\nstaging.inverselink.com\nstorybook.inverselink.com\nsupport-app.inverselink.com\nsupport.hackerone.com\ntestserver.inverselink.com\nui-docs.inverselink.com\nwithinsecurity.com\nwww.enorekcah.com\nwww.hackerone.com\nwww.testserver.inverselink.com\n"
  }
]