tls attacks & dns security · - no antivirus protection was present on the investigated...

57
IAIK IAIK TLS Attacks & DNS Security Information Security 2019 Johannes Feichtner [email protected]

Upload: others

Post on 30-Apr-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

IAIK

TLS Attacks amp DNS SecurityInformation Security 2019

Johannes Feichtnerjohannesfeichtneriaiktugrazat

IAIK

Browser Issues

SSLStrip

MITM Attack revisited

PKI Attacks

Weaknesses

FLAME

Implementation Attacks

Protocol Attacks

DNS Security

OutlineApplication

Transport

Link layer(Ethernet WLAN LTEhellip)

TCP IP Model

HTTP TLS SSL

Network

FTP DNS

Telnet SSH

IAIK

All applications running TLS are provided with three essential services

Note Technically not all services are required to be used Can raise risk for security issues

Review TLS Services

SMTPS

TLS

IP

TCP

HTTPS FTPSAuthenticationVerify identity of client and server

Data IntegrityDetect message tampering and forgery eg malicious Man-in-the-middle

EncryptionEnsure privacy of exchangedcommunication

IAIK

= Establish parameters for cryptographically secure data channel

Review TLS Handshake RFC 5246

Full handshakescenario

Optional Only withClient TLS

Client Server

1ClientHello

2

ServerHelloCertificateServerKeyExchangeCertificateRequestServerHelloDone

3

CertificateClientKeyExchange

CertificateVerifyChangeCipherSpec

FinishedChangeCipherSpecFinished

4

Application DataApplication Data

IAIK

Certificate Authority (CA) = Third party trusted by both the subject (owner) of the certificate and the party (site) relying upon the certificate

Browsers ship with set of gt 130 trust stores (root CAs)

Review Certificates

Source httpgoogl4qYsPz

Browser Issues

IAIK

Focus Relationship between TLS and HTTP

Problem Attacker wants to access encrypted data

Browsers also have to deal with legacy websites

Enforcing max security level would bdquobreakldquo connectivity to many sites

Attack Vectors SSLStrip

MITM Attack

hellipand somehow related Cookie Stealing due to absent bdquoSecureldquo flaghellip

Overview

IAIK

Howa) Join WLAN

start ARP Poisoning

b) Create own AP

Eg with smartphonehellip

Review ARP Poisoning

Client

httpwwwapplecomhttpwwwmicrosoftcomhttpswwwgooglecom

Attacker Sniff data

Manipulate data

Attack HTTPS connections

IAIK

Or more accurately bdquoHTTPS Strippingldquo

Problem Who types https when calling URLs

Typically scheme prepended by browser by clicking on links or through redirects

If no prefix specified browsers try http first

Idea1 Perform MITM attack (ARP Poisoning) on unencrypted HTTP transmission

2 Rewrite content to replace https links with http equivalents

Prevent victim from accessing encrypted resources

3 Proxy HTTP requests to genuine HTTPS destination

SSLStrip

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 2: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Browser Issues

SSLStrip

MITM Attack revisited

PKI Attacks

Weaknesses

FLAME

Implementation Attacks

Protocol Attacks

DNS Security

OutlineApplication

Transport

Link layer(Ethernet WLAN LTEhellip)

TCP IP Model

HTTP TLS SSL

Network

FTP DNS

Telnet SSH

IAIK

All applications running TLS are provided with three essential services

Note Technically not all services are required to be used Can raise risk for security issues

Review TLS Services

SMTPS

TLS

IP

TCP

HTTPS FTPSAuthenticationVerify identity of client and server

Data IntegrityDetect message tampering and forgery eg malicious Man-in-the-middle

EncryptionEnsure privacy of exchangedcommunication

IAIK

= Establish parameters for cryptographically secure data channel

Review TLS Handshake RFC 5246

Full handshakescenario

Optional Only withClient TLS

Client Server

1ClientHello

2

ServerHelloCertificateServerKeyExchangeCertificateRequestServerHelloDone

3

CertificateClientKeyExchange

CertificateVerifyChangeCipherSpec

FinishedChangeCipherSpecFinished

4

Application DataApplication Data

IAIK

Certificate Authority (CA) = Third party trusted by both the subject (owner) of the certificate and the party (site) relying upon the certificate

