EH JCE Class Notes
EH JCE Class Notes
Ethical Hacking
1
JCB1603 Ethical Hacking
UNIT-I Introduction To Hacking
Introduction to Hacking – Terminologies – Penetration Test – Vulnerability
Assessments versus Penetration Test – Pre-engagement – Rules of
Engagement - Penetration Testing Methodologies – OSSTMM – Categories of
Penetration Test – Types of Penetration Tests – Vulnerability Assessment
Summary – Reports - Red, Blue, and Purple Teams.
3
JCB1603 Ethical Hacking
UNIT-V Case Study
Authentication Bypass Attacks – Testing for Vulnerability – Automating with
Burp Suite – Session Attacks – SQL Injection Attacks – XSS (Cross-Site Scripting)
- Types of Cross-Site Scripting – Cross-Site Request Forgery (CSRF) – SSRF
Attacks.
4
JCB1613
Ethical Hacking
Lab
5
JCB1613 Ethical Hacking Lab
A) Ethical Hacking In Web:
Foot printing and Reconnaissance:
Performing Foot Printing using Google Hacking, Website Information,
Information about an archived website,
1. Extract Contents of a Website
2. Trace any Received Email
3. Fetch DNS Information.
B) Malware Threats: Worms, Viruses, Trojans:
1. Use Password Cracking, Dictionary Attacks.
2. Encrypt and Decrypt Passwords.
3. Simulate DoS Attack to Reduce the Speed of Website: Tool- HTTP Flooder.
4. ARP Poisoning in Windows, Ifconfig, ping, netstat, traceroute,
Steganography Tools.
5. Exploit an Attack on Computer System using IP Tools; Reverse IP Attack.
6
JCB1613 Ethical Hacking Lab
C) Developing and Implementing Malwares:
1. Creating a Simple Key logger in Python, Creating a Virus, Creating a Trojan
Scanning Networks, Enumeration and Sniffing,
i). Generate reports using Network port scanning, IDS tools, and sniffing tools.
ii). Practical of Nmap Security Scanner for Network Exploration &
Security Audits.
iii). Network Level Hijacking.
7
JCB1613 Ethical Hacking Lab
D) Ethical Hacking Web Servers, Web Applications:
1. Hacking a Website by Remote File Inclusion, Disguise as Google Bot to view
hidden
Content of a website.
2. Practical on Session Hijacking.
3. Phishing - Practical on Social Engineering.
4. Exploit SQL Injection Vulnerabilities using PySQL - Python Framework or
Similar.
Tools sqlmap.
5. Practical on Cross Site Scripting (XSS).
6. Practical on Server Side Request Forgery (SSRF).
7. Practical on Cross Site Request Forgery (CSRF).
8. Android hacking.
9. Burp Suite, a tool for performing security testing of web applications.
8
JCB1613 Ethical Hacking Lab
E) Wireless Network Hacking:
1. Hacking Wireless Networks: Email Tracker- to Trace the Route of any Email
or Ip:
Tool-Ip Locater, Email_Spidr, Aid4Mail.
2. Wifi Crack- to Crack the Keys of wifi tool- aircrack(linux) cain abel(windows),
Lan
Guard, Wireshark, BurpSuite.
F) Penetration Testing:
1. Penetration Testing using Metasploit.
9
JCB1613 Ethical Hacking Lab
D) Ethical Hacking Web Servers, Web Applications:
1. Hacking a Website by Remote File Inclusion, Disguise as Google Bot to view
hidden
Content of a website.
2. Practical on Session Hijacking.
3. Phishing - Practical on Social Engineering.
4. Exploit SQL Injection Vulnerabilities using PySQL - Python Framework or
Similar.
Tools sqlmap.
5. Practical on Cross Site Scripting (XSS).
6. Practical on Server Side Request Forgery (SSRF).
7. Practical on Cross Site Request Forgery (CSRF).
8. Android hacking.
9. Burp Suite, a tool for performing security testing of web applications.
10
Acknowledgement
we acknowledge this course content areas are used from CyBoK, CSA cloud
security alliance and publically available , open source content. Used for
knowledge sharing to improve cyber security awareness among the users.
The Cloud Security Alliance (CSA) is a non-profit organization that brings together experts and
community to build best practices and push forward cybersecurity for everyone.
https://www.isaca.org/
https://www.cybok.org/knowledgebase1_1/
https://www.cisa.gov/
https://attack.mitre.org/
https://github.com/cloudsecurityalliance
https://cloudsecurityalliance.org/
https://learn.microsoft.com/en-us/azure/security/fundamentals/overview
11
1: Introduction to
Ethical Hacking
12
Definition of a Penetration Tester
Sometimes called ethical
hackers though label is less
preferred
Specially trained
13
What Is a Penetration Tester?
• Can be employed full-time by a company
• May work freelance as a contractor
• Uses the techniques of malicious hackers against a
client
• Tactics and tools of pen tester are the same as a
hacker
• Intent and permission differ
14
Why Use Penetration Testing?
To test and evaluate
Taking on the pen tester security
role and the associated
skillset has become more To ensure compliance
important in today’s world with laws
as organizations have had To perform security
to take a more serious look audits
at their security posture
and how to improve it. To monitor
15
Origins of Penetration Testing
The term hacker is an old one
that can trace its origin back Evolved from traditional hacking
about 50 years to technology
enthusiasts of the 1960s.
Arose from a need to proactively
assess an organization’s security
These individuals were not like
the hackers of today; they were
simply those who were curious Created in response to hacker
and passionate about new activity
technologies and spent time
exploring the inner workings and Increasingly popular with rise in
limitations of early systems. cybercrime
16
Goals of a Penetration Tester
Hackers
• Have existed since the 1960s
• Originally technology enthusiasts
Original Hackers
• Tried out new technology
• Pushed boundaries
• Satisfied their curiosity
• Sought out undocumented features
19
Evolution of Internet
Hackers became more prolific and more dangerous not too
long after the availability of the Internet to the general public.
Newer
Introductio First attacks attacks
n of the were Later include
Internet mostly attacks financial
expanded mischievou became fraud,
possibilities s and malicious piracy,
and range benign credit card
theft
20
Opponents
In the “real world,”
Script
hackers tend to be kiddies
broken down into
different categories
to differentiate their Terrorists
White
Hats
skills and intent.
These are the Malicious
different types of
hackers you can
expect to encounter
in the real world. Black Hats Gray Hats
21
Examples of Cybercrimes
Over the past two Identity theft
decades crimes
associated with Theft of service
hacking have
evolved Fraud
tremendously.
Embezzlement
These are some Writing malware
broad categories
of cybercrime. Cyberstalking
22
Target: Apple iCloud
In August 2014, a massive data breach against Apple’s iCloud
was responsible for the public disclosure of hundreds of
celebrity pictures in various intimate moments. This breach
has so far resulted in lawsuits by many of those who had their
pictures stolen as well as a lot of negative publicity for Apple.
• Hackers broke into Apple’s cloud-based storage service.
• Several celebrities had their photos stolen and posted online.
• This breach resulted in numerous ongoing lawsuits.
23
Target 2014
In 2014 Target Corp The breach resulted in loss of
became a victim of a customer data.
large-scale cybercrime.
56 million records were
This breach was compromised during the incident.
responsible for the
The breach resulted in major
disclosure of an lawsuits.
estimated 56 million
different credit card
There was a decrease in business.
accounts.
24
JP Morgan 2014
83 million accounts In October 2014 JP Morgan revealed
compromised to the U.S. Securities and Exchange
Commission (SEC) that 83 million
accounts were compromised. The
Being actively investigated
by SEC in the United States breach is being actively investigated
by the U.S. Secret Service.
Generated numerous
lawsuits Early information points to the
breach being the result of attackers
discovering vulnerabilities in
Loss of customers software on JP Morgan’s own
computer systems.
25
Hacking and the Law
26
Addressing Legal Issues
1986 US Electronic
1974 US Privacy Act Communications Privacy
Act
1994 US Communications
1996 US Computer Fraud
Assistance for Law
and Abuse Act
Enforcement Act
Federal Information
Security Management Act
(FISMA)
28
Points to Remember
Remember as a pen tester that the law will impact your
actions and can result in prison time and/or fines if you do
things without permission.
Do not attempt to become an “armchair” lawyer. Rather,
understand that the law has an impact on what you do. Seek
legal assistance if you don’t fully understand the implications.
• The law will impact and guide many penetration tests.
• Seek legal assistance from a lawyer; don’t try to
interpret the law yourself.
29
Pen Testing Process
Once a pen tester is in Follows a series of steps
possession of the
necessary permissions to
Ensures tasks and goals are
conduct their activities, completed properly
the actual testing can
take place. May vary based on need
Planting Privilege
System Hacking
Backdoors Escalation
Covering Tracks
31
Conclusion of the Test
Once this is complete, the tester should be prepared to present
a detailed report of their findings. Presenting the report to the
client may be the last task the tester has or there may be
additional steps.
Potential outcomes
Presentation plus
Presentation of the Presentation plus
recommendation
report to the client recommendations
with remediation
32
2: System
Fundamentals
33
Operating Systems
OS requires intimate
The operating familiarity
system provides
Performs diverse
many features, but functions
OS Features
look underneath
Works with
the interface and hardware
you will find the
Acts as platform for
platform all applications
responsible for the
Provides monitoring
applications being and management
executed.
34
Common OS Features
•Graphical User Interface
•Network Support
•Multitasking
•Application Support
•Hardware Interface
35
Microsoft Windows
The majority of the systems will be running
Microsoft Windows in some form.
• The dominate OS
• Debuted in 1980s
• Installed on PCs and other devices
• Installed on 90% of computers
36
Windows Security Issues
• Windows is a huge target because of a large
installed base.
• An endless stream of countless updates are hard
to keep track of.
• The default configurations is left in place by
many consumers.
• A large number of older or legacy systems still
exist.
37
Apple’s Mac OS X
Has replaced
Windows Coexists in
systems in many
some environments
environments
Popular in
environments
Apple’s
where other
proprietary OS
Apple products
exist
38
Issues with Mac OS X
• The security solutions are lacking versus other
platforms.
• There is naivety among users who feel that
vulnerabilities do not exist.
• Features are generally all enabled and ready to
use even if the user is not using them.
39
Linux
• Advanced operating system suited to tech enthusiasts
• Popular among techies, but also useful as a desktop OS
• Popular with pen testers
• Widely used as a server OS
40
Facts About Linux
• Higher level of knowledge required
• Least privilege is the default security model
• Open source allows for scrutiny by public
• Extremely flexible
• Present on many embedded devices
41
Next Step, Networks
A pen tester must understand the dynamics of
networks.
42
Networks Types
Personal Local Municip Wide
Area Area al Area Area
Network Network Network Network
(PAN) (LAN) (MAN) (WAN)
Conceived in 1970s
• Is most popular
• Other protocols are essentially extinct
46
TCP vs. UDP
Transmission Control User Datagram Protocol
Protocol (TCP) (UDP)
Reliable Unreliable
Connection
Connectionless
Oriented
Stateless or
Less overhead than
connectionless
TCP
protocol
49
IP Addresses
50
Examples of IP Addresses
10.15.1.15 169.254.20.16
Written in dotted
• Separated by periods
decimal format
Four numbers
separated by decimal • 210.168.69.2
points
IP address is made up
• Network, Then Host
of network and host
52
Types of IP Addresses
IP Addresses
Type Assignment
53
Types of IP Addresses
IP
Network Host
Address
Subnetting is the
logical breakdown of
a network address
space into smaller
subnetworks.
54
About Ports
Ports identify and categorize types of traffic.
55
Port Ranges (TCP and UDP)
TCP and UDP
56
Network Hardware
57
Routers and Switches
Routers and switches are commonly used devices in networks.
59
Looking at Switches
60
Proxies
Protect internal systems
61
Firewalls
Caching of content
Packet filtering
Content filtering
Stateful packet
Examine traffic
filtering
headers
62
Placement of a Firewall
63
Intrusion Detection System
Intrusion detection system (IDS)
Is a passive device
64
Cryptography
Chapter 3
65
3:Cryptography
66
Goals of Cryptography
Confidentiality
Integrity
Goals Nonrepudiation
Authentication
67
Uses of Cryptography
Applications of cryptography
Symmetric and asymmetric cryptography
Working with hashing
Purposes of keys
Types of algorithms
Key management issues
68
Understanding Cryptography
• Legal issues
• Financial compliance
• Healthcare regulations
• Defense industries
• Acceptable algorithms
• Key strengths
69
What Is Cryptography?
As information has
Protects
changed and human information
threats.
70
Hieroglyphics as an Example
Intricate Egyptian hieroglyphics had spiritual and
patterns and religious significance
glyphs used in Not designed to preserve secrets
Egyptian
hieroglyphics Used to commune with other world
were commonly Usage restricted to royal family and religious
used for spiritual orders
and religious Could not be deciphered again until 1799
and discovery of Rosetta stone
reasons.
71
Modern Applications of Cryptography
Cryptography has even made some of the everyday
technologies that you use possible.
Plaintext or cleartext
Ciphertext
Algorithms
Keys
73
Introducing Symmetric Cryptography
All algorithms that fit into the symmetric variety use a single
key to both encrypt and decrypt (hence the name symmetric).
• Confidentiality
Symmetric • Speed
systems are
great at • Overall simplicity
• Providing authenticity
Drawbacks of • Key management
symmetric
systems • Lack of non-repudiation capability
74
Examples of Symmetric Algorithms
There are currently a myriad of symmetric algorithms
available; a Google search turns up an endless sea of
alphabet soup of algorithms.
Data Encryption Standard (DES)
Triple DES (3DES)
Blowfish
International Data Encryption Algorithm (IDEA)
RC2, RC4, RC5, RC6
Rijndael or Advanced Encryption Standard (AES)
Twofish
75
Asymmetric or Public Key Cryptography
The concept of public key Uses a key pair consisting of a
cryptography was intended to public key and a private key
overcome key management
problems in previous Ensures non-repudiation
systems.
Can enforce authentication
In the system each user
receives a pair of keys called Solves key management issues
the public key and the private
key. Each person’s public key Is slower compared to symmetric
is published, whereas the systems
private key is kept secret.
76
Asymmetric Encryption
Encryption
Hello Algorithm $%@@!
Key 1
Decryption
$%@@! Algorithm Hello
Key 2
77
About that Hash
A hash is a one-way function
Can be computed in one direction and not the other
Is a fixed length
Creates a unique output for every input
78
Hashing Algorithms
Hashing is used to detect changes in information: anything
that is hashed and then changed, even a small amount, will
result in an entirely different hash from the original.
Message Digest 2 (MD2)
Message Digest 4 (MD4)
Message Digest 5 (MD5)
Message Digest 6 (MD6)
HAVAL
RIPE-MD
Secure Hash Algorithm-0 (SHA-0)
Secure Hash Algorithm-1 (SHA-1)
Secure Hash Algorithm-2 (SHA-2)
79
Hashing in Digital Signatures
Zelda decrypts the
Seeing who the
hash value, thus
Sean creates a sender is, Zelda
validating the
message. retrieves Sean’s
identity of the
public key.
sender.
81
Certification Authorities
A certification authority (CA) handles digital
certificates.
83
Applications of Cryptography: IPSec
87
4: Footprinting
88
Losing Control of Information
•Business loss
•Information leakage
•Privacy loss
•Corporate espionage
89
What Is Footprinting?
The process of Process of researching a target carefully and looking
researching and for useful information
uncovering details
about your target Uncovering detailed information
will take some time
to complete, but Looking for information that may be useful during
the time will be later steps
well spent if it Using publically available resources to gain
helps you refine information
your actions later
Looking for carelessly or thoughtlessly shared
to make them more information in places such as social networking sites
effective.
90
What Types of Information to Look For?
• Technical sources such as network information,
applications, IP address ranges, and device information
• Administrative information such as organizational
structure, policies, hiring procedures, employee
information, phone directories, and more
• Physical details such as location data, facility data,
people details, and social interactions
91
How to Gather Information
Active methods are those that directly engage the target such
as using phone calls.
Look for e-mail addresses that may tell more about a specific
individual.
93
Examining a Website Offline
Downloading
content to a local
Examining a website can be made easier
drive allows for a
much closer and
by copying it to a local drive.
detailed
examination of Allows you to search the files and
website content information within at your leisure.
than may be
possible when Website downloaders are designed to
viewing the perform this task.
website online
through a browser.
94
What Can BlackWidow Do?
• What can it
download?
• Scriptable
• Network Spy
• Snapshot of web
pages
• Scan filters
• Support for
customizable scans
95
Downloading Sites with Wget
Is noninteractive
96
What Else to Learn from a Website
Additional information is
available with extra effort.
99
Google Hacking Keywords
cache will display the version of a web page that Google contains in its
cache.
• Usage: cache:<website name>
link is used to list any web pages that contain links to the page in the
query.
• Usage: link:<website name>
site will restrict the search to the location specified.
• Usage: <keyword> site:<website name>
allintitle will return pages with specified keywords in their title.
• Usage: allintitle:<keywords>
allinurl will only return results with the specific query in the URL.
• Usage: allinurl:<keywords> 100
Using Google Alerts
Alerts are a feature present in many search engines that
notify you when something that fits your search criteria has
been posted.
• Google alerts are a customized automated search.
• They can be built to look for details that are useful.
• They can be used to keep an eye on a search while you
work on other tasks.
• Up to 1,000 alerts can be assigned to an e-mail address.
101
Searching for People
Spokeo: www.spokeo.com
Pipl: www.pipl.com
Yasni: www.yasni.com
Zabasearch: www.zabasearch.com
Intelius: www.intelius.com
ZoomInfo: www.zoominfo.com
Infospace: www.infospace.com
KGB: www.kgbpeople.com
People: www.peepdb.com
Radaris: www.radaris.com
102
Determining Location
•Google
Earth
•Google
Maps
•Google
Streetview
•Webcams
103
Using Social Networking
Because of the nature Useful tool for information gathering
of these services and
their tendency to skew Common to encounter over-sharing of
information accidentally or deliberately
toward openness and
ease of sharing
Easy to encounter information leakage
information, an
attacker does not have
to put in a tremendous Drawback is openness of networks
amount of work to
learn useful details. Easy to collect information
104
Popular Social Networking Sites
There are several
social networks you
can use to search for Facebook Twitter Google+
information, each
with its own built-in
Instagra
search function LinkedIn
m
Tumblr
YouTube
Twitter
Foursquare
Instagram
Picasa
Panaramio
Flickr
106
Looking Up Financial Information
Services such as Yahoo, Google, CNBC, Financial data can reveal useful
Usatoday, and countless others information about a company.
provide information about a company
Public companies can be searched via
that may not be readily available stock symbol.
through other means.
Competitors may also have useful
information about the target.
Employee profile
Hardware information
Software information
108
Working with Email as an Information Source
For a malicious party
Value is in email’s content and volume
and a pen tester, the
information carried
Politemail can allow for the
by this medium is tracking of information
staggering and is
valuable to an WhoReadMe can also allow for the
attacker looking for tracking of email
information of all
OS, browser type, and installed
types. ActiveX controls can be found in email
109
Using Whois
Whois is a utility designed to allow
Cross-platform utility for
you to collect information about a looking up domain
domain name or web address. information
Should be cross-checked
as information may be
anonymous
110
Social Engineering
Inside every environment is the human being. This is in most cases
the weakest and easiest component to target. Human beings tend
to be one of the easiest places to extract information from.
• Baiting
• Phishing
• Spear phishing
• Pretexting
• Tailgating
• Eavesdropping
• Shoulder surfing
• Dumpster diving 111
Summary
• Wealth of resources for gaining information.
• Most are easily accessible.
• Research should be meticulous.
• A healthy amount of time should be spent on footprinting.
• Thorough research will pay off later.
• Be mindful of documentation.
112
5: Scanning
113
The Role of Scanning
Each scan type is like a piece of a larger puzzle that
can be assembled to gain a clearer view of the overall
target.
• Ping sweep
• Port scanning
• Vulnerability scanning
114
Getting Started with Scanning
Network scanning is an
IP addresses of live systems
intense and methodical
process of uncovering Lists of open and closed ports
the structure of the
Operating system versions
network and hosts on
it. MAC addresses
Ping is used diagnostically to ensure that Uses the Internet Control Message
the host computer the user is trying to Protocol (ICMP)
reach is actually operating. Ping works Sends a packet to a remote system
and waits for a response
by sending an Internet Control Message
Protocol (ICMP) Echo Request to a If no response within a set time, the
target is listed as unreachable
specified interface on the network and
waiting for a reply. 117
Angry IP Scanner
• Common scanner used to perform ping scans
• Can scan a range of IP addresses and their ports
• Pings each address to determine whether it’s alive
• Can scan a range of IP addresses extremely fast
• Can save results to a file for later use
118
Introducing NMAP
The utility is used for everything
from performing network Flexible
inventory to security auditing as Powerful
well as monitoring systems.
Portable
Easy
Free
Well documented
Supported
119
What Is a Port Scan?
Used to identify the open and
closed ports on a system
A port is a virtual endpoint on a
system
Examples are port 80 for HTTP and
21 for FTP
Port scanning has legitimate uses in When combined with an IP
address, they form a socket
managing networks, but port
scanning also can be malicious in A socket identifies which service to
connect to on a system
nature if someone is looking for a
weakened access point to break Port scans allow an attacker to
locate potential entry points
into your computer. 120
TCP and the Three-Way Handshake
TCP establishes connections
Ports can be TCP or UDP.
and then verifies that each and
every packet makes it to their
destination in the right order. TCP is a connection-oriented protocol.
To accomplish this, TCP uses
The three-way handshake is used to establish
the three-way handshake. a connection.
The completion of three-way handshake is
used before sending packets.
The three-way handshake does not handle
security.
TCP also provides sequence numbers for the
reassembly of data.
121
User Datagram Protocol (UDP)
No
Much like
UDP does not guarantees Advantage
UDP is TCP, UDP
make that data is low
stateless sends
connections will arrive at overhead
packets
destination
122
TCP Flags
123
TCP Full Connect Scan
Utilizes the three-way handshake
124
Half Open Scans
125
XMAS Scan
A packet is sent with PSH, URG, and FIN all
set at once
126
FIN Scan
Occurs when a packet is sent with the FIN
flag set
127
Fragmenting
Fragmenting breaks up
packets
Is reassembled by target
129
Vulnerability Scanners
These tools Used to identify known vulnerabilities
function by
checking coding, Not typically stealthy
ports, variables,
Generally performed by automated
banners, and many means
other potential
May only catch problems that are
problems areas already known
looking for issues.
Not a good choice if trying to simulate
an attack
130
Providing Cover with Proxies
131
Summary
• Scanning requires a good understanding of
networking technologies.
• Enumeration follows scanning.
• Enumeration seeks to reveal information
from a system.
• Enumeration is an active measure.
• Information can include usernames, group
information, printer data, and other data.
132
6: Enumeration
133
What Is Enumeration?
134
Enumeration
You can expect to gain Network resources and shares
even more information
during this step as you are Users and groups
digging deeper and
gathering information Routing tables
such as usernames, host
Auditing and service settings
names, share names,
services, application data, Applications and banners
group information, and
much more. SNMP and DNS details
135
What to Uncover and How
The process of enumeration is finding out about what
services are running, including versions, open shares,
account details, or possible points of entry. One such target
is SMB.
136
Ports of Interest
• TCP 53: This is used for DNS zone transfers.
• TCP 135: This is used by email clients to connect to email servers.
• TCP 137: NBNS provides name resolution services for the NetBIOS
protocol.
• TCP 139: This is for NetBIOS Session Service or SMB over NetBIOS.
• TCP 445: SMB over TCP or Direct Host improves network access.
• UDP 161: SNMP is a protocol used for network management.
• TCP/UDP 389: LDAP is used by many directory applications.
• TCP / UDP 3368: This is the Global Catalog Service associated with Active
Directory.
• TCP 25: SMTP is used for the transmission of messages.
137
NetBIOS
Commonly exploited service
138
NULL Sessions and NetBIOS
This feature is used to allow clients or endpoints of a connection to access
certain types of information across the network.
List of
List of
users and
machines
groups
Users
List of
and host
shares
SIDs
Information includes user IDs, share names, security policy settings, users
currently logged in, and more.
Windows XP and Windows Server 2003 are not vulnerable to null session
attacks.
Patches won’t fix the issue, and most hardening techniques won’t keep it
from being exploited.
140
Using a NULL Session
• Requires a short list of commands
• Main command is the “net” command
• To connect to a remote session, use:
• net use \\<machine name> “/user:”
• To view shares on a remote system, use:
• net view \\<machine name>
• To connect to a remote share, use:
• net use <drive letter> \\<machine name>\<shared folder
name>
141
Extracting from SNMP
SNMPWalk is an open source
Retrieves information from SNMP
tool that was part of the Net-
SNMP project at Carnegie
Mellon University in the early
Preys upon plaintext information
1990s when SNMP was first
deployed.
Queries devices to determine if
information is kept secret
142
PsTools Suite for Enumeration
Freeware utility
144
What About Metasploit?
The Metasploit framework was
introduced as a research Metasploit was designed for
project by the well-known security research and assessments
security researchers H.D.
Moore and spoonm. Contains numerous exploits to be
used
145
Summary
• Enumeration follows scanning.
• Enumeration seeks to reveal information from a
system.
• Enumeration is an active measure.
• Information can include usernames, group
information, printer data, and other data.
146
7: System Hacking
147
Gaining Access
•What is gaining access?
• Breaking passwords
• Opening up a system
• Can lead to further actions
148
Password Cracking
Passwords are the most widely used form of
The ability to crack authentication.
passwords is a Usernames and passwords are a commonly
required skill to you targeted item.
as a penetration Enumeration may have gathered usernames in
some cases.
tester as passwords
represent an Password cracking is used to obtain passwords.
effective way to gain Password cracking refers to a group of
access to a system. techniques.
149
What Makes a Password Susceptible to Cracking?
Passwords are Passwords that contain letters, special characters, and numbers:
stud@52
intended to be Passwords that contain only numbers: 23698217
something Passwords that contain only special characters: &*#@!(%)
that is easy to Passwords that contain letters and numbers: meetl23
remember but Passwords that contain only uppercase or only lowercase:
POTHMYDE
at the same Passwords that contain only letters and special characters:
rex@&ba
time not easily Passwords
123@$4
that contain only special characters and numbers:
154
Man-in-the-Middle
This type of attack takes place when two different parties
communicate with one another with a third party listening in.
155
Active Online
Attacks that fit into this category are those that
require direct interaction with a system in an
attempt to break a password.
• Guessing
• Malware
156
Password Guessing
Password guessing is a Pet’s
valid and somewhat name
effective form of
Best Spouse’s
obtaining a password. friend name
157
Using Malware
In February 2005, Joe Lopez, a businessman from Florida, filed a suit
against Bank of America after unknown hackers stole $90,000 from his
Bank of America account. The money had been transferred to Latvia.
An investigation showed that Mr. Lopez’s computer was infected with a
malicious program, Backdoor.Coreflood, which records every keystroke
and sends this information to malicious users via the Internet.
158
Using Malware
• Keyloggers are
a good example
of malware.
• Keyloggers can
be used to gain
countless
pieces of
information.
159
Offline
• Rainbow tables
• Uses precomputed hashes to identify password
160
What Is a Rainbow Table?
Rainbow tables are the end result of a
process where every possible
combination of characters is generated
within certain limits.
• Reduces difficulty in brute-force
methods
• Generates hashes for every possible
password
• Takes time to create hash table
• Faster than other types of attacks
• Effective against LAN Manager systems
161
Privilege Escalation
Not every system Increasing access for
compromised account
hack will initially
provide an
Typically, breached
unauthorized user account will not have
broad privileges
with full access to the
Privilege escalation
targeted system. In Raising privileges to a
those circumstances, level where more
actions can take place
privilege escalation is
required. Can be vertical or
horizontal
162
Privilege Escalation Types
Privilege escalation is the process where the access that is
obtained is increased to a higher level where more actions
can be carried out. The reality is that the account accessed
typically will end up being a lower privileged one and
therefore one with less access.
• Vertical
• Raising the privileges of an account that has already
been compromised
• Horizontal
• Compromising one account and then another and
another, each with an increased level of access
163
Tools for Privilege Escalation
ERD Commander
Kali Linux
Parrot OS
164
Opening a Shell
LAN Turtle is a remote access pen What LAN Turtle
testing tool enables is the
ability to
Housed with USB network adapter perform several
attacks such as
Allows opening of a remote shell on man-in-the-
a system
middle, sniffing,
With shell, open commands can be and many
transmitted to remote system others.
165
Running Applications
When an attacker is
executing applications on a
Backdoors
system, they are doing so
with specific goals in mind.
Crackers
Keyloggers
Malware
166
Covering Tracks
Eliminate or
Important step
Leave no trace alter logs, error
in removing
behind messages, and
evidence
files
More evidence
or tracks
means greater
chance of
being detected
167
Working with Log Files
Surgical
Disabling of May prevent removal of
Prevent leaving
auditing on a or slow entries in log
of information
system detection files is
possible
168
Alternate Data Streams
ADS was introduced into the Windows NTFS file system
starting in Windows NT 3.1. This was implemented in
order to allow compatibility with the Macintosh
Hierarchical File System (HFS).
170
8: Malware
171
An Overview of Malware
Malware has quickly Malware is an umbrella
become one of the term for several forms of
leading problems bad software.
plaguing modern Malware has become more
technology, with several destructive and stealthy.
Malware
million new forms of
malware created every It has evolved to more
readily steal information.
year (by some estimates
around 1,200 new It may be useful, but it’s
potentially risky to use
pieces are created each during a test.
hour). 172
Forms of Malware
Malware is anything that Viruses
consumes resources and
time while providing Worms
nothing in return and Trojan horses
uses those resources to Rootkits
perform some operation
that is counter to the Spyware
system owner’s best Adware
interests. Ransomware
173
Authors of Malware
Skilled
Criminals
programmers
174
A Closer Look at the Creators
Professional
and Researchers
experienced and testers
programmers 175
Virus Family Tree
When talking about MBR virus
viruses, it is important File infector virus
that you have an
Macro virus
understanding that not
all viruses are created Service injection viruses
equal, and in fact there Multipartite
is a whole family of Polymorphic
virii.
Encrypted
176
What Is a Worm?
Unlike their virus Self-propagating
malicious code
cousins that
require a host Does not need user
program to start input
their dirty work, Requires a system
Worm
worms just need a to be vulnerable
system to be
Replicates and
vulnerable to start spreads
their own self-
replicating process. Spreads rapidly
177
Worm Example: Slammer
Doubled every 8.5 seconds for first 3 minutes
of life
178
Spyware
This type of Torrent sites
software operates
Instant messaging
in the background
and out of a user’s Email
attachments
Forms
sight quietly
collecting Physical access
Relies on
Host carries
social
malicious
engineering
payload Trojan to activate
horse
go unnoticed, their
Spy
popularity has
exploded, and Steal passwords
they've become the
malware of choice Use your computer as a zombie
for many online
criminals. Send SMS messages
181
Summary
• Types of backdoors
• Type of Trojans
• Categories of malware
• Malware creation kits
• Importance of keyloggers
182
9: Sniffers
183
What Is Sniffing?
Sniffers are a • Is the act of viewing information
broad category as it flows over the network
that • Can be performed with
hardware or software
encompasses
• Preys on vulnerable networks
any utility that and protocols
has the ability to • Passwords (from email, the
perform a Web, SMB, FTP, SQL, or
packet-capturing Telnet)
function. • Email text
184
Law Enforcement and Sniffing
Lawful interception Lawful interception is legally
(LI) is defined as sanctioned access to network data
legally accessing Must have authority in pursuit of
communications evidence or analysis
and network data
such as telephone Regulated by the law
calls or email
messages. Sometimes called wiretapping
185
Vulnerable Protocols
SMTP NNTP
HTTP POP
rlogin FTP
Insecure
Telnet IMAP
Protocols
Sniffers
Windump
189
Types of Sniffing
190
What Are Hubs?
191
Network Switches
• Switches
• Perform examination of each packet
• Look at source and destination of each packet
• Use information to direct traffic
• Separate network into collision domains
• Isolate network nodes from one another
When a packet is received by the switch, the
destination and source addresses and compares them
to a table of network segments and addresses.
192
Wireshark
• As of this writing, Wireshark reigns supreme as perhaps the best
sniffer on the market.
• Wireshark has been around for quite a while, and it has proven its
worth time and time again.
• Wireshark is natively available on Windows, Mac OS X, and Linux.
As of
193
tcpdump
tcpdump is an open source
network utility that is freely A command-line
available under the BSD packet sniffer
license. Intercepts traffic
in TCP/IP format
Can send output
to file
Known as being very
fast and efficient
194
Active Sniffing Close-Up
When sniffing is performed in a switched network, it is called
active sniffing.
Active sniffing means the network
has a switch instead of a hub.
195
MAC Flooding
A switch keeps track of MAC addresses received by writing them
to a content addressable memory (CAM) table. If a switch is
flooded with MAC addresses, it may easily overwhelm the
switch’s ability to write to its own CAM table.
Involves flooding the switch
with numerous requests
Overloads the CAM table in
the switch
Causes switch to fail and act
like a hub
196
ARP Spoofing
Denial of service
Man-in-the-
middle/sniffing
MAC flooding
Allows a system to
impersonate another
Can allow for the bypass of
any mechanism that uses a
MAC address to control traffic
198
SMAC
199
Sniffing Countermeasures
Use a hardware-switched network for the most sensitive
portions of your network.
Implement IP DHCP snooping on switches to prevent ARP
poisoning and spoofing attacks.
Implement policies preventing promiscuous mode on network
adapters.
Be careful when deploying wireless access points, knowing
that all traffic on the wireless network is subject to sniffing.
Encrypt your sensitive traffic using an encrypting protocol
such as SSH or IPsec.
200
Summary
• Sniffing allows the interception of network traffic.
• Sniffing targets vulnerable or insecure network
protocols.
• Sniffing uses packet sniffers to gather traffic.
• Sniffing comes in active and passive modes.
• Sniffing can be impacted by hubs and switches.
201
10: Social
Engineering
202
How Do Social Engineers Work?
Threats Ignorance
Trust Scarcity
Moral Human
Urgency
obligation element
203
Why Social Engineering Works
Social engineering is effective for a number of reasons,
each of which can be remedied or exploited depending on
whether you are the defender or the attacker.
• Lack of a technological fix
• Insufficient security policies
• Difficult detection
• Lack of training
204
Example of Social Engineering
• An unexpected phone call from your Internet service
provider (ISP) or Microsoft
• Tells you you’re either in danger (a virus or outdated
software) or missing something valuable
• Why it works:
• Exploits trust
• Exploits buzzwords
• Exploits scarcity
205
Example of Social Engineering
In the next phase, the attacker gains the user’s trust,
convinces the user a technical service is being provided,
and requires payment via credit card.
• Exploits lack of technical know-how
• Interacts with victim to build trust
• Acts as if providing a legitimate service
• Uses charade to obtain financial information
206
Example of Social Engineering
Leverages
Exploit fear target’s
ignorance
Stresses
Presents
urgency to
image of
force
authority
reaction
207
Signs of an Attack
• Use (or abuse) of authority
• Inability to provide contact information
• Making informal requests
• Excessive name dropping
• Excessive use of praise
• Discomfort when questioned
208
Social Engineering Phases
Social engineering, Use recon to gain details about a target.
like the other
attacks we have
explored, consists Select a specific individual or group who may have
what you need to get closer to the desired target.
of multiple phases,
each designed to
Forge a relationship with the intended victim
move the attacker through interaction.
one step closer to
the ultimate goal.
Exploit the relationship with the victim.
209
Impact of Social Engineering
After experiencing a
Economic loss
successful social
engineering attack,
businesses say they suffer Terrorism
from business disruption,
lost productivity, and lost Loss of privacy
revenue and need to undo
damage or conduct a Lawsuits and arbitrations
forensic analysis.
Temporary or permanent closure
210
Targets of Social Engineering
An attacker will look for targets of opportunity or
potential victims who have the most to offer.
• Receptionists
• Help desk personnel
• System administrators
• Executives
• Users
211
Dangers of Social Networking
Personal information
Photos
Location information
Friend information
Business information
Likes and dislikes
212
Information Found on Social Networking
Social networking Location information
has made the
attacker’s job Personal data
easier because of Company information
the volume of
Photos of private or secure
data and facilities
personal
Information on co-workers
information
available. Event or vacation information
213
Countermeasures Against Social Engineering
217
Signs of Identity Theft
One of the You see withdrawals that are unexplained.
most prominent
You don’t get your bills or other mail.
and rapidly
evolving threats Merchants refuse your checks.
is identity theft, Debt collectors call you about debts that aren’t
yours.
which falls You find unfamiliar accounts or charges on your
under the credit report.
Medical providers bill you for services you didn’t
heading of use.
social You get notice that your information was
compromised by a data breach.
engineering. 218
Protection Against Identity Theft
Formulate
Examine Be careful of Avoid using
your own
requests for applications standard
questions
personal that require security
where
information registration questions
possible
In many cases, the only thing standing between someone and your
money is a four- to six-digit number or a word or combination of
words.
219
Finding Out About Yourself
Spokeo Intellius
ZabaSearch
Facebook
People Search
LinkedIn Shodan
220
Summary
•What social engineering is
•How social engineering works
•Countermeasures
221
11: Denial of
Service
222
Goals of Denial-of-Service Attacks
Unavailability of a resource
Slow performance
224
Denial-of-Service Goals and Motivations
• Web server compromise
• Back-end resources
• Network or computer specific
• Extortion via a threat of a DoS attack
• Turf wars and fights between online gangs
• Anticompetition business practices
• Punishment for undesired actions
• Expression of anger and criticism
• Training for other attacks
• Self-induced
• No reason at all 225
Types of Attacks
A successful DoS • Type #1: Volumetric attacks
attack is a highly • 65% of attacks
noticeable event that • Eats resources
makes it a popular • Hard to mitigate
weapon of choice for • Type #2: Application-layer attacks
hacktivists, cyber • 17% of DDoS attacks.
vandals, extortionists, • HTTP flood is a form
and those looking to
make a point.
226
Forms of Denial of Service
Service request floods
SYN attack/flood
ICMP flood attack
Ping of death
Teardrop
Smurf and/or fraggle
Land
227
SYN Floods at Work
The basic idea behind SYN flooding • Attacker floods server with
utilizes the three-way handshake SYN packets with spoofed
that begins with a user sending a source address
“synchronize” (SYN) message to the • Server responds with
server. SYN/ACK reply to fake
source address
• No ACK reply server must
wait until half-open
connection times out
• Prevents legitimate users
from accessing the server
228
SYN Flood Countermeasures
231
Steps Leading to a Smurf Attack
•Huge numbers of ICMP requests are sent to the victim’s IP
address.
•The source destination IP address is spoofed.
•The hosts on the victim’s network respond to the ICMP
requests.
•This creates a significant amount of traffic on the victim’s
network, resulting in consumption of bandwidth and
ultimately causing the victim’s server to crash.
232
Countermeasures for Smurf Attacks
234
Ping of Death
236
Land Attack
Looks similar to Syn-Flood
Sometimes referred to as “infinite loop”
attack
Crashes a system by sending it a forged
packet
Packet has source and destination set to the
victim’s IP address
Makes system think it is sending itself a
message
Can crash or slow a system
237
Permanent Denial of Service
By exploiting Also known a Permanent Denial of Service
(PDoS)
security flaws or
misconfigurations, Phlashing is a form
permanent denial
Running a highly virtualized environment
of service (PDoS)
can destroy the Organizations highly dependent on IoT
firmware and/or
basic functions of Organizations with centralized security
gateways
system. Organizations that are considered critical
infrastructure
238
A Word About Buffer Overflows
A buffer overflow occurs
Occurs when a program
when a program or process attempts to store data in
tries to store more data in a memory
buffer (temporary data Can occur because of
storage area) than it was programming errors
intended to hold.
Can be uncovered in any
software
239
DDoS Attacks
A standard DoS Attacker compromises multiple hosts
attack can be
launched from a Hosts are used to execute the attack
single malicious
client, whereas a DoS is a one-on-one, smaller-scale attack
242
Summary
• Denial-of-service attacks
• How denial-of-service attacks work
243
12: Session
Hijacking
244
What Is Session Hijacking?
Session hijacking,
also known as TCP Session hijacking is roughly a stolen
session hijacking, is session.
a method of taking A session represents a
over a web user connection.
session by
Session hijacking incorporates the
surreptitiously same concepts as sniffing.
obtaining the
session ID and It can be used to take over
authenticated sessions.
masquerading as
the authorized user. 245
Understanding Session Hijacking
No account lockout for invalid session IDs
Insecure handling
Weak session ID generation algorithm
Indefinite session expiration time
Cleartext transmission
Small session IDs
246
Spoofing vs. Hijacking
Spoofing occurs when an attacking party impersonates an identity.
In hijacking, the attacker takes over an existing active session.
Sniffing
Monitoring
Session desynchronization
Session ID prediction
Command injection
247
Types of Session Hijacking
Active Passive
250
TCP Sequence Numbers
Sequence number describes order
of packets
32-bit number
251
Session Hijacking and Web Applications
Session hijacking at the application level focuses on gaining access to a
host by obtaining legitimate session IDs from the victim.
Embedded as a
hidden field
Embedded in a
Cookies
URL
Session
IDs
252
Application-Level Hijacking
Predicting session tokens
• /app/spo22022005131020
Session sniffing • /app/spo22022005141520
• /app/spo22022005171126
• /app/spo22022005213111
Man-in-the-browser attack
• Browser helper objects
Man-in-the-middle attack • Extensions
• API hooking
• JavaScript
253
Cross-Site Scripting
Cross-site • The attacker stores malicious code in the
vulnerable page.
scripting (XSS) is • The user authenticates in the application.
Stored attacks
a type of attack • The user visits a vulnerable page.
that can occur in • Malicious code is executed by the user’s
browser.
many forms, but
in general it • It is in the form of an email or via a different
web server.
occurs when data • It occurs when a party injects executable
Reflected
of some type attacks
code within an HTTP response.
• The code is not persistent and is not stored.
enters a web • It leverages JavaScript, VBScript, or other
application scripting languages where appropriate.
through an
untrusted source. 254
Session Fixation
A session ID is sent to a victim in a
malicious hyperlink for the victim to
click.
The victim is tricked into authenticating
to a target using an attacker-created
login form.
The attacker uses injection to insert
malicious code in the hyperlink.
The HTTP header response uses the
server to fix the session ID in the
victim’s browser.
255
Key Concepts
Blind hijacking
IP spoofing
Source routing
DNS spoofing
256
Network Session Hijacking
• Blind hijacking
• IP spoofing
• Source routing
• DNS spoofing
• ARP cache poisoning
• Desynchronizing the connection
257
Network Session Hijacking
Blind hijacking
IP spoofing
Source routing
DNS spoofing
261
Summary
•What is TCP or session hijacking?
•How is session hijacking performed?
•Different formats of session hijacking
•Active or passive session hijacks
•Results of a successful attack
262
Web Servers and Applications
Chapter 13
263
13: Web Servers
and Applications
264
Client and Server
Server administrators
Network
administrators
Roles
End users
Application
administrator
Application
developer
265
A Closer Look at Web Servers
Web server delivers content over HTTP or other protocols.
• Certificate support
Security
• Authentication support
features
• Security support and management
• Process management
Application • Server-side language
development • Database support
• Protocol listeners
Infrastructure as a Service
The cloud is a model (IaaS)
for creating shared
resources that can Platform as a Service
be dynamically (PaaS)
allocated and shared
on demand. Software as a Service
(SaaS)
271
A Closer Look at Web Applications
• Presentation layer
• Logic layer
• Data layer
272
What Is a Cookie?
Cookies are used to store data.
Authentication Application
Web server
process content
Session
tracking
Login
Data access
Permissions
Data store
Logout
Logic
274
Common Problems with Web Applications
• Flawed Web Design
• Too much revealed in code
• Presence of server information
• Presence of connection information
• Buffer Overflow
• Software-based issue
• Common vulnerability
• Can cause numerous issues
275
Other Attacks Against Web Applications
• Denial-of-service attack
• Distributed denial-of-service attack
• Ping or ICMP flooding attack
• Smurf attack
• SYN flooding
• Fragmentation attack
276
Banner Grabbing
Banner grabbing is an
activity that is used to
determine information
about services that are
being run on a remote
computer.
278
Common Flaws and Attack Messages
May be caused by
Misconfiguration
inexperience
Database
manipulation
Database
corruption
Input validation
Buffer overflows
Inconsistent data
279
Cross-Site Scripting
Cross-site scripting (XSS) is a type of attack that can occur in
many forms, but in general it occurs when data of some type
enters a web application through an untrusted source.
• The attacker stores malicious code into the vulnerable page.
Stored • The user authenticates in the application.
attacks • The user visits a vulnerable page.
• Malicious code is executed by the user’s browser.
281
Scripting Errors
Upload bombing
Sample scripts
Secure
Expires HttpOnly
Cookie
Path Domain
283
Session Hijacking and Web Applications
Session hijacking at the application level focuses on gaining
access to a host by obtaining legitimate session IDs from the
victim.
Embedded as a
hidden field
Embedded in a
URL Cookies
Session IDs
284
Summary
• Definition of a web server
• Definition of a web application
• Can take many forms
• Process and store data on server
285
14: SQL Injection
286
What Is SQL Injection?
SQL injection is where a database
SQL injection is typically a result
is attacked using a query
of flaws in an application.
language.
Alteration of data
Escalation of privileges
Denial of service
Data extraction
Destruction of data
Altering transactions
288
Web Applications
A web application is
software that is installed Browser
on top of a web server based
and is designed to
respond to requests,
process information,
and store information. Types
Mobile Client
apps based
289
Client and Server Web Applications
A server application The server application is on the web server.
is hosted on a web The client is a web browser or web-enabled
server and is application.
designed to be
Information is stored on the server.
accessed remotely
via a web browser Processing is done on the server.
or web-enabled
application. The end result is delivered to the user.
Database Types
Object-
Relational Distributed
Oriented
Database Database
Database
For all of its complexities, a database can be described as simply
a hierarchical, structured format for storing information for later
retrieval, modification, management, and other purposes.
292
The Structure of Web Applications
Presentation
Logic Layer Data Layer
Layer
293
Pieces of the Web Application Puzzle
Authentication Application
Web Server
Process Content
Session
Tracking
Login
Data Access
Permissions
Data Store
Logout
Logic
294
Common Problems with Web Applications
• Flawed Web Design
• Too much revealed in code
• Presence of server information
• Presence of connection information
• Buffer Overflow
• Software-based issue
• Common vulnerability
• Can cause numerous issues
295
Error Messages
May reveal too much
information
Should be suppressed or
sanitized
Detailed messages should
be accessible only in
development
Custom error message
pages may be a solution
296
Common Flaws and Attack Messages
• Misconfiguration
• May be caused by inexperience
• Input validation
• Database manipulation
• Database corruption
• Buffer overflows
• Inconsistent data
297
Locating a Target
299
Summary
• SQL injection
• Steps for performing SQL injection
• SQL injection techniques
• SQL injection in Oracle
• SQL injection in MySql
• Attacking SQL servers
• Automated tools for SQL injection
• Countermeasures to SQL injection
300
15: Hacking WiFi
and Bluetooth
301
802.11
• IEEE group responsible for defining interface between
wireless clients and their network access points in
wireless LANs
• First wireless standard was defined in 1997
• Standard was responsible for defining three types of
transmission at the Physical layer
• Diffused infrared : infrared transmission-based
• Direct sequence spread spectrum (DSSS): radio-based
• Frequency hopping spread spectrum (FHSS): radio-
based
302
802.11
• Specified WEP as an optional security protocol
• Specified use of 2.4 GHz industrial, scientific, and
medical (ISM) radio band
• Mandated 1 Mbps data transfer rate and optional 2
Mbps data transfer rate
• Most prominent working groups: 802.11b, 802.11a,
802.11i, and 802.11g
303
A Look at 802.11a
• Sets specifications for wireless data transmission of
up to 54 Mbps in the 5 GHz band
• Uses an orthogonal frequency division multiplexing
encoding scheme rather than FHSS or DSSS
• Approved in 1999
• Typically restricted to corporate deployments
304
A Look at 802.11b
• Establishes specifications for data transmission that
provides 11 Mbps transmission at 2.4 GHz band
• Sometimes referred to as “WiFi” when associated
with WECA-certified devices
• Uses only DSSS
• Approved in 1999
• First widely adopted wireless standard
• Deployed in home, small businesses, and corporations
• Being supplanted slowly by 802.11g and 802.11n
305
A Look at 802.11g
• Responsible for providing raw data throughput
over wireless networks at a throughput rate of
22 Mbps or more
• Draft created in January 2002; final approval in
2003
• Replaced 802.11b in many wireless deployments
306
A Look at 802.11i
• Responsible for fixing security flaws in WEP and
802.1x
• Hopes to eliminate WEP altogether and replace it
with Temporal Key Integrity Protocol (TKIP)
• Ongoing; not yet approved
307
Wired Equivalent Privacy (WEP)
• Optional security protocol for wireless local area
networks defined in the 802.11b standard
• Designed to provide same level of security as a wired
LAN
• Not considered adequate security without also
implementing a separate authentication process and
providing for external key management
308
Wireless LAN (WLAN)
• Connects clients to network resources using
radio signals to pass data through the ether
• Employs wireless access points (APs)
• Connected to the wired LAN
• Acts as radio broadcast stations that transmit
data to clients equipped with wireless network
interface cards (NICs)
309
How WEP Functions
• Employs a symmetric key to authenticate wireless
devices and to guarantee integrity of data by
encrypting transmissions
• Each of the APs and clients must share the same key
• Client sends a request to the AP asking for
permission to access the wired network
310
How WEP Works
• If WEP has not been enabled (default), the AP
allows the request to pass.
• If WEP has been enabled, the client begins a
challenge-and-response authentication process.
311
Vulnerabilities of WEP
• Problems related to the initialization vector (IV)
that it uses to encrypt data and ensure its
integrity
• Can be picked up by hackers
• Is reused on a regular basis
• Problems with how it handles keys
• Advanced techniques employed by hackers can
breech WEP in less than 30 seconds
312
Other WLAN Security Loopholes
• “War” techniques:
• War driving
• War flying
• War walking
• War ballooning
• Unauthorized users can attach themselves to WLANs
and use their resources, set up their own access
points, and jam the network.
• WEP authenticates clients, not users.
• Wireless network administrators and users must be
educated about inherent insecurity of wireless
systems and the need for care.
313
Conducting a Wireless Site Survey
1. Conduct a needs assessment of network users.
2. Obtain a copy of the site’s blueprint.
3. Do a walk-through of the site.
4. Identify possible access point locations.
5. Verify access point locations.
6. Document findings.
314
Summary
• The Many Faces of 802.11
• The Role of Wireless Application Protocol (WAP)
• Wired Equivalent Privacy (WEP)
315
16: Mobile Device
Security
316
Overview
• Quick Overview of Mobile Devices
• Mobile Threats and Attacks
• Countermeasures
317
Overview of Mobile Devices
• Mobile devices
–Mainly smartphones, tablets
• Sensors: GPS, camera, accelerometer, etc.
• Mobile hardware
• Mobile software
318
Mobile Threats and Attacks
• Data Leakage
• Unsecured Wi-Fi
• Network Spoofing
• Phishing attacks
• Spyware
• Broken cryptography
319
Device Malware
• iOS malware: very little
• Android malware growth keeps increasing
• Main categories:
• Trojans
• Monitoring apps/spyware
• Adware
• Botnets
320
Location Disclosure
• MAC, Bluetooth Addresses, IMEI, IMSI, etc. are
globally unique
• Infrastructure based mobile communication
• Peer-to-Peer ad hoc mobile communication
321
Mobile Access Control
• Very easy for attacker to control a mobile device
if he/she has physical access
• Especially if there’s no way to authenticate user
• Tempting target for thieves
• Theft of mobile devices increasing
• Need access controls for mobile devices
322
Authentication: Categories
•Authentication generally based on:
• Something supplicant knows
• Password/passphrase
• Unlock pattern
• Something supplicant has
• Magnetic key card
• Smart card
• Token device
• Something supplicant is
• Fingerprint
• Retina scan 323
Password Cracking
• Passwords are the most widely used form of
authentication
• Usernames and passwords are a commonly targeted
item
• Enumeration may have gathered usernames in some
cases
• Password cracking is used to obtain passwords
• Password cracking refers to a group of techniques
• Is an essential skill for penetration testers
324
What Makes a Password Susceptible to Cracking?
• Passwords that contain letters, special characters, and numbers:
stud@52
• Passwords that contain only numbers: 23698217
• Passwords that contain only special characters: &*#@!(%)
• Passwords that contain letters and numbers: meetl23
• Passwords that contain only uppercase or only lowercase: POTHMYDE
• Passwords that contain only letters and special characters: rex@&ba
• Passwords that contain only special characters and numbers: 123@$4
• Passwords of 11 characters or less
325
An Overview of Malware
• Malware
• Malware is an umbrella term for several forms of
bad software
• Malware has become more destructive and
stealthy
• Has evolved to more readily steal information
• May be useful, but potentially risky to use during a
test
326
Forms of Malware
• Viruses
• Worms
• Trojan Horses
• Rootkits
• Spyware
• Adware
• Ransomware
327
Summary
• Mobile devices are increasingly popular
• There are many threats and attacks against
mobile devices, (e.g., loss/theft, sensitive
information leakage, and location privacy
compromise)
• Mobile access control, information leakage
protection, and location privacy protection, etc.
328
17: Evasion
329
Intrusion Detection System (IDS)
• Detects malicious activity in computer systems
• Identifies and stops attacks in progress
• Conducts forensic analysis once attack is over
330
The Value of IDS
• Monitors network resources to detect intrusions
and attacks that were not stopped by preventative
techniques (firewalls, packet-filtering routers,
proxy servers)
• Compares traffic to signature files that recognize
specific known types of attack
• Expands available options to manage risk from
threats and vulnerabilities
331
Difficulties with IDS
• IDS must correctly identify intrusions and attacks
• True positives
• True negatives
• False negatives
• IDS missed an attack
• False positives
• Benign activity reported as malicious
332
Handling False Negatives and Positives
• False negatives
• Obtain more coverage by using a combination of
network-based and host-based IDS
• Deploy NIDS at multiple strategic locations in the
network
• False positives
• Reduce number using the tuning process
333
Types of IDS
• Network-based IDS (NIDS)
• Monitors network traffic
• Provides early warning system for attacks
• Host-based IDS (HIDS)
• Monitors activity on host machine
• Able to stop compromises while they are in
progress
334
NIDS
• Uses a dedicated platform for purpose of
monitoring network activity
• Analyzes all passing traffic
• Sensors have two network connections
• One operates in promiscuous mode to sniff passing
traffic.
• An administrative NIC sends data such as alerts to a
centralized management system.
• Most commonly employed form of IDS
335
NIDS Architecture
• Place IDS sensors strategically to defend most
valuable assets
• Typical locations of IDS sensors
• Just inside the firewall
• On the DMZ
• On any subnets containing mission-critical servers
336
NIDS Signature Types
• Signature-based IDS
• Looks for patterns in packet payloads that indicate a
possible attack
• Port signature
• Watches for connection attempts to a known or
frequently attacked port
• Header signatures
• Watch for dangerous or illogical combinations in packet
headers
337
NIDS Reactions
• TCP resets
• IP session logging
• Shunning or blocking
338
Host-Based IDS (HIDS)
• Primarily used to protect only critical servers
• Software agent resides on the protected system
• Detects intrusions by analyzing logs of operating
systems and applications, resource utilization,
and other system activity
• Use of resources can have impact on system
performance
339
HIDS Method of Operation
• Auditing logs (system logs, event logs, security logs,
syslog)
• Monitoring file checksums to identify changes
• Elementary network-based signature techniques
including port activity
• Intercepting and evaluating requests by applications
for system resources before they are processed
• Monitoring of system processes for suspicious
activity
340
HIDS Active Monitoring Capabilities
• Log the event.
• Alert the administrator.
• Terminate the user login.
• Disable the user account.
341
Passive Detection Systems
• Can take passive action (logging and alerting)
when an attack is identified
• Cannot take active actions to stop an attack in
progress
342
Active Detection Systems
• Have logging, alerting, and recording features of
passive IDS, with additional ability to take action
against offending traffic
• Options
• IDS shunning or blocking
• TCP reset
• Used in networks where IDS administrator has
carefully tuned the sensor’s behavior to
minimize number of false positive alarms
343
Signature and Anomaly-Based IDS
• Signature detections
• Also known as misuse detection
• IDS analyzes information it gathers and compares it
to a database of known attacks, which are
identified by their individual signatures
• Anomaly detection
• Creates a model of normal use and looks for activity
that does not conform to that model
344
Honeypots
• False systems that lure intruders and that gather
information on methods and techniques they
use to penetrate networks—by purposely
becoming victims of their attacks
• Simulate unsecured network services
• Make forensic process easy for investigators
345
Honeypot Deployment Goals
• Goal
• Gather information on hacker techniques,
methodology, and tools
• Deployed for
• Conducting research into hacker methods
• Detecting attacker inside organization’s network
perimeter
346
Commercial Honeypots
• ManTrap
• Specter
• Smoke Detector
• NetFacade
347
Honeypot Deployment Options
• For research purposes
• Directly connect a honeypot to the Internet,
allowing the owner to collect the most data
• For organizational security
• Deploy inside the network where it can serve to
detect attackers and alert security administrators to
their presence
348
Honeypot Design
• Must attract, and avoid tipping off, the attacker
• Must not become a staging ground for attacking
other hosts inside or outside the firewall
349
Summary
• Explained intrusion detection systems and identified some
of the major characteristics of intrusion detection products
• Detailed the differences between host-based and network-
based intrusion detection
• Identified active detection and passive detection features of
both host- and network-based IDS products
• Explained honeypots and how they are employed to
increase network security
• Outlined the proper response to an attack
350
18: Cloud
Technologies and
Security
351
Cloud Computing Service Models
• Software as a Service (SaaS)
• Examples: Office 365 or Gmail
• Eliminates the need to install and maintain applications
on individual computers
• Platform as a Service (PaaS)
• Software developers use PaaS as a framework on which
to build applications OSs, servers, storage, managed by
someone else
• Infrastructure as a Service (IaaS)
• Self-service model with access to configure and use all
levels of infrastructure down to the server 352
Types of Cloud Solutions
• Public Cloud
• External, hosted by a third party
• Security issue: control by a third party may be an unacceptable risk
• Private Cloud
• Built by an individual company for their use only
• Retains control of security and data
• Hybrid
• Combines public and private
• May store sensitive data on private cloud while using size and scale of
public cloud for less sensitive data
• Community Cloud
• Shared by several organizations with common needs and security goals
353
Security Threats in the Cloud
• Large data breaches more common
• Data loss (data might not just be copied and
stolen but inadvertently deleted)
• Accounts and services may be hijacked and
credentials intercepted
• Cloud APIs may be insecure
• DoS also affects cloud
354
More Security Threats in the Cloud
• Malicious insiders or poor security practices at the
cloud service
• Use of cloud services by attackers to scale their
attacks
• Multitenancy
• Various clients reside on the same machine.
• A flaw in implementation could compromise security.
• Laws and Regulations
• The consumer retains the ultimate responsibility for
compliance.
355
Cloud Computing Attacks
• Session Riding (aka Cross-Site Request Forgery)
• Tricks a user into running request that runs with
their privileges and context
• Side Channel Attacks
• Potentially devastating but requires skill and luck by
the attacker
• Signature Wrapping Attacks
• Relies on altering web service SOAP and XML
content but preserving the ID
356
Controls for Cloud Security
• Secure design and architecture are key
• Identity and access management as important or
more important in the cloud
• Governance (ensures that the policies, procedures,
and standards are deployed and enforced)
• Risk management and compliance
• Consider availability and uptime QoS/SLA of your
cloud provider
357
Testing Security in the Cloud
• SOASTA CloudTest
• LoadStorm
• BlazeMeter
• Nexpose
• AppThwack
• Jenkins Dev@Cloud
• Xamarin Test Cloud
358
Quiz Time
359
Thank you
360