CNIT 129S: Ch 6: Attacking Authentication

Sam Bowne
Sam BowneInstructor at CCSF um CCSF
CNIT 129S: Securing
Web Applications
Ch 6: Attacking Authentication
Authentication Technologies
• Over 90% of apps use name & password
More Secure Methods
• Two-factor authentication
(or more)
• PIN from a token, SMS
message, or mobile app
• In addition to a
password
• Submitted through an
HTML form
Cryptographic Methods
• Client-side SSL certificate
• Smartcards
• More expensive, higher overhead
HTTP Authentication
• Basic, Digest, and Windows-integrated
• Rarely used on the Internet
• More common in intranets, especially Windows
domains
• So authenticated employees can easily
access secured resources
Third-Party Authentication
Third-Party Authentication
Link Ch 6b
Third-Party Authentication
Design Flaws
• Bad Passwords
CNIT 129S: Ch 6: Attacking Authentication
Brute-Force Attacks
• Strictly, "brute force" refers to
trying every possible combination
of characters
• Very slow
• In practice, attackers use lists of
common passwords
• Defense: account lockout rules
after too many failed login attempts
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking Authentication
Poor Attempt Counters
• Cookie containing failedlogins=1
• Failed login counter held within the current
session
• Attacker can just withhold the session cookie
to defeat this
• Sometimes a page continues to provide
information about a password's correctness
even after account lockout
Insecure Lockout
CNIT 129S: Ch 6: Attacking Authentication
CNIT 129S: Ch 6: Attacking Authentication
Verbose Failure Messages
• Friendly for legitimate users
• But helpful for attackers
CNIT 129S: Ch 6: Attacking Authentication
Script to Find Phone #s
• echo $1,`curl -d "customerEmailAddress=
$1" "https://www.att.com/olam/
submitSLIDEmailForgotIdSlid.myworld" -
silent| grep -Po '(?<=provided ()d*'`
• When you run 

getatt.sh john.smith@example.com