Browsers ship with set of gt 130 trust stores (root CAs)

Review Certificates

Source httpgoogl4qYsPz

Browser Issues

IAIK

Focus Relationship between TLS and HTTP

Problem Attacker wants to access encrypted data

Browsers also have to deal with legacy websites

Enforcing max security level would bdquobreakldquo connectivity to many sites

Attack Vectors SSLStrip

MITM Attack

hellipand somehow related Cookie Stealing due to absent bdquoSecureldquo flaghellip

Overview

IAIK

Howa) Join WLAN

start ARP Poisoning

b) Create own AP

Eg with smartphonehellip

Review ARP Poisoning

Client

httpwwwapplecomhttpwwwmicrosoftcomhttpswwwgooglecom

Attacker Sniff data

Manipulate data

Attack HTTPS connections

IAIK

Or more accurately bdquoHTTPS Strippingldquo

Problem Who types https when calling URLs

Typically scheme prepended by browser by clicking on links or through redirects

If no prefix specified browsers try http first

Idea1 Perform MITM attack (ARP Poisoning) on unencrypted HTTP transmission

2 Rewrite content to replace https links with http equivalents

Prevent victim from accessing encrypted resources

3 Proxy HTTP requests to genuine HTTPS destination

SSLStrip

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 3: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

All applications running TLS are provided with three essential services

Note Technically not all services are required to be used Can raise risk for security issues

Review TLS Services

SMTPS

TLS

IP

TCP

HTTPS FTPSAuthenticationVerify identity of client and server

Data IntegrityDetect message tampering and forgery eg malicious Man-in-the-middle

EncryptionEnsure privacy of exchangedcommunication

IAIK

= Establish parameters for cryptographically secure data channel

Review TLS Handshake RFC 5246

Full handshakescenario

Optional Only withClient TLS

Client Server

1ClientHello

2

ServerHelloCertificateServerKeyExchangeCertificateRequestServerHelloDone

3

CertificateClientKeyExchange

CertificateVerifyChangeCipherSpec

FinishedChangeCipherSpecFinished

4

Application DataApplication Data

IAIK

Certificate Authority (CA) = Third party trusted by both the subject (owner) of the certificate and the party (site) relying upon the certificate

Browsers ship with set of gt 130 trust stores (root CAs)

Review Certificates

Source httpgoogl4qYsPz

Browser Issues

IAIK

Focus Relationship between TLS and HTTP

Problem Attacker wants to access encrypted data

Browsers also have to deal with legacy websites

Enforcing max security level would bdquobreakldquo connectivity to many sites

Attack Vectors SSLStrip

MITM Attack

hellipand somehow related Cookie Stealing due to absent bdquoSecureldquo flaghellip

Overview

IAIK

Howa) Join WLAN

start ARP Poisoning

b) Create own AP

Eg with smartphonehellip

Review ARP Poisoning

Client

httpwwwapplecomhttpwwwmicrosoftcomhttpswwwgooglecom

Attacker Sniff data

Manipulate data

Attack HTTPS connections

IAIK

Or more accurately bdquoHTTPS Strippingldquo

Problem Who types https when calling URLs

Typically scheme prepended by browser by clicking on links or through redirects

If no prefix specified browsers try http first

Idea1 Perform MITM attack (ARP Poisoning) on unencrypted HTTP transmission

2 Rewrite content to replace https links with http equivalents

Prevent victim from accessing encrypted resources

3 Proxy HTTP requests to genuine HTTPS destination

SSLStrip

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 4: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

= Establish parameters for cryptographically secure data channel

Review TLS Handshake RFC 5246

Full handshakescenario

Optional Only withClient TLS

Client Server

1ClientHello

2

ServerHelloCertificateServerKeyExchangeCertificateRequestServerHelloDone

3

CertificateClientKeyExchange

CertificateVerifyChangeCipherSpec

FinishedChangeCipherSpecFinished

4

Application DataApplication Data

IAIK

Certificate Authority (CA) = Third party trusted by both the subject (owner) of the certificate and the party (site) relying upon the certificate

Browsers ship with set of gt 130 trust stores (root CAs)

Review Certificates

Source httpgoogl4qYsPz

Browser Issues

IAIK

Focus Relationship between TLS and HTTP

Problem Attacker wants to access encrypted data

Browsers also have to deal with legacy websites

Enforcing max security level would bdquobreakldquo connectivity to many sites

Attack Vectors SSLStrip

MITM Attack

hellipand somehow related Cookie Stealing due to absent bdquoSecureldquo flaghellip

Overview

IAIK

Howa) Join WLAN

start ARP Poisoning

b) Create own AP

Eg with smartphonehellip

Review ARP Poisoning

Client

httpwwwapplecomhttpwwwmicrosoftcomhttpswwwgooglecom

Attacker Sniff data

Manipulate data

Attack HTTPS connections

IAIK

Or more accurately bdquoHTTPS Strippingldquo

Problem Who types https when calling URLs

Typically scheme prepended by browser by clicking on links or through redirects

If no prefix specified browsers try http first

Idea1 Perform MITM attack (ARP Poisoning) on unencrypted HTTP transmission

2 Rewrite content to replace https links with http equivalents

Prevent victim from accessing encrypted resources

3 Proxy HTTP requests to genuine HTTPS destination

SSLStrip

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 5: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Certificate Authority (CA) = Third party trusted by both the subject (owner) of the certificate and the party (site) relying upon the certificate

Browsers ship with set of gt 130 trust stores (root CAs)

Review Certificates

Source httpgoogl4qYsPz

Browser Issues

IAIK

Focus Relationship between TLS and HTTP

Problem Attacker wants to access encrypted data

Browsers also have to deal with legacy websites

Enforcing max security level would bdquobreakldquo connectivity to many sites

Attack Vectors SSLStrip

MITM Attack

hellipand somehow related Cookie Stealing due to absent bdquoSecureldquo flaghellip

Overview

IAIK

Howa) Join WLAN

start ARP Poisoning

b) Create own AP

Eg with smartphonehellip

Review ARP Poisoning

Client

httpwwwapplecomhttpwwwmicrosoftcomhttpswwwgooglecom

Attacker Sniff data

Manipulate data

Attack HTTPS connections

IAIK

Or more accurately bdquoHTTPS Strippingldquo

Problem Who types https when calling URLs

Typically scheme prepended by browser by clicking on links or through redirects

If no prefix specified browsers try http first

Idea1 Perform MITM attack (ARP Poisoning) on unencrypted HTTP transmission

2 Rewrite content to replace https links with http equivalents

Prevent victim from accessing encrypted resources

3 Proxy HTTP requests to genuine HTTPS destination

SSLStrip

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 6: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

Browser Issues

IAIK

Focus Relationship between TLS and HTTP

Problem Attacker wants to access encrypted data

Browsers also have to deal with legacy websites

Enforcing max security level would bdquobreakldquo connectivity to many sites

Attack Vectors SSLStrip

MITM Attack

hellipand somehow related Cookie Stealing due to absent bdquoSecureldquo flaghellip

Overview

IAIK

Howa) Join WLAN

start ARP Poisoning

b) Create own AP

Eg with smartphonehellip

Review ARP Poisoning

Client

httpwwwapplecomhttpwwwmicrosoftcomhttpswwwgooglecom

Attacker Sniff data

Manipulate data

Attack HTTPS connections

IAIK

Or more accurately bdquoHTTPS Strippingldquo

Problem Who types https when calling URLs

Typically scheme prepended by browser by clicking on links or through redirects

If no prefix specified browsers try http first

Idea1 Perform MITM attack (ARP Poisoning) on unencrypted HTTP transmission

2 Rewrite content to replace https links with http equivalents

Prevent victim from accessing encrypted resources

3 Proxy HTTP requests to genuine HTTPS destination

SSLStrip

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 7: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Focus Relationship between TLS and HTTP

Problem Attacker wants to access encrypted data

Browsers also have to deal with legacy websites

Enforcing max security level would bdquobreakldquo connectivity to many sites

Attack Vectors SSLStrip

MITM Attack

hellipand somehow related Cookie Stealing due to absent bdquoSecureldquo flaghellip

Overview

IAIK

Howa) Join WLAN

start ARP Poisoning

b) Create own AP

Eg with smartphonehellip

Review ARP Poisoning

Client

httpwwwapplecomhttpwwwmicrosoftcomhttpswwwgooglecom

Attacker Sniff data

Manipulate data

Attack HTTPS connections

IAIK

Or more accurately bdquoHTTPS Strippingldquo

Problem Who types https when calling URLs

Typically scheme prepended by browser by clicking on links or through redirects

If no prefix specified browsers try http first

Idea1 Perform MITM attack (ARP Poisoning) on unencrypted HTTP transmission

2 Rewrite content to replace https links with http equivalents

Prevent victim from accessing encrypted resources

3 Proxy HTTP requests to genuine HTTPS destination

SSLStrip

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 8: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Howa) Join WLAN

start ARP Poisoning

b) Create own AP

Eg with smartphonehellip

Review ARP Poisoning

Client

httpwwwapplecomhttpwwwmicrosoftcomhttpswwwgooglecom

Attacker Sniff data

Manipulate data

Attack HTTPS connections

IAIK

Or more accurately bdquoHTTPS Strippingldquo

Problem Who types https when calling URLs

Typically scheme prepended by browser by clicking on links or through redirects

If no prefix specified browsers try http first

Idea1 Perform MITM attack (ARP Poisoning) on unencrypted HTTP transmission

2 Rewrite content to replace https links with http equivalents

Prevent victim from accessing encrypted resources

3 Proxy HTTP requests to genuine HTTPS destination

SSLStrip

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 9: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Or more accurately bdquoHTTPS Strippingldquo

Problem Who types https when calling URLs

Typically scheme prepended by browser by clicking on links or through redirects

If no prefix specified browsers try http first

Idea1 Perform MITM attack (ARP Poisoning) on unencrypted HTTP transmission

2 Rewrite content to replace https links with http equivalents

Prevent victim from accessing encrypted resources

3 Proxy HTTP requests to genuine HTTPS destination

SSLStrip

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 10: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

SSLStripBrowser Attacker

GEThttpbankingcom

Answer HTML page eg withlink to httploginbankingcom

Server

httpbankingcom

Modify server answer Rewrite everylta href=ldquohttpsrdquogt to lta href=ldquohttprdquogt and keep map of changes

GEThttploginbankingcom httpsloginbankingcom

Protection HSTS

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 11: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

hellipby faking server certificates

Problem Users often accept invalid or self-signed certificates anyway

We have ~130 certificate authorities (CA) in our browserslsquo trust stores

They are not equally rigid when issuing certificates

bdquoRogue certificateldquo could be obtained and misused

Exploit validation flaws - especially with mobile apps

Can overwrite certificate validation routines

Many apps silently (without warning) accept invalid certificates

MITM Attack

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 12: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

MITM Attack

googlecom

googlecom

Client

1 Client requests page via https

2 Attacker impersonates serverusing fraudulent cert

3 Attacker intercepts requestand performs it himself

4 Attacker receives responsedelivers it to client

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 13: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Tools sslsplit

mitmproxy

Fiddler

Burp Suite

MITM Attack

Source httpgooglEjihVg

Source httpsgoogliKnd7J

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 14: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

What do you do if you receive an alert

Many users proceed anyway

33 of Firefox users

56 of Chrome users

Why so many invalid certs Misconfiguration of server

Eg cert does not match domain name

Certificate issues

User called domain name (wwwdomainat) but cert only valid for domainat

Validity expired

Certificate Warnings

See httpsgoogl6gcir5

See httpgooglS2oW8y

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 15: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

PKI Attacks

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 16: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Public Key Infrastructure (PKI) Goal Enable secure communication of parties that have never met

Principles Identity Authority Trust

But what is Trust (not) Basically just says that certificate can be validated by a CA in our trust store

Trust can be inherited by intermediate CAs

Certificate Authorities (CAs) decide what is trustworthy

Note 46 countries with valid CAsUSA South Africa England Belgium Japan Germany Netherlands Israel

Saudi Arabia Iceland Russia Macedonia hellip do you trust them

Overview

See httpsgooglVAYROa

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 17: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Permission of domain owners not required for certificate issuance

Any CA can issue certificate for any domain without permission

Weak domain validation

bdquoDomain-validatedldquo certificates issued based on whether you control a domaineg confirm mail receipt to webmasterdomaincom or place file within directory

Revocation does not work

Theory Browsers check against blacklists (CRL OCSP) whether cert is blacklisted

Practice If check takes too long bdquosoft-failldquo without error message

Trust is not agile

We either trust a CA or not nothing in between eg grading

PKI Weaknesses

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 18: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Best attack for PKI attack Get root key

How Steal them

Harder because keys often enclosedin Hardware Security Module (HSM)

Governmental agency simply request them from CAs

Break root (or intermediate) certs

Until 2014 Still (weak) 1024-bit RSAcertificates in Firefox

Root Key Compromise

Source httpsgooglSRuWKQ

Source httpgooglQAYdNL

See httpsgooglT7cN66

See httpsgoogleCehMN

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 19: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

The first CA to be completely compromisedhellip

Public discovery on 27082011 ndash obviously hacked since July

Iranian user had problems accessing his mail account

CA Breach ndash DigiNotar

Source httpsgoogl0rd3Uw

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 20: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Some days later it become public that the problem is (a lot) biggerhellip

CA Breach ndash DigiNotar

The most critical servers contain malicious software that can normally be detected by anti-virus software We have

strong indications that the CA-servers although physically very securely placed in a tempest proof environment were

accessible over the network from the management LAN

- The network has been severely breached All CA servers were members of one Windows domain which made it possible

to access them all using one obtained userpassword combination The password was not very strong and could easily

be brute-forced

- The software installed on the public web servers was outdated and not patched

- No antivirus protection was present on the investigated servers

- An intrusion prevention system is operational It is not clear at the moment why it didnrsquot block some of the outside web

server attacks No secure central network logging is in place

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 21: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Attacker issued gt 500 certificates for widely-known websites

All certificates forged legitimate OCSP revocation information

Browsers asked real OCSP servers for revocation info of rogue certificates

Enabled DigiNotar to trace back certificate usage to mostly Iran

CA Breach ndash DigiNotar

comorgandroidcomglobalsigncommozillaorgskypecomtorprojectorg wordpresscom

loginlivecomloginyahoocomgooglecomwwwfacebookcomtwittercomwindowsupdatecomwwwupdatemicrosoftcomaddonsmozillaorg

digicertcomstartsslcomaolcomwwwmossadgovilwwwciagovmicrosoftcomthawtecomhellip

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 22: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

2012 Highly-advanced malware found

Found in several Middle East countries

Iran Israel Sudan Syria Egypt hellip

Active for two years

Fairly complex

Over 20 attack modules

Network sniffing microphoneactivation file retrieval hellip

Most interesting aspectUsed a valid certificate not signed by a CA

Flame Malware

Source httpsgooglevDHnZ

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 23: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Assume PC has been infected via USB stick How to attack other hosts in same network

Via direct remote exploits

What if OS is not specifically vulnerable

Attack something that each Windows PC has Update functionality

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host CLocalnetwork

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 24: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Get hosts to download Update from attackerlsquos server

Strategy Within LANs we often need proxies to allow browser to access Internet

Manual configuration takes a lot of time

Web Proxy Auto DiscoveryProtocol (WPAD) invented

IdeaDistribute proxy informationto browsers using PAC(Proxy Auto Config) file format

Flame ndash Windows Update

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 25: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

How WPAD works

Host asks via DHCP DNS and NetBIOS protocols for file wpaddat

Eg find proxy via NetBIOS (= address resolution in MS protocol world)

Name resolution using broadcasts infected host answers

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network WPAD protocol

Infected host tellsothers via NetBIOS bdquoI have a PAC file foryour browserldquo

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 26: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Hosts have received PAC file with contentldquoFor updatemicrosoftcom use attackerproxycomrdquo Now hosts ask Windows Update for news

Flame ndash Windows Update

Windows Updateupdatemicrosoftcom

Host A (infected)

Host B Host C

Local network

PAC file PAC file

attackerproxycom

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 27: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Now not-yet infected hosts go to updateattackercom for Windows UpdatesWe want to distribute Flame via Windows update file

Q Doesnlsquot updatemicrosoftcom use HTTPS

A It also accepts HTTP -)

Q Doesnlsquot Microsoft sign updates using special Code Signing certificates

