Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax error: unexpected end of file #37

Open
iq-rasco opened this issue Nov 24, 2024 · 3 comments
Open

syntax error: unexpected end of file #37

iq-rasco opened this issue Nov 24, 2024 · 3 comments

Comments

@iq-rasco
Copy link

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

@NicholasMarrone-1997
Copy link

NicholasMarrone-1997 commented Dec 7, 2024

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
}

@iq-rasco
Copy link
Author

iq-rasco commented Dec 7, 2024

thanx i well be try.

@iq-rasco
Copy link
Author

iq-rasco commented Dec 9, 2024

@NicholasMarrone-1997
Thank you bro it worked !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants