SlideShare a Scribd company logo
1 of 22
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 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 DBAdpcobb
 
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 QueriesChema 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_injectionAhmed AbdelSatar
 
Havij help english
Havij help englishHavij help english
Havij help englishmoguinos
 
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 injectionSatyajit Mukherjee
 
Time-Based Blind SQL Injection
Time-Based Blind SQL InjectionTime-Based Blind SQL Injection
Time-Based Blind SQL Injectionmatt_presson
 
Sql Injection and Entity Frameworks
Sql Injection and Entity FrameworksSql Injection and Entity Frameworks
Sql Injection and Entity FrameworksRich Helton
 
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 telecomAhmedA79
 
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 MorimotoPichaya 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 AlexandrescuCristian Alexandrescu
 
Pobs cleanup-steps-nauman
Pobs cleanup-steps-naumanPobs cleanup-steps-nauman
Pobs cleanup-steps-naumanNauman 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 XSBlackvard
 
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 permissionsRavi Kumar Lanke
 
HDinsight Workshop - Prerequisite Activity
HDinsight Workshop - Prerequisite ActivityHDinsight Workshop - Prerequisite Activity
HDinsight Workshop - Prerequisite ActivityIdan Tohami
 
installation and configuration of informatica server
installation and configuration of informatica serverinstallation and configuration of informatica server
installation and configuration of informatica serverketulp
 
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 ◄
 
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 Servicebutest
 
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 Servicebutest
 
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 CloudFIWARE
 
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 cloudHenar Muñoz Frutos
 
Sql interview question part 8
Sql interview question part 8Sql interview question part 8
Sql interview question part 8kaashiv1
 
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 labCynthia 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 HadoopCynthia 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 seljasmin849794
 
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. prjasmin849794
 
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 rulejasmin849794
 
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 usuallyjasmin849794
 
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 overjasmin849794
 
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 culjasmin849794
 
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 rjasmin849794
 
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 pejasmin849794
 
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 namemha59jasmin849794
 
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 workfjasmin849794
 
(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 tjasmin849794
 
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 terroristjasmin849794
 
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 medijasmin849794
 
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 assignmenjasmin849794
 

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

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 

Recently uploaded (20)

Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 

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.