bare-bones appsec testing cure. be stephen deck, gse, osce ... · application testing phases 3....

28
BE INFORMED. BE STRATEGIC. BE SECURE. Bare-bones AppSec Testing Stephen Deck, GSE, OSCE, CISSP @ranger_cha BE INFORMED. BE STRATEGIC. BE SECURE.

Upload: others

Post on 24-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

BE

IN

FO

RM

ED

.B

E S

TR

AT

EG

IC.B

E S

EC

UR

E.

Bare-bones AppSec Testing

Stephen Deck, GSE, OSCE, CISSP

@ranger_cha

BE

IN

FO

RM

ED

.B

E S

TR

AT

EG

IC.B

E S

EC

UR

E.

Page 2: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

OBJECTIVE

-What is AppSec?

-Web app testing methodology

-CTF web app advice

2

Page 3: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

APPSEC AS A DISCIPLINE

-Application Security

-AppSec finds new vulnerabilities in a single

application

-Sometimes finds known config issues or vulnerable

components

-Different from pentesting

-Pentesting finds known vulns across many systems

3

Page 4: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

WEB APP TESTING METHODOLOGY OVERVIEW

-Use OWASP Testing Guide v4

-Detailed steps for testing apps

-Way more than OWASP Top 10

-Still need to apply some to all inputs

-https://www.owasp.org/images/1/19/OTGv4.pdf

4

Page 5: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

APPLICATION TESTING PHASES

1. Customer Information

2. Reconnaissance

3. Automated Testing

4. Manual Testing

5. Exploitation

6. Reporting

5

Page 6: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

APPLICATION TESTING PHASES

1. Customer Information- Find “dangerous pages”- Contact forms, registration, email, etc.

- In scope systems-Presence of APIs

2. Reconnaissance- Find dangerous pages on your own-Verify scope of systems-Brute-force content

6

Page 7: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

APPLICATION TESTING PHASES

3. Automated Testing- Exclude dangerous pages- “Fuzzes” application input parameters- Good for injection attacks

4. Manual Testing- Controlled testing of dangerous pages- Fuzzing with Intruder- Good for permissions issues

- Broken Access Control- Logic errors

-Verify automated findings

7

Page 8: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

APPLICATION TESTING PHASES

5. Exploitation

-Attack found vulnerabilities

-Attempt to gain command execution

-Attempt to steal data

-Attempt to elevate privileges

6. Reporting

- Include HTTP requests and responses

8

Page 9: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

REAL APPSEC VS CTF

-Real AppSec aims to find ALL vulnerabilities and misconfigurations

-CTF AppSec looks for specific information or code execution

-Enumeration is always key!

9

Page 10: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF APP TESTING PHASES

1. Recon

2. Analyze

3. Test

4. Exploit

5. Escalate

10

Page 11: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE - RECON

-Start a port scan with service enumeration-Know the nmap timing options- max-retries, min-parallelism, min-rate

- Try to browse to ports 80 and 443, then try odd scan results

-Start dirb/gobuster

-Start nikto

-Start brute forcing authentication pages (not today)

-Start spidering

11

Page 12: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

NMAP EXAMPLE

August 23, 2018 12

Page 13: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

DIRB EXAMPLE

August 23, 2018 13

Page 14: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

NIKTO EXAMPLE

August 23, 2018 14

Page 15: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

NIKTO EXAMPLE

August 23, 2018 15

Page 16: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – ANALYZE & TEST

-Check server responses for secrets-Session tokens, flags in comments, flags in headers

- If it is small and custom…-Use paramalyzer Burp plugin-Look for - File references-Encoded/encrypted content- File uploads

-Check all response headers

16

Page 17: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – ANALYZE & TEST

- If it is an off-the-shelf app…

-Check Metasploit

-Look online for more exploits

-Packetstorm

-Exploit-db

-Osvdb

-Default credentials

17

Page 18: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – FILE REFERENCES

18

Page 19: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – FILE REFERENCES

19

Page 20: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – FILE UPLOADS

20

Page 21: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – FILE UPLOADS

21

Page 22: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – EXPLOIT

-Metasploit for COTS

-Rumkin for encoding

-Vulns that give command execution and arbitrary file read-Direct file references (insecure direct object reference)- File inclusion (remote/local file inclusion)-Command injection-SQLi (sqlmap, CO2 Burp plugin can help)- noSQL (look for [$eq] style parameters or try to add it)

- If there are bots, look for XSS

22

Page 23: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – REMOTE FILE INCLUSION

23

Page 24: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – WEBSHELLS

24

Page 25: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

CTF WEB APP ADVICE – WEBSHELLS

25

Page 26: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

RESOURCES

-www.vulnhub.com

-www.root-me.org

-https://www.owasp.org/images/1/19/O

TGv4.pdf

26

Page 27: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

SUMMARY

-Sometimes find known issues, less

common

-AppSec finds new vulnerabilities

-Recon, Attack, Report

-Automation is key

27

Page 28: Bare-bones AppSec Testing CURE. BE Stephen Deck, GSE, OSCE ... · APPLICATION TESTING PHASES 3. Automated Testing - Exclude dangerous pages - “Fuzzes” application input parameters

www.directdefense.comwww.directdefense.com