1

I wrote a shell script that bundles a few networking tools together (amass, nmap etc) and they all work fine except httprobe (a tool that takes a list of domains and probes for working http and https servers). The tool is written in Go. The Go Interpreter is in my $PATH. The tool works perfectly when used from the terminal (in any directory including the one the script is in). I wish I could provide more information but I'm stumped and really can't think of how to debug this.

OS: Elementary OS (Ubuntu bionic base)

Dave M
  • 13,138
  • 25
  • 36
  • 47
Pink Bug
  • 11
  • 1
  • How are you invoking “httprobe”? How are you invoking the script? What is the exact error message? – Daniel B Aug 15 '20 at 07:42
  • @DanielB Thank you for the reply, Inside the script I'm using `cat wordlist.txt | sort -u | httprobe -s -p https:443` ( to filter out http severs). Script is run by `sudo ./script.sh ` and the error `./script.sh: line : httprobe : command not found`. – Pink Bug Aug 15 '20 at 07:49
  • 1
    I managed to fix this, turns out that go was in my $PATH but not in the secure_path at /etc/sudoers so essentially every go command that I ran with sudo would error out that means that when I ran the script with `sudo ./script.sh` would error out because one of the commands that actually ran inside the script was `sudo httprobe`. Fixed it by adding go to /etc/sudoers/secure_path – Pink Bug Aug 15 '20 at 12:36
  • A lesson: include more information in the question. Your question doesn't even mention `sudo`. You were asked "how are you invoking the script?" and you chose to write a comment instead of editing the question. Then you answered in a comment. Please take our short [tour] to see how the site is supposed to work. Your question and comments can be rebuilt and form a [self-answered question](https://superuser.com/help/self-answer). The question should describe the problem without relying on comments; and the solution should be in an answer. – Kamil Maciorowski Aug 16 '20 at 21:38

0 Answers0