SlideShare a Scribd company logo
1 of 108
Chapter 16 
S it 
Security 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development 
Textbook to be published by Pearson Ed in Pearson Ed early 2014 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development 
http://www.funwebdev.com
Objectives 
1Security Principles 2Authentication 
3Cryptography 4HTTPS 
5Security Best Practices 6Common Threat Vectors 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Section 1 of 6 
SECURITY PRINCIPLES 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Security Overview 
The right way of addressing security is right from the 
beginning and all along the way so that you can plan 
for a secure system and hopefully have one in the end. 
Not only is a malicious hacker on a tropical island a 
threat but so too is a sloppy programmer, a 
disgruntled manager, or a naive secretary. 
Since websites are an application of networks and 
computer systems, you must draw from those 
disciplines to learn many foundational security ideas. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Information Security 
The CIA Triad 
Information security is the holistic practice of 
protecting information from unauthorized users. 
Computer/IT security is just one aspect of this holistic 
thinking, which addresses the role computers and 
networks play. 
The other is information assurance, which ensures 
that data is not lost when issues do arise. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Information Security 
The CIA Triad 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Information Security 
The CIA Triad 
• Confidentiality is the principle of maintaining privacy for 
the data you are storing, transmitting, etc. 
• This is the concept most often thought of when security is 
brought up. 
• Integrity is the principle of ensuring that data is accurate 
and correct. 
• This can include preventing unauthorized access and 
modification, but also extends to disaster preparedness and 
recovery. 
• Availability is the principle of making information available 
when needed to authorized people. 
• It is essential to making the other two elements relevant, 
since without it, it’s easy to have a confidential and integral 
system (a locked box). 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Security Standards 
This is really serious stuff 
In addition to the triad, there are ISO standards 
ISO/IEC 27002‐270037 that speak directly (and 
thoroughly) about security techniques and are 
routinely adopted by governments and corporations 
the world over. 
These standards are very comprehensive, outlining the 
need for risk assessment and management, security 
policy, and business continuity to address the triad. 
This chapter touches on some of those key ideas that 
are most applicable to web development. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Risk Assessment and 
Management 
Risk assessment uses the concepts of 
• actors, 
• impacts, 
• threats, and 
• vulnerabilities 
to determine where to invest in defensive 
countermeasures. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Actors 
Risk Assessment 
The term “actors” refers to the people who are 
attempting to access your system. They can be 
categorized as 
• Internal 
• External 
• Partner 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Actors 
The three amigos 
• Internal actors are the people who work for the 
organization. Although they account for a small 
p g percentage of the attacks, they are especially 
dangerous due to their internal knowledge of the 
systems. 
• External actors are the people outside of the 
organization. It turns out that more than three 
quarters of external actors are affiliated with 
organized crime or nation states. 
• Partner actors are affiliated with an organization 
that you partner or work with. Quite often partners 
are granted some access to each other’s systems 
( to p place , orders, for p ) 
example). 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Impact 
what systems were infiltrated and what data was stolen or lost? 
• A l loss f of il bili availability prevents users f from i 
accessing some 
or all of the systems. 
This might manifest as a g denial of service attack, or a SQL 
injection attack (described later), where the payload removes the 
entire user database, preventing logins from registered users. 
• A loss of confidentiality includes the disclosure of 
confidential information to a (often malicious) third party. 
This could manifest as a cross‐site script attack where data is 
stolen right off your screen or a full‐fledged database theft where 
credit cards and passwords are taken. 
• A loss of integrity changes your data or prevents you from 
having correct data. 
This might manifest as an attacker hijacking a user session, 
perhaps placing fake orders or changing a user’s home address. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Threats 
STRIDE 
A threat refers to a particular path that a hacker could use 
to exploit a vulnerability and gain unauthorized access to 
your system. 
A flood destroying your data center is a threat just as 
much as malicious SQL injections, buffer overflows, 
denial of service, and cross‐site scripting attacks. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Threats 
Categorize threats with Stride 
• S fi Spoofing – Th The k attacker uses someone l ’ else’s i f i 
information to access 
the System. 
• Tampering – The attacker p g modifies some data in nonauthorized 
ways. 
• Repudiation – The attacker removes all trace of their attack, so 
that they cannot be held accountable for other damages done. 
• Information disclosure – The attacker accesses data they should 
not be able to. 
• Denial of service – The attacker prevents real users from accessing 
the systems. 
•• Elevation of privilege – The attacker increases their privileges on 
the system thereby getting access to things they are not 
authorized to do. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Vulnerabilities 
The holes in your armor 
Once vulnerabilities are identified, they can be assessed for risk. 
Some vulnerabilities are not fixed because they are unlikely to be 
exploited exploited, while others are low risk because the consequences of an 
exploit are not critical. 
The top five classes of web vulnerability are: 
1. Injection 
2. Broken authentication and session management 
3. Cross‐site scripting 
4. Insecure direct object references 
5. Security misconfiguration 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Assessing Risk 
Putting it all together 
For our purposes, it will suffice to summarize that in 
risk assessment you would begin by identifying the 
actors actors, vulnerabilities, and threats to your information 
systems. 
The probability of an attack, the skill of the actor, and 
the impact of a successful penetration are all factors in 
determining where to focus your security efforts. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Assessing Risk 
A visual way of assessing threats 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Policies 
One part of your defenses 
• Usage policy defines what systems users are 
permitted to use, and under what situations. A 
company may, p y y for example, prohibit social 
networking while at work. Usage policies are often 
designed to reduce risk by removing some attack 
vector. 
• Authentication policy controls how users are 
granted access to the systems. 
• Legal policies define a wide range of things 
including data retention and backup policies as well 
as accessibility requirements (like having all public 
communication well organized for the blind). 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Policies 
Please don’t make me change my password every day 
Password policies can stipulate 
• the characteristics of acceptable passwords, and 
• expiration of passwords. 
Ironically, draconian password policies introduce new 
attack vectors, nullifying the purpose of the policy at 
the first place. 
Where authentication is critical, two‐factor 
authentication should be applied in place of password 
policies that do not increase security. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Business Continuity 
There is material enough for an entire courses here 
Part of a secure system is being able to access it in the 
case of the unforeseen. You should consider 
• Administrator Password Management 
• Backups and Redundancy 
• Geographic Redundancy 
• Stage Mock Events 
• Auditing you systems 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Secure By Design 
People are bad 
Secure by design addresses that there are malicious 
users out there. By continually distrusting user input 
(and even internal values) throughout the design and 
implementation phases, you will produce more secure 
software than if you didn’t consider security at every 
stage. 
Techniques can be applied at every stage of the 
software development life cycle to make your 
software Secure By Design. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Secure By Design 
Here’s what we do 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Secure By Design 
Code Reviews 
In a code review system, programmers must have 
their code peer‐reviewed before committing it to the 
repository. 
In addition to peer‐review, new employees are often 
assigned a more senior programmer who uses the 
code review opportunities to point out inconsistencies 
with company style and practice. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Secure By Design 
Unit Testing 
Unit testing is the principle of writing small programs 
to test your software as you develop it. Usually the 
units in a unit test are a module or class, and the test 
can compare the expected behavior of the class 
against the actual output. 
If you break any existing functionality, a unit test will 
discover it right away, saving you future headache and 
bugs. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Secure By Design 
Pair Programming 
Pair programming is the technique where two 
programmers work together at the same time on one 
computer. 
• One programmer drives the work and manipulates 
the mouse and keyboard while 
• the other programmer can focus on catching 
mistakes and high‐level thinking. 
After a set time interval the roles are switched and 
work continues. 
Like a continuous code review. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Secure By Design 
Security Testing 
Security testing is the process of testing the system 
against scenarios that attempt to break the final 
system. 
It can also include penetration testing where the 
company attempts to break into their own systems to 
find vulnerabilities as if they were hackers. 
Whereas normal testing focuses on passing user 
requirements, security testing focuses on surviving 
one or more attacks that simulate what could be out in 
the wild. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Secure By Design 
Secure by Default 
Systems are often created with default values that 
create security risks (like a blank password). 
Secure by default aims to make the default settings of 
a software system secure, so that those type of 
breaches are less likely even if the end users are not 
very knowledgeable about security. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Social Engineering 
In Computer Security 
Social engineering is the human part of information 
security that increases the effectiveness of an attack. 
No one would click a link in an email that said: 
• click here to get a virus, 
but they might click a link to: 
• get your free vacation. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Social Engineering 
Phising 
Phishing scams such as the Spanish Prisoner or Nigerian 
Prince Scams. Users might be tricked into disclosing 
information or even sending money in the hopes of freeing 
up even more. 
Good defenses include: 
• spam filters 
• good policies, with users trained not to click links in 
emails 
Some organizations go so far as to set up false phishing 
scams that target their own employees to see which ones 
will divulge information to such scams. Those employees 
are then etrained orterminated. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Security Theather 
Nothing to see here folks 
Security theater is when visible security measures are 
put in place without too much concern as to how 
effective they are at improving actual security. 
This is often done in 404 pages where a stern warning 
might read: 
Your IP address is XX.XX.XX.XX. This unauthorized access 
attempt has been logged. Any illegal activity will be 
reported to the authorities. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Section 2 of 6 
AUTHENTICATION 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Authentication 
Authentication is the process by which you decide 
that someone is who they say they are and therefore 
permitted to access the requested resources. 
Whether 
• getting entrance to an airport, 
• getting past the bouncer at the bar, or 
• logging into your web application, 
you have already seen authentication in action. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Authentication Factors 
the things you can ask someone for 
Authentication factors are the things you can ask someone for 
in an effort to validate that they are who they claim to be. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Authentication Factors 
the things you can ask someone for 
• Knowledge factors are the things you know 
Passwords, PIN, Challenge Question 
• Ownership factors are the things that you possess 
Key, FOB, Card, Mobile Phone 
• Inherence factors are the things you are 
Fingerprint, signature, DNA, gait 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Single Factor Authentication 
How many factors do you need? 
Single‐factor authentication is the weakest and most common 
category of authentication system where you ask for only one 
of the three factors. 
• Know a password 
• Posses an access card 
• Fingerprint access on your mobile phone 
When better authentication confidence is required, more than 
one authentication factor should be considered 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Multi Factor Authentication 
More than one. 
Multifactor authentication is where two distinct factors of 
authentication must pass before you are granted access. 
The way we all access an ATM machine is an example of two‐factor 
authentication: 
• you must have both the knowledge factor (PIN) and 
• the ownership factor(card) 
Multifactor authentication is becoming prevalent in consumer 
products as well: 
• your cell phone is used as the ownership factor alongside 
• y your p password as a g knowledge f 
factor. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Third Party Authentication 
Let someone else worry about it 
Many popular services allow you to use their system to 
authenticate the user and provide you with enough data to 
manage your application. 
Third‐party authentication schemes like OpenID and oAuth are 
popular with developers and are used under the hood by many 
major websites including Amazon, Facebook, Microsoft, and 
Twitter, to name but a few. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
OAuth 
3rd party Authentication requires some effort 
OAuth uses four user roles 
• The resource owner is normally the end user who can gain 
access to the resource (though it can be a computer as well). 
• The resource server hosts the resources and can process 
requests using access tokens. 
• The client is the application making requests on behalf of 
the resource owner. 
• The authorization server issues tokens to the client upon 
successful authentication of the resource owner. Often this 
is the same as the resource server. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
OAuth 
An overview 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Authorization 
Not the same as authentication 
Authorization defines what rights and privileges a user 
has once they are authenticated. 
• Authentication grants access 
vs 
• Authorization defines what the user with access can 
(and cannot) do. 
The principle of least privilege is a helpful rule of 
thumb that tells you to give users and software only 
the privileges required to accomplish their work. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Authorization 
Not the same as authentication 
Some examples in web development where proper 
authorization increases security include: 
• Using a separate database user for read and write 
privileges on a database 
• Providing each user an account where they can 
access their own files securely 
• Setting permissions correctly so as to not expose 
files to unauthorized users 
• Ensuring Apache is not running as the root account 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Section 3 of 6 
CRYPTOGRAPHY 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Cryptography 
Secret Messages 
Being able to send a secure message has been an important 
tool in warfare and affairs of state for centuries. 
At a basic level we are trying to get a message from one actor 
(we will call her Alice), to another (Bob), without an 
eavesdropper (Eve) intercepting the message. 
Since a single packet of data is routed through any number of 
intermediate locations on its way to the destination, getting 
your data (and passwords) is as simple as reading the data 
during one of the hops unless you use cryptography. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Cryptography 
The problem 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Cryptography 
The goal 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Cryptography 
Some key terms 
A cipher is a message that is scrambled so that it 
cannot easily be read, unless one has some secret key. 
The key can be a number, a phrase, or a page from a 
book. 
What is important in both ancient and modern 
cryptography is to keep the key a secret between the 
sender and the receiver. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Cryptography 
Substitution ciphers 
A substitution cipher is one where each character of 
the original message is replaced with another 
character according to the encryption algorithm and 
key. 
•• Caesar 
• Vigenere 
• One Time Pad 
• Modern Block Ciphers 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Caesar 
Substitution ciphers 
The Caesar cipher, named for and used by the Roman 
Emperor, is a substitution cipher where every letter of 
a message is g replaced with another letter, by shifting 
the alphabet over an agreed number (from 1 to 25). 
The message HELLO, for example, becomes KHOOR 
when a shift value of 3 is used 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
The problem with lousy ciphers 
Letter distribution is not flat 
The frequency of letters (and sets of two and three 
letters) is well known 
If you noticed the letter J occurring most frequently, it 
g 
might well be the letter E 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
The problem with lousy ciphers 
Letter distribution is not flat 
Any good cipher must therefore try to make the 
resulting cipher text letter distribution relatively flat so 
as to remove any trace of the telltale pattern of letter 
distributions. 
Simply swapping one letter for another does not do 
that, necessitating other techniques. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Vigenère 
Early attempt to flatten letter distribution of ciphers 
The Vigenère cipher, named for the sixteenth‐century 
cryptographer, uses a keyword to encode a message. 
The key phrase is written below the message and the 
letters are added together to form the cipher text as 
illustrated 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
One Time Pad 
Vigenere with an infinitely long key 
The one‐time pad refers to a perfect technique of 
cryptography where Alice and Bob both have identical 
copies of a very long sheet of numbers, randomly 
created 
Claude Shannon famously proved that the one‐time 
pad is impossible to crack 
However, it is impractical to implement on a large 
scale and remains a theoretical benchmark that is 
rarely applied in practice. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Modern Block Ciphers 
Ciphers in the computer age 
block ciphers encrypt and decrypt messages using an 
iterative replacing of a message with another 
scrambled message using 64 or 128 bits at a time. 
• The Data Encryption Standard (DES) and its 
replacement, 
• The Advanced Encryption Standard (AES) 
Are two‐block ciphers still used in web encryption 
today 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
DES illustration 
Pretty simple, no? 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Symmetric Key Problem 
How to exchange the key? 
All of the ciphers we have covered thus far use the 
same key to encode and decode, so we call them 
symmetric ciphers. 
The problem is that we have to have a shared private 
key. How? 
• Over the phone? 
• In an email? 
• Through the regular mail? 
• In person? 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Public Key Cryptography 
Solves the problem of key exchange 
Public key cryptography (or asymmetric 
cryptography) solves the problem of the secret key by 
using two distinct keys: 
• a public one, widely distributed 
• another one, kept private 
Algorithms like the Diffie‐Hellman key exchange allow 
a shared secret to be created out in the open, despite 
the presence of an eavesdropper 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Diffie-Hellman key exchange 
Solves the problem of key exchange 
Not used extensively anymore but the mathematics of 
the Diffie‐Hellman key exchange are accessible to a 
wide swath of readers. 
Modern algorithms (like RSA) apply similar thinking 
but with more complicated mathematics. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Diffie-Hellman key exchange 
Solves the problem of key exchange 
The algorithm relies on the power associative rule, 
which states that: 
gab can be used as a symmetric key for encryption, but 
since only ga and gb are transmitted the symmetric key 
isn’t intercepted. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Diffie-Hellman key exchange 
Solves the problem of key exchange 
To set up the communication, Alice and Bob agree to a 
prime number p and a generator g for the cyclic group 
modulo p. 
• Alice then chooses an integer a, and sends the 
value ga mod p to Bob. 
• Bob also chooses a random integer b and sends 
gb mod p back to Alice. 
• Since gab = gba, Bob and Alice now have a shared 
secret key that can be used for symmetric 
encryption algorithms such as DES or AES. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Diffie-Hellman key exchange 
Solves the problem of key exchange 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Digital Signatures 
Confirming the sender is authentic 
A digital signature is a mathematically secure way of 
validating that a particular digital document was 
• created by the person claiming to create it 
(authenticity), 
• Was not modified in transit (integrity), 
• and cannot be denied (non‐repudiation). 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Digital Signatures 
Confirming the sender is authentic 
A digital signature is a mathematically secure way of 
validating that a particular digital document was 
• created by the person claiming to create it 
(authenticity), 
• Was not modified in transit (integrity), 
• and cannot be denied (non‐repudiation). 
The process of signing a digital document can be as 
simple as encrypting a hash of the transmitted 
message. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Digital Signatures 
Confirming the sender is authentic 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Section 4 of 7 
HYPERTEXT TRANSFER 
PROTOCOL SECURE (HTTPS) 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTTPS 
Secure HTTP 
HTTPS is the HTTP protocol running on top of the 
Transport Layer Security (TLS). 
It’s easy to see from a client’s perspective that a site is 
secured by the little padlock icons in the URL bar used 
by most modern browsers 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTTPS 
Secure Handshakes 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTTPS 
Certificates 
The certificate that is transmitted during the 
handshake is actually an X.509 certificate, which 
contains many details including the algorithms used, 
the domain it was issued for, and some public key 
information. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTTPS 
Certificate Authorities 
A Certificate Authority (CA) allows users to place their 
trust in the certificate since a trusted, independent 
third party signs it. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
HTTPS 
Self-Signed Certificates 
Self‐signed certificates provide the same level of 
encryption, but the validity of the server is not 
confirmed. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Section 5 of 67 
SECURITY BEST PRACTICES 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Best Practices 
Some good things to do 
It’s now time to discuss some practical things you can 
do to harden your system against attacks 
• Secure Data Storage 
• Monitor Your Systems 
• Audit and Attack Thyself 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Secure Data Storage 
Not if, but when 
Even household names like Sony, Citigroup, Target and 
GE Money have had their systems breached and data 
stolen. 
If even globally active companies can be impacted, you 
must ask yourself: when (not if) you are breached, 
what data will the attacker have access to? 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Data Storage 
Naïve credential storage example 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Data Storage 
How can we make it better 
Two techniques that improve the integrity of your 
data. 
• Secure Hash 
• Salted Secure Hash 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Data Storage 
Secure Hash 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Data Storage 
Secure Hash 
A simple Google search for the string stored in our 
newly defined table: 
5f4dcc3b5aa765d61d8327deb882cf99 brings up 
dozens of results which tell you that that string is 
indeed the MD5 digest for password. 
The technique of adding some noise to each password 
is called salting the password and makes your 
passwords very secure. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Data Storage 
Secure Salted Hash 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Monitor Your Systems 
You mean manually? 
There are tools that allow you to pre‐configure a 
system to check in on all your sites and servers 
periodically. Nagios, for example, lets you see the 
status and history of your devices, and sends out 
notifications by email as per your preferences. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Monitor Your Systems 
Systems Monitors 
One of the best ways to mitigate damage is to detect 
an attack as quickly as possible, rather than let an 
attacker take their time in exploiting your system once 
inside. 
We can detect intrusion 
• directly by watching login attempts, and 
• indirectly by watching for suspicious behavior like a 
web server going down. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Monitor Your Systems 
Systems Monitors 
There are tools that allow you to pre‐configure a 
system to check in on all your sites and servers 
periodically. Nagios, for example, lets you see the 
status and history of your devices, and sends out 
notifications by email as per your preferences. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Monitor Your Systems 
Access Monitors 
As any experienced site administrator will attest, there 
are thousands of attempted login attempts being 
performed all day long 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Monitor Your Systems 
Automated Intrusion Blocking 
For those of us less interested in writing that script 
from scratch, consider the well‐tested and widely used 
• Python script blockhosts.py or 
• failzban or 
• blockhostz. 
These tools look for failed login attempts by both SSH 
and FTP and automatically update hosts.deny files as 
needed. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Audit and Attack Thyself 
Only if you own everything 
There are a number of companies that you can hire 
(and grant written permission) to test your servers and 
report on what they’ve found. 
If you prefer to perform your own analysis, you should 
be aware of some open‐source attack tools such as 
w3af, which provide a framework to test your system 
including SQL injections, XSS, bad credentials, and 
more. 
It should be noted that performing any sort of analysis 
on servers you do not have permission to scan could 
land you a very large jail term 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Section 6 of 6 
COMMON THREAT VECTORS 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
SQL Injection 
Using user input fields for evil. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
SQL Injection 
Using user input fields for evil. 
There are two ways to protect against such attacks: 
• sanitize user input, and 
• apply the least privileges possible for the 
application’s database user. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Cross Site Scripting 
XSS 
In the original formulation for these type of attacks, a 
malicious user would get a script onto a page and that 
script would then send data through AJAX to a 
malicious party, hosted at another domain (hence the 
cross, in XSS). 
There are two main categories of XSS vulnerability: 
•• Reflected XSS 
• Stored XSS. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Reflected XSS 
XSS 
Reflected XSS (also known as nonpersistent XSS) are 
attacks that send malicious content to the server, so 
that in the server response, the malicious content is 
embedded. 
Consider a login page that outputs a welcome 
message to the user, based on a GET parameter. 
A malicious user could try to put JavaScript into the 
page by typing the URL: 
index.php?User=<script>alert("bad");<script> 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Reflected XSS 
XSS 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Stored XSS 
Another XSS attack 
Stored XSS (also known as persistent XSS) is even 
more dangerous, because the attack can impact every 
user that visits the site. 
Consider a site where users can add comments to 
existing blog posts. A malicious user could enter a 
comment that includes malicious JavaScript 
The next time anyone logs in, their session cookie can 
be stolen. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Stored XSS 
Another XSS attack 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Thwarting XSS 
Filter User Input 
• strip_tags() removes all the HTML tags 
But hackers are sophisticated, so libraries such as 
HTMLPurifier or HTML sanitizer from Google allows 
you to easily remove a wide range of dangerous 
characters that could be used as part of an XSS attack 
$user= $_POST['uname']; 
$purifier = new HTMLPurifier(); 
$clean_user = $purifier‐>purify($user); 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Thwarting XSS 
Escape Dangerous content 
You may recall HTML escape codes allow characters to be 
encoded as a code, preceded by &, and ending with a 
semicolon (e.g., < can be encoded as &lt;). 
if you escape the malicious script before sending users 
would receive the following: 
&lt;script&gt;alert(&quot;hello&quot;);&lt;/script&gt; 
Which does not get interpreted as JavaScript. 
The trick is not to escape everything. Only escape output 
that originated as user input since that could be a potential 
XSS attack vector (normally, that’s the content pulled from 
the database). 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Insecure Direct Object 
Reference 
An insecure direct object reference is a fancy name 
for when some internal value is exposed to the user, 
and attackers can then manipulate these internal keys 
to gain access to things they should not have access 
to. 
For instance, if a user can determine that his or her 
uploaded photos are stored sequentially as 
/images/99/1.jpg, /images/99/2.jpg, . . . , they might 
try to access images of other users by requesting 
/images/101/1.jpg. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Insecure Direct Object 
Reference 
One strategy for protecting your site against this threat 
is to obfuscate URLs to use hash values rather than 
sequential names. For example: 
Rather than store images as 
• 1.jpg, 2.jpg . . . 
Generate URLs like 
• 9a76eb01c5de4362098.jpg 
Using a one way hash. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Insecure Direct Object 
Reference 
Another technique is to route requests for file assets 
through PHP scripts. 
This allows you to add an authorization check for every 
picture using the $_SESSION variable. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
DoS 
Denial of Service 
Denial of service attacks (DoS attacks) are attacks that 
aim to overload a server with illegitimate requests in 
order to prevent the site from responding to 
legitimate ones. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
DDoS 
Distributed Denial of Service 
Distributed Denial of service attacks have requests 
coming in from multiple machines, often as part of a 
bot army of infected machines under the control of a 
single organization or user 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
DDoS 
Defence 
Interestingly, defense against this type of attack is 
similar to preparation for a huge surge of traffic, that 
is, caching dynamic pages whenever possible, and 
ensuring you have the bandwidth needed to respond. 
Unfortunately, these attacks are very difficult to 
counter, as illustrated by a recent attack on the 
spamhaus servers, which generated 300Gbps worth of 
requests 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Security Misconfiguration 
That’s a wide net 
There are many systems that can be badly configured: 
• Out‐of‐date Software 
• Open Mail Relays 
• More Input Attacks 
• Virtual Open Mail Relay 
• Arbitrary Program Execution 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Out of Date Software 
Seems simple enough 
Most softwares are regularly updated with new 
versions that add features, and fix bugs. 
Sometimes these updates are not applied, either out 
of laziness/incompetence, or because they conflict 
with other software that is running on the system that 
is not compatible with the new version. 
The solution is straightforward: update your software 
as quickly as possible. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Open Mail Relays 
Letting someone send mail as you 
An open mail relay refers to any mail server that 
allows someone to route email through without 
authentication. 
Open relays are troublesome since spammers can use 
your server to send their messages rather than use 
their own servers. 
This means that the spam messages are sent as if the 
originating IP address was your own web server! If 
that spam is flagged at a spam agency like spamhaus, 
your mail server’s IP address will be blacklisted, and 
then many mail providers will block legitimate email 
from you. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Virtual Open Mail Relays 
Letting someone send mail as you despite a closed relay 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Virtual Open Mail Relays 
Letting someone send mail as you despite a closed relay 
By transmitting the email address of the recipient, the 
contact form is at risk of abuse since an attacker could 
send to any email they want. 
Instead, you should transmit an integer that 
corresponds to an ID in the user table, thereby 
requiring the database lookup of a valid recipient. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Arbitrary Program Execution 
Let them run any program they want 
Another potential attack with user‐coupled control 
relates to running commands in Unix through a PHP 
script. 
Functions like exec(), system(), and passthru() allow 
the server to run a process as though they were a 
logged‐in user.. 
To prevent this major class of attack, be sure to 
• sanitize input, with escapeshellarg() and be mindful 
of how user input is being passed to the shell. 
• applying least possible privileges will also help 
mitigate this attack. 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Arbitrary Program Execution 
Let them run any program they want 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
What You’ve Learned 
1Security Principles 2Authentication 
3Cryptography 4HTTPS 
5Security Best Practices 6Common Threat Vectors 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development
Buy the book, or 
Find out more at 
www.funwebdev.com 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development 
Textbook to be published by Pearson Ed in Pearson Ed early 2014 
Randy Connolly and Ricardo Hoar Fundamentals of Web Development 
http://www.funwebdev.com

More Related Content

What's hot

Bootstrap 5 whats new
Bootstrap 5   whats newBootstrap 5   whats new
Bootstrap 5 whats newSandun Perera
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Gil Fink
 
Wordpress Syllabus.pdf
Wordpress Syllabus.pdfWordpress Syllabus.pdf
Wordpress Syllabus.pdfNilDada
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Ikhade Maro Igbape
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application SecurityRob Ragan
 
Fundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersFundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersLemi Orhan Ergin
 
HTML-(workshop)7557.pptx
HTML-(workshop)7557.pptxHTML-(workshop)7557.pptx
HTML-(workshop)7557.pptxRaja980775
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development PresentationTurnToTech
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityAbdul Wahid
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTIONAnoop T
 
ppt of web designing and development
ppt of web designing and developmentppt of web designing and development
ppt of web designing and development47ishu
 
Advanced Sql Injection ENG
Advanced Sql Injection ENGAdvanced Sql Injection ENG
Advanced Sql Injection ENGDmitry Evteev
 

What's hot (20)

Bootstrap 5 whats new
Bootstrap 5   whats newBootstrap 5   whats new
Bootstrap 5 whats new
 
Bootstrap 5 basic
Bootstrap 5 basicBootstrap 5 basic
Bootstrap 5 basic
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Wordpress Syllabus.pdf
Wordpress Syllabus.pdfWordpress Syllabus.pdf
Wordpress Syllabus.pdf
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation Cross Site Scripting Defense Presentation
Cross Site Scripting Defense Presentation
 
jQuery PPT
jQuery PPTjQuery PPT
jQuery PPT
 
Web security 2012
Web security 2012Web security 2012
Web security 2012
 
Intro to Web Application Security
Intro to Web Application SecurityIntro to Web Application Security
Intro to Web Application Security
 
Fundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-DevelopersFundamentals of Web Development For Non-Developers
Fundamentals of Web Development For Non-Developers
 
HTML-(workshop)7557.pptx
HTML-(workshop)7557.pptxHTML-(workshop)7557.pptx
HTML-(workshop)7557.pptx
 
Web Development Presentation
Web Development PresentationWeb Development Presentation
Web Development Presentation
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
SQL INJECTION
SQL INJECTIONSQL INJECTION
SQL INJECTION
 
ppt of web designing and development
ppt of web designing and developmentppt of web designing and development
ppt of web designing and development
 
Advanced Sql Injection ENG
Advanced Sql Injection ENGAdvanced Sql Injection ENG
Advanced Sql Injection ENG
 
SQL Injection
SQL InjectionSQL Injection
SQL Injection
 
Css
CssCss
Css
 
Codeigniter
CodeigniterCodeigniter
Codeigniter
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
 

Viewers also liked

Information security group presentation ppt
Information security group presentation   pptInformation security group presentation   ppt
Information security group presentation pptvaishalshah01
 
