├── README.md └── main.sh /README.md: -------------------------------------------------------------------------------- 1 | # Cloud Recon 2 | This script is used to search for cloud certificate entities such as Amazon, Azure, and others that have been extracted by the kaeferjaeger.gay provider. It is useful for subdomain enumeration and finding additional apex domains during your reconnaissance processes. 3 | ## Installation 4 | ```bash 5 | git clone https://github.com/Spix0r/cloudrecon.git 6 | cd cloudrecon 7 | chmod +x main.sh 8 | ``` 9 | ## Usage 10 | -u: Update local cloud data files. 11 | -s : Search for a domain or subdomain containing the specified term in cloud data files. 12 | -h: Display usage information. 13 | -q: Run the script in silent mode, suppressing all output. 14 | ### Example 15 | ```bash 16 | ./cloud_data_search.sh -u -s Company_Name 17 | ``` 18 | -------------------------------------------------------------------------------- /main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Define colors 4 | RED="\033[1;31m" 5 | GREEN="\033[1;32m" 6 | BLUE="\033[1;36m" 7 | YELLOW="\033[1;33m" 8 | RESET="\033[0m" 9 | PURPLE="\033[1;35m" 10 | 11 | # Define usage information 12 | usage() { 13 | echo -e "${YELLOW}Usage:${RESET} $0 ${GREEN}[-u]${RESET} ${BLUE}[-s ]${RESET} ${YELLOW}[-h]${RESET} ${PURPLE}[-q]${RESET}" >&2 14 | echo -e "${YELLOW}Options:${RESET}" >&2 15 | echo -e "-u Update clouds data" >&2 16 | echo -e "-s Search for a domain or subdomain containing your search term in clouds data" >&2 17 | echo -e "-h Display this help message" >&2 18 | echo -e "-q Silent mode, suppress all output" >&2 19 | exit 1 20 | } 21 | 22 | # Initialize variables 23 | DOMAIN="" 24 | UPDATE=0 25 | SILENT=0 26 | 27 | # Logger function 28 | log() { 29 | local level=$1 30 | local message=$2 31 | if [ $SILENT -eq 0 ]; then 32 | case $level in 33 | INFO) 34 | echo -e "[${YELLOW}INF${RESET}] $message${RESET}" >&2 35 | ;; 36 | OK) 37 | echo -e "[${GREEN}OK${RESET}] $message${RESET}" >&2 38 | ;; 39 | ERROR) 40 | echo -e "[${RED}ERR${RESET}] $message${RESET}" >&2 41 | ;; 42 | *) 43 | echo "Invalid log level" >&2 44 | ;; 45 | esac 46 | fi 47 | } 48 | 49 | # Parse command line arguments 50 | while getopts "uhs:q" opt; do 51 | case $opt in 52 | u) 53 | UPDATE=1 54 | ;; 55 | s) 56 | DOMAIN="$OPTARG" 57 | ;; 58 | h) 59 | usage 60 | ;; 61 | q) 62 | SILENT=1 63 | ;; 64 | \?) 65 | log ERROR "Invalid option: -$OPTARG" >&2 66 | usage 67 | ;; 68 | esac 69 | done 70 | 71 | # Function to update cloud data 72 | update() { 73 | if [ $SILENT -eq 0 ]; then 74 | log INFO "Updating cloud" 75 | fi 76 | mkdir -p "$HOME/.cloudscrt/" 77 | rm -rf "$HOME/.cloudscrt/"* 78 | wget http://kaeferjaeger.gay/sni-ip-ranges/amazon/ipv4_merged_sni.txt -O "$HOME/.cloudscrt/amazon.txt" --quiet && log OK "Amazon done" || log ERROR "Failed to update Amazon" 79 | wget http://kaeferjaeger.gay/sni-ip-ranges/digitalocean/ipv4_merged_sni.txt -O "$HOME/.cloudscrt/digitalocean.txt" --quiet && log OK "DigitalOcean done" || log ERROR "Failed to update DigitalOcean" 80 | wget http://kaeferjaeger.gay/sni-ip-ranges/microsoft/ipv4_merged_sni.txt -O "$HOME/.cloudscrt/microsoft.txt" --quiet && log OK "Microsoft done" || log ERROR "Failed to update Microsoft" 81 | wget http://kaeferjaeger.gay/sni-ip-ranges/google/ipv4_merged_sni.txt -O "$HOME/.cloudscrt/google.txt" --quiet && log OK "Google done" || log ERROR "Failed to update Google" 82 | wget http://kaeferjaeger.gay/sni-ip-ranges/oracle/ipv4_merged_sni.txt -O "$HOME/.cloudscrt/oracle.txt" --quiet && log OK "Oracle done" || log ERROR "Failed to update Oracle" 83 | } 84 | 85 | # Function to search for a domain in cloud data 86 | search() { 87 | query="$1" 88 | if [ -z "$query" ]; then 89 | log ERROR "No query specified" 90 | exit 1 91 | fi 92 | 93 | if [ -d "$HOME/.cloudscrt" ]; then 94 | cat "$HOME/.cloudscrt/"*".txt" | grep -F ".$query" | awk -F'-- ' '{print $2}'| tr ' ' '\n' | tr '[' ' '| sed 's/ //'| sed 's/\]//'| grep -F ".$query" | sort -u 95 | else 96 | log ERROR "~/.cloudscrt not found" 97 | exit 1 98 | fi 99 | } 100 | 101 | # Main function 102 | main() { 103 | if [ $UPDATE -eq 1 ]; then 104 | update 105 | fi 106 | if [ -n "$DOMAIN" ]; then 107 | search "$DOMAIN" 108 | fi 109 | if [[ "$UPDATE" -eq 0 && "$DOMAIN" == "" ]]; then 110 | if [ $SILENT -eq 0 ]; then 111 | echo "" >&2 112 | usage 113 | fi 114 | fi 115 | } 116 | 117 | # Display banner 118 | displayBanner(){ 119 | if [ $SILENT -eq 0 ]; then 120 | echo -e "${PURPLE} _______ __ ___ " >&2 121 | echo -e "${PURPLE} / ___/ /__ __ _____/ / / _ \___ _______ ___ " >&2 122 | echo -e "${PURPLE} / /__/ / _ \/ // / _ / / , _/ -_) __/ _ \/ _ \\" >&2 123 | echo -e "${PURPLE} \___/_/\___/\_,_/\_,_/ /_/|_|\__/\__/\___/_//_/" >&2 124 | echo -e " ${GREEN}github.com/Spix0r${RESET}" >&2 125 | fi 126 | } 127 | 128 | # Run the main function 129 | displayBanner 130 | main 131 | --------------------------------------------------------------------------------