SlideShare a Scribd company logo
1 of 75
Download to read offline
Hands-On Ethical
Hacking and
Network Defense

3rd Edition
Chapter 10
Hacking Web Servers
Revised 11-8-17
Objectives
• Describe Web applications
• Explain Web application vulnerabilities
• Describe the tools used to attack Web
servers
Client’s Browser
Internet Explorer
or Firefox
Web Server
IIS or Apache
HTTP
HTTPS
Web Servers
• The three main Web servers are nginx and Apache
(Open source) & IIS (Microsoft)
■ Link Ch 10c (image from 11-8-17)
Understanding Web Applications
• It is nearly impossible to write a program
without bugs
• Some bugs create security vulnerabilities
• Web applications also have bugs
• Web applications have a larger user base than
standalone applications
• Bugs are a bigger problem for Web
applications
Web Application Components
• Static Web pages
• Created using HTML
• Dynamic Web pages
• Need special components
• <form> tags
• Common Gateway Interface (CGI) scripts
• Active Server Pages (ASP)
• PHP
• ColdFusion
• Scripting languages like JavaScript
• ODBC (Open Database connector)
Web Forms
• Use the <form> element or tag in an HTML
document
• Allows customer to submit information to the
Web server
• Web servers process information from a
Web form by using a Web application
• Easy way for attackers to intercept data
that users submit to a Web server
8
9
HTML Form
Client’s Browser
HTML Forms
JavaScript
Web Server
CGI Scripts
HTTP
HTTPS
Common Gateway Interface
(CGI)
• Handles moving data from a Web server
to a Web browser
• The majority of dynamic Web pages are
created with CGI and scripting languages
• Describes how a Web server passes data
to a Web browser
• Relies on Perl or another scripting language
to create dynamic Web pages
CGI Languages
• CGI programs can be written in different
programming and scripting languages
• C or C++
• Perl
• Unix shell scripting
• Visual Basic
• FORTRAN
Common Gateway Interface
(CGI) (continued)
• CGI example
■ Written in Perl
■ Hello.pl
■ Should be placed in the cgi-bin directory on the
Web server
#!/usr/bin/perl
print "Content-type: text/htmlnn";
print "Hello Security Testers!";
14
15
Active Server Pages (ASP)
• Microsoft’s server-side script engine
• HTML pages are static—always the same
• ASP creates HTML pages as needed. They are
not static
• ASP uses scripting languages such as
JScript or VBScript
• Not all Web servers support ASP
• IIS supports ASP
• Apache doesn’t support ASP as well
Active Server Pages (ASP)
• You can’t see
the source of
an ASP page
from a browser
• This makes it
harder to hack
into, although not
impossible
• ASP examples at
links 

