Securing Web Applications Thesis
Securing Web Applications Thesis
SUBJECT
Promotion: 2015/2016
Thank you
I finally send a special thought to my parents and my family for their support.
support in my choices and their unwavering attention, including encouragements and
Unconditional love has accompanied me always.
i
Table of contents
Title Page
Thank you
Table of contents
List of tables
List of figures
List of abbreviations
General introduction 1
Chapter 1: Tools of Cybersecurity
1 Introduction 3
ii
4.1.1 Application architecture 16
4.1.2 Definition of security rules 17
4.1.3 Risk Assessment 18
4.2 DO 18
4.2.1 Definition of defense in depth 18
4.2.2 The partitioning 19
4.2.3 High Availability 20
4.2.4 Multi-level defense of services 21
4.2.5 Choice of tools and staff training 22
4.3 Check 22
4.4 ACT 23
5. Conclusion 23
Chapter 3: Conceptual Analysis
1 Introduction 24
2 Definition of objectives 24
Modeling of the projected architecture 24
3.1 Use case diagram 25
3.1.1 Identification of system stakeholders 25
iii
3 Installation and configuration of the Endian Firewall 39
3.1 Installation 39
3.2 Configuration 40
3.3 Definition and application of firewall rules 40
Inter-Zone Traffic 40
3.3.2 Incoming traffic 41
3.3.3 Outgoing traffic 42
3.4 Configuration of the intrusion prevention probe 42
4 Installation and configuration of the SQUID reverse proxy 43
4.1 Installation 43
4.2 Configuration 44
5 Audit and monitoring 45
5.1 Setting up the audit station 45
5.2 Traffic monitoring interfaces 46
6 Conclusion 47
General conclusion 48
Bibliography and webography
Annexes
Summary
iv
List of figures
Title Page
Figure 1.1: Symmetric cryptography 7
v
List of abbreviations
AES: Advanced Encryption Standard
ANSSI: National Agency for the Security of Information Systems
ASP:Active Server Pages
ASVS: Application Security Verification Standard
CERT: Computer Emergency Response Team
CESTI: Center for Evaluation of Information Technology Security
CSRF: Cross-Site Request Forgery
CSS: Cascading Style Sheets
DES: Data Encryption Standard
DMZ: Demilitarized Zone
DNS: Domain Name System
DoS: Denial of Service
ESAPI: Enterprise Security API
FTP: File Transfer Protocol
HIDS: Host Based Intrusion Detection System
HTML: Hypertext Markup Language
HTTP: HyperText Transfer Protocol
IDS: Intrusion Detection System
IEC: International Electrotechnical Commission
IETFInternet Engineering Task Force
HMI: Human Machine Interface
IPS: Intrusion Prevention System
IPSec: Internet Protocol Security
ISO: International Organization for Standardization
Information technology
JSP: Java Server Pages
L2F: Layer Two Forwarding
L2TP: Layer Two Tunneling Protocol
NAT: Network Address Translation
NIDS: Network Based Intrusion Detection System
OWASP: Open Web Application Security Project
PDCA: Plan, Do, Check, Act
vi
POP3: Post Office Protocol
PPTP: Point-to-Point Tunneling Protocol
RC4: Rivest Cipher 4
Active Solidarity Income
Secunia PSI: Secunia Personal Software Inspector
DBMS: Database Management System
ISMS: information security management systems
SMTP: Simple Mail Transfer Protocol
SSH: Secure SHell
SSL: Secure Sockets Layer
TCP: Transmission Control Protocol
TLS: Transport Layer Security
UML: Unified Modeling Language
Uniform Resource Locator
UTM: Universal Transverse Mercator
Virtual Private Network
VRT: Vulnerability Research Team
WASC: Web Application Security Consortium
XML: Extensible Markup Language
XSS: cross-site scripting
vii
General introduction
The emergence of the web and the dynamics that the computer industry is experiencing have impacted
Our review has made us dependent on the use of these technologies to perform everything.
type of transaction.
Now everything can be done online: electronic shopping, social networks, transactions
banking... etc.
For these reasons, the security aspect has been emphasized. It now represents a crucial asset.
for the company, which must ensure a secure framework for both itself and its
users.
The hostile context of the internet world, the constant emergence of threats, as well as the
complexity of web applications that goes hand in hand with the emergence of new technologies,
we face recurring issues which are:
Secondly, it is about putting into practice the acquired knowledge, in order to secure
The web application, this need will be the subject of our thesis.
To this end, we will address in this study the security aspect of web applications and
best practices to consider in a secure and high architecture
availability.
1
General Introduction
In the practical part, we will define a typical architecture based on best practices.
practices for securing web applications and implementing essential tools
which will be subject to a front barrier to ensure security at four levels:
2
Chapter 1
Tools of computer security
1 Introduction
To cope with the hostile computing environment where we are constantly subjected to
Of all kinds of aggression, it is essential to know what to arm oneself with and against what.
In this context, this chapter provides an overview of the basic concepts and standards
international, in order to become familiar with the field of computer security and its
management, as well as a state of the art of IT security tools.
3
Chapter 1 - Tools of Information Security
False positive: detection in the absence of an attack, alarm generated by an IDS (Intrusion Detection System)
The main objective of computer security is to ensure that the system can
preserve the fundamental criteria namely:
Integrity
Professor Jean REMAEKERS defines integrity as follows: "Integrity allows for
certify that the data, processes or services have not been modified, altered or
destroyed both intentionally and accidentally
Availability
The availability of a resource is its accessibility and usability.
is measured over the period of time during which the offered service is operational.
Confidentiality
The International Organization for Standardization defines confidentiality as follows: "the
ensuring that the information is only accessible to those whose access is
authorized." In other words, confidentiality consists of protecting information against its
disclosure by a third party.
Authenticity
Authenticity is the proof that information truly comes from the person who has it.
issued the information, this proof results from an authentication process.
non-repudiation
During a conversation, it may happen that one of the two interlocutors denies having
I participated in the information exchange. This service helps to protect the other interlocutor.
4
Chapter 1 – Tools of Information Security
This organization was created in 1947 with the aim of producing international standards in
the industrial and commercial areas called ISO standards.
These standards are useful for industrial and economic organizations of all types, to
governments, to regulatory bodies, to economic leaders, to
compliance assessment professionals, to suppliers and buyers of products and
services, in both the public and private sectors, and ultimately, they serve the interests
the public in general when acting as a consumer and user.
The ISO 27000 family of standards helps organizations ensure the security of their
information. These standards facilitate the management of information security, particularly the
financial data, documents submitted to intellectual property, information
related to staff or the data that you are entrusted with by third parties.
ISO/IEC 27001, which outlines the requirements for security management systems
Information Security Management System (ISMS) is the most famous standard in this family.
5
Chapter 1–Tools of Cybersecurity
Also, we can add the complementary standards that align with our theme, we
6
Chapter 1–Tools of Information Security
The choice of security tools and their implementation represents the second phase of
PDCA model. We deemed it useful to briefly define the principle of encryption and the
tunneling on which the majority of cybersecurity technologies rely, thus
what the main security tools.
5.1 Encryption
The encryption and decryption keys are identical, security relies on the non
disclosure of keys and the resistance of algorithms to attacks. The most known are:
DES, IDEA, RC4 and AES.
The encryption and decryption keys are different, the security relies on the fact
the time required to deduce the secret keys associated with the public keys is
theoretically unreasonable.
The most well-known are: RSA, elliptic curves, Pohlig-Hellman, Rabin, and ElGamal.
7
Chapter 1–Tools of Cybersecurity
8
Chapter 1 – Tools of Information Security
9
Chapter 1 – Tools of Information Security
5.4 Antivirus
10
Chapter 1–Tools of Computer Security
Reverse proxy or commonly called a frontend proxy server allows the relay between
an external internet user to access internal servers, reverse proxies ensure
so the functionality of a reverse proxy.
In terms of cybersecurity, the reverse proxy provides the following benefits:
The control of external access to internal servers
Distributing the load among several servers
Cache management
Traffic auditing and monitoring
...
11
Chapter 1–Tools of Computer Security
6 Conclusion
This chapter has allowed us to understand some essential concepts in the implementation of
Work of computer security, it requires a whole management system.
The second part of the chapter helped us to understand the functioning of the main.
computer security tools.
In the next chapter, we will talk about web applications, their mechanisms and their
basic concepts, we briefly expose the vulnerabilities and the most significant threats
answered, in order to show the good practices to be followed for the security of
web applications.
12
Chapter 2
The security of web applications
1 Introduction
Web attacks can have harmful effects on any business that has a website.
web. In this context, it is essential to understand how applications work.
web and the typology of attacks in order to accurately define the security approach to
to undertake in their protections while relying on best practices.
…There are only two types of companies: those that have been hacked and those that haven't.
There are two types of companies: those that have been hacked and those that will be.
said Robert S. Mueller, director of the FBI.
In terms of software architecture, web applications are undergoing an evolution.
permanent, and are becoming increasingly complex. This complexity is felt at
through several points to understand the operation that involves several machines, the logic
development that relies on other existing applications, as well as interoperability
programming languages used.
Web applications are generally based on a Client-server architecture, 3-tier.
In a three-tier architecture, the principle of this architecture is defined by these three layers:
13
Chapter 2 - The Security of Web Applications
14
Chapter 2 – Web Application Security
On its part, OWASP periodically establishes a comprehensive list called 'TOP 10' ranking
also the most common threats to web applications in order of importance, it is to
note that the information mentioned here is taken from the most recent version (2013) published by
the OWASP.
In figure 2.2, we compare the different threats mentioned in table 2.1.
For more information on the top 10 threats, see the annex.
3% 2% XSS
5%
Info Leakage
5% 26% Session Management
6% Authentication & Authorization
CSRF
8% SQL Injection
Web Server Version
Remote Code Execution
16%
13% Web Server Configuration
Unauthorized Directory Access
16%
Top 10 OWASP
A1 - Injection
A2 - Broken Authentication and Session Management
A3 - Cross-Site Scripting (XSS)
A4 - Insecure Direct Object References
A5 - Security Misconfiguration
A6 - Sensitive Data Exposure
A7 - Missing Function Level Access Control
A8 - Cross-Site Request Forgery (CSRF)
A9 - Using Components with Known Vulnerabilities
A10 - Unvalidated Redirects and Forwards
15
Chapter 2 - Web Application Security
30
25
20
15
10
5
2011
0
2012
Opinions differ regarding the formulation of best practices and their implementation.
security measures for web applications, but they all follow the same method namely
the PDCA method (Plan, Do, Check, and Act), also known as the Deming wheel, mentioned in the
Chapter 1, the section "The Management of Information Systems Security". At the level of
In this part, we will detail each step while emphasizing best practices.
retain and implement before, during, and after the realization of a web application.
4.1 PLAN
16
Chapter 2 – Web Application Security
17
Chapter 2 - The security of web applications
4.2 DO
This phase consists of describing and implementing the security measures identified in the
phase PLAN.
In our case, we will detail the generic and fundamental measures.
foreseeable, but it should be noted that the measures vary from one web application to another.
other according to its criticality.
18
Chapter 2–Web Application Security
Ensure multi-level defense of services: at the network level, at the system level
of exploitation and at the application level;
Only allow what is strictly necessary for the functioning of the web application;
Only implement controlled barriers both technically
which is organizational.
19
Chapter 2–The security of web applications
INTERNET
DNS
DNS Reverse
Reverse Proxy
Proxy
Reverse Proxy DNS
Reverse Proxy DNS
WAF WAF
DMZ Frontale DMZ Frontale
IDS/IPS
IDS/IPS IDS/IPS
IDS/IPS
Web
Web server
server Web
Web server
server
Public DMZ Public DMZ
Application
Application server
server
Restricted DMZ Application
Application server
server
Restricted DMZ
IDS/IPS
IDS/IPS
IDS/IPS
Database
Database Server
Server
DMZ Privé Database
Serv eurBServer
as e de ddata
DMZ Privé
20
Chapter 2 - Web Application Security
The second scenario is the unavailability of the platform or one of its components.
following an incident, to address this issue it is necessary to plan for a second site
backup that will take over if the first production site does not respond.
The multi-level defense of services means taking charge of the security aspect on
several levels to know: network level, operating system level, and application level.
The multi-level defense of services can be ensured by rules that the Agency
The National Agency for the Security of Information Systems (ANSSI) has reinstated in its note
21
Chapter 2–Web Application Security
The choice of security tools must focus on reliable tools, the acquisition of tools will
of pairing with the allocation of human resources necessary for the administration and the
maintenance of security. Also, training of the technical personnel operating on the platform
is required.
4.3 Check
The check phase is a phase dedicated to controlling the actions carried out in the DO phase.
it is done through:
A regular audit: The purpose of the audit is to monitor the compliance of the web application in
considering all aspects including the organizational aspect. The audit must be
documented.
The implementation of the various technical security tests of the platform:
The tests to be conducted concern the different layers hosting the web application: networks,
systems, hardware, software, database and applications. There is a wide range of tools
intended for vulnerability testing, we cite as an example:
KALI Linux, which is a distribution dedicated to security testing including various
couches.
- Specialized websites for detecting vulnerabilities of online websites, for example:
the siteThe content at the provided URL cannot be accessed for [Link] test the 'Heartbleed' vulnerability
Tools for detecting software vulnerabilities present on an operating system,
example: Secunia Personal Software Inspector (Secunia PSI), Endpoint security 10 Kaspersky
Trusted sites specialized in the publication and listing of vulnerabilities
example: CERT (Computer Emergency Response Team), CESTI (Evaluation Center of the
Information Technology Security), Security Focus (SYMANTEC)
The verification of the application of security procedures. In the case where the policy of
security was established from the outset, and the web solution was documented through
procedures, it is imperative to verify the application of all these procedures and rules.
Log analysis and supervision of tools: The different software and hardware tools
used in securing the web application generate logs, these must be
monitored and meticulously analyzed to identify any anomalies, malfunctions or
doubtful behavior of the system.
22
Chapter 2 - The security of web applications
4.4 ACT
This phase includes all the corrective actions to be taken to address the
vulnerabilities identified during the CHECK phase.
5. Conclusion
This chapter outlines the methodology to be followed for the implementation of an architecture.
23
Chapter 3
Conceptual analysis
1 Introduction
At the end of the study conducted in the previous chapters where we saw the web applications.
their principles and concepts and the best practices to follow for their security.
This chapter presents a study of the existing situation and lists the objectives to be achieved in a
2 Definition of Objectives
The priority objective is to secure the hosted website before it goes into production.
finale. To achieve this goal, we propose an architecture that will, on one hand
to apply best practices in terms of securing web applications and another
part of respecting security standards through the implementation of security tools
necessary while adapting to the environment intended to host the site.
As a result, the proposed architecture will optimize access to the site and secure interaction.
among the different components of the platform that will offer flexibility to the user
requesting a more efficient website and administration to the administrator
system/network loaded with the platform.
At this level, we will model the architecture to be designed and its various actors.
With the help of UML (Unified Modeling Language), it will allow us to study in detail.
the functional aspect through the description of each interaction that will take place between the
different stakeholders and the proposed architecture.
24
Chapter 3 - Conceptual Analysis
- Hacker: Any person whose goal is to harm the functioning of the site and the
platform.
For each identified actor, we define the different goals they seek to achieve.
to reach.
25
Chapter 3 - Conceptual Analysis
Installer <<include>>
Log in
<<include>>
Set up
<<include>>
<<include>>
UPDATE
Check backup
System Administrator
<<include>>
<<extend>>
Monitors
Generate statistics
<<extend>>
Front Office Users Level 1
extend
Download Documents
Consult site <<extend>>
<<include>>
extend
Authenticator
<<extend>>
Front Office Level 2 Users
<<extend>>
Ask Questions
Insert Content
<<include>> Authenticator
Delete Content
<<include>>
<<include>>
Publish Content
Create User
Manage Users
<<extend>>
Delete User
<<extend>>
<<extend>>
User Modifier
Assigner Profile
27
Chapter 3–Conceptual Analysis
28
Chapter 3 - Conceptual Analysis
Front office IDS Firewall Reverse Proxy Web server Database Server
Yes
Access Granted Search for the page in the reverse proxy cache
Yes
Forwarder package Data search
If data
No exists
Error message
Yes
Parcel forwarder Send data
Yes
29
Chapter 3 – Conceptual Analysis
Figure 3.5 shows the administrator activity diagram related to the actor.
Administrator the diagram details the tracking of the request from the latter to administer the
platform from its broadcast until its end, taking into account all cases of
possible figures.
Administrator Firewall Server Monitoring and Administrator Backup server DB Server Web server Reverse proxy
Authenticator
If you log in
of correct pass
No
Yes
If address
No and authorized ports
Yes
Authenticator
Access denied
Authenticator
Authenticator
Authenticator
No
No
No
Yes
No
Yes
Authenticator Yes
Administer the server Administer the server Manage the server Administer the server
Please log in
in correct way
No
Yes
30
Chapter 3 - Conceptual Analysis
Backup server Firewall Administration and monitoring server Database Server Web Server
No Yes
Authenticate
No
Authenticate
Yes
No
Yes
No
Authenticator
Yes
Transfer backup
4 Architecture
We have brought the concept of partitioning into architecture through the implementation
instead of demilitarized zones (DMZ), these are classified by order of criticality
going from the public DMZ hosting the web server to the restricted DMZ for the servers
from monitoring and backup to the most critical DMZ private for the server
database.
We grouped the reverse proxy server with the web server, and we put a
probe at the entrance of the platform. The proposed architecture can be explained as follows:
Requests coming from outside pass through the physical firewall and undergo
A preliminary analysis shows that the allowed packets are routed to our second firewall.
software, where they are inspected by a probe to detect any suspicious activity, a
logging is ensured at this level, then filtered by the firewall.
HTTP and HTTPS requests from the outside requesting the web page
Only those can pass through the firewall, the latter are redirected to the reverse server
proxy, subsequently to the web server, the rest of the requests are systematically
rejected by the firewall.
The web server requests the database server through the firewall, this
last is responsible for redirecting the request from the web server (public DMZ) to the
32
Chapter 3–Conceptual Analysis
database server (private DMZ), only database queries are allowed from
to pass.
the return of the database query will be done in the same way, and will be routed
to the external user going through the firewall that handles redirecting the response from
web server to the outside.
The backup server located in the restricted DMZ is responsible for making
Backups of the servers from the platform cross the firewall destined for both
DMZ to perform backups of the servers: web, reverse proxy, and database
data using a well-defined service and ports.
The monitoring/administration server manages the entire platform, it has access
secured to all components of the platform, logins are made
in SSH and through secured interfaces in HTTPS.
The tools used in the design of our architecture are free tools (Open
Our choice was to use open tools for the benefits that these
latest offers to know:
33
Chapter 3–Conceptual Analysis
Endian firewall has bundled several software applications and integrated them into a single software for
to facilitate their exploitation and administration, among these software we mention the most prominent:
5.2.1 Netfilter
Netfilter is a firewall operating on a Linux kernel that has existed since version 2.4,
It is the successor to the Ipchains product, aimed at controlling, modifying, and filtering the
IP packets, and to ensure the monitoring of connections.
34
Chapter 3 - Conceptual Analysis
The great accessibility of the open source technology Snort offers many advantages:
Snort rules allow for traffic inspection while ensuring that they are capable of
to prevent the exploitation of the vulnerability for which they were designed. Their format
respects the current standard in the sector, used by security experts worldwide
whole.
SQUID is a tool that generally allows to secure and control access to the internet
for users of a company's local network, it is the function of a Proxy, but it can
also be used to secure and control user access to the internet to a or
several internal web servers, it is the function of reverse proxy.
The reverse proxy is placed between the Internet and the web server. When a client browser
make an HTTP request, the DNS server will route the request to the reverse machine
proxy, the web server is not real. The reverse proxy checks its cache to see if it
contains the requested element, otherwise, it connects to the actual web server and downloads the
36
Chapter 3 - Conceptual Analysis
requested document to its cache. The reverse proxy server's cache can only be used when
for cacheable URLs (such as HTML pages and images)
Dynamic content, such as CGI scripts and Active Server Pages cannot be
cached. The use of proxy caching for static pages is based on the tags
HTTP headers returned from the web page. [16]
6 Conclusion
37
CHAPTER 4
1 Introduction
At the end of the conceptual study carried out in the previous chapter, in this chapter we
let's try to achieve the projected architecture.
At this stage, we will implement the various tools and configure them according to our plan.
architecture.
Endian Firewall
Role: Software firewall, intrusion prevention tool, tool for
supervision...etc.
OS: Linux
Software: Netfilter and Snort (plus other tools)
Reverse proxy server
Role: Reverse proxy server
OS: Ubuntu Server 14.04
Software: SQUID
Monitoring and administration server
Role: Administration and monitoring station
OS: Ubuntu Desktop 14.04
Software: Monitoring Tool
38
Chapter 4 - Implementation and Achievement
Web Server
Role: Web server
Windows 7
Software: wamp server
2.2 Addressing plan of the platform
3.1 Installation:
Before starting the installation, you need to download the latest stable version of Endian.
Firewall located on the official [Link].
Once the ISO image is retrieved, we can boot with it on our virtual machine which
turns into a firewall office.
39
Chapter 4–Implementation and Realization
3.2 Configuration:
Endian Firewall segments the platform into four zones, each zone corresponds to a
security level:
Red zone: corresponds to the unsecured area, that is to say the internet, we will set.
the interface of this zone at [Link]
Orange zone: area solicited from the outside, it houses the web server and the reverse server.
proxy, its interface is set to [Link]
Blue zone: Specific area for wireless devices (wifi).
Green zone: it is the most protected area, it refers to the local network, it houses our
two restricted and private DMZs, that is why we will assign two network interfaces
for each DMZ for physical separation, plus a logical separation that will take place at
inter-zone firewall rules level.
40
Chapter 4 – Implementation and Realization
41
Chapter 4 – Implementation and Realization
42
Chapter 4 - Implementation and Realization
43
Chapter 4–Implementation and Realization
#cd /etc/network
#vi interfaces
Edit the content as follows
auto eth0
interface eth0 inet static
address [Link]
netmask [Link]
gateway [Link]
:wq!
Restart the interface
#cd /etc/init.d
#./networking restart
4.2 Configuration
The configuration of the reverse proxy is done at the level of the [Link] configuration file
which is located at /etc/squid3
#cd /etc/squid3
Copy the existing file and rename it to have a backup of the original file
#[Link]
Edit the content of the [Link] file and insert the following lines
#vi [Link]
The contents of the configuration file must be changed as follows:
http_port 80 accel defaultsite=[Link]
forwarded_for on
44
Chapter 4 – Implementation and Realization
#cd /etc/init.d
#./squid3 start
In order to maintain the established level of security and improve it over time, it is
It is essential to establish a station dedicated to the periodic audit of the platform, this
the measure represents a preventive measure to identify any potential breaches and to
correct in time.
Backtrack 5 is the most well-known distribution specialized in penetration testing and which
offers a range of security testing tools from network tests to tests
vulnerabilities of websites.
This distribution offers a tool called Zenmap, which is a tool designed to detect ports.
open in a network.
45
Chapter 4 - Implementation and Realization
Two interfaces allow the administrator to monitor traffic. The first interface
concerns the logging file of Endian firewall located under the Logs menu
and Reports where you can view the logs live.
Note: To enable logging, Ulogd must be started by executing the commands:
#cd /etc/init.d
#./ulogdstart
The second interface is the traffic monitoring interface located in the menu.
Service>>Traffic Monitoring, then go to the administration interface.
46
Chapter 4 - Implementation and Realization
6 Conclusion
47
General conclusion
The study conducted throughout our thesis aimed to respond to the
following issues:
How to secure a web application?
How to maintain the security of a web application?
What steps should be taken for securing a web application?
To provide the necessary answers to these issues, we have
analyzed the aspect of computer security as a whole and application security
web in particular taking into account the constant evolution of technologies
the information that goes hand in hand with the multiplication of the threats we must face
face.
The theoretical study was followed by a conceptual analysis that allowed us to identify
the needs and to model the projected architecture.
Given the importance of the security aspect of web applications, we have used
the fundamental security tools and applying good practices in an architecture
proposed.
The main contributions are summarized as follows:
The application of the computer system security process based on the
PDCA model to highlight the steps to follow;
Design a secure architecture that precisely aligns with the level of
expected security;
Concoct the right and reliable tools and use and configure them as being a
front safety barrier
Highlight the preventive aspect through the implementation of the necessary tools.
intrusion prevention;
However, we can consider different perspectives in order to maintain the level of
security, for example we cite:
Implementation of a tool to test the website's vulnerability.
The establishment of a VPN tunnel.
Finally, we must point out that our thesis, like any research work, is
not free from some gaps and limitations. These are mainly due to reasons
following:
Short duration.
48
General conclusion
49
Bibliography and webography
[1] and [2] Professor REMAEKERSJean. "Computer Security Course"
University of Namur. Belgium. 2012.
OWASP periodically establishes a comprehensive list called 'TOP 10' ranking also the
most common threats of web applications in order of importance, the latest version
recent (2013) published by OWASP is as follows:
1) Injection
An injection flaw, such as SQL injection, OS injection, and LDAP injection, occurs when data
unreliable is sent to an interpreter as part of a command or request.
The attacker's hostile data can deceive the interpreter into executing some
accidental commands or access unauthorized data.
We will present some attack scenarios in what follows.
Scenario 1:
An application uses unreliable data in the construction of the SQL call.
vulnerable following:
String query = "SELECT * FROM accounts WHERE"
custID='
Scenario 2:
Similarly, blind faith in a Framework application can lead to
on queries still vulnerable (e.g. HibernateQueryLanguage (HQL)):
Query HQLQuery = [Link]("FROM accounts
WHERE custID='" + [Link]("id") + "'
The attacker modifies the ‘id’ parameter in their browser and sends:
' or '1'='1.
For example:
[Link] or '1'='1
The meaning of the two queries is changed to return all the rows of the table.
accounts. The worst attacks can corrupt data, even invoke procedures
stored.
2) Violation of authentication and session management
The application functions related to authentication and session management are not
often not implemented correctly, allowing attackers to compromise the
Chapter 3 - Conceptual Analysis
Front office IDS Firewall Reverse Proxy Web server Database Server
Yes
Access Granted Search for the page in the reverse proxy cache
Yes
Forwarder package Data search
If data
No exists
Error message
Yes
Parcel forwarder Send data
Yes
29
Annexes
Scenario 3:
The application server configuration allows the display of stack status at
the user. Attackers appreciate these error messages.
Scenario 4:
The application server comes with example applications that have not been deleted from
your production server. The said application example contains vulnerabilities
knowns usable by the attacker to compromise the server.
6) Exposure of sensitive data
Many web applications do not properly protect sensitive data such as
that credit cards, tax identifiers and authentication information. The hackers
can steal or alter this poorly protected data to commit identity theft,
from credit card fraud or other crimes. Sensitive data deserves a
additional protection such as static or in-transit encryption, as well as precautions
specific during the exchange with the browser.
Examples of attack scenarios
Scenario 1:
A website protects credit card numbers through a function of
transparent encryption (TDE) of the DBMS. This method also leads to a
transparent decryption of data when it leaves the database. By exploiting a
SQL injection, the attacker retrieves the data in plain text...
Scenario 2:
A public site does not require SSL while browsing in the authenticated section.
A malicious actor connects to an open wireless network and collects the traffic.
from a user. It retrieves the token from an authenticated session and thereby accesses the data.
and user privileges in the application.
Scenario 3:
By exploiting a vulnerability in a file upload function, a malicious actor
obtains the hash base of passwords. The hashes having been generated
in the simple form without salt, a rainbow table attack it
reveals passwords.
Lack of access control at the functional level
Almost all web applications check access rights at the functional level.
before making this feature visible in the user interface. However, the
applications must perform the same access control checks on the server during
Annexes
to access each function. If the requests are not verified, attackers will be
to forge requests in order to access an unauthorized feature.
Examples of attack scenarios
Scenario 1:
The attacker is content to visit the targeted URLs. The following URLs require
Authentication and administrative rights are required for 'admin_getappInfo'.
[Link]
[Link]
A vulnerability exists if an unauthenticated user can access one of these
pages where an authenticated but non-privileged user can access 'admin_getapp'
Info. In this latter case, it may allow the attacker to identify others
unprotected administration features.
Scenario 2:
A page uses an 'action' parameter to specify the functionality to invoke, and
different actions require different privileges. A vulnerability exists if these
privileges are not verified.
8) Cross-Site Request Forgery (CSRF)
A CSRF (Cross Site Request Forgery) attack forces a victim's browser
authenticated to send a forged HTTP request, including the session cookie of the
victim as well as any other information automatically included, to a web application
vulnerable. This allows the attacker to force the victim's browser to generate
requests that the vulnerable application thinks are legitimately coming from the victim.
Example of an attack scenario
An application allows a user to submit a change request.
of state, which requires no secret:
[Link]
4673243243
The attacker can therefore forge a request to transfer money from the account of the
victim on her own account, and hide it in an image tag, or in a tag
iframe, stored on a site under its control:
<img src="[Link]
amount=1500&destinationAccount=attackersAcct#“
Annexes
If the victim visits one of the attacker's sites while still authenticated
on the site [Link], its browser will include the user session data in the
forged request and the latter will succeed.
9) Use of components with known vulnerabilities
Vulnerable components, such as libraries, contexts, and other software modules
almost always operate with maximum privileges. Thus, if exploited, they can
can cause serious data loss or server takeover. The applications
using these vulnerable components can compromise their defenses and allow a
series of attacks and potential impacts.
Example of attack scenarios
The risks associated with the vulnerability of a component can be very varied, ranging from a
malware simple or complex targeting a desired organization. Since most of the
components run with the maximum privileges of the application, any flaw in
one of these components can have a major impact. The two vulnerable components
the following were downloaded 22 million times in 2011.
Apache CXF Authentication Bypass - By not providing a token
authentication, attackers could use any web
services with all privileges. (Apache CXF is an open framework
source not to be confused with the Apache application server.)
Spring Remote Code Execution - An abuse of the language implementatio
Spring's expression allowed attackers to execute arbitrary code.
and thus take control of the server.
All applications using one of these vulnerable libraries are vulnerable.
to the attacks on these components directly accessible to the users of the application.
Other vulnerable libraries, used deeper in the application,
would be more difficult to exploit.
10) Unvalidated redirects and forwards
Web applications frequently redirect and guide users to others.
web pages and websites, and use unreliable data to determine the pages of
destination. Without proper validation, attackers can redirect victims to
phishing or malware sites, or use redirects to access unauthorized pages
authorized.
Examples of attack scenarios
Annexes
Scenario 1:
An application has a page '[Link]' that has a single parameter named
An attacker forges a URL that redirects users to a site
malicious (phishing attempt or malware installation).
Invalid input. The provided text does not contain translatable content.
Scenario 2:
An application makes redirects to direct users to certain pages.
internals. To simplify the return, some pages use a parameter containing the
page where the user must be redirected. In this case, an attacker creates a URL
satisfying the application's access controls and then redirecting it to a
administrative function that he should not have access to.
[Link]
Choose the 'typical' installation and then mount the ISO image of our firewall on the disc image.
Choose Linux as the OS type and then give the machine a name.
Leave the disk size at default and check 'store Virtual disk as single file' then
click Customize Hardware
Remove the USB controller, Sound Card, and Printer to free up the ports
then add three additional network adapters to have four interfaces then
click close then finish
Annexes
Once the creation of the machine is completed, the startup of the machine will generate the
Starting the installation of our Firewall.
Press OK
At this level, we need to define the IP address of our interface that must correspond to the zone.
See, this will be the access address to the administration interface of our firewall.
End of installation
#vi interfaces
Edit the content as follows
auto eth1
interface eth1 inet static
address [Link]
netmask [Link]
[Link]
:wq!
Restart the interface
#cd /etc/init.d
#./networking restart
Launch the browser and type the address [Link]
corresponds to the green zone.
Homepage
Endian firewall offers the possibility to import a configuration backup, into the
if necessary, we click on no because it is a new installation.
Change of the passwords for the administration interface and the root account
2.2 Configuration :
Red zone: corresponds to the unsecured zone, that is to say the internet, we will set it.
the interface of this zone at [Link]
Orange zone: area solicited from the outside, it houses the web server and the reverse server.
proxy, its interface is set to [Link]
Green zone: it is the most protected area, it refers to the local network, it houses our
two restricted and private DMZs, which is why we will assign two network interfaces
for each DMZ for physical separation, plus a logical separation that will take place at
level of inter-zone rules of the firewall.
Abstract:
The number of attacks against companies is growing, which can cause significant losses.
thus the need of IT security becomes so important.
Several policies and tools have been developed to provide effective defense mechanisms.
which include firewalls, Intrusion detection/prevention system (IDS/IPS), reverse proxy, their
The goal is to filter all traffic exchanged with the outside network and allow only authorized.
traffic.
In our project we proposed a simple and effective architecture for securing web
applications which consists of three modules : Endian Firewall, IDS /IPS, reverse proxy.
Those modules work together to ensure our security policy.
Firewall, filter, web application, security policy.
Summary:
The number of attacks against businesses continues to rise, which can lead to
significant losses, thus the need for companies in cybersecurity becomes
increasingly important.
Several policies and tools have been developed to provide mechanisms for
effective defenses among which are firewalls, Detection/Prevention System
intrusion detection/prevention systems (IDS/IPS), reverse proxy, their purpose being to filter all traffic exchanged with the