SlideShare a Scribd company logo
ETHICAL HACKING
LAB SERIES
Lab 14: Understanding SQL Commands &
Injections
Material in this Lab Aligns to the Following Certification
Domains/Objectives
Certified Ethical Hacking (CEH)
Domains
SANS GPEN Objectives
14: SQL Injection
14: Reconnaissance
Document Version: 2016-03-09
Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com
NETLAB Academy Edition, NETLAB Professional Edition, and
NETLAB+ are registered trademarks of Network Development
Group, Inc.
VMware is a registered trademark of VMware, Inc. Cisco, IOS,
Cisco IOS, Networking Academy, CCNA, and CCNP are
registered
trademarks of Cisco Systems, Inc. EMC
2
is a registered trademark of EMC Corporation.
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 2
Contents
Introduction
...............................................................................................
......................... 3
Objective
...............................................................................................
.............................. 3
Pod Topology
...............................................................................................
....................... 4
Lab Settings
...............................................................................................
.......................... 5
1 Basic SQL Commands
...............................................................................................
... 6
2 Querying with SQL
...............................................................................................
..... 11
3 Deleting with SQL
...............................................................................................
....... 12
4 SQL Injection
...............................................................................................
.............. 13
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 3
Introduction
SQL (Structured Query Language) is used by many databases as
a language to query,
insert and delete elements. This lab demonstrates how to build,
query, and delete
elements in a database and how these skills can be used to
attack a database.
Objective
In this lab, you will be conducting ethical hacking practices
using various tools. You will
be performing the following tasks:
1. Basic SQL Commands
2. Querying with SQL
3. Deleting with SQL
4. SQL Injection
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 4
Pod Topology
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 5
Lab Settings
The information in the table below will be needed in order to
complete the lab. The
task sections below provide details on the use of this
information.
Virtual Machine
IP Address
Account
(if needed)
Password
(if needed)
Kali Linux
192.168.9.2 root toor
pfSense
192.168.0.254 admin pfsense
OWASP Broken Web App
192.168.68.12 root owaspbwa
OpenSUSE 192.168.0.2 osboxes osboxes.org
Security Onion
n/a ndg password123
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 6
1 Basic SQL Commands
1. Navigate to the topology page and click on the Kali VM icon.
2. Click anywhere within the Kali console window and press
Enter to display the
login prompt.
3. Enter root as the username. Click Next.
4. Enter toor as the password. Click Sign In.
5. Open the Terminal by clicking on the Terminal icon located
on the left panel.
6. In the new Terminal window, start the mysql service by
typing the command
below followed by pressing the Enter key.
service mysql start
7. Once started, enter the command below to log into the mysql
database.
mysql –u root
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 7
8. Once logged in, view the available databases by entering the
command below.
show databases;
9. Notice the predefined databases. Create a new database
named test.
create database test;
10. Confirm the new test database appears.
show databases;
11. Use the new database by entering the command below.
use test;
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 8
12. View if there are any tables in the test database.
show tables;
13. Create a new table within the test database for users and
populate it.
create table users (name varchar (30), account integer, balance
decimal
(10,2));
14. Show the tables and confirm a new users table appears.
show tables;
15. Add some data into the users table.
insert into users values (‘John’, 123, 10.00);
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 9
16. View the data in the users table.
select * from users;
17. Populate the users table once more with a different
customer.
insert into users values (‘Joe’, 456, 20.00);
18. View the data in the users table.
select * from users;
19. Create another table name personal and populate it.
create table personal (name varchar(30), address varchar(30),
city
varchar(20), telephone integer);
20. Verify the new table exists.
show tables;
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 10
21. Add some data into the personal table.
insert into personal values(‘John’, ‘1313 Mockingbird Lane’,
‘Mockingbird
Heights’, 3105552368);
22. Insert additional data into the personal table.
insert into personal values(‘Joe’, ‘1313 Cemetery Lane’,
‘Greenbrier’,
1313131313);
23. Analyze the data from the personal data.
select * from personal;
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 11
2 Querying with SQL
1. Using the test database, query the names of the users and
balance from the
users table.
select name, balance from users;
2. Query the names of the users and telephone numbers from
the personal table.
select name, telephone from personal;
3. Retrieve data across both tables: users and personal.
select users.name, users.balance, personal.telephone from users
join
personal where users.name=personal.name;
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 12
3 Deleting with SQL
1. Enter the command below to delete a row of data from the
personal table.
delete from personal where name=’Joe’;
2. View the deleted changes.
select * from personal;
3. Delete the entire personal table.
drop table personal;
4. View all the available tables.
show tables;
5. Delete the entire test database.
drop database test;
6. Show all databases.
show databases;
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 13
4 SQL Injection
1. Open the Iceweasel browser by clicking on the Iceweasel
icon located on the left
panel.
2. In the Iceweasel browser, type 192.168.68.12 into the address
field and press
the Enter key.
3. Scroll down to the Training Applications pane and click on
the Damn Vulnerable
Web Application link.
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 14
4. On the DVWA login page, login using admin as the username
and admin as the
password. Click Login.
5. On the DVWA homepage, click on SQL Injection button
located in the left pane.
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 15
6. Test if the application is vulnerable to SQL injection by
trying a simple test using
a true statement. Type the command below into the User ID
text field followed
by clicking the Submit button.
1=1
Notice what happened was that a query was sent to the database
that executed
the following: select first_name,surname from “some table”
where user_id=1
7. Display all records that are false (empty) and all records that
are true (not
empty). Enter the command below into the User ID field
followed by clicking
Submit.
1’ or ‘0’=’0
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 16
Users have now been dumped into the database. The following
query was
executed: select first_name,surname from “some table” where
user_id = 1’ or
‘0’=’0’;
8. Attempt to pull database information and the user of the
database. Enter the
command below into the User ID field, click Submit.
1’ or 1=1 union select database(), user()#
Notice the database() command returns the database name of
dvwa and its user
[email protected] The union statement is similar to “join”
except that it links 2
select statements together and the # character ends the
statement.
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 17
9. Try to pull the database version by entering the command
below into the User ID
field, click Submit.
1’ or 1=1 union select null,version()#
Notice null was used as a placeholder and issued the version()
command. Given
the output, it appears the OS is running on 5.1.41-3ubuntu12.6.
10. Enter the command below into the User ID field to identify
the tables in the
database.
1’ or 1=1 union select null, table_name from
information_schema.tables#
11. Scroll down and identify the table being a users table.
In the query, null was a placeholder again and the table_name is
something that
exists in the main part of the database build called the
information schema.
Lab 14: Understanding SQL Commands & Injections
3/18/2016 Copyright © 2016 Network Development Group, Inc.
www.netdevgroup.com Page 18
12. Attempt to see if any password fields are associated with the
users table. Enter
the command below into the User ID field and click Submit.
1’ or 1=1 union select user, password from users#
Notice towards the bottom, hashes are given out from the query.
13. Close the Kali PC viewer.
SQL Injection
Lab Assignment
In this lab, you will launch an SQL injection attack from Kali to
a vulnerable web application on OWASP BWA.
1) You are required to complete the section titled “SQL
Injection” in the lab instructions starting on Page 13. You
should log into Kali VM and enter “root” as the username and
“toor” as the password before starting the Section 4.
2) You can also complete the first three sections of the lab to
gain acquaintance with SQL. It is recommended, but not
required.
3) Before performing this lab, please make sure that you read
the sections related with SQL Injection in Chapter-26 and
Chapter 27.
4) Take a screenshot of step 12, Section 4. Only take the
screenshots that show password fields that are associated with
the users table.
Reflection Assignment
After completing this lab,
1) Write a one-paragraph summary for what you have done in
this netlab assignment.
2) Write a one-paragraph explanation of how you can fix the
vulnerability on OWASP BWA. (Refer to Chapter 26 and
Chapter 27)
3) Watch the video on this webpage and also read the story on
how an SQL injection vulnerability turned into a national
security case: https://abc7chicago.com/politics/how -the-
russians-penetrated-illinois-election-computers/3778816/ . What
are the consequences of this vulnerability?
Please follow APA formatting style. Cite all sources.