Ch 10d, e, f
Apache Web Server
• Apache is the most popular Web Server
program
• Advantages
• Stable and reliable
• Works on just about any *NIX and Windows
platform
• It is free and open source
• See links Ch 10g, 10h
Using Scripting Languages
• Dynamic Web pages can be developed
using scripting languages
• VBScript
• JavaScript
• PHP
PHP: Hypertext Processor (PHP)
• Enables Web developers to create dynamic Web
pages
• Similar to ASP
• Open-source server-side scripting language
• Can be embedded in an HTML Web page using PHP
tags <?php and ?>
• Users cannot see PHP code in their Web browser
• Used primarily on UNIX systems
• Also supported on Macintosh and Microsoft platforms
PHP Example
<html><head><title>Example</title></head>
<body>
<?php
echo 'Hello, World!';
?>
</body></html>
■ See links Ch 10k, 10l
• PHP has known vulnerabilities
• See links Ch 10m, 10n
• PHP is often used with MySQL Databases
ColdFusion
• Server-side scripting language used to
develop dynamic Web pages
• Created by the Allaire Corporation
• Purchased by Macromedia, now owned by
Adobe -- Expensive
• Uses its own proprietary tags written in
ColdFusion Markup Language (CFML)
• CFML Web applications can contain other
technologies, such as HTML or JavaScript
ColdFusion Example
<html><head><title>Ex</title></head>
<body>
<CFLOCATION URL="www.isecom.org/cf/
index.htm" ADDTOKEN="NO">
</body>
</html>
■ See links Ch 10o
ColdFusion Vulnerabilities
• See links Ch 10p, 10q
VBScript
• Visual Basic Script is a scripting language
developed by Microsoft
• You can insert VBScript commands into a
static HTML page to make it dynamic
• Provides the power of a full programming
language
• Executed by the client’s browser
VBScript Example
<html><body>
<script type="text/vbscript">
document.write("<h1>Hello!</h1>")
document.write("Date Activated: " &
date())
</script>
</body></html>
• See link Ch 10r – works in IE, but not in Firefox
• Firefox does not support VBScript (link Ch 10s)
VBScript vulnerabilities
■ See links Ch 10t, 10u
JavaScript
• Popular scripting language
• JavaScript also has the power of a
programming language
• Branching
• Looping
• Testing
JavaScript Example
<html><head>
<script type="text/javascript">
function chastise_user(){
alert("So, you like breaking rules?")
document.getElementByld("cmdButton").focus(
)}
</script></head>
<body><h3>Don't click the button!</h3>
<form>
<input type="button" value="Don't Click!"
name="cmdButton"
onClick="chastise_user()" />
</form></body></html>
■ See link Ch 10v – works in IE and Firefox
JavaScript Vulnerabilities
See link Ch 10w
31
Popularity of
Programming
Languages
See link Ch 10zs
32
1
Client’s Browser
HTTPorHTTPSWeb Server
Apache or IIS
HTML Forms
CGI Scripts
Database
SQL Server or
Oracle or
MySQL
ODBC or
OLE DB
Or ADO
Connecting to Databases
• Web pages can display information stored
on databases
• There are several technologies used to
connect databases with Web applications
• Technology depends on the OS used
• ODBC
• OLE DB
• ADO
• Theory is the same
Open Database Connectivity (ODBC)
• Standard database access method developed
by the SQL Access Group
• ODBC interface allows an application to
access
• Data stored in a database management system
(DBMS)
• Can use Oracle, SQL, or any DBMS that
understands and can issue ODBC commands
• Interoperability among back-end DBMS is a
key feature of the ODBC interface
Open Database Connectivity (ODBC)
(continued)
• ODBC defines
• Standardized representation of data types
• A library of ODBC functions
• Standard methods of connecting to and logging
on to a DBMS
OLE DB and ADO
• Object Linking and Embedding Database
(OLE DB) and
• ActiveX Data Objects (ADO)
• These two more modern, complex technologies
replace ODBC and make up"Microsoft’s
Universal Data Access“
• See link Ch 10x
Understanding Web Application
Vulnerabilities
• Many platforms and programming
languages can be used to design a Web
site
• Application security is as important as
network security
Attackers controlling a Web server can
■ Deface the Web site
■ Destroy or steal company’s data
■ Gain control of user accounts
■ Perform secondary attacks from the Web site
■ Gain root access to other applications or
servers
Open Web Application Security Project
(OWASP)
■ Open, not-for-profit organization dedicated to
finding and fighting vulnerabilities in Web
applications
■ Publishes the Ten Most Critical Web
Application Security Vulnerabilities
41
42
43
Java Serialization
■ Link Ch 10zt
Cross-Site Scripting (XSS)
● One client posts active content, with <script> tags or
other programming content
● When another client reads the messages, the scripts
are executed in his or her browser
● One user attacks another user, using the vulnerable
Web application as a weapon
49
● <script>alert("XSS vulnerability!")</script>
● <script>alert(document.cookie)</script>
● <script>window.location="http://www.ccsf.edu"</script>
50
XSS Scripting Effects
● Steal another user's authentication cookie
● Hijack session
● Harvest stored passwords from the target's browser
● Take over machine through browser vulnerability
● Redirect Webpage
● Many, many other evil things…
51
Assessing Web Applications
• Issues to consider
• Dynamic Web pages
• Connection to a backend database server
• User authentication
• What platform was used?
Does the Web Application Use
Dynamic Web Pages?
• Static Web pages do not create a secure
environment
• IIS attack example: Directory Traversal
• Adding .. to a URL refers to a directory above
the Web page directory
• Early versions of IIS filtered out , but not
%c1%9c, which is a Unicode version of the
same character
• See link Ch 10 zh
Connection to a Backend Database
Server
• Security testers should check for the
possibility of SQL injection being used to
attack the system
• SQL injection involves the attacker
supplying SQL commands on a Web
application field
SQL Injection Example
HTML form collects name and pw
SQL then uses those fields:
SELECT * FROM customer
WHERE username = 'name' AND password = 'pw'
If a hacker enters a name of
' OR 1=1 --
The SQL becomes:
SELECT * FROM customer
WHERE username ='' OR 1=1 --' AND password =
'pw'
Which is always true, and returns all the records
51
Connection to a Backend Database
Server
• Basic testing should look for
• Whether you can enter text with punctuation
marks
• Whether you can enter a single quotation mark
followed by any SQL keywords
• Whether you can get any sort of database error
when attempting to inject SQL
User Authentication
• Many Web applications require another
server to authenticate users
• Examine how information is passed
between the two servers
• Encrypted channels
• Verify that logon and password information
is stored on secure places
• Authentication servers introduce a second
target
What Platform Was Used?
• Popular platforms include:
• IIS with ASP and SQL Server (Microsoft)
• Linux, Apache, MySQL, and PHP (LAMP)
• Footprinting is used to find out the platform
• The more you know about a system the easier
it is to gather information about its
vulnerabilities
SQLI on Pastebin
56
58
59
Tools of Web Attackers and Security
Testers
• Choose the right tools for the job
• Attackers look for tools that enable them to
attack the system
• They choose their tools based on the
vulnerabilities found on a target system or
application
Web Tools
• Firefox and Chrome Developer Tools
• View parameters and cookies
• Modify and resend requests
• BurpSuite
• Powerful proxy used for Web App
hacking
• Zed Attack Proxy
• Can do simple vulnerability scans
Nikto
• Free, specialized for web apps
70
Nessus
• Commercial, thorough and popular
• Open-source fork is OpenVAS
71
Nessus
72
Nessus
W3af (Free, in Kali)
Skipfish from Google (Free)
75
2

More Related Content

What's hot

OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesSoftware Guru
 
Ch 11: Hacking Wireless Networks
Ch 11: Hacking Wireless NetworksCh 11: Hacking Wireless Networks
Ch 11: Hacking Wireless NetworksSam Bowne
 
Ch 4: Footprinting and Social Engineering
Ch 4: Footprinting and Social EngineeringCh 4: Footprinting and Social Engineering
Ch 4: Footprinting and Social EngineeringSam Bowne
 
CNIT 123 8: Desktop and Server OS Vulnerabilities
CNIT 123 8: Desktop and Server OS VulnerabilitiesCNIT 123 8: Desktop and Server OS Vulnerabilities
CNIT 123 8: Desktop and Server OS VulnerabilitiesSam Bowne
 
Derbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryDerbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryWill Schroeder
 
Chapter 1 Introduction to Security
Chapter 1 Introduction to SecurityChapter 1 Introduction to Security
Chapter 1 Introduction to SecurityDr. Ahmed Al Zaidy
 
MITRE ATT&CK framework
MITRE ATT&CK frameworkMITRE ATT&CK framework
MITRE ATT&CK frameworkBhushan Gurav
 
How to Hunt for Lateral Movement on Your Network
How to Hunt for Lateral Movement on Your NetworkHow to Hunt for Lateral Movement on Your Network
How to Hunt for Lateral Movement on Your NetworkSqrrl
 
Cyber Threat Hunting Workshop
Cyber Threat Hunting WorkshopCyber Threat Hunting Workshop
Cyber Threat Hunting WorkshopDigit Oktavianto
 
Ethical hacking Chapter 7 - Enumeration - Eric Vanderburg
Ethical hacking   Chapter 7 - Enumeration - Eric VanderburgEthical hacking   Chapter 7 - Enumeration - Eric Vanderburg
Ethical hacking Chapter 7 - Enumeration - Eric VanderburgEric Vanderburg
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms Sam Bowne
 
WTF is Penetration Testing v.2
WTF is Penetration Testing v.2WTF is Penetration Testing v.2
WTF is Penetration Testing v.2Scott Sutherland
 
Footprinting and reconnaissance
Footprinting and reconnaissanceFootprinting and reconnaissance
Footprinting and reconnaissanceNishaYadav177
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Codingbilcorry
 
Network security (vulnerabilities, threats, and attacks)
Network security (vulnerabilities, threats, and attacks)Network security (vulnerabilities, threats, and attacks)
Network security (vulnerabilities, threats, and attacks)Fabiha Shahzad
 

What's hot (20)

OWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application VulnerabilitiesOWASP Top 10 Web Application Vulnerabilities
OWASP Top 10 Web Application Vulnerabilities
 
Ch 11: Hacking Wireless Networks
Ch 11: Hacking Wireless NetworksCh 11: Hacking Wireless Networks
Ch 11: Hacking Wireless Networks
 
Metasploit
MetasploitMetasploit
Metasploit
 
Ch 4: Footprinting and Social Engineering
Ch 4: Footprinting and Social EngineeringCh 4: Footprinting and Social Engineering
Ch 4: Footprinting and Social Engineering
 
CNIT 123 8: Desktop and Server OS Vulnerabilities
CNIT 123 8: Desktop and Server OS VulnerabilitiesCNIT 123 8: Desktop and Server OS Vulnerabilities
CNIT 123 8: Desktop and Server OS Vulnerabilities
 
Derbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active DirectoryDerbycon - The Unintended Risks of Trusting Active Directory
Derbycon - The Unintended Risks of Trusting Active Directory
 
Chapter 1 Introduction to Security
Chapter 1 Introduction to SecurityChapter 1 Introduction to Security
Chapter 1 Introduction to Security
 
MITRE ATT&CK framework
MITRE ATT&CK frameworkMITRE ATT&CK framework
MITRE ATT&CK framework
 
How to Hunt for Lateral Movement on Your Network
How to Hunt for Lateral Movement on Your NetworkHow to Hunt for Lateral Movement on Your Network
How to Hunt for Lateral Movement on Your Network
 
Malware analysis
Malware analysisMalware analysis
Malware analysis
 
Cyber Threat Hunting Workshop
Cyber Threat Hunting WorkshopCyber Threat Hunting Workshop
Cyber Threat Hunting Workshop
 
Ethical hacking Chapter 7 - Enumeration - Eric Vanderburg
Ethical hacking   Chapter 7 - Enumeration - Eric VanderburgEthical hacking   Chapter 7 - Enumeration - Eric Vanderburg
Ethical hacking Chapter 7 - Enumeration - Eric Vanderburg
 
Api security-testing
Api security-testingApi security-testing
Api security-testing
 
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
 
WTF is Penetration Testing v.2
WTF is Penetration Testing v.2WTF is Penetration Testing v.2
WTF is Penetration Testing v.2
 
Footprinting and reconnaissance
Footprinting and reconnaissanceFootprinting and reconnaissance
Footprinting and reconnaissance
 
OWASP Secure Coding
OWASP Secure CodingOWASP Secure Coding
OWASP Secure Coding
 
Types of attacks
Types of attacksTypes of attacks
Types of attacks
 
OWASP Top Ten
OWASP Top TenOWASP Top Ten
OWASP Top Ten
 
Network security (vulnerabilities, threats, and attacks)
Network security (vulnerabilities, threats, and attacks)Network security (vulnerabilities, threats, and attacks)
Network security (vulnerabilities, threats, and attacks)
 

Viewers also liked

TCPdump-Wireshark
TCPdump-WiresharkTCPdump-Wireshark
TCPdump-WiresharkHarsh Singh
 
CNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve CryptosystemsCNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve CryptosystemsSam Bowne
 
CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)Sam Bowne
 
Wireshark, Tcpdump and Network Performance tools
Wireshark, Tcpdump and Network Performance toolsWireshark, Tcpdump and Network Performance tools
Wireshark, Tcpdump and Network Performance toolsSachidananda Sahu
 
Cloud Foundry Monitoring How-To: Collecting Metrics and Logs
Cloud Foundry Monitoring How-To: Collecting Metrics and LogsCloud Foundry Monitoring How-To: Collecting Metrics and Logs
Cloud Foundry Monitoring How-To: Collecting Metrics and LogsAltoros
 
CNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis ToolsCNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis ToolsSam Bowne
 
CNIT 141 8. Public-Key Cryptosystems Based on the DLP
CNIT 141 8. Public-Key Cryptosystems Based on the DLPCNIT 141 8. Public-Key Cryptosystems Based on the DLP
CNIT 141 8. Public-Key Cryptosystems Based on the DLPSam Bowne
 
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)Sam Bowne
 
