Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/data/data/com.termux/files/usr/bin/bash
- LOG_FILE="$HOME/webgetorcurl.log"
- BLUE='\033[1;34m'
- GREEN='\033[1;32m'
- YELLOW='\033[1;33m'
- RED='\033[1;31m'
- RESET='\033[0m'
- log_command() {
- echo "$(date '+%F %T') :: $1" >> "$LOG_FILE"
- }
- print_banner() {
- clear
- echo -e "${GREEN}================================================"
- echo -e "${BLUE} Wget & Curl Utility Tool - Termux Ready"
- echo -e "${GREEN} Secure Downloads, Recon & Web Interactions"
- echo -e "================================================${RESET}"
- }
- main_menu() {
- print_banner
- echo "Choose a tool:"
- echo "1) Use wget (File Download Manager)"
- echo "2) Use curl (Data Transfer Toolkit)"
- echo "3) View Log"
- echo "4) Exit"
- echo ""
- read -p "> " tool_choice
- case $tool_choice in
- 1) wget_menu ;;
- 2) curl_menu ;;
- 3) less "$LOG_FILE"; main_menu ;;
- 4) echo -e "${YELLOW}Exiting...${RESET}"; exit ;;
- *) echo -e "${RED}Invalid input.${RESET}"; sleep 1; main_menu ;;
- esac
- }
- wget_menu() {
- print_banner
- echo -e "${BLUE}WGET Options:${RESET}"
- echo "1) Basic download"
- echo "2) Recursive download"
- echo "3) Mirror website"
- echo "4) Resume download"
- echo "5) Custom user-agent"
- echo "6) Use proxy"
- echo "7) Limit speed"
- echo "8) Output to file"
- echo "9) Number of retries"
- echo "10) Custom headers"
- echo "11) Set timeout"
- echo "12) Background download"
- echo "13) FTP download"
- echo "14) No-parent directory recursion"
- echo "15) Set download directory"
- echo "16) Quiet mode"
- echo "17) Timestamping"
- echo "18) Back to Main Menu"
- echo ""
- read -p "> " opt
- case $opt in
- 1) read -p "URL: " url; wget "$url"; log_command "wget $url" ;;
- 2) read -p "URL: " url; wget -r "$url"; log_command "wget -r $url" ;;
- 3) read -p "URL: " url; wget -m "$url"; log_command "wget -m $url" ;;
- 4) read -p "URL: " url; wget -c "$url"; log_command "wget -c $url" ;;
- 5) read -p "URL: " url; read -p "User-Agent: " ua; wget --user-agent="$ua" "$url"; log_command "wget --user-agent='$ua' $url" ;;
- 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" ;;
- 7) read -p "URL: " url; read -p "Rate (e.g. 500k): " rate; wget --limit-rate="$rate" "$url"; log_command "wget --limit-rate=$rate $url" ;;
- 8) read -p "URL: " url; read -p "Filename: " file; wget -O "$file" "$url"; log_command "wget -O $file $url" ;;
- 9) read -p "URL: " url; read -p "Retries: " ret; wget --tries="$ret" "$url"; log_command "wget --tries=$ret $url" ;;
- 10) read -p "URL: " url; read -p "Header: " header; wget --header="$header" "$url"; log_command "wget --header='$header' $url" ;;
- 11) read -p "URL: " url; read -p "Seconds: " sec; wget --timeout="$sec" "$url"; log_command "wget --timeout=$sec $url" ;;
- 12) read -p "URL: " url nohup wget "$url" > /dev/null 2>&1 & log_command "wget background $url" ;;
- 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" ;;
- 14) read -p "URL: " url; wget -r --no-parent "$url"; log_command "wget --no-parent $url" ;;
- 15) read -p "URL: " url; read -p "Directory: " dir; wget -P "$dir" "$url"; log_command "wget -P $dir $url" ;;
- 16) read -p "URL: " url; wget -q "$url"; log_command "wget -q $url" ;;
- 17) read -p "URL: " url; wget -N "$url"; log_command "wget -N $url" ;;
- 18) main_menu ;;
- *) wget_menu ;;
- esac
- sleep 2; wget_menu
- }
- curl_menu() {
- print_banner
- echo -e "${BLUE}CURL Options:${RESET}"
- echo "1) Basic GET request"
- echo "2) Download file"
- echo "3) Custom headers"
- echo "4) User-Agent spoofing"
- echo "5) Follow redirects"
- echo "6) POST data"
- echo "7) JSON POST"
- echo "8) Upload file"
- echo "9) Set timeout"
- echo "10) Use proxy"
- echo "11) Save output to file"
- echo "12) Silent mode"
- echo "13) Show response headers only"
- echo "14) Auth with username and password"
- echo "15) Back to Main Menu"
- echo ""
- read -p "> " opt
- case $opt in
- 1) read -p "URL: " url; curl "$url"; log_command "curl $url" ;;
- 2) read -p "URL: " url; read -p "Filename: " file; curl -o "$file" "$url"; log_command "curl -o $file $url" ;;
- 3) read -p "URL: " url; read -p "Header: " header; curl -H "$header" "$url"; log_command "curl -H '$header' $url" ;;
- 4) read -p "URL: " url; read -p "User-Agent: " ua; curl -A "$ua" "$url"; log_command "curl -A '$ua' $url" ;;
- 5) read -p "URL: " url; curl -L "$url"; log_command "curl -L $url" ;;
- 6) read -p "URL: " url; read -p "POST data (key=value): " data; curl -d "$data" "$url"; log_command "curl -d '$data' $url" ;;
- 7) read -p "URL: " url; read -p "JSON data: " json; curl -H "Content-Type: application/json" -d "$json" "$url"; log_command "curl JSON $url" ;;
- 8) read -p "URL: " url; read -p "File path: " file; curl -F "file=@$file" "$url"; log_command "curl upload $file to $url" ;;
- 9) read -p "URL: " url; read -p "Seconds: " sec; curl --max-time "$sec" "$url"; log_command "curl --max-time=$sec $url" ;;
- 10) read -p "URL: " url; read -p "Proxy (http://host:port): " proxy; curl -x "$proxy" "$url"; log_command "curl -x $proxy $url" ;;
- 11) read -p "URL: " url; read -p "Output file: " out; curl "$url" -o "$out"; log_command "curl $url -o $out" ;;
- 12) read -p "URL: " url; curl -s "$url"; log_command "curl -s $url" ;;
- 13) read -p "URL: " url; curl -I "$url"; log_command "curl -I $url" ;;
- 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" ;;
- 15) main_menu ;;
- *) curl_menu ;;
- esac
- sleep 2; curl_menu
- }
- main_menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement