I have the latest version of hping3 installed, but Bash says "command not found"

5,600

The thing is, hping3 installs into /usr/sbin and you are not able to find it because /usr/sbin is only available in root´s $PATH. To top it off hping3 is only meant to be run as root.

hping3 actually needs access to network API functionalities to spoof packets (raw sockets) that are not accessible to programs running with the permissions of normal users.

Share:
5,600

Related videos on Youtube

Mars
Author by

Mars

Updated on September 18, 2022

Comments

  • Mars
    Mars over 1 year

    I'm trying to use the hping3 tool on Debian GNU/Linux (Jessie), and it doesn't want to play nice. When I run apt-get install hping3, it tells me that it's at the latest version already. When I run whereis hping3, it shows that it's where it should be.

    But when I try to use the tool, it says:

    bash: hping3: command not found

    I've read the syntax on the man page and done some googling, and I have absolutely no idea what the issue is. Has anybody else had this problem?

    • Jeff Schaller
      Jeff Schaller about 8 years
      If you run the full path shown in there whereis output, does it work? May just be a PATH issue.
    • Mars
      Mars about 8 years
      It works when I run the full path.
    • Vincenzo Lanera
      Vincenzo Lanera about 8 years
      To improve the quality of your questions, show the specific Google searches you have used. Searching on the error message you saw, which should be the first thing anyone tries, returns exactly the solution you need--- the PATH variable is not set right: Google search for "bash command not found"
    • Rui F Ribeiro
      Rui F Ribeiro about 8 years
      Which user are you using to run hping3?
    • Will
      Will about 8 years
      Does alias hping3 show anything? If you type which -a hping3, do any of them appear to be a symlink?
    • Mars
      Mars about 8 years
      Rui: I was using my non-root account, which I've now realized is a mistake. I forgot you needed to have root access to do what hping3 does with the packets you send. Will: running that command shows nothing. I'll just try and fix the PATH issue, and if all else fails, make hping3 an alias for "/usr/sbin/hping3". I appreciate the edit, by the way. Formatting isn't my strong suit lol
    • Rui F Ribeiro
      Rui F Ribeiro about 8 years
      Yep, I figured it out by your error....it is normal to have that as a regular user. Are you saying when you do sudo hping3 you have it too? And if logged in as root?
    • Mars
      Mars about 8 years
      The process runs when I use it with sudo or su, so it was a permissions problem.