1

I am currently practicing SQL injection on a local host web application. In order to successfully do that, a value must be returned in the statement (by using SELECT). I'm trying to change the password of the user:

changepwd', (UPDATE mysql.user SET authentication_string=PASSWORD('new password') 
             WHERE user='root' UNION SELECT authentication_string from mysql.user)) #

With SQL injection you can't use ;. I tried UNIONin that example to see if it would work but no luck. Any other ideas i could try?

Reckope
  • 101
  • 1
  • 1
  • 8

1 Answers1

0

I think the answer to this question is here.

In short the answer is create a stored procedure.

Community
  • 1
  • 1
  • generally speaking this is the way to go, but he's asking about sql injection, so creating a SP is not an option – Nir Levy Nov 23 '16 at 22:17
  • Then is it possible to inject and procedure and call it? Maybe by changing the delimiter and running several calls. (I don't know if it's possible and haven't tested it) – Ricardo Rodrigues Nov 23 '16 at 22:32