0

sqlmap is a python base project which can be used to automate sql injection check. I'm able to install the same through pip into pycharm, project interpreter. Note, after pip install, sqlmap is available as "import sqlmap" within code.

now if i create a sample python project for e.g. samplecode.py and want to want to invoke sqlmap tools command-line option, how can i do that ???

Basically I want to invoke or run sqlmap, via calling sqlmap tool, filling its command line option, running within the console and read back its console output through python code, please help.

below is the command line option sqlmap gives.

sqlmap.py -u -p <post_parameters>

sqlmap tool

OneCricketeer
  • 126,858
  • 14
  • 92
  • 185
Bidyut Mondal
  • 51
  • 1
  • 3
  • If you can `import sqlmap`, why would you want to run its CLI parser? – OneCricketeer Oct 05 '20 at 20:06
  • Otherwise - https://stackoverflow.com/questions/89228/how-to-call-an-external-command?rq=1 – OneCricketeer Oct 05 '20 at 20:09
  • I have used sqlmap via terminals but now want to use sqlmap tool via filling its command-line switches but through python code and new to python programming, so looking for a way out – Bidyut Mondal Oct 05 '20 at 20:14
  • Checked the linked question if you want to run arbitrary terminal commands – OneCricketeer Oct 05 '20 at 20:33
  • @OneCricketeer thanks for your response. Just in case is there any way to invoke utility like sqlmap to invoke within "Python Console" ? – Bidyut Mondal Oct 06 '20 at 08:52
  • Not sure what you mean by that. As pointed out, you can either `import sqlmap` and interact directly, or spawn a shell process using `subprocess` or `os` modules – OneCricketeer Oct 06 '20 at 15:08
  • Thanks. In further research, I got that the tool which I want to use it was never meant to be used like Library and the only option left to use as a standalone application through the shell – Bidyut Mondal Oct 07 '20 at 09:03

0 Answers0