Security in Web 2.0, Social Web and Cloud
Security in Web 2.0, Social Web and CloudSecurity in Web 2.0, Social Web and Cloud
Security in Web 2.0, Social Web and CloudITDogadjaji.com
 
Introduction to web security @ confess 2012
Introduction to web security @ confess 2012Introduction to web security @ confess 2012
Introduction to web security @ confess 2012jakobkorherr
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009mirahman
 
Top Ten Proactive Web Security Controls v5
Top Ten Proactive Web Security Controls v5Top Ten Proactive Web Security Controls v5
Top Ten Proactive Web Security Controls v5Jim Manico
 
Cisco Study: State of Web Security
Cisco Study: State of Web Security Cisco Study: State of Web Security
Cisco Study: State of Web Security Cisco Canada
 
Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web SecurityChris Shiflett
 
Modern Web Security
Modern Web SecurityModern Web Security
Modern Web SecurityBill Condo
 
Top 10 Web App Security Risks
Top 10 Web App Security RisksTop 10 Web App Security Risks
Top 10 Web App Security RisksSperasoft
 
Introduction to Web security
Introduction to Web securityIntroduction to Web security
Introduction to Web securityjeyaselvir
 
Web Server Web Site Security
Web Server Web Site SecurityWeb Server Web Site Security
Web Server Web Site SecuritySteven Cahill
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application SecurityYnon Perek
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity George Boobyer
 
Tutorial 09 - Security on the Internet and the Web
Tutorial 09 - Security on the Internet and the WebTutorial 09 - Security on the Internet and the Web
Tutorial 09 - Security on the Internet and the Webdpd
 
Cia security model
Cia security modelCia security model
Cia security modelImran Ahmed
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesCarol McDonald
 

Viewers also liked (20)

Information security group presentation ppt
Information security group presentation   pptInformation security group presentation   ppt
Information security group presentation ppt
 
Web Security
Web SecurityWeb Security
Web Security
 
Security in Web 2.0, Social Web and Cloud
Security in Web 2.0, Social Web and CloudSecurity in Web 2.0, Social Web and Cloud
Security in Web 2.0, Social Web and Cloud
 
Introduction to web security @ confess 2012
Introduction to web security @ confess 2012Introduction to web security @ confess 2012
Introduction to web security @ confess 2012
 
Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009Php & Web Security - PHPXperts 2009
Php & Web Security - PHPXperts 2009
 
Top Ten Proactive Web Security Controls v5
Top Ten Proactive Web Security Controls v5Top Ten Proactive Web Security Controls v5
Top Ten Proactive Web Security Controls v5
 
Cisco Study: State of Web Security
Cisco Study: State of Web Security Cisco Study: State of Web Security
Cisco Study: State of Web Security
 
Evolution Of Web Security
Evolution Of Web SecurityEvolution Of Web Security
Evolution Of Web Security
 
Modern Web Security
Modern Web SecurityModern Web Security
Modern Web Security
 
Top 10 Web App Security Risks
Top 10 Web App Security RisksTop 10 Web App Security Risks
Top 10 Web App Security Risks
 
Introduction to Web security
Introduction to Web securityIntroduction to Web security
Introduction to Web security
 
Web security
Web securityWeb security
Web security
 
Web Server Web Site Security
Web Server Web Site SecurityWeb Server Web Site Security
Web Server Web Site Security
 
Web Application Security
Web Application SecurityWeb Application Security
Web Application Security
 
DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity DrupalCamp London 2017 - Web site insecurity
DrupalCamp London 2017 - Web site insecurity
 
Extreme security in web servers
Extreme security in  web serversExtreme security in  web servers
Extreme security in web servers
 
Web Security
Web SecurityWeb Security
Web Security
 
Tutorial 09 - Security on the Internet and the Web
Tutorial 09 - Security on the Internet and the WebTutorial 09 - Security on the Internet and the Web
Tutorial 09 - Security on the Internet and the Web
 
Cia security model
Cia security modelCia security model
Cia security model
 
Top 10 Web Security Vulnerabilities
Top 10 Web Security VulnerabilitiesTop 10 Web Security Vulnerabilities
Top 10 Web Security Vulnerabilities
 

Similar to Web Security Chapter Summary

Information Technology Security Basics
Information Technology Security BasicsInformation Technology Security Basics
Information Technology Security BasicsMohan Jadhav
 
Cyber security series advanced persistent threats
Cyber security series   advanced persistent threats Cyber security series   advanced persistent threats
Cyber security series advanced persistent threats Jim Kaplan CIA CFE
 
Cybersecurity…real world solutions
Cybersecurity…real world solutions Cybersecurity…real world solutions
Cybersecurity…real world solutions ErnestStaats
 
How Can I Reduce The Risk Of A Cyber-Attack?
How Can I Reduce The Risk Of A Cyber-Attack?How Can I Reduce The Risk Of A Cyber-Attack?
How Can I Reduce The Risk Of A Cyber-Attack?Osei Fortune
 
SAM05_Barber PW (7-9-15)
SAM05_Barber PW (7-9-15)SAM05_Barber PW (7-9-15)
SAM05_Barber PW (7-9-15)Norm Barber
 
Lec 1- Intro to cyber security and recommendations
Lec 1- Intro to cyber security and recommendationsLec 1- Intro to cyber security and recommendations
Lec 1- Intro to cyber security and recommendationsBilalMehmood44
 
Anatomy of a cyber attack
Anatomy of a cyber attackAnatomy of a cyber attack
Anatomy of a cyber attackMark Silver
 