it will output a line of text that looks like:
• john.smith@example.com,6782345678
• Link Ch 6d
Username Importance
• Attacks that reveal valid usernames are called
"username enumeration"
• Not as bad as finding a password, but still a
privacy intrusion
• But could be used for social engineering
attacks, such as spearphishing emails
Similar but Non-Identical
Error Messages
• Any difference can be exploited; even response
time
Vulnerable Transmission of
Credentials
• Eavesdroppers may reside:
HTTPS Risks
• If credentials are sent unencrypted, the
eavesdropper's task is trivial, but even HTTPS
can't prevent these risks:
• Credentials sent in the query string are likely
to appear in server logs, browser history, and
logs of reverse proxies
• Many sites take credentials from a POST and
then redirect it (302) to another page with
credentials in the query string
HTTPS Risks
• Cookie risks:
• Web apps may store credentials in cookies
• Even if cookies cannot be decrypted, they can be
re-used
• Many pages open a login page via HTTP and use an
HTTPS request in the form
• This can be defeated by a man-in-the-middle
attack, like sslstrip
CNIT 129S: Ch 6: Attacking Authentication
Password Change
Functionality
• Periodic password change mitigates the threat
of password compromise (a dubious claim)
• Users need to change their passwords when
they believe them to be compromised
Vulnerable Password
Change Systems
• Reveal whether the requested username is valid
• Allow unrestricted guesses of the "existing
password" field
• Validate the "existing password" field before
comparing the "new password" and "confirm
new password" fields
• So an attacker can test passwords without
making any actual change
Password Change Function
• Identify the user
• Validate "existing password"
• Integrate with any account lockout features
• Compare the new passwords with each other
and against password quality rules
• Feed back any error conditions to the user
• Often there are subtle logic flaws
Forgotten Password
Functionality
• Often the weakest link
• Uses a secondary challenge, like "mother's
maiden name"
• A small set of possible answers, can be brute-
forced
• Often can be found from public information
Forgotten Password
Functionality
• Often users can write their own questions
• Attackers can try a long list of usernames
• Seeking a really weak question, like "Do I own
a boat?"
• Password "Hints" are often obvious
Forgotten Password
Functionality
• Often the mechanism used to reset the
password after a correct challenge answer is
vulnerable
• Some apps disclose the forgotten password to
the user, so an attacker can use the account
without the owner knowing
• Some applications immediately let the user in
after the challenge--no password needed
Forgotten Password
Functionality
• Some apps allow the user to specify an email
for the password reset link at the time the
challenge is completed
• Or use email from a hidden field or cookie
• Some apps allow a password reset and don't
notify the user with an email
"Remember Me"
• Sometimes a simple persistent cookie, like
• RememberUser=jsmith
• Session=728
• No need to actually log in, if username or
session ID can be guessed or found
"Remember Me"
• Even if the userid or session token is properly
encrypted, it can be stolen via XSS or by getting
access to a user's phone or PC
User Impersonation
• Sometimes help desk personnel or other special
accounts can impersonate users
• This may have flaws like
• Implemented with a "hidden" function lacking
proper access controls, such as
• /admin/ImpersonateUser.jsp
• A guessable session number
• A fixed backdoor password
Incomplete Validation
• Some applications
truncate passwords
without telling users
• Also strip unusual
characters
• Link Ch 6e
Nonunique Usernames
• Rare but it happens
• You may be able to create a new account with
the same username as an existing account
• During registration or a password change
• If the password also matches, you can detect
that from a different error messge
Predictable Usernames
• Automatically generated names like
• User101, User102, ...
Predictable Initial Passwords
• User accounts are create in large batches
• All have the same initial password
Insecure Distribution of
Credentials
• Passwords sent by email, SMS, etc.
• Users may never change those credentials
• Activation URLs may be predictable
• Some apps email the new password to the user
after each password change
Implementation Flaws
Fail-Open Login
• Blank or invalid username may cause an
exception in the login routine
• Or very long or short values
• Or letters where numbers are expected...
• And allow the user in
Multistage Login
• Enter username and password
• Enter specific digits from a PIN (a CAPTCHA)
• Enter value displayed on a token
Multistage Login Defects
• May allow user to skip steps
• May trust data that passes step one, but let user
change it, so invaid or locked-out accounts
remain available
• May assume that the same username applies to
all three stages but not verify this
Multistage Login Defects
• May use a randomly-chosen question to verify
the user
• But let the attacker alter that question in a
hidden HTML field or cookie
• Or allow many requests, so attacker can choose
an easy question
Insecure Credential Storage
• Plaintext passwords in database
• Hashed with MD5 or SHA-1, easily cracked
Securing Authentication
• Considerations
• How critical is security?
• Will users tolerate inconvenient controls?
• Cost of supporting a user-unfriendly system
• Cost of alternatives, compare to revenue
generated or value of assets
Strong Credentials
• Minimum password length, requiring alphabetical,
numeric, and typographic characters
• Avoiding dictionary words, password same as
username, re-use of old passwords
• Usernames should be unique
• Automatically generated usernames or passwords
should be long and random, so they cannot be
guessed or predicted
• Allow users to set strong passwords
Handle Credentials
Secretively
• Protect then when created, stored, and transmitted
• Use well-established cryptography like SSL, not
custom methods
• Whole login page should be HTTPS, not just the
login button
• Use POST rathern than GET
• Don't put credentials in URL parameters or cookies
Handle Credentials
Secretively
• Don't transmit credentials back to the client,
even in parameters to a redirect
• Securely hash credentials on the server
Hashing
• Password hashes must be salted and stretched
• Salt: add random bytes to the password before
hashing it
• Stretched: many rounds of hashing (Kali Linux 2
uses 5000 rounds of SHA-512)
CNIT 129S: Ch 6: Attacking Authentication
Handle Credentials
Secretively
• Client-side "remember me" functionality should
remember only nonsecret items such as
usernames
• If you allow users to store passwords locally,
they should be reversibly encrypted with a key
known only to the server
• And make sure there are no XSS
vulnerabilities
Handle Credentials
Secretively
• Force users to change passwords periodically
• Credentials for new users should be sent as
securely as possible and time-limited; force
password change on first login
• Capture some login information with drop-down
lists instead of text fields, to defeat keyloggers
Validate Credentials
Properly
• Validate entire credential, with case sensitivity
• Terminate the session on any exception
• Review authentication logic and code
• Strictly control user impersonation
Multistage Login
• All data about progress and the results of
previous validation tasks should be held in the
server-side session object and never available
to the client
• No item of information should be submitted
more than once by the user
• No means for the user to modify data after
submission
Multistage Login
• The first task at every stage should be to verify
that all prior stages have been correctly
completed
• Always proceed through all stages, even if the
first stage fails--don't give attacker any
information about which stage failed
Prevent Information Leakage
• All authentication failures should use the same
code to produce the same error message
• To avoid subtle differences that leak
information
• Account lockout can be used for username
enumeration
• Login attempts with invalid usernames should
lead to the same error messages as valid ones
Self-Registration
• Allowing users to choose usernames permits
username enumeration. Better methods:
• Generate unique, unpredictable usernames
• Use e-mail addresses as usernames and
require the user to receive and use an email
message
Prevent Brute-Force Attacks
• At login, password change, recover lost password, etc.
• Using unpredictable usernames and preventing their
enumeration makes brute-force attacks more difficult
• High-security apps like banks disable an account after
several failed logins
• Account holder must do something out-of-band to
re-activate account, like phone customer support
and answer security questions
• A 30-minute delay is friendlier and cheaper
Prevent Brute-Force Attacks
• Consider this type of attack
• Use many different usernames with the same
password, such as "password"
• Defenses: strong password rules, CAPTCHA
Password Change
• No way to change username
• Require user to enter the old password
• Require new password twice (to prevent
mistakes)
• Same error message for all failures
• Users should be notified out-of-band (such as
via email) that the password has been changed
Account Recovery
• For security-critical apps, require account
recovery out-of-band
• Don't use "password hints"
• Email a unique, time-limited, unguessable,
single-use recovery URL
Account Recovery
• Challenge questions
• Don't let users write their own questions
• Don't use questions with low-entropy
answers, such as "your favorite color"
Log, Monitor, and Notify
• Log all authentication-related events
• Protect logs from unauthorized access
• Anomalies such as brute-force attacks should
trigger IDS alerts
• Notify users out-of-band of any critical security
events, such as password changes
• Notify users in-band of frequent security events,
such as time and source IP of the last login
1 von 66

Recomendados

Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms von
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsCh 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense MechanismsSam Bowne
4K views59 Folien
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms von
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms
Ch 1: Web Application (In)security & Ch 2: Core Defense Mechanisms Sam Bowne
562 views59 Folien
CNIT 129S: Ch 7: Attacking Session Management von
CNIT 129S: Ch 7: Attacking Session Management CNIT 129S: Ch 7: Attacking Session Management
CNIT 129S: Ch 7: Attacking Session Management Sam Bowne
1.1K views128 Folien
Presentation on Web Attacks von
Presentation on Web AttacksPresentation on Web Attacks
Presentation on Web AttacksVivek Sinha Anurag
1.3K views22 Folien
Security in distributed systems von
Security in distributed systems Security in distributed systems
Security in distributed systems Haitham Ahmed
53K views109 Folien
Authentication techniques von
Authentication techniquesAuthentication techniques
Authentication techniquesIGZ Software house
11.3K views33 Folien

Más contenido relacionado

Was ist angesagt?

CNIT 129S Ch 4: Mapping the Application von
CNIT 129S Ch 4: Mapping the ApplicationCNIT 129S Ch 4: Mapping the Application
CNIT 129S Ch 4: Mapping the ApplicationSam Bowne
297 views84 Folien
Authentication vs authorization von
Authentication vs authorizationAuthentication vs authorization
Authentication vs authorizationFrank Victory
4.3K views7 Folien
Malicious software von
Malicious softwareMalicious software
Malicious softwarerajakhurram
12.9K views67 Folien
Password Management von
Password ManagementPassword Management
Password ManagementRick Chin
4.7K views21 Folien
User Authentication: Passwords and Beyond von
User Authentication: Passwords and BeyondUser Authentication: Passwords and Beyond
User Authentication: Passwords and BeyondJim Fenton
2.5K views55 Folien
Block Cipher and its Design Principles von
Block Cipher and its Design PrinciplesBlock Cipher and its Design Principles
Block Cipher and its Design PrinciplesSHUBHA CHATURVEDI
3.4K views8 Folien

Was ist angesagt?(20)

CNIT 129S Ch 4: Mapping the Application von Sam Bowne
CNIT 129S Ch 4: Mapping the ApplicationCNIT 129S Ch 4: Mapping the Application
CNIT 129S Ch 4: Mapping the Application
Sam Bowne297 views
Authentication vs authorization von Frank Victory
Authentication vs authorizationAuthentication vs authorization
Authentication vs authorization
Frank Victory4.3K views
Malicious software von rajakhurram
Malicious softwareMalicious software
Malicious software
rajakhurram12.9K views
Password Management von Rick Chin
Password ManagementPassword Management
Password Management
Rick Chin4.7K views
User Authentication: Passwords and Beyond von Jim Fenton
User Authentication: Passwords and BeyondUser Authentication: Passwords and Beyond
User Authentication: Passwords and Beyond
Jim Fenton2.5K views
Malware Classification and Analysis von Prashant Chopra
Malware Classification and AnalysisMalware Classification and Analysis
Malware Classification and Analysis
Prashant Chopra1.4K views
CNIT 129S: 8: Attacking Access Controls von Sam Bowne
CNIT 129S: 8: Attacking Access ControlsCNIT 129S: 8: Attacking Access Controls
CNIT 129S: 8: Attacking Access Controls
Sam Bowne1.2K views
User authentication von CAS
User authenticationUser authentication
User authentication
CAS5.4K views
CNIT 129S: Ch 4: Mapping the Application von Sam Bowne
CNIT 129S: Ch 4: Mapping the ApplicationCNIT 129S: Ch 4: Mapping the Application
CNIT 129S: Ch 4: Mapping the Application
Sam Bowne1.7K views
Web Security Attacks von Sajid Hasan
Web Security AttacksWeb Security Attacks
Web Security Attacks
Sajid Hasan518 views
CNIT 129S: 11: Attacking Application Logic von Sam Bowne
CNIT 129S: 11: Attacking Application LogicCNIT 129S: 11: Attacking Application Logic
CNIT 129S: 11: Attacking Application Logic
Sam Bowne1.1K views
Intruders and Viruses in Network Security NS9 von koolkampus
Intruders and Viruses in Network Security NS9Intruders and Viruses in Network Security NS9
Intruders and Viruses in Network Security NS9
koolkampus13.3K views
Cross Site Scripting ( XSS) von Amit Tyagi
Cross Site Scripting ( XSS)Cross Site Scripting ( XSS)
Cross Site Scripting ( XSS)
Amit Tyagi27.2K views
12 symmetric key cryptography von drewz lin
12   symmetric key cryptography12   symmetric key cryptography
12 symmetric key cryptography
drewz lin9.9K views
CNIT 129S: Ch 3: Web Application Technologies von Sam Bowne
CNIT 129S: Ch 3: Web Application TechnologiesCNIT 129S: Ch 3: Web Application Technologies
CNIT 129S: Ch 3: Web Application Technologies
Sam Bowne1.2K views

Destacado

CNIT 40: 6: DNSSEC and beyond von
CNIT 40: 6: DNSSEC and beyondCNIT 40: 6: DNSSEC and beyond
CNIT 40: 6: DNSSEC and beyondSam Bowne
721 views30 Folien
CNIT 129S: Ch 5: Bypassing Client-Side Controls von
CNIT 129S: Ch 5: Bypassing Client-Side ControlsCNIT 129S: Ch 5: Bypassing Client-Side Controls
CNIT 129S: Ch 5: Bypassing Client-Side ControlsSam Bowne
2.2K views94 Folien
CNIT 121: 12 Investigating Windows Systems (Part 3) von
CNIT 121: 12 Investigating Windows Systems (Part 3)CNIT 121: 12 Investigating Windows Systems (Part 3)
CNIT 121: 12 Investigating Windows Systems (Part 3)Sam Bowne
1.1K views55 Folien
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3) von
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)Sam Bowne
1.1K views73 Folien
CNIT 121: 4 Getting the Investigation Started on the Right Foot & 5 Initial D... von
CNIT 121: 4 Getting the Investigation Started on the Right Foot & 5 Initial D...CNIT 121: 4 Getting the Investigation Started on the Right Foot & 5 Initial D...
CNIT 121: 4 Getting the Investigation Started on the Right Foot & 5 Initial D...Sam Bowne
955 views70 Folien
CNIT 121: 11 Analysis Methodology von
CNIT 121: 11 Analysis MethodologyCNIT 121: 11 Analysis Methodology
CNIT 121: 11 Analysis MethodologySam Bowne
966 views57 Folien

Destacado(20)

CNIT 40: 6: DNSSEC and beyond von Sam Bowne
CNIT 40: 6: DNSSEC and beyondCNIT 40: 6: DNSSEC and beyond
CNIT 40: 6: DNSSEC and beyond
Sam Bowne721 views
CNIT 129S: Ch 5: Bypassing Client-Side Controls von Sam Bowne
CNIT 129S: Ch 5: Bypassing Client-Side ControlsCNIT 129S: Ch 5: Bypassing Client-Side Controls
CNIT 129S: Ch 5: Bypassing Client-Side Controls
Sam Bowne2.2K views
CNIT 121: 12 Investigating Windows Systems (Part 3) von Sam Bowne
CNIT 121: 12 Investigating Windows Systems (Part 3)CNIT 121: 12 Investigating Windows Systems (Part 3)
CNIT 121: 12 Investigating Windows Systems (Part 3)
Sam Bowne1.1K views
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3) von Sam Bowne
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
CNIT 121: 12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne1.1K views
CNIT 121: 4 Getting the Investigation Started on the Right Foot & 5 Initial D... von Sam Bowne
CNIT 121: 4 Getting the Investigation Started on the Right Foot & 5 Initial D...CNIT 121: 4 Getting the Investigation Started on the Right Foot & 5 Initial D...
CNIT 121: 4 Getting the Investigation Started on the Right Foot & 5 Initial D...
Sam Bowne955 views
CNIT 121: 11 Analysis Methodology von Sam Bowne
CNIT 121: 11 Analysis MethodologyCNIT 121: 11 Analysis Methodology
CNIT 121: 11 Analysis Methodology
Sam Bowne966 views
CNIT 121: 2 IR Management Handbook von Sam Bowne
CNIT 121: 2 IR Management HandbookCNIT 121: 2 IR Management Handbook
CNIT 121: 2 IR Management Handbook
Sam Bowne1.9K views
CNIT 129S: 9: Attacking Data Stores (Part 1 of 2) von Sam Bowne
CNIT 129S: 9: Attacking Data Stores (Part 1 of 2)CNIT 129S: 9: Attacking Data Stores (Part 1 of 2)
CNIT 129S: 9: Attacking Data Stores (Part 1 of 2)
Sam Bowne1.2K views
CNIT 121: 3 Pre-Incident Preparation von Sam Bowne
CNIT 121: 3 Pre-Incident PreparationCNIT 121: 3 Pre-Incident Preparation
CNIT 121: 3 Pre-Incident Preparation
Sam Bowne2K views
CNIT 129S: 13: Attacking Users: Other Techniques (Part 1 of 2) von Sam Bowne
CNIT 129S: 13: Attacking Users: Other Techniques (Part 1 of 2)CNIT 129S: 13: Attacking Users: Other Techniques (Part 1 of 2)
CNIT 129S: 13: Attacking Users: Other Techniques (Part 1 of 2)
Sam Bowne692 views
CNIT 121: Computer Forensics Ch 1 von Sam Bowne
CNIT 121: Computer Forensics Ch 1CNIT 121: Computer Forensics Ch 1
CNIT 121: Computer Forensics Ch 1
Sam Bowne2.5K views
CNIT 121: 6 Discovering the Scope of the Incident & 7 Live Data Collection von Sam Bowne
CNIT 121: 6 Discovering the Scope of the Incident & 7 Live Data CollectionCNIT 121: 6 Discovering the Scope of the Incident & 7 Live Data Collection
CNIT 121: 6 Discovering the Scope of the Incident & 7 Live Data Collection
Sam Bowne1.3K views
CNIT 40: 3: DNS vulnerabilities von Sam Bowne
CNIT 40: 3: DNS vulnerabilitiesCNIT 40: 3: DNS vulnerabilities
CNIT 40: 3: DNS vulnerabilities
Sam Bowne1.3K views
CNIT 128 Ch 4: Android von Sam Bowne
CNIT 128 Ch 4: AndroidCNIT 128 Ch 4: Android
CNIT 128 Ch 4: Android
Sam Bowne644 views
CNIT 127 Ch Ch 1: Before you Begin von Sam Bowne
CNIT 127 Ch Ch 1: Before you BeginCNIT 127 Ch Ch 1: Before you Begin
CNIT 127 Ch Ch 1: Before you Begin
Sam Bowne1.2K views
Is Your Mobile App Secure? von Sam Bowne
Is Your Mobile App Secure?Is Your Mobile App Secure?
Is Your Mobile App Secure?
Sam Bowne857 views
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures von Sam Bowne
Practical Malware Analysis Ch 14: Malware-Focused Network SignaturesPractical Malware Analysis Ch 14: Malware-Focused Network Signatures
Practical Malware Analysis Ch 14: Malware-Focused Network Signatures
Sam Bowne2.1K views
CNIT 128 Ch 3: iOS von Sam Bowne
CNIT 128 Ch 3: iOSCNIT 128 Ch 3: iOS
CNIT 128 Ch 3: iOS
Sam Bowne503 views
CNIT 127 Ch 5: Introduction to heap overflows von Sam Bowne
CNIT 127 Ch 5: Introduction to heap overflowsCNIT 127 Ch 5: Introduction to heap overflows
CNIT 127 Ch 5: Introduction to heap overflows
Sam Bowne1.9K views
CNIT 40: 4: Monitoring and detecting security breaches von Sam Bowne
CNIT 40: 4: Monitoring and detecting security breachesCNIT 40: 4: Monitoring and detecting security breaches
CNIT 40: 4: Monitoring and detecting security breaches
Sam Bowne370 views