More Related Content

What's hot

Sql Injection Myths and Fallacies
Sql Injection Myths and FallaciesSql Injection Myths and Fallacies
Sql Injection Myths and Fallacies
Karwin Software Solutions LLC
 
SQL 2012 and Powershell for the Bleeding Edge DBA
SQL 2012 and Powershell for the Bleeding Edge DBASQL 2012 and Powershell for the Bleeding Edge DBA
SQL 2012 and Powershell for the Bleeding Edge DBA
dpcobb
 
Time-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy QueriesTime-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy Queries
Chema Alonso
 
Defcon 17-joseph mccray-adv-sql_injection
Defcon 17-joseph mccray-adv-sql_injectionDefcon 17-joseph mccray-adv-sql_injection
Defcon 17-joseph mccray-adv-sql_injection
Ahmed AbdelSatar
 
Havij help english
Havij help englishHavij help english
Havij help english
moguinos
 
Sq linjection
Sq linjectionSq linjection
Technical Note - ITME: Running StADOSvr.exe as a Service
Technical Note - ITME: Running StADOSvr.exe as a ServiceTechnical Note - ITME: Running StADOSvr.exe as a Service
Technical Note - ITME: Running StADOSvr.exe as a Service
Wonderware InTouch Machine Edition
 
Unethical access to website’s databases hacking using sql injection
Unethical access to website’s databases hacking using sql injectionUnethical access to website’s databases hacking using sql injection
Unethical access to website’s databases hacking using sql injection
Satyajit Mukherjee
 