CNIT 141: 10. Digital Signatures
CNIT 141: 10. Digital SignaturesCNIT 141: 10. Digital Signatures
CNIT 141: 10. Digital SignaturesSam Bowne
 
Navigating the Ecosystem of Pivotal Cloud Foundry Tiles
Navigating the Ecosystem of Pivotal Cloud Foundry TilesNavigating the Ecosystem of Pivotal Cloud Foundry Tiles
Navigating the Ecosystem of Pivotal Cloud Foundry TilesAltoros
 

Viewers also liked (13)

TCPdump-Wireshark
TCPdump-WiresharkTCPdump-Wireshark
TCPdump-Wireshark
 
CNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve CryptosystemsCNIT 141: 9. Elliptic Curve Cryptosystems
CNIT 141: 9. Elliptic Curve Cryptosystems
 
CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)CNIT 124 Ch 13: Post Exploitation (Part 1)
CNIT 124 Ch 13: Post Exploitation (Part 1)
 
Wireshark, Tcpdump and Network Performance tools
Wireshark, Tcpdump and Network Performance toolsWireshark, Tcpdump and Network Performance tools
Wireshark, Tcpdump and Network Performance tools
 
Tcpdump
TcpdumpTcpdump
Tcpdump
 
Wireshark - presentation
Wireshark - presentationWireshark - presentation
Wireshark - presentation
 
Cloud Foundry Monitoring How-To: Collecting Metrics and Logs
Cloud Foundry Monitoring How-To: Collecting Metrics and LogsCloud Foundry Monitoring How-To: Collecting Metrics and Logs
Cloud Foundry Monitoring How-To: Collecting Metrics and Logs
 
CNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis ToolsCNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis Tools
 
CNIT 141 8. Public-Key Cryptosystems Based on the DLP
CNIT 141 8. Public-Key Cryptosystems Based on the DLPCNIT 141 8. Public-Key Cryptosystems Based on the DLP
CNIT 141 8. Public-Key Cryptosystems Based on the DLP
 
Tcpdump hunter
Tcpdump hunterTcpdump hunter
Tcpdump hunter
 
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
CNIT 125 Ch 5 Communication & Network Security (part 2 of 2)
 
CNIT 141: 10. Digital Signatures
CNIT 141: 10. Digital SignaturesCNIT 141: 10. Digital Signatures
CNIT 141: 10. Digital Signatures
 
Navigating the Ecosystem of Pivotal Cloud Foundry Tiles
Navigating the Ecosystem of Pivotal Cloud Foundry TilesNavigating the Ecosystem of Pivotal Cloud Foundry Tiles
Navigating the Ecosystem of Pivotal Cloud Foundry Tiles
 

Similar to CNIT 123 Ch 10: Hacking Web Servers

Ch10 Hacking Web Servers http://ouo.io/2Bt7X
Ch10 Hacking Web Servers http://ouo.io/2Bt7XCh10 Hacking Web Servers http://ouo.io/2Bt7X
Ch10 Hacking Web Servers http://ouo.io/2Bt7Xphanleson
 
Ethical hacking Chapter 10 - Exploiting Web Servers - Eric Vanderburg
Ethical hacking   Chapter 10 - Exploiting Web Servers - Eric VanderburgEthical hacking   Chapter 10 - Exploiting Web Servers - Eric Vanderburg
Ethical hacking Chapter 10 - Exploiting Web Servers - Eric VanderburgEric Vanderburg
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETRajkumarsoy
 
Web programming
Web programmingWeb programming
Web programmingIshucs
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Securitychuckbt
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetAdil Mughal
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government DevelopersFrank La Vigne
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Commit University
 
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.pptintroaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.pptAvijitChaudhuri3
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.pptasmachehbi
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development PresentationTurnToTech
 
AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )senthil0809
 

Similar to CNIT 123 Ch 10: Hacking Web Servers (20)

Ch10 Hacking Web Servers http://ouo.io/2Bt7X
Ch10 Hacking Web Servers http://ouo.io/2Bt7XCh10 Hacking Web Servers http://ouo.io/2Bt7X
Ch10 Hacking Web Servers http://ouo.io/2Bt7X
 