A There was an old CA that used MD5 signatures for certificates

MD5 is broken since many years - cryptographic attack possible

Quite easy to find collision create certificate andmake it seem to be signed by the CA

Flame ndash Windows Update

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 28: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Attacker used attack on MD5 to create valid certificate Most interesting thing New so far unknown attack method used bdquoChosen-prefix collision attackldquo very timing and cost-intensive collision search

Flame ndash Windows Update

MD5 Hash (128-bit)

CN = updatemicrosoftcom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

MD5 Hash (128-bit)

CN = updateattackercom

Valid from to

Other data

Public Key

Signed MD5 Hash(by private CA key)

Private Key (Attacker)

equal

equal

Private Key (CA) Attacker signedmalware (Windows Update package)with own private key

Windows happilyinstalled the malware

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 29: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Public Key Pinning (RFC 7469)

Addresses problem that any CA can issue any certificate

Enables site owners to explicitly specify legitimate fingerprints

DANE (RFC 6698)

Based on DNSSEC (integrity checking for DNS zones)

Alternative approach for pinning

Certificate Transparency (CT)

Framework to audit and monitor certificates quickly find fraudulent certificates

Legitimate CAs shall submit certificates to CT logs

If unknown certificate used for site warn client

Improvements

See httpsgoogl2kqVTT

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 30: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

Implementation Attacks

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 31: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

ProblemThose who design protocols ciphers are often not those who implement it

Many have critical conceptual flaws but even more bdquobad codeldquo is out there

Bypassing (strong) crypto is always easier than breaking ithellip

Types On-purpose interception of encrypted traffic

Install root certificate in userlsquos browser and perform MITM attack

Certificate Validation Flaws

Library issues

Wrong usage of APIs

Overview

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 32: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Products want to manipulateeven encrypted web traffic

bdquoEnterpriseldquo security products Antiviruses Ad-Blockers Adware hellip

bdquoSuperfishldquo

Analyzes images on webpagesand provides matching ads

Preinstalled on many Lenovos

Became public in 022015

Same issue with others eg on Dell notebook (112015)

Source httpgooglesDjtS

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 33: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Superfish

Wouldnlsquot Certificate Pinning (HPKP) uncover such a MITM attackSad truth No because manually installed root CAs disable pinning in browsers

See httpsgooglOZksTj and httpsgooglteWRTO

Test whether you are affected by Superfish amp friendshttpssuperfishtlsfundehttpsbadsslcomdashboard

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 34: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

How to check certificates correctly1 Ensure server certificate corresponds to intended domain name

2 All chain certificates must be checked that

They have not expired

Their signatures are valid

3 Foreach intermediate certificate check

What key usage is allowed eg sign certificates for web but not Code Signing

That it can be used to sign the hostname in the leaf certificate

How to do it correctly with OpenSSL See httpsgooglqbFDZw

Certificate Validation Flaws

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 35: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Recurring problems in widely-usedlibraries (OpenSSL GnuTLS Microsoft Crypto API hellip)

Padding oracleAllow attacker to repeatedlyprobe encrypted payload forclues about plaintext inside

Memory corruptionCode execution using malformeddigital signatures

The ASN1 implementation in OpenSSL before 101o and 102 before

102c allows remote attackers to execute arbitrary code or cause a

denial of service (buffer underflow and memory corruption) via an ANY

field in crafted serialized data aka the negative zero issue

Source httpgooglJElv4d

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 36: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Information disclosure vulnerability in OpenSSL

Exploits faulty implementation of bdquoHeartbeatldquo protocol

How Developer forgot to check length of input variable

Attacker may request up to 64 KB of server process memory

Consequences Leak of private session information

Response could include session cookies passwords etc

Private keys

Simple but slow Search for prime numbers in Heartbleed message

If one prime found enough to calculate private RSA key

Heartbleed

See httpsgooglPC9liK

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 37: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

What went wrong

goto failAbout the security content of iOS 706

Impact An attacker with a privileged network position may capture or modify data in sessions protected by SSLTLS

Description Secure Transport failed to validate the authenticity of the connection This issue was addressed by restoring

missing validation stepsSource httpgooglxQQTkU

static OSStatus SSLVerifySignedServerKeyExchange(SSLContext ctx

bool isRsa SSLBuffer signedParams hellip)

if ((err = SSLHashSHA1update(amphashCtx ampsignedParams)) = 0)

goto fail

goto failhellip

err = sslRawVerify(ctx ctx-gtpeerPubKey dataToSign dataToSignLen

signature signatureLen)

Source httpgoogliK8FbN

Code will always jump to fail after second goto fail

Skips call to sslRawVerify

Intended signature verificationwill never be executed

Any private key will be accepted See httpsgooglVYJDDk

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 38: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

NSA found a certificate validation bug (CVE-2020-0601) concerning ECDSA signatures

Whatlsquos the problemCryptoAPIrsquos CA certificate cache falsely thinks a fake root CA is also part of theCA certificate store as soon as its public key and serial number match a certificate that is already in in the cache

ConsequenceAttackers can spoof trusted ECC root certs by crafting valid private keys by just copying public key + all used cert parameters

Windows forgets to check the base point generator Grsquo

A spoofing vulnerability exists in the way Windows CryptoAPI

(Crypt32dll) validates Elliptic Curve Cryptography (ECC)

certificates Attackers can exploit it by using a spoofed code-

signing certificate to sign a malicious executable A successful

exploit could also allow the attacker to conduct man-in-the-

middle attacks and decrypt confidential information on user

connections to the affected software

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 39: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

Protocol Attacks

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 40: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Overview

Source Cloudflare

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 41: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Past attacks in categorieshellip

Downgrade attacks Freak Logjam

Compression attacks Crime Time Breach

Attacks via Padding Oracles Lucky 13 Beast Poodle

RSA-related attacks Bleichenbacher Drown

Insecure Renegotiation

Overview

See httpsgooglvKwCm4

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 42: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Problem For compatibility reasons weak ciphers often remain activated

Attacker could trick server amp client into negotiating connections using them

Example bdquoFactoring RSA Export Keysldquo (FREAK) - 2014

1 Perform MITM attack

2 Swap supported ciphers with EXPORT cipher (= weak encryption key)

3 Crack EXPORT key

Downgrade Attacks

RSA-EXPORT-WITH-RC4-40-MD5

RSA-EXPORT-WITH-DES40-CBC-SHA

DHE-DSS-EXPORT-WITH-RC4-56-SHA

EXPORT suites

512-bit RSA key 40-bit RC4 key

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 43: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

FREAK Client Attacker

Client RandomSupported CiphersSupported Curves

Client generatesweak shared key

Server

Server RandomEXPORT CipherCertificateServerKeyExchangeSignature

ClientKeyExchangeChangerCipherSpec

Finished Message(Original)

Client RandomEXPORT Cipher (40-bit key)Supported Curves

Brute forceall 240 keys

ClientKeyExchangeChangerCipherSpecFinished Message (Modified)

Server generatesweak shared key

ChangerCipherSpecFinished Message(Modified)

ChangerCipherSpecFinished Message (Original)

All traffic beyond this point is encrypted with weak shared keys Attacker can readmodify everything

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 44: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

= bdquoMessage length side channelldquo bdquoCompression Oracleldquo

Problem If server applies compression on encrypted data

attackers may add own data which is then also compressed

Size of compressed content lets you draw conclusions on content

How does it work Compression algorithms eliminate redundancy repeated characters

If size of compressed content is reduced despite appending bytes to encrypted msg Attacker can assume

Injected content matches some part of unknown source part he tries to find out

Compression Attacks

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 45: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

bdquoOracleldquo exists if attacker can add arbitrary data compressed in same way assome unknown secret data Now by observing size of compressed output if output size reduced by compression guess was correct

Example

Compression AttacksIf you canrsquot forgive yourself

how can you forgive someone else

Compression would keep only one copyof duplicated data

GET JSESSIONID=X HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

GET JSESSIONID=B HTTP11

Host wwwexamplecom

Cookie JESSIONID=B3DF4B07AE33CA

Injected data X incorrect guess 73 bytes compressed B correct guess 72 bytes compressed

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 46: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

= Decrypting RSA with Obsolete and Weakened Encryption

Ingredients Practical attack against SSLv2

Same certificate shared among used protocols (SSLv2 hellip TLS 12)

Implementation errors in OpenSSL

