Skip to content

Latest commit

 

History

History
77 lines (43 loc) · 2.05 KB

README.md

File metadata and controls

77 lines (43 loc) · 2.05 KB

More SQLi

Write-up author: jon-brandy

DESCRIPTION:

Can you find the flag on this website. Try to find the flag here.

HINT:

  1. SQLiLite

STEPS:

  1. In this challenge we're given a web app which has a login feature.

image

  1. Let's fill both username and password as ' OR "1=1"-- -.

RESULT

image

  1. Successfully logged in, now we need to dump the data, based from the hint the DBMS might be sqlite3, let's try to find the number of columns (should be 3, because it shows us 3, but let's check it again) that could be viewed, use this query:
' UNION SELECT 1,2,3-- -

sqlite3

RESULT

image

  1. Great now let's dump all the table name from sqlite_master, query:
' UNION SELECT 1, tbl_name, 3 FROM sqlite_master;--

RESULT

image

  1. Great now we know that there's 4 table name within sqlite_master, but things to note here. In sqlite3, there's a column name named sql in sqlite_master. This column stores all the SQL syntax used to create database object.
  2. Let's run this query:
' UNION SELECT 1, sql, 3 FROM sqlite_master;--

RESULT

image

  1. Notice inside the more_table table, it stored a column named flag, this should be our interest now. Let's run this query:
' UNION SELECT 1, flag, 3 FROM more_table;--

RESULT

image

  1. Got the flag!

FLAG:

picoCTF{G3tting_5QL_1nJ3c7I0N_l1k3_y0u_sh0ulD_98236ce6}