Time-Based Blind SQL Injection
Time-Based Blind SQL InjectionTime-Based Blind SQL Injection
Time-Based Blind SQL Injection
matt_presson
 
Sql Injection and Entity Frameworks
Sql Injection and Entity FrameworksSql Injection and Entity Frameworks
Sql Injection and Entity Frameworks
Rich Helton
 
Share point
Share pointShare point
Share point
Sathish Kumar
 
Manual de instalacion pentaho
Manual de instalacion pentahoManual de instalacion pentaho
Manual de instalacion pentaho
Fernando Velasquez
 
SQL Injection - Newsletter
SQL Injection - NewsletterSQL Injection - Newsletter
SQL Injection - Newsletter
Smitha Padmanabhan
 
Iranian Non-malware Fileless Attacks targeting aerospace and telecom
Iranian Non-malware Fileless Attacks targeting aerospace and telecomIranian Non-malware Fileless Attacks targeting aerospace and telecom
Iranian Non-malware Fileless Attacks targeting aerospace and telecom
AhmedA79
 
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya MorimotoSQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
Pichaya Morimoto
 
Sql injection course made by Cristian Alexandrescu
Sql injection course made by Cristian AlexandrescuSql injection course made by Cristian Alexandrescu
Sql injection course made by Cristian Alexandrescu
Cristian Alexandrescu
 
Pobs cleanup-steps-nauman
Pobs cleanup-steps-naumanPobs cleanup-steps-nauman
Pobs cleanup-steps-nauman
Nauman R
 

What's hot (17)

Sql Injection Myths and Fallacies
Sql Injection Myths and FallaciesSql Injection Myths and Fallacies
Sql Injection Myths and Fallacies
 
SQL 2012 and Powershell for the Bleeding Edge DBA
SQL 2012 and Powershell for the Bleeding Edge DBASQL 2012 and Powershell for the Bleeding Edge DBA
SQL 2012 and Powershell for the Bleeding Edge DBA
 
Time-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy QueriesTime-Based Blind SQL Injection Using Heavy Queries
Time-Based Blind SQL Injection Using Heavy Queries
 
Defcon 17-joseph mccray-adv-sql_injection
Defcon 17-joseph mccray-adv-sql_injectionDefcon 17-joseph mccray-adv-sql_injection
Defcon 17-joseph mccray-adv-sql_injection
 
Havij help english
Havij help englishHavij help english
Havij help english
 
Sq linjection
Sq linjectionSq linjection
Sq linjection
 
Technical Note - ITME: Running StADOSvr.exe as a Service
Technical Note - ITME: Running StADOSvr.exe as a ServiceTechnical Note - ITME: Running StADOSvr.exe as a Service
Technical Note - ITME: Running StADOSvr.exe as a Service
 
Unethical access to website’s databases hacking using sql injection
Unethical access to website’s databases hacking using sql injectionUnethical access to website’s databases hacking using sql injection
Unethical access to website’s databases hacking using sql injection
 
Time-Based Blind SQL Injection
Time-Based Blind SQL InjectionTime-Based Blind SQL Injection
Time-Based Blind SQL Injection
 
Sql Injection and Entity Frameworks
Sql Injection and Entity FrameworksSql Injection and Entity Frameworks
Sql Injection and Entity Frameworks
 
Share point
Share pointShare point
Share point
 
Manual de instalacion pentaho
Manual de instalacion pentahoManual de instalacion pentaho
Manual de instalacion pentaho
 
SQL Injection - Newsletter
SQL Injection - NewsletterSQL Injection - Newsletter
SQL Injection - Newsletter
 
Iranian Non-malware Fileless Attacks targeting aerospace and telecom
Iranian Non-malware Fileless Attacks targeting aerospace and telecomIranian Non-malware Fileless Attacks targeting aerospace and telecom
Iranian Non-malware Fileless Attacks targeting aerospace and telecom
 
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya MorimotoSQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
SQL Injection 101 : It is not just about ' or '1'='1 - Pichaya Morimoto
 
Sql injection course made by Cristian Alexandrescu
Sql injection course made by Cristian AlexandrescuSql injection course made by Cristian Alexandrescu
Sql injection course made by Cristian Alexandrescu
 
Pobs cleanup-steps-nauman
Pobs cleanup-steps-naumanPobs cleanup-steps-nauman
Pobs cleanup-steps-nauman
 

Similar to Ethical hacking lab series lab 14 understan

Consuming Data With HANA XS
Consuming Data With HANA XSConsuming Data With HANA XS
Consuming Data With HANA XS
Blackvard
 
Microsoft Lync Server 2010 Installation
Microsoft Lync Server 2010 InstallationMicrosoft Lync Server 2010 Installation
Microsoft Lync Server 2010 Installation
Shahab Al Yamin Chawdhury
 
Obiee 11g security creating users groups and catalog permissions
Obiee 11g security  creating users groups and catalog permissionsObiee 11g security  creating users groups and catalog permissions
Obiee 11g security creating users groups and catalog permissions
Ravi Kumar Lanke
 
DotNetNuke
DotNetNukeDotNetNuke
DotNetNuke
Ambati Sreedhar
 
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
 
HDinsight Workshop - Prerequisite Activity
HDinsight Workshop - Prerequisite ActivityHDinsight Workshop - Prerequisite Activity
HDinsight Workshop - Prerequisite Activity
Idan Tohami
 
installation and configuration of informatica server
installation and configuration of informatica serverinstallation and configuration of informatica server
installation and configuration of informatica server
ketulp
 
DNS Cache White Paper
DNS Cache White PaperDNS Cache White Paper
DNS Cache White Paper
Ryan Ellingson
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan
► Supreme Mandal ◄
 
Client Server Live Hosting Documentation
Client Server Live Hosting Documentation Client Server Live Hosting Documentation
Client Server Live Hosting Documentation
Khwaja Yunus Ali Medical University
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Service
butest
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Service
butest
 
Setting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloudSetting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloud
Henar Muñoz Frutos
 
Setting up your virtual infrastructure using FI-LAB Cloud
Setting up your virtual infrastructure using FI-LAB CloudSetting up your virtual infrastructure using FI-LAB Cloud
Setting up your virtual infrastructure using FI-LAB Cloud
FIWARE
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8
kaashiv1
 
Ebook8
Ebook8Ebook8
Ebook8
kaashiv1
 
Big Data: Big SQL web tooling (Data Server Manager) self-study lab
Big Data:  Big SQL web tooling (Data Server Manager) self-study labBig Data:  Big SQL web tooling (Data Server Manager) self-study lab
Big Data: Big SQL web tooling (Data Server Manager) self-study lab
Cynthia Saracco
 
Big Data: Querying complex JSON data with BigInsights and Hadoop
Big Data:  Querying complex JSON data with BigInsights and HadoopBig Data:  Querying complex JSON data with BigInsights and Hadoop
Big Data: Querying complex JSON data with BigInsights and Hadoop
Cynthia Saracco
 
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Anderson Bassani
 

Similar to Ethical hacking lab series lab 14 understan (20)

Consuming Data With HANA XS
Consuming Data With HANA XSConsuming Data With HANA XS
Consuming Data With HANA XS
 
Microsoft Lync Server 2010 Installation
Microsoft Lync Server 2010 InstallationMicrosoft Lync Server 2010 Installation
Microsoft Lync Server 2010 Installation
 
Obiee 11g security creating users groups and catalog permissions
Obiee 11g security  creating users groups and catalog permissionsObiee 11g security  creating users groups and catalog permissions
Obiee 11g security creating users groups and catalog permissions
 
DotNetNuke
DotNetNukeDotNetNuke
DotNetNuke
 
Blind sql injection
Blind sql injectionBlind sql injection
Blind sql injection
 
Blind sql injection
Blind sql injectionBlind sql injection
Blind sql injection
 
HDinsight Workshop - Prerequisite Activity
HDinsight Workshop - Prerequisite ActivityHDinsight Workshop - Prerequisite Activity
HDinsight Workshop - Prerequisite Activity
 
installation and configuration of informatica server
installation and configuration of informatica serverinstallation and configuration of informatica server
installation and configuration of informatica server
 
DNS Cache White Paper
DNS Cache White PaperDNS Cache White Paper
DNS Cache White Paper
 
SQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout PlanSQL Server 2000 Installation Rollout Backout Plan
SQL Server 2000 Installation Rollout Backout Plan
 