Ethical hacking Chapter 10 - Exploiting Web Servers - Eric Vanderburg
Ethical hacking   Chapter 10 - Exploiting Web Servers - Eric VanderburgEthical hacking   Chapter 10 - Exploiting Web Servers - Eric Vanderburg
Ethical hacking Chapter 10 - Exploiting Web Servers - Eric Vanderburg
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Introduction to asp
Introduction to aspIntroduction to asp
Introduction to asp
 
Web programming
Web programmingWeb programming
Web programming
 
Php reports sumit
Php reports sumitPhp reports sumit
Php reports sumit
 
Html5 Application Security
Html5 Application SecurityHtml5 Application Security
Html5 Application Security
 
DevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp NetDevNext - Web Programming Concepts Using Asp Net
DevNext - Web Programming Concepts Using Asp Net
 
Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government Developers
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
introduction to web application development
introduction to web application developmentintroduction to web application development
introduction to web application development
 
Introaspnet
IntroaspnetIntroaspnet
Introaspnet
 
Aspintro
AspintroAspintro
Aspintro
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta Workshop HTML5+PhoneGap by Ivano Malavolta
Workshop HTML5+PhoneGap by Ivano Malavolta
 
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.pptintroaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
introaspnetkjadbfksdjkfaskjdbfkajsbfkjfjkswa.ppt
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.ppt
 
introaspnet.ppt
introaspnet.pptintroaspnet.ppt
introaspnet.ppt
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
 
A comprehensive software infrastructure of .Net
A comprehensive software infrastructure of .Net  A comprehensive software infrastructure of .Net
A comprehensive software infrastructure of .Net
 
AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )AIR - Framework ( Cairngorm and Parsley )
AIR - Framework ( Cairngorm and Parsley )
 

More from Sam Bowne

3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities Sam Bowne
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam Bowne
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)Sam Bowne
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic CurvesSam Bowne
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-HellmanSam Bowne
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1Sam Bowne
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android ApplicationsSam Bowne
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3Sam Bowne
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard ProblemsSam Bowne
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)Sam Bowne
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis MethodologySam Bowne
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated EncryptionSam Bowne
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)Sam Bowne
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)Sam Bowne
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream CiphersSam Bowne
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data CollectionSam Bowne
 

More from Sam Bowne (20)

Cyberwar
CyberwarCyberwar
Cyberwar
 
3: DNS vulnerabilities
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
 
8. Software Development Security
8. Software Development Security8. Software Development Security
8. Software Development Security
 
4 Mapping the Application
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
 
3. Attacking iOS Applications (Part 2)
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
 
12 Elliptic Curves
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
 
11. Diffie-Hellman
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
 
2a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
 
9 Writing Secure Android Applications
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
 
12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
 
10 RSA
10 RSA10 RSA
10 RSA
 
12 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
 
9. Hard Problems
9. Hard Problems9. Hard Problems
9. Hard Problems
 
8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
 
11 Analysis Methodology
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
 
8. Authenticated Encryption
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
 
7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
 
7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
 
5. Stream Ciphers
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
 
6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
 

Recently uploaded

GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 

Recently uploaded (20)

TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

