Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example on SQL-Injection-Interpolation no longer works #78

Open
enygma opened this issue Jun 26, 2019 · 3 comments
Open

Example on SQL-Injection-Interpolation no longer works #78

enygma opened this issue Jun 26, 2019 · 3 comments

Comments

@enygma
Copy link

enygma commented Jun 26, 2019

This is based on a new installation of the software.

The example query provided in SQL-Injection-Interpolation.md no longer works as the database no longer allows more than one SQL statement to be executed (an error is thrown).

An injection payload that does work, however, is:

http://127.0.0.1:8000/admin/1/analytics/?ip=184.166.51.156&password from app_user--

This injects after that first SELECT and then comments out the remainder of the statement.

@colbyprior
Copy link

I ran into this same issue. I replaced the cursor.execute(cmd) with a cursor.executescript(cmd) in the analytics model and this fixed the attack for me. Perhaps I should submit this as a pull request?

cursor.execute(cmd)

@palmergs
Copy link
Contributor

Yes, please submit a pull request and we'll give it a look over asap.

@colbyprior
Copy link

It looks like I got mixed up when I was testing this. cursor.executescript runs the SQL however it doesn't actually return the result. Sorry about that, my fault.

There isn't much way around this if you are using sqlite from what I can see. The example link could be changed to something like http://127.0.0.1:8000/admin/1/analytics/?ip=0.0.0.0&password,%20email%20from%20app_user--.

I have tested mysql and sqlite and they both work with this exploit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants