# Interactive Example SQL Injection

On this page is an interactive demonstration of what you can do with SQL injection. Due to security concerns on our own server, this is using a Javascript implementation of a SQL server called TrimQuery, it has a few limitations and you can't try out the tricks using commenting. As such, we recommend you set up your own local server and try it there - there are plenty of videos and demos online to get you going.

Below, there's a username box together with the associated output by typing the query you do. None of it is escaped, so you can do as you please. Just remember, commenting isn't supported by this parser. The query that we'll assume to make is as follows:

    SELECT * FROM users WHERE users.username = '<your text here>'

Just as info to help you, there is only one table in the database. It's named users and has been filled with some sample data. The table schema is as follows:

- id - integer
- user - string
- password - string, hashed password in SHA1 format
- email_address - string
- usergroup - number, 0 is admin, 1 is normal user

Some examples to start you off are as follows:

- bob (expected standard input)
- bob123' OR users.usergroup = '0 (injects an admin usergroup request with a known username to not exist)
- bob123' OR users.email_address = 'admin@test.com (injects an email address with a known username to not exist)

Username
Output: