Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web...

52
Open Source SAST and DAST Tools for WebApp Pen Testing Drew Kirkpatrick Department of Homeland Security Science and Technology Directorate Cyber Security Division Funded by:

Transcript of Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web...

Page 1: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

Open Source SAST and

DAST Tools

for WebApp Pen Testing

Drew Kirkpatrick

Department of Homeland SecurityScience and Technology Directorate

Cyber Security Division

Funded by:

Page 2: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

2

White Hats have plenty of disadvantages over their malicious counterparts

There are a few advantages we can leverage with better penetration testing tools:

• Access to server binaries/bytecode

• Access to server-side source code

Web Application Pen Testing

Page 3: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

3

OWASP Code Pulse – Provides insightinto the real-time code coverage of black box testing activities by monitoring the execution of the web application

Attack Surface Detector – Performs static code analysisof a web application to detect the application endpoints, parameters, and parameter datatypes, and makes that data available in Burp Suite and OWASP ZAP

Open Source Tools for White Hats

Page 4: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

4

Code Pulse

https://owasp.org/index.php/OWASP_Code_Pulse_Project

Page 5: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

5

Code Pulse Need

Coverage gaps – by definition, penetration testing is typically a purely black box perspective, which makes it almost impossible to ascertain the attack surface coverage gaps

Test tuning – DAST tools are tricky to configure, due to the complex variations in the target applications. Manual testers have challenges tying web requests to the underlying source code.

Coverage data communication – lack of coverage insight from the black box perspective makes this currently challenging, and comparing testing tools and techniques difficult

Page 6: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

6

How Code Pulse Works

Leverages Java and .NET instrumentation libraries to provide real-time measurement of application method calls

• JVM Code Pulse agent runs in the same JVM as the target application

• .NET Code Pulse tracer based on OpenCover code coverage tool

Instruments server bytecode—no changes in source code are needed

Sends method coverage to Code Pulse client for real-time visualization

Page 7: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

7

Code Pulse Benefit

Helps web application testers associate the endpoints they interact with to the underlying classes and methods called in the application server

Find gaps in the test coverage

Allows comparison and tuning of dynamic testing tools and techniques

Percentage of code coverage is a useful metric for communicating testing activity

Page 8: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

8

Code Pulse Screenshot

Page 9: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

9

Future Code Pulse Plans

Provide line-level code display in Code Pulse

• Will allow more accurate measurement of code coverage

• Will simplify code review

Better integration of attack surface detection

• Display specific endpoints to access methods visualized in Code Pulse

Page 10: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

10

Attack Surface Detector

Page 11: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

11

Attack Surface Detector Need

Attack surface gaps – black box testing by penetration testers can miss unlinked endpoints without extensive endpoint brute forcing

Parameter detection – Identifying optional parameters during a black box test can be time-consuming and often miss valid parameters that affect execution of the software

Enumeration effort – Manual penetration testing is costly, and the available time may not allow for thorough enumeration of an application’s attack surface

Page 12: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

12

• Java / JSP

• Python / Django

• Ruby / Rails

How the Attack Surface Detector Works

Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages and frameworks

Multiple parsers are needed in order to support different languages and frameworks

Supported Frameworks:

• C# / ASP.NET MVC

• C# / Web Forms

• Java / Spring MVC

• Java / Struts

Page 13: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

13

Attack Surface Detector Benefit

Provides a faster and more thorough enumeration of a web application's attack surface

Detects the endpoints of a web application, the parameters, and parameter data types, including:

• Unlinked endpoints a spider won’t find in client side code

• Optional parameters never used in the client side code

Imports this data into Burp Suite and OWASP ZAP to use during assessment

Page 14: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

14

Pre-seeding in Burp Suite

Page 15: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

15

Future Attack Surface Detector Plans

Ability to analyze zip files of source code

Attack Surface Difference Generator

• Endpoints and parameters that are new or modified between two different versions of software will be detected

• This “difference” in attack surface will be imported into Burp Suite and OWASP ZAPS

Page 16: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

16

Enough! Just show me already

Page 17: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

17

Contacts and Source Code

Drew Kirkpatrick [email protected]/hoodoer

[email protected]

Page 18: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages

18

Plan B – Backup slides

Page 19: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 20: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 21: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 22: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 23: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 24: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 25: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 26: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 27: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 28: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 29: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 30: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 31: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 32: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 33: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 34: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 35: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 36: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 37: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 38: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 39: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 40: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 41: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 42: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 43: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 44: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 45: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 46: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 47: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 48: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 49: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 50: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 51: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages
Page 52: Open Source SAST and DAST Tools for WebApp Pen Testing · Static code analysis identifies web application endpoints by parsing routes and identifying parameters in the supported languages