Ethical Hacking Interview Questions and Answers.pdf
Ethical Hacking Interview Questions and Answers.pdfEthical Hacking Interview Questions and Answers.pdf
Ethical Hacking Interview Questions and Answers.pdfShivamSharma909
 
Chapter 1 introduction(web security)
Chapter 1 introduction(web security)Chapter 1 introduction(web security)
Chapter 1 introduction(web security)Kirti Ahirrao
 
Application Security Testing for Software Engineers: An approach to build sof...
Application Security Testing for Software Engineers: An approach to build sof...Application Security Testing for Software Engineers: An approach to build sof...
Application Security Testing for Software Engineers: An approach to build sof...Michael Hidalgo
 
Law Firm Cybersecurity: Practical Tips for Protecting Your Data
Law Firm Cybersecurity: Practical Tips for Protecting Your DataLaw Firm Cybersecurity: Practical Tips for Protecting Your Data
Law Firm Cybersecurity: Practical Tips for Protecting Your DataAccellis Technology Group
 
Aujas incident management webinar deck 08162016
Aujas incident management webinar deck 08162016Aujas incident management webinar deck 08162016
Aujas incident management webinar deck 08162016Karl Kispert
 
Application Security: Safeguarding Data, Protecting Reputations
Application Security: Safeguarding Data, Protecting ReputationsApplication Security: Safeguarding Data, Protecting Reputations
Application Security: Safeguarding Data, Protecting ReputationsCognizant
 
Cyber Security for Financial Planners
Cyber Security for Financial PlannersCyber Security for Financial Planners
Cyber Security for Financial PlannersMichael O'Phelan
 
CompTIA_Security_plus_SY0-701_course_content.pdf
CompTIA_Security_plus_SY0-701_course_content.pdfCompTIA_Security_plus_SY0-701_course_content.pdf
CompTIA_Security_plus_SY0-701_course_content.pdfInfosec train
 
CompTIA_Security_plus_SY0-701_course_content.pdf
CompTIA_Security_plus_SY0-701_course_content.pdfCompTIA_Security_plus_SY0-701_course_content.pdf
CompTIA_Security_plus_SY0-701_course_content.pdfpriyanshamadhwal2
 
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦Infosec train
 
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦priyanshamadhwal2
 
Security+ SY0-701 CERTIFICATION TRAINING.pdf
Security+ SY0-701 CERTIFICATION TRAINING.pdfSecurity+ SY0-701 CERTIFICATION TRAINING.pdf
Security+ SY0-701 CERTIFICATION TRAINING.pdfinfosecTrain
 
CompTIA Security+ (Plus) Certification Training Course
CompTIA Security+ (Plus) Certification Training CourseCompTIA Security+ (Plus) Certification Training Course
CompTIA Security+ (Plus) Certification Training CourseInfosecTrain Education
 

Similar to Web Security Chapter Summary (20)

Information Technology Security Basics
Information Technology Security BasicsInformation Technology Security Basics
Information Technology Security Basics
 
Cyber security series advanced persistent threats
Cyber security series   advanced persistent threats Cyber security series   advanced persistent threats
Cyber security series advanced persistent threats
 
Cybersecurity…real world solutions
Cybersecurity…real world solutions Cybersecurity…real world solutions
Cybersecurity…real world solutions
 
How Can I Reduce The Risk Of A Cyber-Attack?
How Can I Reduce The Risk Of A Cyber-Attack?How Can I Reduce The Risk Of A Cyber-Attack?
How Can I Reduce The Risk Of A Cyber-Attack?
 
SAM05_Barber PW (7-9-15)
SAM05_Barber PW (7-9-15)SAM05_Barber PW (7-9-15)
SAM05_Barber PW (7-9-15)
 
Lec 1- Intro to cyber security and recommendations
Lec 1- Intro to cyber security and recommendationsLec 1- Intro to cyber security and recommendations
Lec 1- Intro to cyber security and recommendations
 
Anatomy of a cyber attack
Anatomy of a cyber attackAnatomy of a cyber attack
Anatomy of a cyber attack
 
Ethical Hacking Interview Questions and Answers.pdf
Ethical Hacking Interview Questions and Answers.pdfEthical Hacking Interview Questions and Answers.pdf
Ethical Hacking Interview Questions and Answers.pdf
 
Chapter 1 introduction(web security)
Chapter 1 introduction(web security)Chapter 1 introduction(web security)
Chapter 1 introduction(web security)
 
Application Security Testing for Software Engineers: An approach to build sof...
Application Security Testing for Software Engineers: An approach to build sof...Application Security Testing for Software Engineers: An approach to build sof...
Application Security Testing for Software Engineers: An approach to build sof...
 
Law Firm Cybersecurity: Practical Tips for Protecting Your Data
Law Firm Cybersecurity: Practical Tips for Protecting Your DataLaw Firm Cybersecurity: Practical Tips for Protecting Your Data
Law Firm Cybersecurity: Practical Tips for Protecting Your Data
 
Aujas incident management webinar deck 08162016
Aujas incident management webinar deck 08162016Aujas incident management webinar deck 08162016
Aujas incident management webinar deck 08162016
 
Application Security: Safeguarding Data, Protecting Reputations
Application Security: Safeguarding Data, Protecting ReputationsApplication Security: Safeguarding Data, Protecting Reputations
Application Security: Safeguarding Data, Protecting Reputations
 
Cyber Security for Financial Planners
Cyber Security for Financial PlannersCyber Security for Financial Planners
Cyber Security for Financial Planners
 
CompTIA_Security_plus_SY0-701_course_content.pdf
CompTIA_Security_plus_SY0-701_course_content.pdfCompTIA_Security_plus_SY0-701_course_content.pdf
CompTIA_Security_plus_SY0-701_course_content.pdf
 
CompTIA_Security_plus_SY0-701_course_content.pdf
CompTIA_Security_plus_SY0-701_course_content.pdfCompTIA_Security_plus_SY0-701_course_content.pdf
CompTIA_Security_plus_SY0-701_course_content.pdf
 
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
 
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
𝐋𝐚𝐭𝐞𝐬𝐭 𝐂𝐨𝐦𝐩𝐓𝐈𝐀 𝐒𝐞𝐜𝐮𝐫𝐢𝐭𝐲+ 𝐒𝐘𝟎-𝟕𝟎𝟏 𝐄𝐱𝐚𝐦
 
Security+ SY0-701 CERTIFICATION TRAINING.pdf
Security+ SY0-701 CERTIFICATION TRAINING.pdfSecurity+ SY0-701 CERTIFICATION TRAINING.pdf
Security+ SY0-701 CERTIFICATION TRAINING.pdf
 
CompTIA Security+ (Plus) Certification Training Course
CompTIA Security+ (Plus) Certification Training CourseCompTIA Security+ (Plus) Certification Training Course
CompTIA Security+ (Plus) Certification Training Course
 

More from Randy Connolly

Ten-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeTen-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeRandy Connolly
 
Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Randy Connolly
 
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Randy Connolly
 
Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Randy Connolly
 
Modern Web Development (2018)
Modern Web Development (2018)Modern Web Development (2018)
Modern Web Development (2018)Randy Connolly
 
Helping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesHelping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesRandy Connolly
 
Constructing a Web Development Textbook
Constructing a Web Development TextbookConstructing a Web Development Textbook
Constructing a Web Development TextbookRandy Connolly
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for ManagersRandy Connolly
 
Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Randy Connolly
 
17 Ways to Fail Your Courses
17 Ways to Fail Your Courses17 Ways to Fail Your Courses
17 Ways to Fail Your CoursesRandy Connolly
 
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Randy Connolly
 
Constructing and revising a web development textbook
Constructing and revising a web development textbookConstructing and revising a web development textbook
Constructing and revising a web development textbookRandy Connolly
 
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesComputing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesRandy Connolly
 
Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Randy Connolly
 
Thinking About Technology
Thinking About TechnologyThinking About Technology
Thinking About TechnologyRandy Connolly
 
A longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataA longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataRandy Connolly
 
Is Human Flourishing in the ICT World of the Future Likely?
Is Human Flourishing in the ICT World of the Future Likely?Is Human Flourishing in the ICT World of the Future Likely?
Is Human Flourishing in the ICT World of the Future Likely?Randy Connolly
 
Constructing a Contemporary Textbook
Constructing a Contemporary TextbookConstructing a Contemporary Textbook
Constructing a Contemporary TextbookRandy Connolly
 

More from Randy Connolly (20)

Ten-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS DegreeTen-Year Anniversary of our CIS Degree
Ten-Year Anniversary of our CIS Degree
 
Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)Careers in Computing (2019 Edition)
Careers in Computing (2019 Edition)
 
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
Facing Backwards While Stumbling Forwards: The Future of Teaching Web Develop...
 
Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)Where is the Internet? (2019 Edition)
Where is the Internet? (2019 Edition)
 
Modern Web Development (2018)
Modern Web Development (2018)Modern Web Development (2018)
Modern Web Development (2018)
 
Helping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing DisciplinesHelping Prospective Students Understand the Computing Disciplines
Helping Prospective Students Understand the Computing Disciplines
 
Constructing a Web Development Textbook
Constructing a Web Development TextbookConstructing a Web Development Textbook
Constructing a Web Development Textbook
 
Web Development for Managers
Web Development for ManagersWeb Development for Managers
Web Development for Managers
 
Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"Disrupting the Discourse of the "Digital Disruption of _____"
Disrupting the Discourse of the "Digital Disruption of _____"
 
17 Ways to Fail Your Courses
17 Ways to Fail Your Courses17 Ways to Fail Your Courses
17 Ways to Fail Your Courses
 
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
Red Fish Blue Fish: Reexamining Student Understanding of the Computing Discip...
 
Constructing and revising a web development textbook
Constructing and revising a web development textbookConstructing and revising a web development textbook
Constructing and revising a web development textbook
 
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing DisciplinesComputing is Not a Rock Band: Student Understanding of the Computing Disciplines
Computing is Not a Rock Band: Student Understanding of the Computing Disciplines
 
Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...Citizenship: How do leaders in universities think about and experience citize...
Citizenship: How do leaders in universities think about and experience citize...
 
Thinking About Technology
Thinking About TechnologyThinking About Technology
Thinking About Technology
 
A longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission dataA longitudinal examination of SIGITE conference submission data
A longitudinal examination of SIGITE conference submission data
 
Is Human Flourishing in the ICT World of the Future Likely?
Is Human Flourishing in the ICT World of the Future Likely?Is Human Flourishing in the ICT World of the Future Likely?
Is Human Flourishing in the ICT World of the Future Likely?
 
Constructing a Contemporary Textbook
Constructing a Contemporary TextbookConstructing a Contemporary Textbook
Constructing a Contemporary Textbook
 
CSS: Introduction
CSS: IntroductionCSS: Introduction
CSS: Introduction
 
HTML: An Introduction
HTML: An IntroductionHTML: An Introduction
HTML: An Introduction
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 