Similar a CNIT 129S: Ch 6: Attacking Authentication

CNIT 129S - Ch 6a: Attacking Authentication von
CNIT 129S - Ch 6a: Attacking AuthenticationCNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking AuthenticationSam Bowne
850 views71 Folien
Ch 6: Attacking Authentication von
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking AuthenticationSam Bowne
152 views73 Folien
CNIT 129: 6. Attacking Authentication von
CNIT 129: 6. Attacking AuthenticationCNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking AuthenticationSam Bowne
163 views73 Folien
Redesigning Password Authentication for the Modern Web von
Redesigning Password Authentication for the Modern WebRedesigning Password Authentication for the Modern Web
Redesigning Password Authentication for the Modern WebCliff Smith
257 views36 Folien
CISSP Prep: Ch 6. Identity and Access Management von
CISSP Prep: Ch 6. Identity and Access ManagementCISSP Prep: Ch 6. Identity and Access Management
CISSP Prep: Ch 6. Identity and Access ManagementSam Bowne
2.4K views68 Folien
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner... von
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Michael Pirnat
3.6K views109 Folien

Similar a CNIT 129S: Ch 6: Attacking Authentication(20)

CNIT 129S - Ch 6a: Attacking Authentication von Sam Bowne
CNIT 129S - Ch 6a: Attacking AuthenticationCNIT 129S - Ch 6a: Attacking Authentication
CNIT 129S - Ch 6a: Attacking Authentication
Sam Bowne850 views
Ch 6: Attacking Authentication von Sam Bowne
Ch 6: Attacking AuthenticationCh 6: Attacking Authentication
Ch 6: Attacking Authentication
Sam Bowne152 views
CNIT 129: 6. Attacking Authentication von Sam Bowne
CNIT 129: 6. Attacking AuthenticationCNIT 129: 6. Attacking Authentication
CNIT 129: 6. Attacking Authentication
Sam Bowne163 views
Redesigning Password Authentication for the Modern Web von Cliff Smith
Redesigning Password Authentication for the Modern WebRedesigning Password Authentication for the Modern Web
Redesigning Password Authentication for the Modern Web
Cliff Smith257 views
CISSP Prep: Ch 6. Identity and Access Management von Sam Bowne
CISSP Prep: Ch 6. Identity and Access ManagementCISSP Prep: Ch 6. Identity and Access Management
CISSP Prep: Ch 6. Identity and Access Management
Sam Bowne2.4K views
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner... von Michael Pirnat
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Shiny, Let’s Be Bad Guys: Exploiting and Mitigating the Top 10 Web App Vulner...
Michael Pirnat3.6K views
CNIT 125 6. Identity and Access Management von Sam Bowne
CNIT 125 6. Identity and Access ManagementCNIT 125 6. Identity and Access Management
CNIT 125 6. Identity and Access Management
Sam Bowne541 views
«How to start in web application penetration testing» by Maxim Dzhalamaga von 0xdec0de
«How to start in web application penetration testing» by Maxim Dzhalamaga «How to start in web application penetration testing» by Maxim Dzhalamaga
«How to start in web application penetration testing» by Maxim Dzhalamaga
0xdec0de811 views
5. Identity and Access Management von Sam Bowne
5. Identity and Access Management5. Identity and Access Management
5. Identity and Access Management
Sam Bowne1.7K views
CNIT 129S Ch 7: Attacking Session Management von Sam Bowne
CNIT 129S Ch 7: Attacking Session ManagementCNIT 129S Ch 7: Attacking Session Management
CNIT 129S Ch 7: Attacking Session Management
Sam Bowne204 views
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2) von Sam Bowne
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
CNIT 129S: 13: Attacking Users: Other Techniques (Part 2 of 2)
Sam Bowne825 views
Logical Attacks(Vulnerability Research) von Ajay Negi
Logical Attacks(Vulnerability Research)Logical Attacks(Vulnerability Research)
Logical Attacks(Vulnerability Research)
Ajay Negi8.1K views
Ch 7: Attacking Session Management von Sam Bowne
Ch 7: Attacking Session ManagementCh 7: Attacking Session Management
Ch 7: Attacking Session Management
Sam Bowne171 views
Introduction to Web Security von Kamil Lelonek
Introduction to Web SecurityIntroduction to Web Security
Introduction to Web Security
Kamil Lelonek665 views

Más de Sam Bowne

Cyberwar von
CyberwarCyberwar
CyberwarSam Bowne
13 views22 Folien
3: DNS vulnerabilities von
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities Sam Bowne
40 views40 Folien
8. Software Development Security von
8. Software Development Security8. Software Development Security
8. Software Development SecuritySam Bowne
21 views85 Folien
4 Mapping the Application von
4 Mapping the Application4 Mapping the Application
4 Mapping the ApplicationSam Bowne
61 views88 Folien
3. Attacking iOS Applications (Part 2) von
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)Sam Bowne
33 views45 Folien
12 Elliptic Curves von
12 Elliptic Curves12 Elliptic Curves
12 Elliptic CurvesSam Bowne
51 views50 Folien

