• No results found

"Practical Security Testing for Web Applications"

N/A
N/A
Protected

Academic year: 2021

Share ""Practical Security Testing for Web Applications""

Copied!
18
0
0

Loading.... (view fulltext now)

Full text

(1)

         

T10

Track

5/7/2009 11:15:00 AM

"Practical Security Testing for

Web Applications"

Presented by:

Rafal Los

Hewlett-Packard Application Security Center

(2)

Rafal Los

Rafal Los is currently a Sr. Security Consultant with Hewlett-Packard’s Application Security Center (ASC). Rafal has over 13 years of experience in network and system design, security policy and process design, risk analysis, penetration testing and consulting. Over the past eight years, he has focused on Information Security and Risk Management, leading security

architecture teams and managing successful enterprise security programs for General Electric and other Fortune 100 companies, as well as SMB enterprises. Previously Rafal spent three years in-house with GE Consumer Finance, leading its security programs.

(3)

Practical Security Testing

for Web Applications

24 February 2009

1

for Web Applications

Rafal M. Los Rafal M. Los

HP ASC Sr. Security Solutions Expert HP ASC Sr. Security Solutions Expert

Agenda

Agenda

y

Understanding the QA/Security Relationship

y

Negative Testing 360°

y

Building Negative Tests

y

Implementation and Execution

(4)

Agenda

Agenda

y

Understanding the QA/Security Relationship

y

Negative Testing 360°

y

Building Negative Tests

y

Implementation and Execution

y

Looking Ahead

24 February 2009

3

Looking Ahead

Background

Why do QA teams care about security?

• Traditionally securityis left to the security team

• Security issues must be addressed throughout SDL • QA teams add missing element

QA teams are crucial to security • Understand application test-cases • Understand application workflows • Security is a natural extension of quality

(5)

QA – Security Relationship

Similarities – core principles • Testing web application logic • Functional testing on live code • Specific data-sets used

Differences – outlying goals Differences – outlying goals

24 February 2009

5

• Stress-test vs. break test • Positive vs. negative data sets

• Reinforcing positive vs. uncovering negative

The “Hacker” Mindset

y Why would anyone want to break an application?

y Fun y Malice y Profit y Attack users y Attack systems y Mentality difference

y QA asks How does it perform? y QA asks – How does it perform? y Hacker asks – How can I break it?

(6)

Whose Problem is Security?

y Many components to the security “problem”

y Policyy

y Development frameworks/standards y Audit

y Metrics

y Security is a pillar of overall quality

y Does it function? f 24 February 2009 7 y Does it perform? y y Is it secure?Is it secure?

Agenda

Agenda

y

Understanding the QA/Security Relationship

y

Negative Testing 360°

y

Building Negative Tests

y

Implementation and Execution

(7)

Negative Testing Overview

What is negative testing?

y Testing for unintended features

y Testing using unintended data sets y Testing for unintended logic flow

“ l d d h l d

24 February 2009

9

“Negative testing involves understanding the application, and finding ways to manipulate the code to perform in ways as to create unintended exposures”

Negative Testing Overview

Selection bias

Æ

Confirmation bias

y Testing to confirm desired resultsconfirm desired results

y Testing using known desired data and flknown desired data and flows y Testing which completely misses the point…

“ confirmation bias is a tendency to search for or interpret …confirmation bias is a tendency to search for or interpret new information in a way that confirms one's preconceptions and to avoid information and interpretations which

(8)

Negative Testing Mindset

Traditional QA: proving the positive

• Prove certain activity functions as defined by business case

• Requirements are easily defined in application flow and function

Negative testing: finding the negative

24 February 2009

11

• Find negative (unintended) functions/results

• No way to clearly define “bad stuff ” as a requirement to test against

Negative Testing - Data

Types of negative data depends on purpose

•• Exploit a clientExploit a client

• Client-side script or technology •• Corrupt or crash a systemCorrupt or crash a system

• Database control characters

• Non-native character sets, system characters • S t d

• System commands

•• Retrieve data from the systemRetrieve data from the system

• Database queries, control language • System commands

(9)

Negative Testing - Flow

Goal is to manipulate application logic

Goal is to manipulate application logic

Identify “breakable” application logic

• Create a race condition

• Break application control-flow

• Force an out of processaction • Inject a rogue process

24 February 2009

13

Test-cases based off of proper application logic flows

Requires in-depth knowledge of application flow

Negative Testing - Tools

Tools are an integral part of

negative testing

•• Manual tools

Manual tools

• Flow diagrams

• Data sets

• Logic charts

•• Automated tools

Automated tools

g

g

•• Automated tools

Automated tools

• Black-box scanners

(10)

Negative Testing - Tools

W kfl b l biliti

Automated tools *cannot* perform all testing

• Workflow-base vulnerabilities…

• Analyze the application logic and data

Human beings must…

24 February 2009 15 • Guide tools • Interpret results

Agenda

Agenda

y

Understanding the QA/Security Relationship

y

Negative Testing 360°

y

Building Negative Tests

y

Implementation and Execution

(11)

Building the Test

24 February 2009

17

Building Data-Negative Tests

All possible inputs All possible inputs

Negative Test Data Negative Test Data

Data-unknown (unknown impact) p p p p •Letters •Numbers •Special characters •Control characters Situational Refinement •Database ÆSQLi •Client-side ÆXSS •XMLdbÆX-Path.i Allowed (positive) characters Case-specific

malicious •Cross-site scripting •SQL Injection

(12)

Building Data-Negative Tests

y

y Manual human testingManual human testing

y Must build test data sets manuallyy

y Sniper approach (can be precise)

y Often very slow, methodical

y Identifies false-positives

y

y ToolsTools--based testingbased testing

y Builds test data sets automatically

h h

24 February 2009

19

y Shotgun approach (not precise)

y Ability to be extremely fast

y Trouble with false-positives

Negative Data Sets

Facts about negative data

y Negative data sets are best generated by tools if the tester g g y is not

a security expert

y Many pre-built negative data sets already exist

y Sla.ckers.org – XSS cheat-sheet

y Tools can point Æclick Ætest

y Black-box testing tools save time & effort y Humans must analyze results

y Must mix positive/negative data for completeness

y Workflows often require good data to proceed

(13)

Flow Analysis Testing

Can a process step be bypassed? Can a process step be bypassed? Submit quote

Can a process step be injected? Can a process step be injected?

Step 1 Step 2 Step 3 Step 4

Verify Identity Request quote Receive quote Submit for purchase

Step 1 Step 2 Step 3 Step 4

Submit quote for someone

else?

24 February 2009

21

Verify Identity Request quote Receive quote

Injected!

Modify quote Submit for purchase

Flow Analysis Testing

y

y Manual human testingManual human testing

y Can analytically identify specific y y y p weakpointsp

y Distinguishes between success/failure readily

y Often very slow, methodical

y Ability to tailor testing to situation/process

y

y ToolsTools--based testingbased testing

y Attacks every point, cannot distinguish

ff l d h f l

y Difficulty distinguishing success/failure

y Ability to be extremely fast

(14)

Flow Analysis Testing

Facts about flow analysis testing

y Tester must understand application flowpp

y Proper application flow to turn into negative y “Random manipulation” rarely works

y Focus on application control-points

y Key points in application logic

y Don’t leave your testing to tools-only

y Most tools can’t identify control points, dive deep into flows

24 February 2009

23

y Human analyst has an obvious advantage (critical thinking)

Agenda

Agenda

y

Understanding the QA/Security Relationship

y

Negative Testing 360°

y

Building Negative Tests

y

Implementation and Execution

(15)

Negative Testing Process

Analyze Requirements

Build Test Sets

Test Negative Analyze Findings[3]

24 February 2009

25

Test Positive Data

Test Negative Data[1]

Test Positive Flow

Test Negative Flow[2]

Testing Negative Data

1. Identify all visible inputs (data “source”)

i. Input positive datap p

y Analyze behavior

ii. Input negative data

y Analyze behavior

2. Identify all hidden fields (data “source”)

i. Input positive data

y Analyze behaviorAnalyze behavior

ii. Input negative data

(16)

Testing Negative Flow

… as we’ve learned this will be manual work

y Map out all control-flowsp

y Identify a potentially weak logic element

y Walk the positive-control flow path

y Ensure proper positive path is understood

y Map possible negative-control flow paths y Execute negative-control flow paths

A l diff b i i / i

24 February 2009

27

y Analyst difference between positive/negative attempts y Repeat if necessary to adjust/adapt until satisfied

y Attempt at least 3-5 loop-repetitions

Identify Weaknesses

y How do you identify a weakness/defect

y Undesired application reactionpp

y Crash?

y Skip control step?

y Disclosure of unintended data

y Debug information

y Disclosure of internal data

(17)

Agenda

Agenda

y

Understanding the QA/Security Relationship

y

Negative Testing 360°

y

Building Negative Tests

y

Implementation and Execution

y

Looking Ahead 24 February 2009 29 Looking Ahead

Looking Ahead

Looking Ahead

y Addressing “deep” defects

y

y WorkflowWorkflow--basedbased security defects

y Traditionally cannot be scanned for cannot be scanned for (with automated tools)

y Analysis of Defects

y When is a critical defectcritical defect… not?

(18)

Questions?

• Security Strategist

• Application Security Specialist • Security Strategist

• Application Security Specialist

• Following the White Rabbit:

http://www.communities.hp.com/securitysoftware/blogs/rafal

• Digital Security SoapBox: http://preachsecurity.blogspot.com/

• Following the White Rabbit:

http://www.communities.hp.com/securitysoftware/blogs/rafal

• Digital Security SoapBox: http://preachsecurity.blogspot.com/

24 February 2009 31 • Email: [email protected] • Direct: (404) 606-6056 • Email: [email protected] • Direct: (404) 606-6056

References

Related documents

Next, the individuals’ willingness to pay is inferred using the results of the estimation of the choice model according to the levels of landscape attributes in order to infer

Children in the READ 180 intervention participated in three 20-minute literacy activities, including (1) individualized computer-assisted reading instruction with

The program trained participants as gatekeepers utilizing Question, Persuade, Refer (QPR) strategies and incorporated audience- specific information related to suicide risk in

While a standard median filter alone is not able to remove the high noise density [12] and filling method fails to remove low density noise such as narrow eyelash

Ewazen enjoys experimenting with different combination of sounds within the wind ensemble. He likes to pair instruments with each other that usually don’t play together. For

Section 41-b, para –4 : Every occupier shall, with the approval of the Chief Inspector, draw up an on site emergency plan and detailed disaster control measures for his factory and

Finally some of these services were implemented using Cape Clear (Cape Clear, 2003) Web Services development and deployment software... have also designed a toolbox for

The employment relation that is governed by this contract is a consensual contractual relation. Neither of the Two Parties may be required to continue in this employment relation