CNIT 123 Ch 10: Hacking Web Servers

  • 1. Hands-On Ethical Hacking and Network Defense
 3rd Edition Chapter 10 Hacking Web Servers Revised 11-8-17
  • 2. Objectives • Describe Web applications • Explain Web application vulnerabilities • Describe the tools used to attack Web servers
  • 3. Client’s Browser Internet Explorer or Firefox Web Server IIS or Apache HTTP HTTPS
  • 4. Web Servers • The three main Web servers are nginx and Apache (Open source) & IIS (Microsoft) ■ Link Ch 10c (image from 11-8-17)
  • 5. Understanding Web Applications • It is nearly impossible to write a program without bugs • Some bugs create security vulnerabilities • Web applications also have bugs • Web applications have a larger user base than standalone applications • Bugs are a bigger problem for Web applications
  • 6. Web Application Components • Static Web pages • Created using HTML • Dynamic Web pages • Need special components • <form> tags • Common Gateway Interface (CGI) scripts • Active Server Pages (ASP) • PHP • ColdFusion • Scripting languages like JavaScript • ODBC (Open Database connector)
  • 7. Web Forms • Use the <form> element or tag in an HTML document • Allows customer to submit information to the Web server • Web servers process information from a Web form by using a Web application • Easy way for attackers to intercept data that users submit to a Web server
  • 8. 8
  • 10. Client’s Browser HTML Forms JavaScript Web Server CGI Scripts HTTP HTTPS
  • 11. Common Gateway Interface (CGI) • Handles moving data from a Web server to a Web browser • The majority of dynamic Web pages are created with CGI and scripting languages • Describes how a Web server passes data to a Web browser • Relies on Perl or another scripting language to create dynamic Web pages
  • 12. CGI Languages • CGI programs can be written in different programming and scripting languages • C or C++ • Perl • Unix shell scripting • Visual Basic • FORTRAN
  • 13. Common Gateway Interface (CGI) (continued) • CGI example ■ Written in Perl ■ Hello.pl ■ Should be placed in the cgi-bin directory on the Web server #!/usr/bin/perl print "Content-type: text/htmlnn"; print "Hello Security Testers!";
  • 14. 14
  • 15. 15
  • 16. Active Server Pages (ASP) • Microsoft’s server-side script engine • HTML pages are static—always the same • ASP creates HTML pages as needed. They are not static • ASP uses scripting languages such as JScript or VBScript • Not all Web servers support ASP • IIS supports ASP • Apache doesn’t support ASP as well
  • 17. Active Server Pages (ASP) • You can’t see the source of an ASP page from a browser • This makes it harder to hack into, although not impossible • ASP examples at links 
 Ch 10d, e, f
  • 18. Apache Web Server • Apache is the most popular Web Server program • Advantages • Stable and reliable • Works on just about any *NIX and Windows platform • It is free and open source • See links Ch 10g, 10h
  • 19. Using Scripting Languages • Dynamic Web pages can be developed using scripting languages • VBScript • JavaScript • PHP
  • 20. PHP: Hypertext Processor (PHP) • Enables Web developers to create dynamic Web pages • Similar to ASP • Open-source server-side scripting language • Can be embedded in an HTML Web page using PHP tags <?php and ?> • Users cannot see PHP code in their Web browser • Used primarily on UNIX systems • Also supported on Macintosh and Microsoft platforms
  • 21. PHP Example <html><head><title>Example</title></head> <body> <?php echo 'Hello, World!'; ?> </body></html> ■ See links Ch 10k, 10l • PHP has known vulnerabilities • See links Ch 10m, 10n • PHP is often used with MySQL Databases
  • 22. ColdFusion • Server-side scripting language used to develop dynamic Web pages • Created by the Allaire Corporation • Purchased by Macromedia, now owned by Adobe -- Expensive • Uses its own proprietary tags written in ColdFusion Markup Language (CFML) • CFML Web applications can contain other technologies, such as HTML or JavaScript
  • 25. VBScript • Visual Basic Script is a scripting language developed by Microsoft • You can insert VBScript commands into a static HTML page to make it dynamic • Provides the power of a full programming language • Executed by the client’s browser
  • 26. VBScript Example <html><body> <script type="text/vbscript"> document.write("<h1>Hello!</h1>") document.write("Date Activated: " & date()) </script> </body></html> • See link Ch 10r – works in IE, but not in Firefox • Firefox does not support VBScript (link Ch 10s)
  • 27. VBScript vulnerabilities ■ See links Ch 10t, 10u
  • 28. JavaScript • Popular scripting language • JavaScript also has the power of a programming language • Branching • Looping • Testing
  • 29. JavaScript Example <html><head> <script type="text/javascript"> function chastise_user(){ alert("So, you like breaking rules?") document.getElementByld("cmdButton").focus( )} </script></head> <body><h3>Don't click the button!</h3> <form> <input type="button" value="Don't Click!" name="cmdButton" onClick="chastise_user()" /> </form></body></html> ■ See link Ch 10v – works in IE and Firefox
  • 32. 32 1
  • 33. Client’s Browser HTTPorHTTPSWeb Server Apache or IIS HTML Forms CGI Scripts Database SQL Server or Oracle or MySQL ODBC or OLE DB Or ADO
  • 34. Connecting to Databases • Web pages can display information stored on databases • There are several technologies used to connect databases with Web applications • Technology depends on the OS used • ODBC • OLE DB • ADO • Theory is the same
  • 35. Open Database Connectivity (ODBC) • Standard database access method developed by the SQL Access Group • ODBC interface allows an application to access • Data stored in a database management system (DBMS) • Can use Oracle, SQL, or any DBMS that understands and can issue ODBC commands • Interoperability among back-end DBMS is a key feature of the ODBC interface
  • 36. Open Database Connectivity (ODBC) (continued) • ODBC defines • Standardized representation of data types • A library of ODBC functions • Standard methods of connecting to and logging on to a DBMS
  • 37. OLE DB and ADO • Object Linking and Embedding Database (OLE DB) and • ActiveX Data Objects (ADO) • These two more modern, complex technologies replace ODBC and make up"Microsoft’s Universal Data Access“ • See link Ch 10x
  • 38. Understanding Web Application Vulnerabilities • Many platforms and programming languages can be used to design a Web site • Application security is as important as network security
  • 39. Attackers controlling a Web server can ■ Deface the Web site ■ Destroy or steal company’s data ■ Gain control of user accounts ■ Perform secondary attacks from the Web site ■ Gain root access to other applications or servers
  • 40. Open Web Application Security Project (OWASP) ■ Open, not-for-profit organization dedicated to finding and fighting vulnerabilities in Web applications ■ Publishes the Ten Most Critical Web Application Security Vulnerabilities
  • 41. 41
  • 42. 42
  • 44. Cross-Site Scripting (XSS) ● One client posts active content, with <script> tags or other programming content ● When another client reads the messages, the scripts are executed in his or her browser ● One user attacks another user, using the vulnerable Web application as a weapon 49
  • 45. ● <script>alert("XSS vulnerability!")</script> ● <script>alert(document.cookie)</script> ● <script>window.location="http://www.ccsf.edu"</script> 50
  • 46. XSS Scripting Effects ● Steal another user's authentication cookie ● Hijack session ● Harvest stored passwords from the target's browser ● Take over machine through browser vulnerability ● Redirect Webpage ● Many, many other evil things… 51
  • 47. Assessing Web Applications • Issues to consider • Dynamic Web pages • Connection to a backend database server • User authentication • What platform was used?
  • 48. Does the Web Application Use Dynamic Web Pages? • Static Web pages do not create a secure environment • IIS attack example: Directory Traversal • Adding .. to a URL refers to a directory above the Web page directory • Early versions of IIS filtered out , but not %c1%9c, which is a Unicode version of the same character • See link Ch 10 zh
  • 49. Connection to a Backend Database Server • Security testers should check for the possibility of SQL injection being used to attack the system • SQL injection involves the attacker supplying SQL commands on a Web application field
  • 50. SQL Injection Example HTML form collects name and pw SQL then uses those fields: SELECT * FROM customer WHERE username = 'name' AND password = 'pw' If a hacker enters a name of ' OR 1=1 -- The SQL becomes: SELECT * FROM customer WHERE username ='' OR 1=1 --' AND password = 'pw' Which is always true, and returns all the records
  • 51. 51
  • 52. Connection to a Backend Database Server • Basic testing should look for • Whether you can enter text with punctuation marks • Whether you can enter a single quotation mark followed by any SQL keywords • Whether you can get any sort of database error when attempting to inject SQL
  • 53. User Authentication • Many Web applications require another server to authenticate users • Examine how information is passed between the two servers • Encrypted channels • Verify that logon and password information is stored on secure places • Authentication servers introduce a second target
  • 54. What Platform Was Used? • Popular platforms include: • IIS with ASP and SQL Server (Microsoft) • Linux, Apache, MySQL, and PHP (LAMP) • Footprinting is used to find out the platform • The more you know about a system the easier it is to gather information about its vulnerabilities
  • 56. 56
  • 57.
  • 58. 58
  • 59. 59
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67. Tools of Web Attackers and Security Testers • Choose the right tools for the job • Attackers look for tools that enable them to attack the system • They choose their tools based on the vulnerabilities found on a target system or application
  • 68. Web Tools • Firefox and Chrome Developer Tools • View parameters and cookies • Modify and resend requests • BurpSuite • Powerful proxy used for Web App hacking • Zed Attack Proxy • Can do simple vulnerability scans
  • 70. 70 Nessus • Commercial, thorough and popular • Open-source fork is OpenVAS
  • 73. W3af (Free, in Kali)
  • 75. 75 2