Más de Sam Bowne(20)

3: DNS vulnerabilities von Sam Bowne
3: DNS vulnerabilities 3: DNS vulnerabilities
3: DNS vulnerabilities
Sam Bowne40 views
8. Software Development Security von Sam Bowne
8. Software Development Security8. Software Development Security
8. Software Development Security
Sam Bowne21 views
4 Mapping the Application von Sam Bowne
4 Mapping the Application4 Mapping the Application
4 Mapping the Application
Sam Bowne61 views
3. Attacking iOS Applications (Part 2) von Sam Bowne
 3. Attacking iOS Applications (Part 2) 3. Attacking iOS Applications (Part 2)
3. Attacking iOS Applications (Part 2)
Sam Bowne33 views
12 Elliptic Curves von Sam Bowne
12 Elliptic Curves12 Elliptic Curves
12 Elliptic Curves
Sam Bowne51 views
11. Diffie-Hellman von Sam Bowne
11. Diffie-Hellman11. Diffie-Hellman
11. Diffie-Hellman
Sam Bowne58 views
2a Analyzing iOS Apps Part 1 von Sam Bowne
2a Analyzing iOS Apps Part 12a Analyzing iOS Apps Part 1
2a Analyzing iOS Apps Part 1
Sam Bowne41 views
9 Writing Secure Android Applications von Sam Bowne
9 Writing Secure Android Applications9 Writing Secure Android Applications
9 Writing Secure Android Applications
Sam Bowne30 views
12 Investigating Windows Systems (Part 2 of 3) von Sam Bowne
12 Investigating Windows Systems (Part 2 of 3)12 Investigating Windows Systems (Part 2 of 3)
12 Investigating Windows Systems (Part 2 of 3)
Sam Bowne30 views
12 Investigating Windows Systems (Part 1 of 3 von Sam Bowne
12 Investigating Windows Systems (Part 1 of 312 Investigating Windows Systems (Part 1 of 3
12 Investigating Windows Systems (Part 1 of 3
Sam Bowne59 views
9. Hard Problems von Sam Bowne
9. Hard Problems9. Hard Problems
9. Hard Problems
Sam Bowne43 views
8 Android Implementation Issues (Part 1) von Sam Bowne
8 Android Implementation Issues (Part 1)8 Android Implementation Issues (Part 1)
8 Android Implementation Issues (Part 1)
Sam Bowne23 views
11 Analysis Methodology von Sam Bowne
11 Analysis Methodology11 Analysis Methodology
11 Analysis Methodology
Sam Bowne12 views
8. Authenticated Encryption von Sam Bowne
8. Authenticated Encryption8. Authenticated Encryption
8. Authenticated Encryption
Sam Bowne70 views
7. Attacking Android Applications (Part 2) von Sam Bowne
7. Attacking Android Applications (Part 2)7. Attacking Android Applications (Part 2)
7. Attacking Android Applications (Part 2)
Sam Bowne35 views
7. Attacking Android Applications (Part 1) von Sam Bowne
7. Attacking Android Applications (Part 1)7. Attacking Android Applications (Part 1)
7. Attacking Android Applications (Part 1)
Sam Bowne26 views
5. Stream Ciphers von Sam Bowne
5. Stream Ciphers5. Stream Ciphers
5. Stream Ciphers
Sam Bowne103 views
6 Scope & 7 Live Data Collection von Sam Bowne
6 Scope & 7 Live Data Collection6 Scope & 7 Live Data Collection
6 Scope & 7 Live Data Collection
Sam Bowne120 views

Último

JiscOAWeek_LAIR_slides_October2023.pptx von
JiscOAWeek_LAIR_slides_October2023.pptxJiscOAWeek_LAIR_slides_October2023.pptx
JiscOAWeek_LAIR_slides_October2023.pptxJisc
72 views8 Folien
ANATOMY AND PHYSIOLOGY UNIT 1 { PART-1} von
ANATOMY AND PHYSIOLOGY UNIT 1 { PART-1}ANATOMY AND PHYSIOLOGY UNIT 1 { PART-1}
ANATOMY AND PHYSIOLOGY UNIT 1 { PART-1}DR .PALLAVI PATHANIA
234 views195 Folien
SIMPLE PRESENT TENSE_new.pptx von
SIMPLE PRESENT TENSE_new.pptxSIMPLE PRESENT TENSE_new.pptx
SIMPLE PRESENT TENSE_new.pptxnisrinamadani2
173 views15 Folien
231112 (WR) v1 ChatGPT OEB 2023.pdf von
231112 (WR) v1  ChatGPT OEB 2023.pdf231112 (WR) v1  ChatGPT OEB 2023.pdf
231112 (WR) v1 ChatGPT OEB 2023.pdfWilfredRubens.com
137 views21 Folien
Structure and Functions of Cell.pdf von
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdfNithya Murugan
317 views10 Folien

Último(20)

JiscOAWeek_LAIR_slides_October2023.pptx von Jisc
JiscOAWeek_LAIR_slides_October2023.pptxJiscOAWeek_LAIR_slides_October2023.pptx
JiscOAWeek_LAIR_slides_October2023.pptx
Jisc72 views
Structure and Functions of Cell.pdf von Nithya Murugan
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan317 views
The basics - information, data, technology and systems.pdf von JonathanCovena1
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdf
JonathanCovena177 views
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx von ISSIP
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
ISSIP256 views
Plastic waste.pdf von alqaseedae
Plastic waste.pdfPlastic waste.pdf
Plastic waste.pdf
alqaseedae110 views
Nico Baumbach IMR Media Component von InMediaRes1
Nico Baumbach IMR Media ComponentNico Baumbach IMR Media Component
Nico Baumbach IMR Media Component
InMediaRes1425 views
Ch. 7 Political Participation and Elections.pptx von Rommel Regala
Ch. 7 Political Participation and Elections.pptxCh. 7 Political Participation and Elections.pptx
Ch. 7 Political Participation and Elections.pptx
Rommel Regala69 views
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively von PECB
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
PECB 457 views
Use of Probiotics in Aquaculture.pptx von AKSHAY MANDAL
Use of Probiotics in Aquaculture.pptxUse of Probiotics in Aquaculture.pptx
Use of Probiotics in Aquaculture.pptx
AKSHAY MANDAL81 views
AI Tools for Business and Startups von Svetlin Nakov
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
Svetlin Nakov89 views
UWP OA Week Presentation (1).pptx von Jisc
UWP OA Week Presentation (1).pptxUWP OA Week Presentation (1).pptx
UWP OA Week Presentation (1).pptx
Jisc68 views
Narration ppt.pptx von TARIQ KHAN
Narration  ppt.pptxNarration  ppt.pptx
Narration ppt.pptx
TARIQ KHAN110 views

CNIT 129S: Ch 6: Attacking Authentication

  • 1. CNIT 129S: Securing Web Applications Ch 6: Attacking Authentication
  • 2. Authentication Technologies • Over 90% of apps use name & password
  • 3. More Secure Methods • Two-factor authentication (or more) • PIN from a token, SMS message, or mobile app • In addition to a password • Submitted through an HTML form
  • 4. Cryptographic Methods • Client-side SSL certificate • Smartcards • More expensive, higher overhead
  • 5. HTTP Authentication • Basic, Digest, and Windows-integrated • Rarely used on the Internet • More common in intranets, especially Windows domains • So authenticated employees can easily access secured resources
  • 11. Brute-Force Attacks • Strictly, "brute force" refers to trying every possible combination of characters • Very slow • In practice, attackers use lists of common passwords • Defense: account lockout rules after too many failed login attempts
  • 14. Poor Attempt Counters • Cookie containing failedlogins=1 • Failed login counter held within the current session • Attacker can just withhold the session cookie to defeat this • Sometimes a page continues to provide information about a password's correctness even after account lockout
  • 18. Verbose Failure Messages • Friendly for legitimate users • But helpful for attackers
  • 20. Script to Find Phone #s • echo $1,`curl -d "customerEmailAddress= $1" "https://www.att.com/olam/ submitSLIDEmailForgotIdSlid.myworld" - silent| grep -Po '(?<=provided ()d*'` • When you run 
 getatt.sh john.smith@example.com
 it will output a line of text that looks like: • john.smith@example.com,6782345678 • Link Ch 6d
  • 21. Username Importance • Attacks that reveal valid usernames are called "username enumeration" • Not as bad as finding a password, but still a privacy intrusion • But could be used for social engineering attacks, such as spearphishing emails
  • 22. Similar but Non-Identical Error Messages • Any difference can be exploited; even response time
  • 23. Vulnerable Transmission of Credentials • Eavesdroppers may reside:
  • 24. HTTPS Risks • If credentials are sent unencrypted, the eavesdropper's task is trivial, but even HTTPS can't prevent these risks: • Credentials sent in the query string are likely to appear in server logs, browser history, and logs of reverse proxies • Many sites take credentials from a POST and then redirect it (302) to another page with credentials in the query string
  • 25. HTTPS Risks • Cookie risks: • Web apps may store credentials in cookies • Even if cookies cannot be decrypted, they can be re-used • Many pages open a login page via HTTP and use an HTTPS request in the form • This can be defeated by a man-in-the-middle attack, like sslstrip
  • 27. Password Change Functionality • Periodic password change mitigates the threat of password compromise (a dubious claim) • Users need to change their passwords when they believe them to be compromised
  • 28. Vulnerable Password Change Systems • Reveal whether the requested username is valid • Allow unrestricted guesses of the "existing password" field • Validate the "existing password" field before comparing the "new password" and "confirm new password" fields • So an attacker can test passwords without making any actual change
  • 29. Password Change Function • Identify the user • Validate "existing password" • Integrate with any account lockout features • Compare the new passwords with each other and against password quality rules • Feed back any error conditions to the user • Often there are subtle logic flaws
  • 30. Forgotten Password Functionality • Often the weakest link • Uses a secondary challenge, like "mother's maiden name" • A small set of possible answers, can be brute- forced • Often can be found from public information
  • 31. Forgotten Password Functionality • Often users can write their own questions • Attackers can try a long list of usernames • Seeking a really weak question, like "Do I own a boat?" • Password "Hints" are often obvious
  • 32. Forgotten Password Functionality • Often the mechanism used to reset the password after a correct challenge answer is vulnerable • Some apps disclose the forgotten password to the user, so an attacker can use the account without the owner knowing • Some applications immediately let the user in after the challenge--no password needed
  • 33. Forgotten Password Functionality • Some apps allow the user to specify an email for the password reset link at the time the challenge is completed • Or use email from a hidden field or cookie • Some apps allow a password reset and don't notify the user with an email
  • 34. "Remember Me" • Sometimes a simple persistent cookie, like • RememberUser=jsmith • Session=728 • No need to actually log in, if username or session ID can be guessed or found
  • 35. "Remember Me" • Even if the userid or session token is properly encrypted, it can be stolen via XSS or by getting access to a user's phone or PC
  • 36. User Impersonation • Sometimes help desk personnel or other special accounts can impersonate users • This may have flaws like • Implemented with a "hidden" function lacking proper access controls, such as • /admin/ImpersonateUser.jsp • A guessable session number • A fixed backdoor password
  • 37. Incomplete Validation • Some applications truncate passwords without telling users • Also strip unusual characters • Link Ch 6e
  • 38. Nonunique Usernames • Rare but it happens • You may be able to create a new account with the same username as an existing account • During registration or a password change • If the password also matches, you can detect that from a different error messge
  • 39. Predictable Usernames • Automatically generated names like • User101, User102, ...
  • 40. Predictable Initial Passwords • User accounts are create in large batches • All have the same initial password
  • 41. Insecure Distribution of Credentials • Passwords sent by email, SMS, etc. • Users may never change those credentials • Activation URLs may be predictable • Some apps email the new password to the user after each password change
  • 43. Fail-Open Login • Blank or invalid username may cause an exception in the login routine • Or very long or short values • Or letters where numbers are expected... • And allow the user in
  • 44. Multistage Login • Enter username and password • Enter specific digits from a PIN (a CAPTCHA) • Enter value displayed on a token
  • 45. Multistage Login Defects • May allow user to skip steps • May trust data that passes step one, but let user change it, so invaid or locked-out accounts remain available • May assume that the same username applies to all three stages but not verify this
  • 46. Multistage Login Defects • May use a randomly-chosen question to verify the user • But let the attacker alter that question in a hidden HTML field or cookie • Or allow many requests, so attacker can choose an easy question
  • 47. Insecure Credential Storage • Plaintext passwords in database • Hashed with MD5 or SHA-1, easily cracked
  • 48. Securing Authentication • Considerations • How critical is security? • Will users tolerate inconvenient controls? • Cost of supporting a user-unfriendly system • Cost of alternatives, compare to revenue generated or value of assets
  • 49. Strong Credentials • Minimum password length, requiring alphabetical, numeric, and typographic characters • Avoiding dictionary words, password same as username, re-use of old passwords • Usernames should be unique • Automatically generated usernames or passwords should be long and random, so they cannot be guessed or predicted • Allow users to set strong passwords
  • 50. Handle Credentials Secretively • Protect then when created, stored, and transmitted • Use well-established cryptography like SSL, not custom methods • Whole login page should be HTTPS, not just the login button • Use POST rathern than GET • Don't put credentials in URL parameters or cookies
  • 51. Handle Credentials Secretively • Don't transmit credentials back to the client, even in parameters to a redirect • Securely hash credentials on the server
  • 52. Hashing • Password hashes must be salted and stretched • Salt: add random bytes to the password before hashing it • Stretched: many rounds of hashing (Kali Linux 2 uses 5000 rounds of SHA-512)
  • 54. Handle Credentials Secretively • Client-side "remember me" functionality should remember only nonsecret items such as usernames • If you allow users to store passwords locally, they should be reversibly encrypted with a key known only to the server • And make sure there are no XSS vulnerabilities
  • 55. Handle Credentials Secretively • Force users to change passwords periodically • Credentials for new users should be sent as securely as possible and time-limited; force password change on first login • Capture some login information with drop-down lists instead of text fields, to defeat keyloggers
  • 56. Validate Credentials Properly • Validate entire credential, with case sensitivity • Terminate the session on any exception • Review authentication logic and code • Strictly control user impersonation
  • 57. Multistage Login • All data about progress and the results of previous validation tasks should be held in the server-side session object and never available to the client • No item of information should be submitted more than once by the user • No means for the user to modify data after submission
  • 58. Multistage Login • The first task at every stage should be to verify that all prior stages have been correctly completed • Always proceed through all stages, even if the first stage fails--don't give attacker any information about which stage failed
  • 59. Prevent Information Leakage • All authentication failures should use the same code to produce the same error message • To avoid subtle differences that leak information • Account lockout can be used for username enumeration • Login attempts with invalid usernames should lead to the same error messages as valid ones
  • 60. Self-Registration • Allowing users to choose usernames permits username enumeration. Better methods: • Generate unique, unpredictable usernames • Use e-mail addresses as usernames and require the user to receive and use an email message
  • 61. Prevent Brute-Force Attacks • At login, password change, recover lost password, etc. • Using unpredictable usernames and preventing their enumeration makes brute-force attacks more difficult • High-security apps like banks disable an account after several failed logins • Account holder must do something out-of-band to re-activate account, like phone customer support and answer security questions • A 30-minute delay is friendlier and cheaper
  • 62. Prevent Brute-Force Attacks • Consider this type of attack • Use many different usernames with the same password, such as "password" • Defenses: strong password rules, CAPTCHA
  • 63. Password Change • No way to change username • Require user to enter the old password • Require new password twice (to prevent mistakes) • Same error message for all failures • Users should be notified out-of-band (such as via email) that the password has been changed
  • 64. Account Recovery • For security-critical apps, require account recovery out-of-band • Don't use "password hints" • Email a unique, time-limited, unguessable, single-use recovery URL
  • 65. Account Recovery • Challenge questions • Don't let users write their own questions • Don't use questions with low-entropy answers, such as "your favorite color"
  • 66. Log, Monitor, and Notify • Log all authentication-related events • Protect logs from unauthorized access • Anomalies such as brute-force attacks should trigger IDS alerts • Notify users out-of-band of any critical security events, such as password changes • Notify users in-band of frequent security events, such as time and source IP of the last login