Client Server Live Hosting Documentation
Client Server Live Hosting Documentation Client Server Live Hosting Documentation
Client Server Live Hosting Documentation
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Service
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Service
 
Setting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloudSetting up your virtual infrastructure using fi lab cloud
Setting up your virtual infrastructure using fi lab cloud
 
Setting up your virtual infrastructure using FI-LAB Cloud
Setting up your virtual infrastructure using FI-LAB CloudSetting up your virtual infrastructure using FI-LAB Cloud
Setting up your virtual infrastructure using FI-LAB Cloud
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8
 
Ebook8
Ebook8Ebook8
Ebook8
 
Big Data: Big SQL web tooling (Data Server Manager) self-study lab
Big Data:  Big SQL web tooling (Data Server Manager) self-study labBig Data:  Big SQL web tooling (Data Server Manager) self-study lab
Big Data: Big SQL web tooling (Data Server Manager) self-study lab
 
Big Data: Querying complex JSON data with BigInsights and Hadoop
Big Data:  Querying complex JSON data with BigInsights and HadoopBig Data:  Querying complex JSON data with BigInsights and Hadoop
Big Data: Querying complex JSON data with BigInsights and Hadoop
 
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
Blockchain - Hyperledger Fabric v1.0 Running on LinuxONE, see it in action!
 

More from jasmin849794

1. you are the marketing manager for a specialty retailer that sel
1. you are the marketing manager for a specialty retailer that sel1. you are the marketing manager for a specialty retailer that sel
1. you are the marketing manager for a specialty retailer that sel
jasmin849794
 
1. short answer question(200 words) [required] roger s. pr
1. short answer question(200 words) [required] roger s. pr1. short answer question(200 words) [required] roger s. pr
1. short answer question(200 words) [required] roger s. pr
jasmin849794
 
1. complete the required major case analysis on the nfl rooney rule
1. complete the required major case analysis on the nfl rooney rule1. complete the required major case analysis on the nfl rooney rule
1. complete the required major case analysis on the nfl rooney rule
jasmin849794
 
1. although major appliances, like washers and dryers, are usually
1. although major appliances, like washers and dryers, are usually1. although major appliances, like washers and dryers, are usually
1. although major appliances, like washers and dryers, are usually
jasmin849794
 
1 it 210 final project guidelines and rubric over
1 it 210 final project guidelines and rubric  over1 it 210 final project guidelines and rubric  over
1 it 210 final project guidelines and rubric over
jasmin849794
 
1 business case scenario – assessment 2 managing cul
1 business case scenario – assessment 2 managing cul1 business case scenario – assessment 2 managing cul
1 business case scenario – assessment 2 managing cul
jasmin849794
 
1 7 5 l e a r n i n g o b j e c t i v e sc h a p t e r
1 7 5 l e a r n i n g  o b j e c t i v e sc h a p t e r1 7 5 l e a r n i n g  o b j e c t i v e sc h a p t e r
1 7 5 l e a r n i n g o b j e c t i v e sc h a p t e r
jasmin849794
 
1 week 8 assignment document library while your pe
1  week 8 assignment document library  while your pe1  week 8 assignment document library  while your pe
1 week 8 assignment document library while your pe
jasmin849794
 
1 canterbury tales (c. 12th century)
1  canterbury tales        (c. 12th century)  1  canterbury tales        (c. 12th century)
1 canterbury tales (c. 12th century)
jasmin849794
 
1 assignment 2 please read all directions below
1  assignment 2  please read all directions below 1  assignment 2  please read all directions below
1 assignment 2 please read all directions below
jasmin849794
 
1 3 week 6 presentation speaker notesstudent namemha59
1     3 week 6 presentation speaker notesstudent namemha591     3 week 6 presentation speaker notesstudent namemha59
1 3 week 6 presentation speaker notesstudent namemha59
jasmin849794
 
1 guideline for the assessment manage workf
1          guideline for the assessment manage workf1          guideline for the assessment manage workf
1 guideline for the assessment manage workf
jasmin849794
 
