Advertisement
WhosYourDaddySec

Curl W get Utility

May 19th, 2025 (edited)
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 6.05 KB | None | 0 0
  1. #!/data/data/com.termux/files/usr/bin/bash
  2.  
  3. LOG_FILE="$HOME/webgetorcurl.log"
  4.  
  5. BLUE='\033[1;34m'
  6. GREEN='\033[1;32m'
  7. YELLOW='\033[1;33m'
  8. RED='\033[1;31m'
  9. RESET='\033[0m'
  10.  
  11. log_command() {
  12.     echo "$(date '+%F %T') :: $1" >> "$LOG_FILE"
  13. }
  14.  
  15. print_banner() {
  16.     clear
  17.     echo -e "${GREEN}================================================"
  18.     echo -e "${BLUE}     Wget & Curl Utility Tool - Termux Ready"
  19.     echo -e "${GREEN}  Secure Downloads, Recon & Web Interactions"
  20.     echo -e "================================================${RESET}"
  21. }
  22.  
  23. main_menu() {
  24.     print_banner
  25.     echo "Choose a tool:"
  26.     echo "1) Use wget (File Download Manager)"
  27.     echo "2) Use curl (Data Transfer Toolkit)"
  28.     echo "3) View Log"
  29.     echo "4) Exit"
  30.     echo ""
  31.     read -p "> " tool_choice
  32.     case $tool_choice in
  33.         1) wget_menu ;;
  34.         2) curl_menu ;;
  35.         3) less "$LOG_FILE"; main_menu ;;
  36.         4) echo -e "${YELLOW}Exiting...${RESET}"; exit ;;
  37.         *) echo -e "${RED}Invalid input.${RESET}"; sleep 1; main_menu ;;
  38.     esac
  39. }
  40.  
  41. wget_menu() {
  42.     print_banner
  43.     echo -e "${BLUE}WGET Options:${RESET}"
  44.     echo "1) Basic download"
  45.     echo "2) Recursive download"
  46.     echo "3) Mirror website"
  47.     echo "4) Resume download"
  48.     echo "5) Custom user-agent"
  49.     echo "6) Use proxy"
  50.     echo "7) Limit speed"
  51.     echo "8) Output to file"
  52.     echo "9) Number of retries"
  53.     echo "10) Custom headers"
  54.     echo "11) Set timeout"
  55.     echo "12) Background download"
  56.     echo "13) FTP download"
  57.     echo "14) No-parent directory recursion"
  58.     echo "15) Set download directory"
  59.     echo "16) Quiet mode"
  60.     echo "17) Timestamping"
  61.     echo "18) Back to Main Menu"
  62.     echo ""
  63.     read -p "> " opt
  64.     case $opt in
  65.         1) read -p "URL: " url; wget "$url"; log_command "wget $url" ;;
  66.         2) read -p "URL: " url; wget -r "$url"; log_command "wget -r $url" ;;
  67.         3) read -p "URL: " url; wget -m "$url"; log_command "wget -m $url" ;;
  68.         4) read -p "URL: " url; wget -c "$url"; log_command "wget -c $url" ;;
  69.         5) read -p "URL: " url; read -p "User-Agent: " ua; wget --user-agent="$ua" "$url"; log_command "wget --user-agent='$ua' $url" ;;
  70.         6) read -p "URL: " url; read -p "Proxy (http://host:port): " proxy; wget -e use_proxy=yes -e http_proxy="$proxy" "$url"; log_command "wget proxy $proxy $url" ;;
  71.         7) read -p "URL: " url; read -p "Rate (e.g. 500k): " rate; wget --limit-rate="$rate" "$url"; log_command "wget --limit-rate=$rate $url" ;;
  72.         8) read -p "URL: " url; read -p "Filename: " file; wget -O "$file" "$url"; log_command "wget -O $file $url" ;;
  73.         9) read -p "URL: " url; read -p "Retries: " ret; wget --tries="$ret" "$url"; log_command "wget --tries=$ret $url" ;;
  74.         10) read -p "URL: " url; read -p "Header: " header; wget --header="$header" "$url"; log_command "wget --header='$header' $url" ;;
  75.         11) read -p "URL: " url; read -p "Seconds: " sec; wget --timeout="$sec" "$url"; log_command "wget --timeout=$sec $url" ;;
  76.         12) read -p "URL: " url nohup wget "$url" > /dev/null 2>&1 & log_command "wget background $url" ;;
  77.         13) read -p "URL: " url; read -p "Username: " user; read -s -p "Password: " pass; echo; wget --ftp-user="$user" --ftp-password="$pass" "$url"; log_command "wget FTP user $user $url" ;;
  78.         14) read -p "URL: " url; wget -r --no-parent "$url"; log_command "wget --no-parent $url" ;;
  79.         15) read -p "URL: " url; read -p "Directory: " dir; wget -P "$dir" "$url"; log_command "wget -P $dir $url" ;;
  80.         16) read -p "URL: " url; wget -q "$url"; log_command "wget -q $url" ;;
  81.         17) read -p "URL: " url; wget -N "$url"; log_command "wget -N $url" ;;
  82.         18) main_menu ;;
  83.         *) wget_menu ;;
  84.     esac
  85.     sleep 2; wget_menu
  86. }
  87.  
  88. curl_menu() {
  89.     print_banner
  90.     echo -e "${BLUE}CURL Options:${RESET}"
  91.     echo "1) Basic GET request"
  92.     echo "2) Download file"
  93.     echo "3) Custom headers"
  94.     echo "4) User-Agent spoofing"
  95.     echo "5) Follow redirects"
  96.     echo "6) POST data"
  97.     echo "7) JSON POST"
  98.     echo "8) Upload file"
  99.     echo "9) Set timeout"
  100.     echo "10) Use proxy"
  101.     echo "11) Save output to file"
  102.     echo "12) Silent mode"
  103.     echo "13) Show response headers only"
  104.     echo "14) Auth with username and password"
  105.     echo "15) Back to Main Menu"
  106.     echo ""
  107.     read -p "> " opt
  108.     case $opt in
  109.         1) read -p "URL: " url; curl "$url"; log_command "curl $url" ;;
  110.         2) read -p "URL: " url; read -p "Filename: " file; curl -o "$file" "$url"; log_command "curl -o $file $url" ;;
  111.         3) read -p "URL: " url; read -p "Header: " header; curl -H "$header" "$url"; log_command "curl -H '$header' $url" ;;
  112.         4) read -p "URL: " url; read -p "User-Agent: " ua; curl -A "$ua" "$url"; log_command "curl -A '$ua' $url" ;;
  113.         5) read -p "URL: " url; curl -L "$url"; log_command "curl -L $url" ;;
  114.         6) read -p "URL: " url; read -p "POST data (key=value): " data; curl -d "$data" "$url"; log_command "curl -d '$data' $url" ;;
  115.         7) read -p "URL: " url; read -p "JSON data: " json; curl -H "Content-Type: application/json" -d "$json" "$url"; log_command "curl JSON $url" ;;
  116.         8) read -p "URL: " url; read -p "File path: " file; curl -F "file=@$file" "$url"; log_command "curl upload $file to $url" ;;
  117.         9) read -p "URL: " url; read -p "Seconds: " sec; curl --max-time "$sec" "$url"; log_command "curl --max-time=$sec $url" ;;
  118.         10) read -p "URL: " url; read -p "Proxy (http://host:port): " proxy; curl -x "$proxy" "$url"; log_command "curl -x $proxy $url" ;;
  119.         11) read -p "URL: " url; read -p "Output file: " out; curl "$url" -o "$out"; log_command "curl $url -o $out" ;;
  120.         12) read -p "URL: " url; curl -s "$url"; log_command "curl -s $url" ;;
  121.         13) read -p "URL: " url; curl -I "$url"; log_command "curl -I $url" ;;
  122.         14) read -p "URL: " url; read -p "Username: " user; read -s -p "Password: " pass; echo; curl -u "$user:$pass" "$url"; log_command "curl -u $user $url" ;;
  123.         15) main_menu ;;
  124.         *) curl_menu ;;
  125.     esac
  126.     sleep 2; curl_menu
  127. }
  128.  
  129. main_menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement