41
1 Testing Web Application Scanner Tools Elizabeth Fong and Romain Gaucher NIST Verify Conference – Washington, DC, October 30, 2007 Disclaimer: Any commercial product mentioned is for information only; it does not imply recommendation or endorsement by NIST nor does it imply that the products mentioned are necessarily the best available for the purpose.

Testing Web Application Scanner Tools

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Testing Web Application Scanner Tools

1

Testing Web ApplicationScanner Tools

Elizabeth Fong and Romain GaucherNIST

Verify Conference – Washington, DC, October 30, 2007

Disclaimer: Any commercial product mentioned is for information only; it does not imply recommendation or endorsement by NIST nor does it imply that the products mentioned are necessarily the best available for the purpose.

Page 2: Testing Web Application Scanner Tools

2

http://xkcd.com

Page 3: Testing Web Application Scanner Tools

3

- NIST SAMATE Project- Which tools find what flaws?- Web Application Scanner tools:

specification and capabilities- Testing Web Application Scanner Tools:

Test methodologies and results

Outline

Page 4: Testing Web Application Scanner Tools

4

• Project partially funded by DHS and NSA.

• Our focus• Examine software development and testing

methods and tools to identify deficiencies in finding bugs, flaws, vulnerabilities, etc.

• Create studies and experiments to measure the effectiveness of tools.

Software Assurance Metrics and Tool Evaluation (SAMATE) Project at NIST

Page 5: Testing Web Application Scanner Tools

5

• Precisely document what a tool class does and does not do

• Inform users– Match the tool to a particular situation– Understand significance of tool results

• Provide feedback to tool developers

Purpose of Tool Evaluations

Page 6: Testing Web Application Scanner Tools

6

• Select class of tool • Develop clear (testable) requirements

– Tool functional specification aided by focus groups– Spec posted for public comment

• Develop a measurement methodology– Develop reference datasets (test cases)– Document interpretation criteria

Details of Tool Evaluations

Page 7: Testing Web Application Scanner Tools

7

• Static Analysis Security Tools• Web Application Vulnerability Tools • Binary Analysis Tools • Web Services Tools• Network Scanner Tools * Defense Information Systems Agency, “Application Security

Assessment Tool Market Survey,” Version 3.0 July 29, 2004

Some Tools for specific application*

Page 8: Testing Web Application Scanner Tools

8

• Firewall • Intrusion Detection/Prevention System• Virus Detection• Fuzzers• Web Proxy Honeypots• Blackbox Pen Tester * OWASP Tools Project

Other Types of Software Assurance Security Tools *

Page 9: Testing Web Application Scanner Tools

9

• Life Cycle Process (requirements, design, …)

• Automation (manual, semi, automatic)

• Approach (preclude, detect, mitigate, react, appraise)

• Viewpoint (blackbox, whitebox (static, dynamic))

• Other (price, platform, languages, …)

How to Classify Tools and Techniques

Page 10: Testing Web Application Scanner Tools

10

The Rise of Web App Vulnerability

0

5

10

15

20

25

2000 2001 2002 2003 2004 2005 2006

Remote fileinclusionSQLinjectionCross-sitescripting

Top web app vulnerabilities as % of total vulnerabilities in NVD

Page 11: Testing Web Application Scanner Tools

11

is software which communicates with a web application through the web front-end and identifies potential security weaknesses in the web application.*

* Web Application Security Consortium evaluation criteria technical draft, August 24. 2007.

Web Application Security Scanner

Page 12: Testing Web Application Scanner Tools

12

Web Application Architecture

Database Server

Client (Browser,Tool, etc.)

HTTPRequests

HTML, etc.

Webapp

Web Server

Page 13: Testing Web Application Scanner Tools

13

- Client and Server Interaction- Distributed n-tiered architecture- Remote access- Heterogeneity- Content delivery via HTTP- Concurrency

- Session management- Authentication and authorization

Characteristics of Web Application

Page 14: Testing Web Application Scanner Tools

14

- Limited to tools that examine software applications on the web.

- Does not apply to tools that scan other artifacts, like requirements, byte-code, or binary code

- Does not apply to database scanners- Does not apply to other system security tools, e.g.,

firewalls, anti-virus, gateways, routers, switches, intrusion detection system

Scope – What types of tools does this spec NOT address?

Page 15: Testing Web Application Scanner Tools

15

- Cross-Site Scripting (XSS)- Injection flaws- Authentication and access control weaknesses- Path manipulation- Improper Error Handling

Some Vulnerabilities that Web Application Scanners Check

Page 16: Testing Web Application Scanner Tools

16

- AppScan DE by Watchfire, Inc. (IBM)- WebInpect by SPI-Dynamics (HP)

- Acunetix WVS by Acunetix- Hailstorm by Cenzic, Inc.- W3AF, Grabber, Paros, etc.- others…

Disclaimer: Any commercial product mentioned is for information only, it does not imply recommendation or endorsement by NIST nor does it imply that the products mentioned are necessarily the best available for the purpose.

Some Web Application Security Scanning Tools

Page 17: Testing Web Application Scanner Tools

17

• What is a common set of functions? • Can they be tested? • How can one measure the

effectiveness? NIST is “neutral”, not consumer reports, and does not

endorse products.

Establishing a Framework to Compare

Page 18: Testing Web Application Scanner Tools

18

• Precisely document what a tool class does and does not do

• Provide feedback to tool developers• Inform users

• Match the tool to a particular situation• Understand significance of tool results

Purpose of a Specification

Page 19: Testing Web Application Scanner Tools

19

• Specifies basic (minimum) functionality • Defines features unambiguously• Represents a consensus on tool functions and

requirements • Serves as a guide to measure the capability of tools

How should this spec be viewed?

Page 20: Testing Web Application Scanner Tools

20

• Not to prescribe the features and functions that all web application scanner tools must have.

• Use of a tool that complies with this specification does not guarantee the application is free of vulnerabilities.

• Production tools should have capabilities far beyond those indicated.

• Used as the basis for developing test suites to measure how a tool meets these requirements.

How should this spec be used?

Page 21: Testing Web Application Scanner Tools

21

• Found in existing applications today• Recognized by tools today• Likelihood of exploit or attack is medium to

high

Criteria for selection of Web Application Vulnerabilities

Page 22: Testing Web Application Scanner Tools

22

• OWASP Top Ten 2007• WASC Threat Classification• CWE – 600+ weaknesses definition dictionary• CAPEC- 100+ attack patterns for known

exploits

Web Application Vulnerabilities

Page 23: Testing Web Application Scanner Tools

23

• Test applications that model real security features and vulnerabilities

• Configurable to be vulnerable to one or many types of attack

• Ability to provide increasing level of defense for a vulnerability

Test Suites

Page 24: Testing Web Application Scanner Tools

24

Defense Mechanisms

• Different programmers use different defenses• Defenses/Filters are not all equivalent• We have different instances of vulnerabilities:

levels of defense

Page 25: Testing Web Application Scanner Tools

25

• Example: Cross-Site Request Forgeries

Levels of Defense

Untrusted.c0m

MyShopping.Com

CSRFScriptUntrusted.c0m redirects to MyShopping.Com

GET /shop.aspx?ItemID=42&Accept=Yes

Thanks For Buying This Item!

“This nice new website: Untrusted.c0m”

Page 26: Testing Web Application Scanner Tools

26

• Example: Cross-Site Request Forgeries- Level 0: No Protection (bad)- Level 1: Using only POST (well...)- Level 2: Checking the referrer (better but referrer may be spoofed)- Level 3: Using a nonce (good)

• Higher level means harder to break

Levels of Defense

Page 27: Testing Web Application Scanner Tools

27

Web Server Database Server

Web Application Scanner Tool

Attacks

HTML, etc.

Webapp

ToolReport Seeded

Vulns.Cheat sheet

?

Page 28: Testing Web Application Scanner Tools

28

Attacks Analysis

• An action that exploits a vulnerability• What exactly is the tool testing?• What do I need to test in my application?

• Do the results match?

Page 29: Testing Web Application Scanner Tools

29

Web Server Database Server

Web Application Scanner Tool

Attacks

HTML, etc.

Webapp

ToolReport

AttacksAnalysis

SeededVulns.?

Page 30: Testing Web Application Scanner Tools

30

• Testing the tool accuracy by inserting check points in most of the attack surface

• Is the tool testing all the application surface?Ex: login correctly, with errors, etc.

Attack Surface Coverage

Page 31: Testing Web Application Scanner Tools

31

(1) Touch the file [login.php]if ( all fields are set ) then (2) All fields are set [login.php] Boolean goodCredentials = checkThisUser(fields) if ( goodCredentials ) then (3) Credentials are correct; Log in [login.php] registerSessionCurrentUser() else if ( available login test > 0 ) then (4) Login information incorrect [login.php] displayErrorLogin() available login test -= 1 else (5) Too many tries with bad info [login.php] displayErrorLogin() askUserToSolveCAPTCHA() endif endifendif

Page 32: Testing Web Application Scanner Tools

32

Web Server Database Server

Web Application Scanner Tool

Attacks

HTML, etc.

Webapp

ToolReport

AttacksAnalysis

CoverageAnalysis

SeededVulns.?

Attack Surface CoverageSAMATE Webapps Scanner Testing Lab

Page 33: Testing Web Application Scanner Tools

33

• Test Suite with 21 vulnerabilities (XSS, SQL Injection, File Inclusion)– PHP, MySQL, Ajax– LAMP

• 4 Scanners (Commercial and Open Source)• One type of vulnerability at the time• Results (Detection rate, False-Positive rate)

Test Suite Evaluation

Page 34: Testing Web Application Scanner Tools

34

Detection Rates for Different Levels of Defense

A B C D0

5

10

15

20

25

30

35

Level 0 Level 1

Tools

De

tect

ion

Ra

te

Page 35: Testing Web Application Scanner Tools

35

False Positive Rates for Different Levels of Defense

A B C D0

10

20

30

40

50

60

70

80

90

100

Level 0 Level 1

Tools

Fals

e-P

ositi

ve R

ate

Page 36: Testing Web Application Scanner Tools

36

Attack Surface Coverage

A E F G0

10

20

30

40

50

60

70

80

% Coverage

Tools

Re

ach

ed

ch

eckp

oin

ts (

%)

Page 37: Testing Web Application Scanner Tools

37

• Refining level of defense in order to have a better granularity

• Thinking of tool profiles such as:

Coming next

Page 38: Testing Web Application Scanner Tools

38

Coming next (cont.)• Using different technologies in our test suites

(JSP, .NET, etc.)• More than one vulnerability at a time

(combinatorial testing?)• Metrics? Brian Chess' metric?

t: True Positivep: False Positiven: False Negative

Page 39: Testing Web Application Scanner Tools

39

• Tools are limited in scope (companies sell service as opposed to selling tool)

• Speed versus Depth (in-depth testing takes time)

• Difficult to read output reports (typically log files)

• False-Positives• Tuning versus default mode

Issues with Web Application Scanner Tools

Page 40: Testing Web Application Scanner Tools

40

- People to comment on specifications- People to submit test cases for sharing with the community- People to help build reference datasets for testing tools?

We need …

Page 41: Testing Web Application Scanner Tools

41

- SAMATE web site http://samate.nist.gov/- Project Leader: Dr. Paul E. Black - Project Team Members:

Elizabeth Fong, Romain Gaucher,Michael Kass, Michael Koo, Vadim Okun, Will Guthrie, John Barkley

Contacts