SubDomz icon indicating copy to clipboard operation
SubDomz copied to clipboard

syntax error: unexpected end of file

Open 0xsheet opened this issue 1 year ago • 3 comments

When running SubDomz.sh script, it returned SubDomz.sh: line 512: syntax error: unexpected end of file.

VirusTotal() function is not properly closed - it's missing a closing curly brace } at line number 273 or 274.

@0xPugal

0xsheet avatar Nov 24 '24 04:11 0xsheet

Can fix by replacing the VirusTotal function with the following code:

VirusTotal() {
  # Ensure domain and VIRUSTOTAL_API_KEY are set
  if [ -z "$domain" ] || [ -z "$VIRUSTOTAL_API_KEY" ]; then
    echo "Domain or API Key not set."
    return 1
  fi

  if [ "$silent" == true ]; then
    curl -s "https://www.virustotal.com/vtapi/v2/domain/report?apikey=$VIRUSTOTAL_API_KEY&domain=$domain" |
      jq | egrep -v "http|Alexa domain info" |
      grep "$domain" |
      sed 's/[",]//g' |
      sed 's/^[[:space:]]*//' |
      anew subdomz-"$domain".txt
  else
    # Run the spinner in the background if PARALLEL is set to true
    if [[ ${PARALLEL} == true ]]; then
      spinner "${BOLD}VirusTotal${NC}" &
      PID="$!"
    fi

    curl -s "https://www.virustotal.com/vtapi/v2/domain/report?apikey=$VIRUSTOTAL_API_KEY&domain=$domain" |
      jq | egrep -v "http|Alexa domain info" |
      grep "$domain" |
      sed 's/[",]//g' |
      sed 's/^[[:space:]]*//' |
      sort -u > tmp-virustotal-"$domain"

    if [[ ${PARALLEL} == true ]]; then
      kill ${PID} 2>/dev/null
    fi

    # Print the result
    echo -e "$BOLD[*] VirusTotal$NC: $(wc -l < tmp-virustotal-"$domain")"
  fi
}

NicholasMarrone-1997 avatar Dec 07 '24 17:12 NicholasMarrone-1997

thanx i well be try.

0xsheet avatar Dec 07 '24 19:12 0xsheet

@NicholasMarrone-1997 Thank you bro it worked !

0xsheet avatar Dec 09 '24 18:12 0xsheet