1
1                                                           1
(Note must create in word because thats the file extension to
(Note must create in word because thats the file extension to (Note must create in word because thats the file extension to
(Note must create in word because thats the file extension to
jasmin849794
 
(Jack ma)this week you will combine your research throughout t
(Jack ma)this week you will combine your research throughout t(Jack ma)this week you will combine your research throughout t
(Jack ma)this week you will combine your research throughout t
jasmin849794
 
U.s. domestic terrorism student these terrorist
 U.s. domestic terrorism student these terrorist U.s. domestic terrorism student these terrorist
U.s. domestic terrorism student these terrorist
jasmin849794
 
Summary statistics column n mean std. dev. min q1 medi
 Summary statistics column n mean std. dev. min q1 medi Summary statistics column n mean std. dev. min q1 medi
Summary statistics column n mean std. dev. min q1 medi
jasmin849794
 
Soteriology of the senses in tibetan buddhism author(s)
 Soteriology of the senses in tibetan buddhism author(s) Soteriology of the senses in tibetan buddhism author(s)
Soteriology of the senses in tibetan buddhism author(s)
jasmin849794
 
P g 0 0 0 4 m a y 0 6 , 2 0 1 1
 P g 0   0 0 4                 m a y  0 6 ,  2 0 1 1   P g 0   0 0 4                 m a y  0 6 ,  2 0 1 1
P g 0 0 0 4 m a y 0 6 , 2 0 1 1
jasmin849794
 
Mgt 3332 organizational behavior module 4 assignmen
 Mgt 3332 organizational behavior  module 4 assignmen Mgt 3332 organizational behavior  module 4 assignmen
Mgt 3332 organizational behavior module 4 assignmen
jasmin849794
 

More from jasmin849794 (20)

1. you are the marketing manager for a specialty retailer that sel
1. you are the marketing manager for a specialty retailer that sel1. you are the marketing manager for a specialty retailer that sel
1. you are the marketing manager for a specialty retailer that sel
 
1. short answer question(200 words) [required] roger s. pr
1. short answer question(200 words) [required] roger s. pr1. short answer question(200 words) [required] roger s. pr
1. short answer question(200 words) [required] roger s. pr
 
1. complete the required major case analysis on the nfl rooney rule
1. complete the required major case analysis on the nfl rooney rule1. complete the required major case analysis on the nfl rooney rule
1. complete the required major case analysis on the nfl rooney rule
 
1. although major appliances, like washers and dryers, are usually
1. although major appliances, like washers and dryers, are usually1. although major appliances, like washers and dryers, are usually
1. although major appliances, like washers and dryers, are usually
 
1 it 210 final project guidelines and rubric over
1 it 210 final project guidelines and rubric  over1 it 210 final project guidelines and rubric  over
1 it 210 final project guidelines and rubric over
 
1 business case scenario – assessment 2 managing cul
1 business case scenario – assessment 2 managing cul1 business case scenario – assessment 2 managing cul
1 business case scenario – assessment 2 managing cul
 
1 7 5 l e a r n i n g o b j e c t i v e sc h a p t e r
1 7 5 l e a r n i n g  o b j e c t i v e sc h a p t e r1 7 5 l e a r n i n g  o b j e c t i v e sc h a p t e r
1 7 5 l e a r n i n g o b j e c t i v e sc h a p t e r
 
1 week 8 assignment document library while your pe
1  week 8 assignment document library  while your pe1  week 8 assignment document library  while your pe
1 week 8 assignment document library while your pe
 
1 canterbury tales (c. 12th century)
1  canterbury tales        (c. 12th century)  1  canterbury tales        (c. 12th century)
1 canterbury tales (c. 12th century)
 
1 assignment 2 please read all directions below
1  assignment 2  please read all directions below 1  assignment 2  please read all directions below
1 assignment 2 please read all directions below
 
1 3 week 6 presentation speaker notesstudent namemha59
1     3 week 6 presentation speaker notesstudent namemha591     3 week 6 presentation speaker notesstudent namemha59
1 3 week 6 presentation speaker notesstudent namemha59
 
1 guideline for the assessment manage workf
1          guideline for the assessment manage workf1          guideline for the assessment manage workf
1 guideline for the assessment manage workf
 
1
1                                                           1
1
 
(Note must create in word because thats the file extension to
(Note must create in word because thats the file extension to (Note must create in word because thats the file extension to
(Note must create in word because thats the file extension to
 
(Jack ma)this week you will combine your research throughout t
(Jack ma)this week you will combine your research throughout t(Jack ma)this week you will combine your research throughout t
(Jack ma)this week you will combine your research throughout t
 
U.s. domestic terrorism student these terrorist
 U.s. domestic terrorism student these terrorist U.s. domestic terrorism student these terrorist
U.s. domestic terrorism student these terrorist
 
Summary statistics column n mean std. dev. min q1 medi
 Summary statistics column n mean std. dev. min q1 medi Summary statistics column n mean std. dev. min q1 medi
Summary statistics column n mean std. dev. min q1 medi
 
Soteriology of the senses in tibetan buddhism author(s)
 Soteriology of the senses in tibetan buddhism author(s) Soteriology of the senses in tibetan buddhism author(s)
Soteriology of the senses in tibetan buddhism author(s)
 
P g 0 0 0 4 m a y 0 6 , 2 0 1 1
 P g 0   0 0 4                 m a y  0 6 ,  2 0 1 1   P g 0   0 0 4                 m a y  0 6 ,  2 0 1 1
P g 0 0 0 4 m a y 0 6 , 2 0 1 1
 
Mgt 3332 organizational behavior module 4 assignmen
 Mgt 3332 organizational behavior  module 4 assignmen Mgt 3332 organizational behavior  module 4 assignmen
Mgt 3332 organizational behavior module 4 assignmen
 

Recently uploaded

Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
ArianaBusciglio
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 

Recently uploaded (20)

Assignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docxAssignment_4_ArianaBusciglio Marvel(1).docx
Assignment_4_ArianaBusciglio Marvel(1).docx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 

Ethical hacking lab series lab 14 understan

  • 1. ETHICAL HACKING LAB SERIES Lab 14: Understanding SQL Commands & Injections Material in this Lab Aligns to the Following Certification Domains/Objectives Certified Ethical Hacking (CEH) Domains SANS GPEN Objectives 14: SQL Injection 14: Reconnaissance
  • 2. Document Version: 2016-03-09 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com NETLAB Academy Edition, NETLAB Professional Edition, and NETLAB+ are registered trademarks of Network Development Group, Inc. VMware is a registered trademark of VMware, Inc. Cisco, IOS, Cisco IOS, Networking Academy, CCNA, and CCNP are registered trademarks of Cisco Systems, Inc. EMC 2 is a registered trademark of EMC Corporation. Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 2 Contents Introduction ............................................................................................... ......................... 3 Objective
  • 3. ............................................................................................... .............................. 3 Pod Topology ............................................................................................... ....................... 4 Lab Settings ............................................................................................... .......................... 5 1 Basic SQL Commands ............................................................................................... ... 6 2 Querying with SQL ............................................................................................... ..... 11 3 Deleting with SQL ............................................................................................... ....... 12 4 SQL Injection ............................................................................................... .............. 13 Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 3 Introduction
  • 4. SQL (Structured Query Language) is used by many databases as a language to query, insert and delete elements. This lab demonstrates how to build, query, and delete elements in a database and how these skills can be used to attack a database. Objective In this lab, you will be conducting ethical hacking practices using various tools. You will be performing the following tasks: 1. Basic SQL Commands 2. Querying with SQL 3. Deleting with SQL 4. SQL Injection Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 4 Pod Topology
  • 5. Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 5 Lab Settings The information in the table below will be needed in order to complete the lab. The task sections below provide details on the use of this information. Virtual Machine IP Address Account (if needed) Password
  • 6. (if needed) Kali Linux 192.168.9.2 root toor pfSense 192.168.0.254 admin pfsense OWASP Broken Web App 192.168.68.12 root owaspbwa OpenSUSE 192.168.0.2 osboxes osboxes.org Security Onion n/a ndg password123 Lab 14: Understanding SQL Commands & Injections
  • 7. 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 6 1 Basic SQL Commands 1. Navigate to the topology page and click on the Kali VM icon. 2. Click anywhere within the Kali console window and press Enter to display the login prompt. 3. Enter root as the username. Click Next. 4. Enter toor as the password. Click Sign In. 5. Open the Terminal by clicking on the Terminal icon located on the left panel. 6. In the new Terminal window, start the mysql service by typing the command below followed by pressing the Enter key. service mysql start 7. Once started, enter the command below to log into the mysql database. mysql –u root
  • 8. Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 7 8. Once logged in, view the available databases by entering the command below. show databases; 9. Notice the predefined databases. Create a new database named test. create database test; 10. Confirm the new test database appears. show databases; 11. Use the new database by entering the command below.
  • 9. use test; Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 8 12. View if there are any tables in the test database. show tables; 13. Create a new table within the test database for users and populate it. create table users (name varchar (30), account integer, balance decimal (10,2)); 14. Show the tables and confirm a new users table appears.
  • 10. show tables; 15. Add some data into the users table. insert into users values (‘John’, 123, 10.00); Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 9 16. View the data in the users table. select * from users; 17. Populate the users table once more with a different customer. insert into users values (‘Joe’, 456, 20.00);
  • 11. 18. View the data in the users table. select * from users; 19. Create another table name personal and populate it. create table personal (name varchar(30), address varchar(30), city varchar(20), telephone integer); 20. Verify the new table exists. show tables; Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 10
  • 12. 21. Add some data into the personal table. insert into personal values(‘John’, ‘1313 Mockingbird Lane’, ‘Mockingbird Heights’, 3105552368); 22. Insert additional data into the personal table. insert into personal values(‘Joe’, ‘1313 Cemetery Lane’, ‘Greenbrier’, 1313131313); 23. Analyze the data from the personal data. select * from personal; Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc.
  • 13. www.netdevgroup.com Page 11 2 Querying with SQL 1. Using the test database, query the names of the users and balance from the users table. select name, balance from users; 2. Query the names of the users and telephone numbers from the personal table. select name, telephone from personal; 3. Retrieve data across both tables: users and personal. select users.name, users.balance, personal.telephone from users join personal where users.name=personal.name;
  • 14. Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 12 3 Deleting with SQL 1. Enter the command below to delete a row of data from the personal table. delete from personal where name=’Joe’; 2. View the deleted changes. select * from personal; 3. Delete the entire personal table. drop table personal; 4. View all the available tables.
  • 15. show tables; 5. Delete the entire test database. drop database test; 6. Show all databases. show databases; Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 13 4 SQL Injection 1. Open the Iceweasel browser by clicking on the Iceweasel icon located on the left panel.
  • 16. 2. In the Iceweasel browser, type 192.168.68.12 into the address field and press the Enter key. 3. Scroll down to the Training Applications pane and click on the Damn Vulnerable Web Application link. Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 14 4. On the DVWA login page, login using admin as the username and admin as the password. Click Login. 5. On the DVWA homepage, click on SQL Injection button located in the left pane.
  • 17. Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 15 6. Test if the application is vulnerable to SQL injection by trying a simple test using a true statement. Type the command below into the User ID text field followed by clicking the Submit button. 1=1 Notice what happened was that a query was sent to the database that executed the following: select first_name,surname from “some table” where user_id=1 7. Display all records that are false (empty) and all records that are true (not empty). Enter the command below into the User ID field followed by clicking Submit. 1’ or ‘0’=’0
  • 18. Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 16 Users have now been dumped into the database. The following query was executed: select first_name,surname from “some table” where user_id = 1’ or ‘0’=’0’; 8. Attempt to pull database information and the user of the database. Enter the command below into the User ID field, click Submit. 1’ or 1=1 union select database(), user()# Notice the database() command returns the database name of dvwa and its user [email protected] The union statement is similar to “join” except that it links 2 select statements together and the # character ends the
  • 19. statement. Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 17 9. Try to pull the database version by entering the command below into the User ID field, click Submit. 1’ or 1=1 union select null,version()# Notice null was used as a placeholder and issued the version() command. Given the output, it appears the OS is running on 5.1.41-3ubuntu12.6. 10. Enter the command below into the User ID field to identify the tables in the database. 1’ or 1=1 union select null, table_name from information_schema.tables#
  • 20. 11. Scroll down and identify the table being a users table. In the query, null was a placeholder again and the table_name is something that exists in the main part of the database build called the information schema. Lab 14: Understanding SQL Commands & Injections 3/18/2016 Copyright © 2016 Network Development Group, Inc. www.netdevgroup.com Page 18 12. Attempt to see if any password fields are associated with the users table. Enter the command below into the User ID field and click Submit. 1’ or 1=1 union select user, password from users# Notice towards the bottom, hashes are given out from the query. 13. Close the Kali PC viewer.
  • 21. SQL Injection Lab Assignment In this lab, you will launch an SQL injection attack from Kali to a vulnerable web application on OWASP BWA. 1) You are required to complete the section titled “SQL Injection” in the lab instructions starting on Page 13. You should log into Kali VM and enter “root” as the username and “toor” as the password before starting the Section 4. 2) You can also complete the first three sections of the lab to gain acquaintance with SQL. It is recommended, but not required. 3) Before performing this lab, please make sure that you read the sections related with SQL Injection in Chapter-26 and Chapter 27. 4) Take a screenshot of step 12, Section 4. Only take the screenshots that show password fields that are associated with the users table. Reflection Assignment After completing this lab, 1) Write a one-paragraph summary for what you have done in this netlab assignment. 2) Write a one-paragraph explanation of how you can fix the vulnerability on OWASP BWA. (Refer to Chapter 26 and Chapter 27) 3) Watch the video on this webpage and also read the story on how an SQL injection vulnerability turned into a national
  • 22. security case: https://abc7chicago.com/politics/how -the- russians-penetrated-illinois-election-computers/3778816/ . What are the consequences of this vulnerability? Please follow APA formatting style. Cite all sources.