Web Security Chapter Summary

  • 1. Chapter 16 S it Security Randy Connolly and Ricardo Hoar Fundamentals of Web Development Textbook to be published by Pearson Ed in Pearson Ed early 2014 Randy Connolly and Ricardo Hoar Fundamentals of Web Development http://www.funwebdev.com
  • 2. Objectives 1Security Principles 2Authentication 3Cryptography 4HTTPS 5Security Best Practices 6Common Threat Vectors Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 3. Section 1 of 6 SECURITY PRINCIPLES Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 4. Security Overview The right way of addressing security is right from the beginning and all along the way so that you can plan for a secure system and hopefully have one in the end. Not only is a malicious hacker on a tropical island a threat but so too is a sloppy programmer, a disgruntled manager, or a naive secretary. Since websites are an application of networks and computer systems, you must draw from those disciplines to learn many foundational security ideas. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 5. Information Security The CIA Triad Information security is the holistic practice of protecting information from unauthorized users. Computer/IT security is just one aspect of this holistic thinking, which addresses the role computers and networks play. The other is information assurance, which ensures that data is not lost when issues do arise. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 6. Information Security The CIA Triad Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 7. Information Security The CIA Triad • Confidentiality is the principle of maintaining privacy for the data you are storing, transmitting, etc. • This is the concept most often thought of when security is brought up. • Integrity is the principle of ensuring that data is accurate and correct. • This can include preventing unauthorized access and modification, but also extends to disaster preparedness and recovery. • Availability is the principle of making information available when needed to authorized people. • It is essential to making the other two elements relevant, since without it, it’s easy to have a confidential and integral system (a locked box). Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 8. Security Standards This is really serious stuff In addition to the triad, there are ISO standards ISO/IEC 27002‐270037 that speak directly (and thoroughly) about security techniques and are routinely adopted by governments and corporations the world over. These standards are very comprehensive, outlining the need for risk assessment and management, security policy, and business continuity to address the triad. This chapter touches on some of those key ideas that are most applicable to web development. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 9. Risk Assessment and Management Risk assessment uses the concepts of • actors, • impacts, • threats, and • vulnerabilities to determine where to invest in defensive countermeasures. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 10. Actors Risk Assessment The term “actors” refers to the people who are attempting to access your system. They can be categorized as • Internal • External • Partner Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 11. Actors The three amigos • Internal actors are the people who work for the organization. Although they account for a small p g percentage of the attacks, they are especially dangerous due to their internal knowledge of the systems. • External actors are the people outside of the organization. It turns out that more than three quarters of external actors are affiliated with organized crime or nation states. • Partner actors are affiliated with an organization that you partner or work with. Quite often partners are granted some access to each other’s systems ( to p place , orders, for p ) example). Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 12. Impact what systems were infiltrated and what data was stolen or lost? • A l loss f of il bili availability prevents users f from i accessing some or all of the systems. This might manifest as a g denial of service attack, or a SQL injection attack (described later), where the payload removes the entire user database, preventing logins from registered users. • A loss of confidentiality includes the disclosure of confidential information to a (often malicious) third party. This could manifest as a cross‐site script attack where data is stolen right off your screen or a full‐fledged database theft where credit cards and passwords are taken. • A loss of integrity changes your data or prevents you from having correct data. This might manifest as an attacker hijacking a user session, perhaps placing fake orders or changing a user’s home address. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 13. Threats STRIDE A threat refers to a particular path that a hacker could use to exploit a vulnerability and gain unauthorized access to your system. A flood destroying your data center is a threat just as much as malicious SQL injections, buffer overflows, denial of service, and cross‐site scripting attacks. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 14. Threats Categorize threats with Stride • S fi Spoofing – Th The k attacker uses someone l ’ else’s i f i information to access the System. • Tampering – The attacker p g modifies some data in nonauthorized ways. • Repudiation – The attacker removes all trace of their attack, so that they cannot be held accountable for other damages done. • Information disclosure – The attacker accesses data they should not be able to. • Denial of service – The attacker prevents real users from accessing the systems. •• Elevation of privilege – The attacker increases their privileges on the system thereby getting access to things they are not authorized to do. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 15. Vulnerabilities The holes in your armor Once vulnerabilities are identified, they can be assessed for risk. Some vulnerabilities are not fixed because they are unlikely to be exploited exploited, while others are low risk because the consequences of an exploit are not critical. The top five classes of web vulnerability are: 1. Injection 2. Broken authentication and session management 3. Cross‐site scripting 4. Insecure direct object references 5. Security misconfiguration Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 16. Assessing Risk Putting it all together For our purposes, it will suffice to summarize that in risk assessment you would begin by identifying the actors actors, vulnerabilities, and threats to your information systems. The probability of an attack, the skill of the actor, and the impact of a successful penetration are all factors in determining where to focus your security efforts. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 17. Assessing Risk A visual way of assessing threats Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 18. Policies One part of your defenses • Usage policy defines what systems users are permitted to use, and under what situations. A company may, p y y for example, prohibit social networking while at work. Usage policies are often designed to reduce risk by removing some attack vector. • Authentication policy controls how users are granted access to the systems. • Legal policies define a wide range of things including data retention and backup policies as well as accessibility requirements (like having all public communication well organized for the blind). Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 19. Policies Please don’t make me change my password every day Password policies can stipulate • the characteristics of acceptable passwords, and • expiration of passwords. Ironically, draconian password policies introduce new attack vectors, nullifying the purpose of the policy at the first place. Where authentication is critical, two‐factor authentication should be applied in place of password policies that do not increase security. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 20. Business Continuity There is material enough for an entire courses here Part of a secure system is being able to access it in the case of the unforeseen. You should consider • Administrator Password Management • Backups and Redundancy • Geographic Redundancy • Stage Mock Events • Auditing you systems Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 21. Secure By Design People are bad Secure by design addresses that there are malicious users out there. By continually distrusting user input (and even internal values) throughout the design and implementation phases, you will produce more secure software than if you didn’t consider security at every stage. Techniques can be applied at every stage of the software development life cycle to make your software Secure By Design. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 22. Secure By Design Here’s what we do Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 23. Secure By Design Code Reviews In a code review system, programmers must have their code peer‐reviewed before committing it to the repository. In addition to peer‐review, new employees are often assigned a more senior programmer who uses the code review opportunities to point out inconsistencies with company style and practice. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 24. Secure By Design Unit Testing Unit testing is the principle of writing small programs to test your software as you develop it. Usually the units in a unit test are a module or class, and the test can compare the expected behavior of the class against the actual output. If you break any existing functionality, a unit test will discover it right away, saving you future headache and bugs. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 25. Secure By Design Pair Programming Pair programming is the technique where two programmers work together at the same time on one computer. • One programmer drives the work and manipulates the mouse and keyboard while • the other programmer can focus on catching mistakes and high‐level thinking. After a set time interval the roles are switched and work continues. Like a continuous code review. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 26. Secure By Design Security Testing Security testing is the process of testing the system against scenarios that attempt to break the final system. It can also include penetration testing where the company attempts to break into their own systems to find vulnerabilities as if they were hackers. Whereas normal testing focuses on passing user requirements, security testing focuses on surviving one or more attacks that simulate what could be out in the wild. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 27. Secure By Design Secure by Default Systems are often created with default values that create security risks (like a blank password). Secure by default aims to make the default settings of a software system secure, so that those type of breaches are less likely even if the end users are not very knowledgeable about security. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 28. Social Engineering In Computer Security Social engineering is the human part of information security that increases the effectiveness of an attack. No one would click a link in an email that said: • click here to get a virus, but they might click a link to: • get your free vacation. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 29. Social Engineering Phising Phishing scams such as the Spanish Prisoner or Nigerian Prince Scams. Users might be tricked into disclosing information or even sending money in the hopes of freeing up even more. Good defenses include: • spam filters • good policies, with users trained not to click links in emails Some organizations go so far as to set up false phishing scams that target their own employees to see which ones will divulge information to such scams. Those employees are then etrained orterminated. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 30. Security Theather Nothing to see here folks Security theater is when visible security measures are put in place without too much concern as to how effective they are at improving actual security. This is often done in 404 pages where a stern warning might read: Your IP address is XX.XX.XX.XX. This unauthorized access attempt has been logged. Any illegal activity will be reported to the authorities. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 31. Section 2 of 6 AUTHENTICATION Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 32. Authentication Authentication is the process by which you decide that someone is who they say they are and therefore permitted to access the requested resources. Whether • getting entrance to an airport, • getting past the bouncer at the bar, or • logging into your web application, you have already seen authentication in action. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 33. Authentication Factors the things you can ask someone for Authentication factors are the things you can ask someone for in an effort to validate that they are who they claim to be. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 34. Authentication Factors the things you can ask someone for • Knowledge factors are the things you know Passwords, PIN, Challenge Question • Ownership factors are the things that you possess Key, FOB, Card, Mobile Phone • Inherence factors are the things you are Fingerprint, signature, DNA, gait Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 35. Single Factor Authentication How many factors do you need? Single‐factor authentication is the weakest and most common category of authentication system where you ask for only one of the three factors. • Know a password • Posses an access card • Fingerprint access on your mobile phone When better authentication confidence is required, more than one authentication factor should be considered Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 36. Multi Factor Authentication More than one. Multifactor authentication is where two distinct factors of authentication must pass before you are granted access. The way we all access an ATM machine is an example of two‐factor authentication: • you must have both the knowledge factor (PIN) and • the ownership factor(card) Multifactor authentication is becoming prevalent in consumer products as well: • your cell phone is used as the ownership factor alongside • y your p password as a g knowledge f factor. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 37. Third Party Authentication Let someone else worry about it Many popular services allow you to use their system to authenticate the user and provide you with enough data to manage your application. Third‐party authentication schemes like OpenID and oAuth are popular with developers and are used under the hood by many major websites including Amazon, Facebook, Microsoft, and Twitter, to name but a few. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 38. OAuth 3rd party Authentication requires some effort OAuth uses four user roles • The resource owner is normally the end user who can gain access to the resource (though it can be a computer as well). • The resource server hosts the resources and can process requests using access tokens. • The client is the application making requests on behalf of the resource owner. • The authorization server issues tokens to the client upon successful authentication of the resource owner. Often this is the same as the resource server. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 39. OAuth An overview Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 40. Authorization Not the same as authentication Authorization defines what rights and privileges a user has once they are authenticated. • Authentication grants access vs • Authorization defines what the user with access can (and cannot) do. The principle of least privilege is a helpful rule of thumb that tells you to give users and software only the privileges required to accomplish their work. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 41. Authorization Not the same as authentication Some examples in web development where proper authorization increases security include: • Using a separate database user for read and write privileges on a database • Providing each user an account where they can access their own files securely • Setting permissions correctly so as to not expose files to unauthorized users • Ensuring Apache is not running as the root account Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 42. Section 3 of 6 CRYPTOGRAPHY Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 43. Cryptography Secret Messages Being able to send a secure message has been an important tool in warfare and affairs of state for centuries. At a basic level we are trying to get a message from one actor (we will call her Alice), to another (Bob), without an eavesdropper (Eve) intercepting the message. Since a single packet of data is routed through any number of intermediate locations on its way to the destination, getting your data (and passwords) is as simple as reading the data during one of the hops unless you use cryptography. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 44. Cryptography The problem Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 45. Cryptography The goal Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 46. Cryptography Some key terms A cipher is a message that is scrambled so that it cannot easily be read, unless one has some secret key. The key can be a number, a phrase, or a page from a book. What is important in both ancient and modern cryptography is to keep the key a secret between the sender and the receiver. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 47. Cryptography Substitution ciphers A substitution cipher is one where each character of the original message is replaced with another character according to the encryption algorithm and key. •• Caesar • Vigenere • One Time Pad • Modern Block Ciphers Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 48. Caesar Substitution ciphers The Caesar cipher, named for and used by the Roman Emperor, is a substitution cipher where every letter of a message is g replaced with another letter, by shifting the alphabet over an agreed number (from 1 to 25). The message HELLO, for example, becomes KHOOR when a shift value of 3 is used Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 49. The problem with lousy ciphers Letter distribution is not flat The frequency of letters (and sets of two and three letters) is well known If you noticed the letter J occurring most frequently, it g might well be the letter E Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 50. The problem with lousy ciphers Letter distribution is not flat Any good cipher must therefore try to make the resulting cipher text letter distribution relatively flat so as to remove any trace of the telltale pattern of letter distributions. Simply swapping one letter for another does not do that, necessitating other techniques. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 51. Vigenère Early attempt to flatten letter distribution of ciphers The Vigenère cipher, named for the sixteenth‐century cryptographer, uses a keyword to encode a message. The key phrase is written below the message and the letters are added together to form the cipher text as illustrated Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 52. One Time Pad Vigenere with an infinitely long key The one‐time pad refers to a perfect technique of cryptography where Alice and Bob both have identical copies of a very long sheet of numbers, randomly created Claude Shannon famously proved that the one‐time pad is impossible to crack However, it is impractical to implement on a large scale and remains a theoretical benchmark that is rarely applied in practice. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 53. Modern Block Ciphers Ciphers in the computer age block ciphers encrypt and decrypt messages using an iterative replacing of a message with another scrambled message using 64 or 128 bits at a time. • The Data Encryption Standard (DES) and its replacement, • The Advanced Encryption Standard (AES) Are two‐block ciphers still used in web encryption today Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 54. DES illustration Pretty simple, no? Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 55. Symmetric Key Problem How to exchange the key? All of the ciphers we have covered thus far use the same key to encode and decode, so we call them symmetric ciphers. The problem is that we have to have a shared private key. How? • Over the phone? • In an email? • Through the regular mail? • In person? Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 56. Public Key Cryptography Solves the problem of key exchange Public key cryptography (or asymmetric cryptography) solves the problem of the secret key by using two distinct keys: • a public one, widely distributed • another one, kept private Algorithms like the Diffie‐Hellman key exchange allow a shared secret to be created out in the open, despite the presence of an eavesdropper Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 57. Diffie-Hellman key exchange Solves the problem of key exchange Not used extensively anymore but the mathematics of the Diffie‐Hellman key exchange are accessible to a wide swath of readers. Modern algorithms (like RSA) apply similar thinking but with more complicated mathematics. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 58. Diffie-Hellman key exchange Solves the problem of key exchange The algorithm relies on the power associative rule, which states that: gab can be used as a symmetric key for encryption, but since only ga and gb are transmitted the symmetric key isn’t intercepted. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 59. Diffie-Hellman key exchange Solves the problem of key exchange To set up the communication, Alice and Bob agree to a prime number p and a generator g for the cyclic group modulo p. • Alice then chooses an integer a, and sends the value ga mod p to Bob. • Bob also chooses a random integer b and sends gb mod p back to Alice. • Since gab = gba, Bob and Alice now have a shared secret key that can be used for symmetric encryption algorithms such as DES or AES. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 60. Diffie-Hellman key exchange Solves the problem of key exchange Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 61. Digital Signatures Confirming the sender is authentic A digital signature is a mathematically secure way of validating that a particular digital document was • created by the person claiming to create it (authenticity), • Was not modified in transit (integrity), • and cannot be denied (non‐repudiation). Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 62. Digital Signatures Confirming the sender is authentic A digital signature is a mathematically secure way of validating that a particular digital document was • created by the person claiming to create it (authenticity), • Was not modified in transit (integrity), • and cannot be denied (non‐repudiation). The process of signing a digital document can be as simple as encrypting a hash of the transmitted message. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 63. Digital Signatures Confirming the sender is authentic Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 64. Section 4 of 7 HYPERTEXT TRANSFER PROTOCOL SECURE (HTTPS) Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 65. HTTPS Secure HTTP HTTPS is the HTTP protocol running on top of the Transport Layer Security (TLS). It’s easy to see from a client’s perspective that a site is secured by the little padlock icons in the URL bar used by most modern browsers Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 66. HTTPS Secure Handshakes Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 67. HTTPS Certificates The certificate that is transmitted during the handshake is actually an X.509 certificate, which contains many details including the algorithms used, the domain it was issued for, and some public key information. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 68. HTTPS Certificate Authorities A Certificate Authority (CA) allows users to place their trust in the certificate since a trusted, independent third party signs it. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 69. HTTPS Self-Signed Certificates Self‐signed certificates provide the same level of encryption, but the validity of the server is not confirmed. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 70. Section 5 of 67 SECURITY BEST PRACTICES Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 71. Best Practices Some good things to do It’s now time to discuss some practical things you can do to harden your system against attacks • Secure Data Storage • Monitor Your Systems • Audit and Attack Thyself Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 72. Secure Data Storage Not if, but when Even household names like Sony, Citigroup, Target and GE Money have had their systems breached and data stolen. If even globally active companies can be impacted, you must ask yourself: when (not if) you are breached, what data will the attacker have access to? Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 73. Data Storage Naïve credential storage example Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 74. Data Storage How can we make it better Two techniques that improve the integrity of your data. • Secure Hash • Salted Secure Hash Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 75. Data Storage Secure Hash Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 76. Data Storage Secure Hash A simple Google search for the string stored in our newly defined table: 5f4dcc3b5aa765d61d8327deb882cf99 brings up dozens of results which tell you that that string is indeed the MD5 digest for password. The technique of adding some noise to each password is called salting the password and makes your passwords very secure. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 77. Data Storage Secure Salted Hash Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 78. Monitor Your Systems You mean manually? There are tools that allow you to pre‐configure a system to check in on all your sites and servers periodically. Nagios, for example, lets you see the status and history of your devices, and sends out notifications by email as per your preferences. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 79. Monitor Your Systems Systems Monitors One of the best ways to mitigate damage is to detect an attack as quickly as possible, rather than let an attacker take their time in exploiting your system once inside. We can detect intrusion • directly by watching login attempts, and • indirectly by watching for suspicious behavior like a web server going down. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 80. Monitor Your Systems Systems Monitors There are tools that allow you to pre‐configure a system to check in on all your sites and servers periodically. Nagios, for example, lets you see the status and history of your devices, and sends out notifications by email as per your preferences. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 81. Monitor Your Systems Access Monitors As any experienced site administrator will attest, there are thousands of attempted login attempts being performed all day long Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 82. Monitor Your Systems Automated Intrusion Blocking For those of us less interested in writing that script from scratch, consider the well‐tested and widely used • Python script blockhosts.py or • failzban or • blockhostz. These tools look for failed login attempts by both SSH and FTP and automatically update hosts.deny files as needed. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 83. Audit and Attack Thyself Only if you own everything There are a number of companies that you can hire (and grant written permission) to test your servers and report on what they’ve found. If you prefer to perform your own analysis, you should be aware of some open‐source attack tools such as w3af, which provide a framework to test your system including SQL injections, XSS, bad credentials, and more. It should be noted that performing any sort of analysis on servers you do not have permission to scan could land you a very large jail term Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 84. Section 6 of 6 COMMON THREAT VECTORS Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 85. SQL Injection Using user input fields for evil. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 86. SQL Injection Using user input fields for evil. There are two ways to protect against such attacks: • sanitize user input, and • apply the least privileges possible for the application’s database user. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 87. Cross Site Scripting XSS In the original formulation for these type of attacks, a malicious user would get a script onto a page and that script would then send data through AJAX to a malicious party, hosted at another domain (hence the cross, in XSS). There are two main categories of XSS vulnerability: •• Reflected XSS • Stored XSS. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 88. Reflected XSS XSS Reflected XSS (also known as nonpersistent XSS) are attacks that send malicious content to the server, so that in the server response, the malicious content is embedded. Consider a login page that outputs a welcome message to the user, based on a GET parameter. A malicious user could try to put JavaScript into the page by typing the URL: index.php?User=<script>alert("bad");<script> Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 89. Reflected XSS XSS Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 90. Stored XSS Another XSS attack Stored XSS (also known as persistent XSS) is even more dangerous, because the attack can impact every user that visits the site. Consider a site where users can add comments to existing blog posts. A malicious user could enter a comment that includes malicious JavaScript The next time anyone logs in, their session cookie can be stolen. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 91. Stored XSS Another XSS attack Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 92. Thwarting XSS Filter User Input • strip_tags() removes all the HTML tags But hackers are sophisticated, so libraries such as HTMLPurifier or HTML sanitizer from Google allows you to easily remove a wide range of dangerous characters that could be used as part of an XSS attack $user= $_POST['uname']; $purifier = new HTMLPurifier(); $clean_user = $purifier‐>purify($user); Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 93. Thwarting XSS Escape Dangerous content You may recall HTML escape codes allow characters to be encoded as a code, preceded by &, and ending with a semicolon (e.g., < can be encoded as &lt;). if you escape the malicious script before sending users would receive the following: &lt;script&gt;alert(&quot;hello&quot;);&lt;/script&gt; Which does not get interpreted as JavaScript. The trick is not to escape everything. Only escape output that originated as user input since that could be a potential XSS attack vector (normally, that’s the content pulled from the database). Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 94. Insecure Direct Object Reference An insecure direct object reference is a fancy name for when some internal value is exposed to the user, and attackers can then manipulate these internal keys to gain access to things they should not have access to. For instance, if a user can determine that his or her uploaded photos are stored sequentially as /images/99/1.jpg, /images/99/2.jpg, . . . , they might try to access images of other users by requesting /images/101/1.jpg. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 95. Insecure Direct Object Reference One strategy for protecting your site against this threat is to obfuscate URLs to use hash values rather than sequential names. For example: Rather than store images as • 1.jpg, 2.jpg . . . Generate URLs like • 9a76eb01c5de4362098.jpg Using a one way hash. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 96. Insecure Direct Object Reference Another technique is to route requests for file assets through PHP scripts. This allows you to add an authorization check for every picture using the $_SESSION variable. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 97. DoS Denial of Service Denial of service attacks (DoS attacks) are attacks that aim to overload a server with illegitimate requests in order to prevent the site from responding to legitimate ones. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 98. DDoS Distributed Denial of Service Distributed Denial of service attacks have requests coming in from multiple machines, often as part of a bot army of infected machines under the control of a single organization or user Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 99. DDoS Defence Interestingly, defense against this type of attack is similar to preparation for a huge surge of traffic, that is, caching dynamic pages whenever possible, and ensuring you have the bandwidth needed to respond. Unfortunately, these attacks are very difficult to counter, as illustrated by a recent attack on the spamhaus servers, which generated 300Gbps worth of requests Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 100. Security Misconfiguration That’s a wide net There are many systems that can be badly configured: • Out‐of‐date Software • Open Mail Relays • More Input Attacks • Virtual Open Mail Relay • Arbitrary Program Execution Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 101. Out of Date Software Seems simple enough Most softwares are regularly updated with new versions that add features, and fix bugs. Sometimes these updates are not applied, either out of laziness/incompetence, or because they conflict with other software that is running on the system that is not compatible with the new version. The solution is straightforward: update your software as quickly as possible. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 102. Open Mail Relays Letting someone send mail as you An open mail relay refers to any mail server that allows someone to route email through without authentication. Open relays are troublesome since spammers can use your server to send their messages rather than use their own servers. This means that the spam messages are sent as if the originating IP address was your own web server! If that spam is flagged at a spam agency like spamhaus, your mail server’s IP address will be blacklisted, and then many mail providers will block legitimate email from you. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 103. Virtual Open Mail Relays Letting someone send mail as you despite a closed relay Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 104. Virtual Open Mail Relays Letting someone send mail as you despite a closed relay By transmitting the email address of the recipient, the contact form is at risk of abuse since an attacker could send to any email they want. Instead, you should transmit an integer that corresponds to an ID in the user table, thereby requiring the database lookup of a valid recipient. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 105. Arbitrary Program Execution Let them run any program they want Another potential attack with user‐coupled control relates to running commands in Unix through a PHP script. Functions like exec(), system(), and passthru() allow the server to run a process as though they were a logged‐in user.. To prevent this major class of attack, be sure to • sanitize input, with escapeshellarg() and be mindful of how user input is being passed to the shell. • applying least possible privileges will also help mitigate this attack. Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 106. Arbitrary Program Execution Let them run any program they want Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 107. What You’ve Learned 1Security Principles 2Authentication 3Cryptography 4HTTPS 5Security Best Practices 6Common Threat Vectors Randy Connolly and Ricardo Hoar Fundamentals of Web Development
  • 108. Buy the book, or Find out more at www.funwebdev.com Randy Connolly and Ricardo Hoar Fundamentals of Web Development Textbook to be published by Pearson Ed in Pearson Ed early 2014 Randy Connolly and Ricardo Hoar Fundamentals of Web Development http://www.funwebdev.com