├── README.md ├── chaosDump.sh └── installer.sh /README.md: -------------------------------------------------------------------------------- 1 | # chaosDump 2 | ![chaoslogo](https://user-images.githubusercontent.com/63975446/156434128-e00ec74b-6be7-49c1-bbbb-76d5f39a1e51.png) 3 | 4 | A powerful and clean bash script to dump and extract information from Project Discovery's Chaos Project 5 | 6 | ChaosDump allows you to dump the complete data schema from https://chaos.projectdiscovery.io and allows you to dump actual datasets on the go. It is light weight and implemented in a very user friendly manner. 7 | Created this as a learning to implement clean and crisp code. Tried my level best to not create any mess and kept the code very clean with a good architecture. 8 | 9 | ## Requirements: 10 | ``` 11 | [+] Jq 12 | [+] pv 13 | [+] peco 14 | ``` 15 | 16 | ## Setup 17 | Run the installer script to setup all the dependecies. 18 | ``` 19 | sudo ./installer.sh 20 | ``` 21 | Note: Run the installer as sudo 22 | 23 | ## Usage 24 | Once the installer has finished setup, you can access chaosDump from anywhere using the command 25 | ``` 26 | chaosdump 27 | ``` 28 | ## Screenshots: 29 | ![chaosFetchoutput](https://user-images.githubusercontent.com/63975446/156434870-7df300fb-3715-43b6-8ea1-930976ea528f.png) 30 | ![chaosSearch](https://user-images.githubusercontent.com/63975446/156434838-861c8f4e-a28b-472f-abd8-6a23a6d3394e.png) 31 | 32 | ## ChaosDump in Action: 33 | https://user-images.githubusercontent.com/63975446/156427489-0c75d3c7-e9fd-4ff5-8e8d-575e0bcf3dae.mp4 34 | 35 | ## Reference: 36 | [+] [Chaos](https://chaos.projectdiscovery.io) by ProjectDiscovery 37 | 38 | -------------------------------------------------------------------------------- /chaosDump.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ChaosDump v1.0 4 | # Author : Rohit (@marcos_iaf) 5 | # https://twitter.com/marcos_iaf 6 | # https://github.com/720922/chaosDump 7 | 8 | ############################################################## 9 | # # 10 | # CONFIG VARS # 11 | # # 12 | ############################################################## 13 | # TERM COLORS 14 | bred='\033[1;31m' 15 | bblue='\033[1;34m' 16 | bgreen='\033[1;32m' 17 | yellow='\033[0;33m' 18 | red='\033[0;31m' 19 | blue='\033[0;34m' 20 | green='\033[0;32m' 21 | reset='\033[0m' 22 | url='https://chaos-data.projectdiscovery.io/index.json' 23 | dir_path=~/.config/chaosDP 24 | 25 | 26 | ############################################################## 27 | # # 28 | # FUNCTIONS # 29 | # # 30 | ############################################################## 31 | 32 | logo() 33 | { 34 | printf "${bred}" 35 | printf ''' 36 | __ ____ 37 | _____/ /_ ____ _____ _____/ __ \__ ______ ___ ____ 38 | / ___/ __ \/ __ `/ __ \/ ___/ / / / / / / __ `__ \/ __ \ 39 | / /__/ / / / /_/ / /_/ (__ ) /_/ / /_/ / / / / / / /_/ / 40 | \___/_/ /_/\__,_/\____/____/_____/\__,_/_/ /_/ /_/ .___/ 41 | ''' 42 | printf "${green}==================== ${blue}Developed By: ${yellow}@marcos_iaf${bred} / / " 43 | printf "\n${bred} /_/ ${reset}" 44 | 45 | # ''' 46 | printf "${reset}" 47 | printf "\n${yellow}===========The powerful\b\b\b\b\b\b\b\bmost powerful Chaos DB dumper==========\n${reset}"|pv -qL $[55+(-2 + RANDOM%5)] 48 | 49 | } 50 | 51 | pause(){ 52 | 53 | read -p "The selected process has completed. Press The 'Enter' Key, and select an option." fackEnterKey 54 | } 55 | 56 | create_prog_list(){ 57 | printf "\n${yellow}[${bred}+${yellow}]${green} Select the program from the databse...${reset}" 58 | # sleep 1 59 | prog_list=$(cat $dir_path/index.json|jq '.[].name'|awk '{print $2}' FS=\") 60 | selected_prog=$(echo "$prog_list"|peco|xargs) 61 | prog_url=$(cat $dir_path/index.json |jq --arg prog "$selected_prog" -r '.[] | select(.name==$prog)|.URL') 62 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 63 | } 64 | 65 | info(){ 66 | create_prog_list 67 | printf "\n${yellow}[${bred}+${yellow}]${green} Looking for the program in the databse..." 68 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 69 | if [ -z "$selected_prog" ] 70 | then 71 | printf "\n\n${yellow}[${bred}!${yellow}] No program selected !!${yellow}[${bred}!${yellow}]${reset}" 72 | else 73 | prog_details=$(cat $dir_path/index.json |jq --arg prog "$selected_prog" -r '.[] | select(.name==$prog)') 74 | prog_details_values=$(echo "${prog_details}"|sed 's/[}{",]//g'|awk '{print $2}'); 75 | name=$(echo ${prog_details_values}|awk '{print $1}') 76 | program_url=$(echo ${prog_details_values}|awk '{print $2}') 77 | count=$(echo ${prog_details_values}|awk '{print $4}') 78 | changes=$(echo ${prog_details_values}|awk '{print $5}') 79 | is_new=$(echo ${prog_details_values}|awk '{print $6}') 80 | if [ ! -z $(echo ${prog_details_values}|awk '{print $7}') ] 81 | then 82 | platform=$(echo ${prog_details_values}|awk '{print $7}') 83 | else 84 | platform="N/A" 85 | fi 86 | bounty=$(echo ${prog_details_values}|awk '{print $8}') 87 | last_updated=$(echo ${prog_details_values}|awk '{print $9}') 88 | printf "\n 89 | ╔══════════════╦════════════════════════════════════════════════════════════╗ 90 | ║ Program ║ ${name} 91 | ╠══════════════╬════════════════════════════════════════════════════════════╣ 92 | ║ name ║ ${name} 93 | ║ program_url ║ ${program_url} 94 | ║ count ║ ${count} 95 | ║ change ║ ${changes} 96 | ║ is_new ║ ${is_new} 97 | ║ platform ║ ${platform} 98 | ║ bounty ║ ${bounty} 99 | ║ last_updated ║ ${last_updated} 100 | ╚══════════════╩════════════════════════════════════════════════════════════╝ 101 | " 102 | fi 103 | printf "\n\n" 104 | pause 105 | } 106 | 107 | dumper(){ 108 | create_prog_list 109 | if [ -z "$selected_prog" ] 110 | then 111 | printf "\n\n${yellow}[${bred}!${yellow}] No program selected!!${yellow}[${bred}!${yellow}]${reset}" 112 | else 113 | printf "\n${yellow}[${bred}+${yellow}]${green} Dumping data for ${blue}$selected_prog...${reset}" 114 | wget -q $prog_url -O "$selected_prog".zip 115 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 116 | printf "\n${yellow}[${bred}+${yellow}]${green} Extracting data...${reset}" 117 | unzip -q "$selected_prog".zip -d "$selected_prog" 118 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 119 | printf "\n${yellow}[${bred}+${yellow}]${green} Dumped Data saved to folder ${blue}$1${reset}" 120 | rm "$selected_prog".zip 121 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 122 | fi 123 | printf "\n\n" 124 | pause 125 | } 126 | 127 | first_run(){ 128 | if [ ! -d $dir_path ] 129 | then 130 | printf "\n${yellow}[${bred}+${yellow}]${bblue} Seems like this is your first run...${yellow}[${bgreen}#720922${yellow}]${reset}" 131 | printf "\n${yellow}[${bred}+${yellow}]${bblue} Updating configurations for the tool${reset}" 132 | mkdir $dir_path 133 | sleep 1 134 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 135 | printf "\n${yellow}[${bred}+${yellow}]${bblue} Dumping fresh records from the chaos database${reset}" 136 | wget $url -q -O $dir_path/index.json 137 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 138 | printf "\n${yellow}[${bred}+${yellow}]${bblue} Finish setting up.${reset}" 139 | sleep 2 140 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]\n${reset}" 141 | fi 142 | } 143 | 144 | db_updater(){ 145 | if [ -d $dir_path ] 146 | then 147 | { 148 | printf "\n${yellow}[${bred}+${yellow}]${bblue} Updating configurations for the tool${reset}" 149 | # mkdir $dir_path 150 | sleep 1 151 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 152 | printf "\n${yellow}[${bred}+${yellow}]${green} Dumping fresh records from the chaos database${reset}" 153 | wget $url -q -O $dir_path/index.json 154 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 155 | printf "\n${yellow}[${bred}+${yellow}]${bblue} Finish setting up.${reset}" 156 | sleep 2 157 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]\n${reset}" 158 | } 159 | else 160 | first_run 161 | fi 162 | } 163 | 164 | menu(){ 165 | clear 166 | logo 167 | first_run 168 | printf "%s\n${blue}-----------------------------------------------------${reset}" 169 | printf "%s\n${bgreen}\t\tChaosDump Menu ${reset}" 170 | printf "%s\n${blue}-----------------------------------------------------${reset}\n" 171 | echo "1. Dump Subdomains" 172 | echo "2. Fetch Stats" 173 | echo "3. Update DataSet" 174 | echo "4. Exit" 175 | } 176 | 177 | read_options(){ 178 | local choice 179 | read -p "Enter choice [ 1 - 4 ] " choice 180 | case ${choice} in 181 | 182 | 1) dumper ;; 183 | 2) info ;; 184 | 3) db_updater ;; 185 | 4) exit 0;; #This will exit out of the application 186 | *) printf "%s\n${red}Error...Option Not Valid, Please Choose Another${reset}" && sleep 1 187 | esac 188 | 189 | 190 | } 191 | 192 | 193 | 194 | ############################################################## 195 | # # 196 | # SCRIPT START # 197 | # # 198 | ############################################################## 199 | while true 200 | do 201 | menu 202 | read_options 203 | done 204 | -------------------------------------------------------------------------------- /installer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | # ChaosDump Installer v1.0 5 | # Author : Rohit (@marcos_iaf) 6 | # https://twitter.com/marcos_iaf 7 | # https://github.com/720922/chaosDump 8 | 9 | 10 | ############################################################## 11 | # # 12 | # CONFIG VARS # 13 | # # 14 | ############################################################## 15 | 16 | # TERM COLORS 17 | bred='\033[1;31m' 18 | bblue='\033[1;34m' 19 | bgreen='\033[1;32m' 20 | yellow='\033[0;33m' 21 | red='\033[0;31m' 22 | blue='\033[0;34m' 23 | green='\033[0;32m' 24 | reset='\033[0m' 25 | 26 | ############################################################## 27 | # # 28 | # FUNCTIONS # 29 | # # 30 | ############################################################## 31 | 32 | logo() 33 | { 34 | printf "${bred}" 35 | printf ''' 36 | __ ____ 37 | _____/ /_ ____ _____ _____/ __ \__ ______ ___ ____ 38 | / ___/ __ \/ __ `/ __ \/ ___/ / / / / / / __ `__ \/ __ \ 39 | / /__/ / / / /_/ / /_/ (__ ) /_/ / /_/ / / / / / / /_/ / 40 | \___/_/ /_/\__,_/\____/____/_____/\__,_/_/ /_/ /_/ .___/ Installer 41 | ''' 42 | printf "${green}==================== ${blue}Developed By: ${yellow}@marcos_iaf${bred} / / " 43 | printf "\n${bred} /_/ ${reset}" 44 | } 45 | 46 | 47 | main_installer(){ 48 | printf "\n${green}Installing required dependencies...${reset}" 49 | sudo apt-get -qq install peco -y 50 | sudo apt-get -qq install jq -y 51 | sudo apt-get -qq install pv -y 52 | printf "\n${green}Dependencies installed succesfully...${reset}" 53 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 54 | printf "\n${green}Finishing up...${reset}" 55 | sudo cp chaosDump.sh /usr/local/bin/chaosdump 56 | printf "${yellow}[${bgreen}\xE2\x9C\x94${yellow}]${reset}" 57 | printf "\n\n${yellow}Now you can run chaosDump from anywhere using command${bblue}chaosdump${reset}" 58 | printf "\n\n${yellow}[${bred}!${yellow}] Setup Finished Succesfully!!${yellow}[${bred}!${yellow}]${reset}" 59 | } 60 | 61 | 62 | ############################################################## 63 | # # 64 | # SCRIPT START # 65 | # # 66 | ############################################################## 67 | logo 68 | main_installer --------------------------------------------------------------------------------