Ins Mod 5
Ins Mod 5
Ins Mod 5
-Anooja Joy
the Eagle’s Eye
of Cyber Security
Network reconnaissance or simply recon is
a term for testing for potential
vulnerabilities in a computer network by
acquiring information about network
using Information Gathering.
It may be a legitimate activity by the
network owner/operator, seeking to protect it
or to enforce its acceptable use policy and
studying how attackers perpetrate
their attacks.
It also may be a precursor to external
attacks on the network. An attacker uses
reconnaissance to discover and analyze the
targets of his attack.
Example: Port Scanning(Nessus, NMAP),
Ping Sweeps, Sniffing
It plays a key role in penetration testing.
To discover IP Address of Hosts.
To identify accessible UDP and TCP ports.
To identify OS type.
To discover active hosts in network.
To identify network structure.
To identify applications and services are running on devices on the network
To discover vulnerabilities that exist that can be exploited
To discover Trust relationships, File permissions and User account information
Social Engineering;
Site (Physical)
Reconnaissance;
Internet
Reconnaissance;
IP/Network
Reconnaissance;
DNS Reconnaissance.
1. Information Gathering: Getting information on network environment like website organization,
owner,location, contact person, pjhone number
Tools: whois lookup,domain tools,geek tools,DNSStuff, search tools(google,yahoo),
nslookup
2. Network Mapping: Creating blueprint of organization network
Tools: packet sniffing tools like wireshark, usage of ping, traceroute,tracert,cheops network
mapping tool
3. Port Scanning: Finding open ports that are accessible and underlying applications.
Tools: namap, nessus and perform TCP SYN scan, XMAS TREE SCAN,NULL SCAN, FIN SCAN,
TCP Connect, UDP Scan, Ping sweep
4. OS detcetion/TCP stack fingerprinting: To identify target OS and system responses. It take
advantage of ambiguity of how to handle illegal combination of TCP code bits that is found in RFC.
Each OS responds to illegal combinations in different ways.
Tools: namap, P0F,XProbe2
There are two types of sniffing attacks: active sniffing and passive sniffing.
Active sniffing – this is sniffing that is conducted on a switch. A switch learns a
CAM table that has the mac addresses of the destinations. Based on this table
the switch is able to decide what network packet is to be sent where. In active
sniffing, the sniffer will flood the switch with bogus ARP requests so that the
CAM table gets full. CAM keeps track of which host is connected to which
port. Once the CAM is full it will send the network traffic to all ports. Now, this is
legitimate traffic that gets distributed to all the ports. This way the attacker can
sniff the traffic from the switch. A switch is a device that connects two network
devices together. Switches use the media access control (MAC) address to
forward information to their intended destination ports. Attackers take advantage of
this by injecting traffic into the LAN to enable sniffing.
Passive sniffing – passive sniffing uses hubs instead of switches. Hubs that exist
in physical layer that receives network traffic on one port and then retransmits that
traffic on all other ports withot knowing source and destination. All an attacker
needs to do is to simply connect to LAN and place sniifer at hub and sniff data
traffic in that network.
1. ARP Spoofing
2. IP Spoofing
3. Session Hijacking
4. MAC Fooding
5. ICMP redirection
6. DHCP spoofing
7. Port stealing
COUNTERMEASURES
Use a VPN all the time
Always use HTTPS when available
Never send form data using HTTP
use encrypted connections. Eg: PGP, SSH
Use switch instead of Hubs
Session
http communication uses many different TCP connections, so the web server
needs a method to recognize every user’s connections
Web Server sends a session token(composed of a string of variable width) to the
client browser after a successful client authentication.
The session ID is normally stored within a cookie or URL.
By using this cookie, only your web server is able to identify who the user is and it
will provide content accordingly. No sensitive information in the cookie, just the
random ID (non-guessable)
The Session Hijacking attack compromises the session token by stealing or
predicting a valid session token to gain unauthorized access to the Web Server.
It is also known as cookie stealing/hijacking/ man in the middle attack
1. Session Sniffing: The attacker uses a sniffer to capture a valid
token session called “Session ID”, then he uses the valid token
session to gain unauthorized access to the Web Server.
2. Cross-site script attack: The attacker can compromise the
session token by using malicious code or programs running at
the client-side. Eg:<SCRIPT> alert(document.cookie);</SCRIPT>
3. Session fixation, where the attacker sets a user's session id to
one known to him, for example by sending the user an email
with a link that contains a particular session id. The attacker
now only has to wait until the user logs in.
4. IP Spoofing: gain unauthorized access to the computer with an
IP address of a trusted host. Attcker has to obtain the IP
address of the client and inject his own packets spoofed with the
IP address of client into the TCP session, so as to fool the server
that it is communicating with the victim i.e. the original host
5. Blind Attack: If attacker is not able to sniff packets and
guess the correct sequence number expected by server, brute
force combinations of sequence number can be tried.
SessionID is basically the “name” of a particular session.
Session sequence number is a number assigned to each
data packet so the receiving device knows the order used
to reassemble the data.
Network level hijacks can be prevented by Ciphering the packets so that the
hijacker cannot decipher the packet headers, to obtain any information which
will aid in spoofing. This encryption can be provided by using protocols such
as IPSEC, SSL, SSH etc.
Eg: Internet security protocol (IPSEC)
Address Resolution Protocol (ARP) is a stateless protocol used for finding MAC addresses that
corresponds to given IP addresses of host machine in a LAN.
An internet protocol address(IPV4 or IPV6) is used to uniquely identify a computer or device such
as printers, storage disks on a computer network.
MAC addresses are used to uniquely identify network interfaces for communication at the physical
layer of the network. MAC addresses are usually embedded into the network card.
All network devices that need to communicate on the network broadcast ARP queries in the system
to find out other machines’ MAC addresses. Each machine has its own ARP table/ARP Cache
containing mapping between IP address and MAC addres. It is generated automatically and expires
after a period of time so that it should be refreshed periodically.
ARP-stateless protocol, a node does not have a record of ARP requests that it has sent.
Here is how ARP works −
1. When one machine needs to communicate with another, it looks up its ARP table.
2. If the MAC address is not found in the table, the ARP_request is broadcasted over the network.
3. All machines on the network will compare this IP address to MAC address.
4. If one of the machines in the network identifies this address, then it will respond to the ARP_request with
its IP and MAC address. A node will accept any ARP reply that it receives (even if it has made
no corresponding ARP request)
5. The requesting computer will store the address pair in its ARP table and communication will take place.
Spoofing means hide one’s true identity in a network.
ARP spoofing is a type of attack in which a attacker sends forged ARP (Address
Resolution Protocol) messages to the client inside a LAN.
A network attacker can respond to ARP request, posing that it has the
requested IPv4 address. Once the attacker's MAC address is mapped to a authentic
legitimate IPv4 address, the attacker will begin receiving any data that is intended
for that legitimate IPv4 address. Now the attacker can launch a man-in-the-middle
attack can start capturing the network traffic for any sensitive user data.
ARP spoofing constructs a large number of forged ARP request and reply packets to
overload the switch.
It opens the door for
Denial-of-service attacks
Session hijacking
Man-in-the-middle attacks
Get a Detection Tool
Set Up Packet Filtering
Static ARP entries: these can
be defined in the local ARP cache
and the switch configured
to ignore all auto ARP reply
packets.
Attackers use this method when they wish to send packets with malicious content to a
target machine and do not want to get identified.
Attackers gain unauthorized access to machines by sending messages that appears to be
from trusted source.
Victim is unaware that the packet is not from a trusted host, and hence it accepts the
packet and sends a response back to the source computer.
Challenge- attacker must guess proper sequence no to send final ACK packet. Also
attacker must use variety of techniques to find address of trusted source and modify
packet headers to make it looking like coming from trusted source.
If successful, attacker may have a connection to the victim’s machine as long as that
machine is active.
Countermeasures
N/W ingress filtering : Packet filtering technique that tries to prevent the source address spoofing
of the Internet traffic and help prevent IP spoofing.
Denial-of-service attack (DoS attack) or Distributed denial-of-service
attack (DDoS attack) is an attempt to make a machine or network resource
unavailable to its intended users by temporarily or indefinitely
disrupting services of a host .
In a DoS attack, the attacker usually sends excessive messages asking the
network or server to authenticate requests that have invalid return addresses.
The network or server will not be able to find the return address of the attacker
when sending the authentication approval, causing the server to wait before
closing the connection. When the server closes the connection, the attacker
sends more authentication messages with invalid return addresses. Hence, the
process of authentication and server wait will begin again, keeping the network
or server busy.
Effects
Resource Exhaustion
Altering or destructing configuration Information
Network architecture weakness such as bandwidth limitation
Server Architecture weakness
OS or software vulnerabilities
Flaws in System Security
The basic types of DoS attack include:
Flooding the network to prevent legitimate network traffic
Disrupting the connections between two machines, thus preventing access to
a service
Preventing a particular individual from accessing a service.
Disrupting a service to a specific system or individual
Disrupting the state of information, such resetting of TCP sessions
A firewall is a network security device that monitors incoming and outgoing network traffic and
decides whether to allow or block specific traffic based on a defined set of security rules.
Firewalls installed specifically to protect information systems can provide another layer of protection
and dedicated rules. It is recommended that, if possible, two different hardware vendors are used to
provide security against vulnerabilities in the firewall code.
Firewall match the network traffic against the rule set defined in its table. Once the rule is matched,
associate action is applied to the network traffic. Based on a defined set of security rules it accepts,
rejects or drops that specific traffic.
Accept : allow the traffic
Reject : block the traffic but reply with an “unreachable error”
Drop : block the traffic with no reply
It requires knowledge of
IP address of firewall
IP address of one system in internal network
Number of hops to the firewall
If data passes thru firewall on port p, then time exceeded error message
User machines
User machines
User machines
Internet
A DMZ describes a network in which the host servers are
located. Limited connections from the Internet are allowed
into the DMZ to provide services like web (HTTP) access and
e-mail (SMTP et al). Connections from the DMZ to the
internal network are not usually allowed by default, which
protects the computers inside from compromised hosts in
the DMZ.
Hosts in the DMZ are frequently additionally protected
using NAT or PAT to further obfuscate the networking
configuration.
A DMZ is often implemented using a third physical interface
on the firewall, but an alternative is to use two firewalls in
series with the DMZ. This provides an additional level of
protection for the internal network.
Ideally:
Internal hosts can access DMZ and Internet
External hosts can access DMZ only, not Intranet
DMZ hosts can access Internet only
• The systems in DMZ are those that must be exposed to the outside world. So this
systems should be maintained carefully by administrator.
• Amount of traffic into internal network is relatively small, hence application proxy
firewall is employed
• Here there are 3 different layers of security added with different firewalls.
DMZ (Demilitarized Zone) is an independent network that acts as a buffer
zone between an external network and the internal network.
The buffer network contains, for example, web servers or mail servers, the
communication of which is monitored by firewalls.
Users from the Internet allow only to access servers in the demilitarized zone
and not to resources of the internal network.
As a rule, users from the internal system do not communicate directly with
support from the Internet.
For example, they access external resources via a proxy server, which, as
a proxy, handles the Internet communication for them.
The firewall rejects packets from the DMZ for which there are no
corresponding input packets in the direction of the Internet and the internal
network.
A demilitarized zone can
implement with one or two
firewalls. Ideally, these are
firewalls from
different manufacturers.
If two firewalls used, there is
one between the DMZ and the
internal network (inner firewall)
and between the DMZ and the
external network (outer firewall).
It prevents security gaps
from allowing both firewalls to
overcome at the same time.
A more cost-effective solution is
to implement the demilitarized
zone with only one firewall.
Firewalls allow traffic only to legitimate hosts and services
Traffic to the legitimate hosts/services can have attacks
Solution?
Intrusion Detection Systems
Monitor data and behavior
Report when identify attacks
An intrusion detection system (IDS) is a device or software application that monitors
a network or systems for malicious activity or policy violations. It looks for unusual
activity or monitor for “suspicious activity” on a network.
IDS can protect against known software exploits, like buffer overflows.
Example: Open Source IDS: Snort, www.snort.org
IDS uses “intrusion signatures” ie, well known patterns of behavior like Ping sweeps,
port scanning, web server indexing, OS fingerprinting, DoS attempts, etc.
However, IDS is only useful if contingency plans are in place to curb attacks as they
are occurring
1. Signature-based intrusion detection systems/ Misuse Detection monitor all the packets
traversing the network and compares them against a database of signatures or patterns of attributes
of known malicious threats, much like antivirus software.
Must tune the IDS to match the characteristics of your network. E.g., what might be unusual in a
network of Unix systems might be normal in a network of Windows Systems (or visa versa)
Example: Signature for port sweep
A set of TCP packets attempting to connect to a sequence of ports on the same device in a
fixed amount of time
ADVANTAGES:
Widely available
Fairly fast
Easy to implement
Easy to update
DISADVANTAGES:
Cannot detect attacks for which it has no signature
The static signature mechanism has obvious problems in that a dedicated attacker can adjust his behaviour
to avoid matching the signature.
The volume of signatures can result in many false positives
2. Anomaly-based intrusion detection systems/Statistical Detection monitor network traffic and
compare it against an established baseline, to determine what is considered normal for the
network with respect to bandwidth, protocols, ports and other devices. This type of IDS
alerts administrators to potentially malicious activity.
using statistics will result in a more adaptable and self-tuning system, hence uses neural networks,
data mining and create training data from observing “good” runs. Gradual changes can be easily
addressed. Gradually adjust expected changes over time
ADVANTAGES:
Can detect attempts to exploit new and unforeseen vulnerabilities
Can recognize authorized usage that falls outside the normal pattern
DISADVANTAGES:
Generally slower, more resource intensive compared to signature-based IDS
Greater complexity, difficult to configure
Higher percentages of false alerts
1. Network based intrusion detection system (NIDS) is deployed at a
strategic point or points within the network, where it can monitor inbound
and outbound traffic to and from all the devices on the network.
Advantages
Easy deployment
Unobtrusive
Difficult to evade if done at low level of network operation
Disadvantages
Fail Open
Different hosts process packets differently
NIDS needs to create traffic seen at the end host
Need to have the complete network topology and complete host behavior
1. Host based intrusion detection systems (HIDS) run on all computers or
devices in the network with direct access to both the internet and the
enterprise internal network. HIDS have an advantage over NIDS in that they
may be able to detect anomalous network packets that originate from inside
the organization or malicious traffic that a NIDS has failed to detect. HIDS may
also be able to identify malicious traffic that originates from the host itself,
as when the host has been infected with malware and is attempting to spread
to other systems.
Advantages
More accurate than NIDS
Less volume of traffic so less overhead
Disadvantages
Deployment is expensive
What happens when host get compromised?
A honey pot is a trap that attracts potential attackers.
Honeypots are filled with fabricated information.
Any access to honeypot triggers monitors, sensors and
event loggers with alarms.
A honeypot isn't set up to address a specific problem,
like a firewall or anti-virus. Instead, it's an information
tool that can help you understand existing threats to
your business and spot the emergence of new threats.
Aim
1. It can be used to detect attacks or Drive attention of a
potential attacker and to deflect them from
critical systems
2. It can also be used to gain information about how
cybercriminals operate and intruders action.
3. Encouraging intruders to stay for some
time so administrators can detect and swiftly act
against them.
The honeypot looks like a real computer
system, with applications and data, fooling
cybercriminals into thinking it's a legitimate
target.
Honeypots are made attractive to attackers by
building in deliberate security vulnerabilities.
For instance, a honeypot might have ports
that respond to a port scan or weak
passwords. Vulnerable ports might be left
open to entice attackers into the honeypot
environment, rather than the more secure live
network.
Honeypots can be placed:
In front of the firewall(Internet)
Demilitarized Zone
Behind the firewall(Intranet)
Honeypots can be classified based on their deployment (use/action) and based on their
level of involvement. Based on deployment, honeypots may be classified as
production honeypots: are low interaction honeypots which are easy to use, capture only
limited information, and are used primarily by corporations.
research honeypots: are complicated honeypots that are run to gather information about the
motives and tactics of the black hat community targeting different networks. These honeypots do
not add direct value to a specific organization; instead, they are used to research the threats that
organizations face and to learn how to better protect against those threats.
1. A decoy database can be set up to monitor software vulnerabilities and spot attacks
exploiting insecure system architecture or using SQL injection, SQL services
exploitation, or privilege abuse.
2. A malware honeypot mimics software apps and APIs to invite malware attacks. The
characteristics of the malware can then be analyzed to develop anti-malware software
or to close vulnerabilities in the API.
3. A spider honeypot is intended to trap webcrawlers ('spiders') by creating web pages
and links only accessible to crawlers
4. Email traps or spam traps place a fake email address in a hidden location where only
an automated address harvester will be able to find it.
A web server is a computer host configured and
connected to Internet for serving web pages on
request and is publicly accessible over Internet. It
rns on different platforms like UNIX,Windows and
Macintosh.
Web Server Vulnerability: Weakness in custom
Web Application services, architecture, design,
configuration, langages, servers, interpreters
or code can be exploited by hackers to
compromise web servers.
The Open Web Application Security Project (OWASP) is
a worldwide not-for-profit charitable organization
focused on improving the security of software
OWASP Top 10 is the list of the 10 most common
application vulnerabilities. It also shows their risks,
impacts, and countermeasures. Updated every three to
four years, the latest OWASP vulnerabilities list was
released in 2018.
Injection. Injection flaws, such as SQL, NoSQL, OS, and LDAP injection, occur when untrusted
data is sent to an interpreter as part of a command or query. The attacker’s hostile data can
trick the interpreter into executing unintended commands or accessing data without proper
authorization.
Broken Authentication. Application functions related to authentication and session
management are often implemented incorrectly, allowing attackers to compromise passwords,
keys, or session tokens, or to exploit other implementation flaws to assume other users’
identities temporarily or permanently.
Sensitive Data Exposure. Many web applications and APIs do not properly protect sensitive
data, such as financial, healthcare, and PII. Attackers may steal or modify such weakly protected
data to conduct credit card fraud, identity theft, or other crimes. Sensitive data may be
compromised without extra protection, such as encryption at rest or in transit, and requires
special precautions when exchanged with the browser.
XML External Entities (XXE). Many older or poorly configured XML processors evaluate
external entity references within XML documents. External entities can be used to disclose
internal files using the file URI handler, internal file shares, internal port scanning, remote code
execution, and denial of service attacks.
Broken Access Control. Restrictions on what authenticated users are allowed to do are often
not properly enforced. Attackers can exploit these flaws to access unauthorized functionality
and/or data, such as access other users’ accounts, view sensitive files, modify other users’ data,
change access rights, etc.
Security Misconfiguration. Security misconfiguration is the most commonly seen issue. This is commonly a
result of insecure default configurations, incomplete or ad hoc configurations, open cloud storage,
misconfigured HTTP headers, and verbose error messages containing sensitive information. Not only must all
operating systems, frameworks, libraries, and applications be securely configured, but they must be
patched/upgraded in a timely fashion.
Cross-Site Scripting XSS. XSS flaws occur whenever an application includes untrusted data in a new web
page without proper validation or escaping, or updates an existing web page with user-supplied data using a
browser API that can create HTML or JavaScript. XSS allows attackers to execute scripts in the victim’s
browser which can hijack user sessions, deface web sites, or redirect the user to malicious sites.
Insecure Deserialization. Insecure deserialization often leads to remote code execution. Even if deserialization
flaws do not result in remote code execution, they can be used to perform attacks, including replay attacks,
injection attacks, and privilege escalation attacks.
Using Components with Known Vulnerabilities. Components, such as libraries, frameworks, and other
software modules, run with the same privileges as the application. If a vulnerable component is exploited, such
an attack can facilitate serious data loss or server takeover. Applications and APIs using components with
known vulnerabilities may undermine application defenses and enable various attacks and impacts.
Insufficient Logging & Monitoring. Insufficient logging and monitoring, coupled with missing or ineffective
integration with incident response, allows attackers to further attack systems, maintain persistence, pivot to
more systems, and tamper, extract, or destroy data. Most breach studies show time to detect a breach is over
200 days, typically detected by external parties rather than internal processes or monitoring.
User-controlled input that enables the attacker to interact with the
application’s back-end database (DB) in non-intended ways.
This could lead to user account compromise, extraction of sensitive data or
denial of service.
Common causes:
Lack of validation and sanitization
No prepared statements (bind queries) used
Principle of least privilege not applied
Attacker submits HTTP request with a malicious parameter value that modifies an existing
SQL query, or adds new queries
HTTP Request
POST /login?u=foo&p=bar
SQL Query
SELECT user, pwdFROM users WHERE u = ‘foo’
HTTP Request
POST /login?u=‘+OR+1<2#&p=bar
SQL Query
SELECT user, pwd FROM users WHERE u = ‘’ OR 1<2#
Attacker submits HTTP request with a malicious parameter value that modifies an existing SQL query, or adds new queries
• Error messages
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the
right syntax to use near '"""' at line 1 SELECT * FROM authors WHERE name = "””
• Special queries
• " union select null,null,null,null,null -- ” gives SQL error message
• " union select null,null,null,null,null,null – ” gives invalid credential message
EXAMPLES
• $username = $_POST['username']; $query = “ SELECT * FROM Users WHERE username
= ‘$username’;“;
• $username=“Bob’ AND DoB=‘11111918”;$query=“ SELECT * FROM Users WHERE username=‘Bob’
AND DoB=‘11111918’;”;
SQL Injection –Authentication Bypass
$username=$_POST[‘username’];
$password=$_POST[‘password’];
$query=“SELECT * FROM users WHERE username=‘$username’
AND password=‘$password’;”;
$username=“Bob’ OR username=‘Alice’--”
$query=“SELECT * FROM users WHERE username=‘Bob’ OR username=‘Alice’--’;”
SQL Injection –Data Theft
$company=$_POST[‘company’];
$query=“SELECT name,lastname,DoBFROM users WHERE company=‘$company’;”;
Certificate, cipher, RB
Data Encapsulation . IPSec uses either ESP or AH. Independent of ESP or AH IPSec can use either transport
mode or tunnel mode.
1. IP Encapsulating Security Payload: Encapsulating Security Payload is for confidentiality or integrity of IP packets. It provides
encryption. ESP uses IP port 50.
2. IP Authentication Header : provides integrity and authentication. Authentication is performed by computing a cryptographic hash-
based message authentication code over nearly all the fields of the IP packet and stores this in a IPSec AH header. This AH header is injected
between the original IP header and the payload.AH uses IP port 51.
MOTIVES
1. Establishes a secure, authenticated channel between the two computer
2. Authenticates and protects the identities of the peers
3. Negotiates what SA policy to use
4. Performs an authenticated shared secret keys exchange
5. Sets up a secure tunnel for phase 2
Each of phase 1uses ephemeral Diffie-Hellman to establish session key to ensure Provides perfect forward
secrecy (PFS)
Main Mode IKE
Negotiate algorithms & hashes.
Users identity is hidden
Generate shared secret keys using a Diffie-Hillman exchange.
Verification of Identities.
Main mode MUST be implemented
Aggressive Mode IKE
Squeezes all negotiation, key exchange, etc. into less packets.
Users identity is revealed
In aggressive mode, Alice chooses some Elgamal context (p, g). Bob may not support it, and reject the
connection. If that happens, Alice should try and connect to Bob using main mode.
Aggressive mode provides mutual authentication, and a shared secret
gab mod p, which can be used to derive keys for the symmetric crypto protocols.
Aggressive mode SHOULD be implemented. So, if aggressive mode is not implemented, “you should feel
guilty about it”.
Might create interoperability issues
Advantage: Less network traffic & faster than main mode
Disadvantage: Information exchanged before a secure channel is created. Vulnerable to sniffing
IC, CP
IC,RC, CS
IC,RC, ga mod p, RA
IC,RC, gb mod p, RB
IC,RC, proofA
Alice Bob
Main differences from main mode and aggressive mode
Main mode can negotiate the values of g and p as part of crypto proposed and crypto
accepted but in aggressive mode cannot negotiate g or p
A passive attacker knows identities of Alice and Bob in aggressive mode, but not in main
mode.
In aggressive mode, Alice chooses some DH context (p, g) and sends that in the
first message exchange. Bob may not support it, and reject the connection. If that
happens, Alice should try and connect to Bob using main mode.
IC, CP
IC,RC, CS
IC,RC, ga mod p, RA
IC,RC, gb mod p, RB
IC,RC, proofA
Alice Bob
Same format as digital signature aggressive mode
Not trying to hide identities…
As a result, does not have problems of main mode
But does not (pretend to) hide identities
CP = crypto proposed, CS = crypto selected
IC = initiator “cookie”, RC = responder “cookie”
K = h(IC,RC,gab mod p,RA,RB)
SKEYID = h(RA, RB, gab mod p)
proofA = h(SKEYID,ga mod p,gb mod p,IC,RC,CP,“Alice”)
IC, CP, ga mod p,
{“Alice”}Bob, {RA}Bob
IC,RC, proofA
Alice Bob
Nonces RA and RB
Trudy can compute “valid” keys and proofs: gab mod p, K, SKEYID, proofA and proofB.
Since public keys of Alice and Bob are public.
All of this also works in main mode
A security failure?
In IPSec public key option, it is a security feature…
Plausible deniability: A protocol that includes plausible deniability allows Alice and Bob
to deny that any conversation took place!
In some cases it might create a problem
E.g., if Alice makes a purchase from Bob, she could later repudiate it (unless she had
signed)
Result of IKE phase 1 is
Mutual authentication
Shared symmetric key
IKE Security Association (SA)
But phase 1 is expensive
Especially in public key and/or main mode
Developers of IKE thought it would be used for lots of things not just IPSec
Partly explains the over-engineering…
IKE Phase 1 Cookies
IC and RC cookies (or “anti-clogging tokens”) supposed to prevent DoS attacks
No relation to Web cookies
To reduce DoS threats, Bob wants to remain stateless as long as possible and IPSec cookies
helps in accomplishing this.
But Bob must remember CP from message 1 (required for proof of identity in message 6) in
main mode
Bob must keep state from 1st message on to calculate ProofB in message 6. So, these
“cookies” offer little DoS protection
IKE Phase 1 establishes IKE SA. SSL session is comparable to IKE Phase 1.
IKE Phase 2 establishes IPSec SA. SSL connections are like IKE Phase 2.
IKE Phase 1 establishes shared symmetric key K, IP Sec Cookies-IC, RC and IKE Security
Association.
CP includes ESP or AH or both.
SA identifies IKE SA from phase 1.
An AH or ESP packet is then sent using the agreed upon “main” SA during the
IKE phase 1.
IKE Phase 2
Negotiates IPSec SA parameters
Establishes IPSec security associations for specific connections (like FTP, telnet, etc)
Renegotiates IPSec SAs periodically
Optionally performs an additional Diffie-Hellman exchange
Once Phase 2 has established an SA for a particular connection, all traffic
on that connection is communicated using the SA.
IC, RC, CP, E(hash1,SA,RA,K)
IP header data
Routers must see IP header to route the packet and hence shouldn't be encrypted.
Some fields of of IP header changes as the packet is forwarded. Eg: TTL
IP and TCP
Consider Web traffic, IP encapsulates TCP packet which encapsulates HTTP packet.
IP header data
Tunnel mode protects both the payload and IP header of the original packet by
encapsulating entire IP packet into a new packet.
Since entire IP packet is encrypted new IP headers are generated for this packet.
Hence IP header is no longer visible to an attacker. Attacker does not know which hosts
are talking
If encryption is used between gateways in tunnel mode, then it reduces information for
traffic analysis.
Used Tunnel mode is used for firewall-to-firewall traffic to deliver services from host to
network(gateways) or network to network or usually gateways owned by the same
organization. New IP header from firewall to firewall.
Disadvantage is overhead of an additional IP header.
IPSec tunnel mode used for firewall to firewall protected traffic, as we must
preserve the original IP header to correctly route the packet from destination
firewall to destination host.
Note: Local networks not protected. Is there any advantage here for transport mode?
Transport mode is more efficient and preferable in traffic protected from host
to host. Tunnel ode would not protect source and destination address in host
to host, since these addresses would be repeated in new header.
What kind of protection? Confidentiality? Integrity? Or Both?
What to protect? Data? Header? Both?
ESP/AH allow some combinations of these.
AH (Authentication Header)
Provides Integrity only (no confidentiality)
With AH No encryption
Integrity-protect everything beyond IP header and some fields of header (why not all
fields?) ie immutable fields
Sequence number
Prevents Anti-replay attacks
Range of sequence numbers for session is 232-1
Sequence numbers are not reused
Integrity Check Value (ICV)
Keyed MAC algorithms used: AES, MD5, SHA-1
MAC is calculated over immutable fields in transit (source/dest. addr, IP version, header
length, packet length)
Authentication Header (AH) will protect data from tampering, but it will not
stop people from seeing it.
it can provide authentication, replay-proofing and integrity checking.
It acomplishes this by adding 3 separate components:
1) An ESP header
2) An ESP trailer and
3) An ESP authentication block.
According to RFC 2410
NULL encryption “is a block cipher the origins of which appear to be lost in
antiquity”
“Despite rumors”, there is no evidence that NSA “suppressed publication of this
algorithm”
Evidence suggests it was developed in Roman times as exportable version of
Caesar’s cipher
Can make use of keys of varying length
No IV is required
Null(P,K) = P for any P and any key K
Is ESP with NULL encryption same as AH ?
Cannot encrypt IP header and AH provides integrity for AH header whereas
ESP doesn’t provide.
Routers must look at the IP header
IP addresses, TTL, etc.
IP header exists to route packets!
AH protects immutable fields in IP header
Cannot integrity protect all header fields
TTL, for example, will change
ESP does not protect IP header at all
Firewalls won’t be able to look into TCP header if its encrypted.