Non-standard compliant SSLv2 client can force handshake

EXPORT ciphers do keep some bits unencrypted

ConsequenceEnables MITM attacks where attacker can decrypt session keys

See httpsdrownattackcom

DROWN Attack

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 47: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

DROWN Attack

Source httpsgooglnuhsfT

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 48: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

X509 certificate handling amp ASN1 parsing are hard to implement correctly

Before breaking SSL TLS protocolsbdquocheaperldquo to attack PKIs or exploit implementation flaws

On-purpose TLS interception is dangerous nobody gets it right

If attackers can identify only one bit of information it is over

bdquoBrute-Forcingldquo via Compression Padding or Timing Oracles

Enabled support for weak insecure ciphers and protocols forcompatibility poses serious risks Downgrade attacks

Lessons Learned

See httpsgooglteWRTO

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 49: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

DNS Security

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 50: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Once upon a timehellipDNS was designed for a closed environment (ARPAnet) ndash this changed obviouslyhellip

Attacking DNS servers Denial-of-Service attacks

Make it unavailable What happens if a DNS server cannot be reached -)

DNS Amplification attack

Multiply amount of traffic flood thanks to bdquolarge repliesldquo after bdquosmall queriesldquo

Cache Poisoning

Let user connect to wrong destination IP address

DNS Issues

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 51: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

What happenedDNS Amplification Attackproducing 300 Gbits traffic on spamhausorg

Why is this problematic 300 Gbs is the scale that

threatens the Internetlsquos corerouters (Tier-1)

By overloading them you riskbreaking global connectivity

RemedyWell Anycasting helpsmore or lesshellip

Source httpgooglczi8eZ

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 52: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Idea Amplify the bandwidth you can use for a DDoS attack

Ingredients1 Being able to set an arbitrary (spoofed) source IP address

eg via ICMP UDP as they require no handshake

2 Make response to query significantly larger than the request

3 Apply this operation distributed using bdquoOpen DNS resolverldquo Servers that resolve recursive DNS requests for anyone on Internet

Why does it workEg attacker sends query with eg 60 bytes response has 3000 bytes Traffic amplification factor of 50

Attacker queries with 100 Mbits responses produce 5 Gbits

DNS Amplification Attack

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 53: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

ScenarioYou go to a cafeacute and use their WiFi How does your browser find wwwgoogleat

Mostly like thishellip Ask local name server obtained via DHCP

You implicitly trust this server

Can return any answer for googleatincluding a malicious IP address that acts as Man-in-the-middle

Think of captive portals hotspot login pages that arise after connectinghellip

How can you know you are getting the bdquocorrectldquo response -)

DNS Security

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 54: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Scenario Assume you control the DNS zone evilat

You receive a query for wwwevilat and reply

Cache Poisoning

QUESTION SECTION

wwwevilat IN A

ANSWER SECTION

wwwevilat 3600 IN A 7252490

AUTHORITY SECTION

evilat 600 IN NS ns1evilat

evilat 600 IN NS googleat

ADDITIONAL SECTION

googleat 5 IN A 7252490

Glue record pointing toattackerlsquos IP not Googlelsquos

And it gets cached

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 55: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

ProblemHow do you get a victim to look up evilatFor the attack to work your forged DNS entry has to be fetchedhellip

One possible solution You might connect to their mail server and send

The mail server will look up to check if it correspondsto the connecting IP address (SPAM filtering)

While resolving you also learn the tainted DNS record

MitigationOnly accept glue records from the domain you asked forhellip

Cache Poisoning

HELO wwwevilat

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 56: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Q How to protect against forged oder manipulated DNS dataA DNS Security Extensions (DNSSEC)

How Chain-of-Trust between all involved name servers

DNSSEC-enabled servers digitally sign all their answers cryptographically

Use (secret) private RSA key for signing

DNS resolvers verify if signature matches received records

Public RSA key for verification is normal RR with type bdquoDNSKEYldquo

EffectDNS content cannot be modified without being detected

Defense

IAIK

Lecture examOutlook

Page 57: TLS Attacks & DNS Security · - No antivirus protection was present on the investigated servers. - An intrusion prevention system is operational. It is not clear at the moment why

IAIK

Lecture examOutlook