I have the latest version of hping3 installed, but Bash says "command not found"
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.
Related videos on Youtube
Mars
Updated on September 18, 2022Comments
-
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 runapt-get install hping3
, it tells me that it's at the latest version already. When I runwhereis 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 about 8 yearsIf you run the full path shown in there whereis output, does it work? May just be a PATH issue.
-
Mars about 8 yearsIt works when I run the full path.
-
Vincenzo Lanera about 8 yearsTo 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 about 8 yearsWhich user are you using to run hping3?
-
Will about 8 yearsDoes
alias hping3
show anything? If you typewhich -a hping3
, do any of them appear to be a symlink? -
Mars about 8 yearsRui: 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 about 8 yearsYep, 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 about 8 yearsThe process runs when I use it with sudo or su, so it was a permissions problem.
-