I cloned this tool sqlmap from GitHub in my debian 12 terminal using sudo apt.
with following steps
git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
there after a folder created in my home directory. I can see it in graphical user interface. thereafter I cd/ sqlmap-dev
in terminal. when I was trying to run sqlmap commands it throwing me bash: python command not found
. I’m providing below code please look into these issue.
david@debian:~$ cd sqlmap-dev
david@debian:~/sqlmap-dev$ python sqlmap.py -u "https://www.hacksplaining.com/lessons/sql-injection" --smart
bash: python: command not found
david@debian:~/sqlmap-dev$ python sqlmap.py -h
bash: python: command not found
david@debian:~/sqlmap-dev$
what went wrong with my installation of Sqlmap ?
Perhaps I missed to trying python3 install sqlmap as it has python dependencies ? I don’t know since there is git clone instruction. I just git cloned and started trying to run sqlmap through entering into directory cd/sqlmap-dev. then I tried to run sqlmap commands it throws me bash python command not found.
2
Answers
It looks like you’re either missing Python on your machine or it’s Python 3.x that you have.
First try the following to ensure it’s indeed the case:
If it still doesn’t work then you’d have to install Python on your machine:
Run the following commands in a shell:
And for future convenience; ensure pip (package manager) is installed as well:
After running the following command, the following should work fine and
sqlmap
should be installed on your machine:as your python is not in your path so please use the absolute path of your python installation to run sqlmap
or if you want to setup your path just to use
python3 sqlmap.py -h
you need to add your path to.bashrc
or.zshrc
file, in your case probably.bashrc
add this line at the end of the file
and exit the nano editor with ctrl + x and y
apply the change by doing
or simply restarting the terminal
to verify path is correctly set use following command in the terminal :
and you can simply use the short command
python3 sqlmap.py -h
without absolute path. make sure you are inside thesqlmap-dev
direcotry