Rugged by example with Gauntlt (Hacker Headshot)

78
Rugged by Example with Gauntlt

description

Hacker Hotshot podcast. http://www.concise-courses.com/infosec/gauntlt-rugged-by-example/

Transcript of Rugged by example with Gauntlt (Hacker Headshot)

Page 1: Rugged by example with Gauntlt (Hacker Headshot)

Rugged by Example

with

Gauntlt

Page 2: Rugged by example with Gauntlt (Hacker Headshot)

@wickett

College Startup

Web Systems Engineer

Media Startup

Web Ops Lead

DevOps

CISSP

CISSP, sounds cool

Page 3: Rugged by example with Gauntlt (Hacker Headshot)

a brief history of infosec

Page 4: Rugged by example with Gauntlt (Hacker Headshot)

1337 tools

Page 5: Rugged by example with Gauntlt (Hacker Headshot)

the worms and viruses didn’t stop

Page 6: Rugged by example with Gauntlt (Hacker Headshot)

we faced skilled

adversaries

Page 7: Rugged by example with Gauntlt (Hacker Headshot)

we couldn’t win

Page 8: Rugged by example with Gauntlt (Hacker Headshot)

Instead of

Engineering

InfoSec

became

Actuaries

Page 9: Rugged by example with Gauntlt (Hacker Headshot)

“[RISK ASSESSMENT] INTRODUCES A DANGEROUS FALLACY: THAT STRUCTURED INADEQUACY IS ALMOST AS GOOD AS ADEQUACY AND THAT UNDERFUNDED SECURITY EFFORTS PLUS RISK MANAGEMENT ARE ABOUT AS GOOD AS PROPERLY FUNDED SECURITY WORK”

Page 10: Rugged by example with Gauntlt (Hacker Headshot)

there were other

movements

Page 11: Rugged by example with Gauntlt (Hacker Headshot)

devs became cool

Page 12: Rugged by example with Gauntlt (Hacker Headshot)

devs became cool agile

Page 13: Rugged by example with Gauntlt (Hacker Headshot)

the biz sells time

now

Page 14: Rugged by example with Gauntlt (Hacker Headshot)
Page 15: Rugged by example with Gauntlt (Hacker Headshot)

dev and ops now play nice

Page 18: Rugged by example with Gauntlt (Hacker Headshot)

cultureautomationmeasurementsharing

credit to John Willis and Damon Edwards

Page 19: Rugged by example with Gauntlt (Hacker Headshot)

infosec hasn’t kept

pace

Page 20: Rugged by example with Gauntlt (Hacker Headshot)

Your punch is soft,just like your heart

Page 21: Rugged by example with Gauntlt (Hacker Headshot)

“Is this

Secure?”

-Your

Customer

Page 22: Rugged by example with Gauntlt (Hacker Headshot)

“It’s

Certified”

-You

Page 23: Rugged by example with Gauntlt (Hacker Headshot)

there’s a better way

Page 24: Rugged by example with Gauntlt (Hacker Headshot)
Page 25: Rugged by example with Gauntlt (Hacker Headshot)

6 R’s of Rugged DevOps

Page 27: Rugged by example with Gauntlt (Hacker Headshot)

how does one join rugged devops?

Page 28: Rugged by example with Gauntlt (Hacker Headshot)
Page 29: Rugged by example with Gauntlt (Hacker Headshot)

enter gauntlt

Page 30: Rugged by example with Gauntlt (Hacker Headshot)

gauntlt is

like this

Page 31: Rugged by example with Gauntlt (Hacker Headshot)

sqlmap sslyze

dirbcurl

generic

nmap

your appgauntlt

exit status: 0

Page 32: Rugged by example with Gauntlt (Hacker Headshot)

gauntlt credits:

Project Leads:

James Wickett

Jeremiah Shirk

Friends: Jason Chan, NetflixNeil Matatall, TwitterMani Tadayon

Page 33: Rugged by example with Gauntlt (Hacker Headshot)

security tools are confusing

Page 34: Rugged by example with Gauntlt (Hacker Headshot)

mapping

discovery

exploitation

Page 35: Rugged by example with Gauntlt (Hacker Headshot)

fuzzfind inject

Page 36: Rugged by example with Gauntlt (Hacker Headshot)

security

tests on

every change

Page 37: Rugged by example with Gauntlt (Hacker Headshot)

wisdom from

a video game

Page 38: Rugged by example with Gauntlt (Hacker Headshot)

always

listen to

Doc

Page 39: Rugged by example with Gauntlt (Hacker Headshot)

Find the

weakness of

your enemy

Page 40: Rugged by example with Gauntlt (Hacker Headshot)

Codify your

knowledge

(cheat sheets)

Page 41: Rugged by example with Gauntlt (Hacker Headshot)

sometimes, you

face the same

enemies again

Page 42: Rugged by example with Gauntlt (Hacker Headshot)

gauntlt is

collaboration

Page 43: Rugged by example with Gauntlt (Hacker Headshot)

Gauntlt helps

dev and ops

and security

to communicate

Page 44: Rugged by example with Gauntlt (Hacker Headshot)

gauntlt

harmonizes

our languages

Page 45: Rugged by example with Gauntlt (Hacker Headshot)

Behavior Driven

Development

BDD is a second-generation, outside–in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters.

Dan North , 2009

Page 46: Rugged by example with Gauntlt (Hacker Headshot)

we have to start

somewhere

Page 47: Rugged by example with Gauntlt (Hacker Headshot)

$ gem install gauntlt

install gauntlt

Page 48: Rugged by example with Gauntlt (Hacker Headshot)

gauntlt design

Simple

Extensible

UNIX™: stdin, stdout, exit status

Minimum features yield maximum utility

Page 49: Rugged by example with Gauntlt (Hacker Headshot)

$ gauntlt --list

Defined attacks: curl dirb garmr generic nmap sqlmap sslyze

Page 50: Rugged by example with Gauntlt (Hacker Headshot)

Attack File

Plain Text File

Gherkin syntax:

Given

When

Then

Page 51: Rugged by example with Gauntlt (Hacker Headshot)

Feature: nmap attacks for example.com Background: Given "nmap" is installed And the following profile: | name | value | | hostname | example.com |

Scenario: Verify server is open on expected ports When I launch an "nmap" attack with: """ nmap -F <hostname> """ Then the output should contain: """ 80/tcp open http """ Scenario: Verify that there are no unexpected ports open When I launch an "nmap" attack with: """ nmap -F <hostname> """ Then the output should not contain: """ 25/tcp """

Given

When

Then

When

Then

Page 52: Rugged by example with Gauntlt (Hacker Headshot)

running gauntlt with failing tests

$ gauntlt

Feature: nmap attacks for example.com

Background: Given "nmap" is installed And the following profile: | name | value | | hostname | example.com |

Scenario: Verify server is open on expected ports When I launch an "nmap" attack with: """ nmap -F www.example.com """ Then the output should contain: """ 443/tcp open https """

1 scenario (1 failed)5 steps (1 failed, 4 passed)0m18.341s

Page 53: Rugged by example with Gauntlt (Hacker Headshot)

$ gauntlt

Feature: nmap attacks for example.com

Background: Given "nmap" is installed And the following profile: | name | value | | hostname | example.com |

Scenario: Verify server is open on expected ports When I launch an "nmap" attack with: """ nmap -F www.example.com """ Then the output should contain: """ 443/tcp open https """

1 scenario (1 passed)4 steps (4 passed)0m18.341s

running gauntlt with passing tests

Page 54: Rugged by example with Gauntlt (Hacker Headshot)

$ gauntlt --steps/^"(\w+)" is installed in my path$//^"curl" is installed$//^"dirb" is installed$//^"garmr" is installed$//^"nmap" is installed$//^"sqlmap" is installed$//^"sslyze" is installed$//^I launch a "curl" attack with:$//^I launch a "dirb" attack with:$//^I launch a "garmr" attack with:$//^I launch a "generic" attack with:$//^I launch an "nmap" attack with:$//^I launch an "sslyze" attack with:$//^I launch an? "sqlmap" attack with:$//^the "(.*?)" command line binary is installed$//^the file "(.*?)" should contain XML:$//^the file "(.*?)" should not contain XML:$//^the following cookies should be received:$//^the following profile:$/

Page 55: Rugged by example with Gauntlt (Hacker Headshot)

$ gauntlt --steps/^"(\w+)" is installed in my path$//^"sqlmap" is installed$//^I launch a "generic" attack with:$//^I launch an? "sqlmap" attack with:$/

Page 56: Rugged by example with Gauntlt (Hacker Headshot)

Feature: nmap attacks for example.com Background: Given "nmap" is installed And the following profile: | name | value | | hostname | example.com |

Scenario: Verify server is open on expected ports When I launch an "nmap" attack with: """ nmap -F <hostname> """ Then the output should contain: """ 80/tcp open http """ Scenario: Verify that there are no unexpected ports open When I launch an "nmap" attack with: """ nmap -F <hostname> """ Then the output should not contain: """ 25/tcp """

setup steps

verify tool

set config

Page 57: Rugged by example with Gauntlt (Hacker Headshot)

Feature: nmap attacks for example.com Background: Given "nmap" is installed And the following profile: | name | value | | hostname | example.com |

Scenario: Verify server is open on expected ports When I launch an "nmap" attack with: """ nmap -F <hostname> """ Then the output should contain: """ 80/tcp open http """ Scenario: Verify that there are no unexpected ports open When I launch an "nmap" attack with: """ nmap -F <hostname> """ Then the output should not contain: """ 25/tcp """

attack

get config

Page 58: Rugged by example with Gauntlt (Hacker Headshot)

Feature: nmap attacks for example.com Background: Given "nmap" is installed And the following profile: | name | value | | hostname | example.com |

Scenario: Verify server is open on expected ports When I launch an "nmap" attack with: """ nmap -F <hostname> """ Then the output should contain: """ 80/tcp open http """ Scenario: Verify that there are no unexpected ports open When I launch an "nmap" attack with: """ nmap -F <hostname> """ Then the output should not contain: """ 25/tcp """

assert

needle

haystack

Page 59: Rugged by example with Gauntlt (Hacker Headshot)

Supported Tools

curlnmapsqlmapsslyzeGarmrdirbgeneric

Page 60: Rugged by example with Gauntlt (Hacker Headshot)

Netflix

Use Case

Real World Cloud Application Security, Jason Chanhttps://vimeo.com/54157394

Page 61: Rugged by example with Gauntlt (Hacker Headshot)

Check your ssl certs

Page 62: Rugged by example with Gauntlt (Hacker Headshot)

cookie tampering

Page 63: Rugged by example with Gauntlt (Hacker Headshot)

curl hacking

Page 64: Rugged by example with Gauntlt (Hacker Headshot)

Look for common apache

misconfigurations

Page 65: Rugged by example with Gauntlt (Hacker Headshot)

@slowFeature: Run dirb scan on a URL

Scenario: Run a dirb scan looking for common vulnerabilities in apache

Given "dirb" is installed And the following profile: | name | value | | hostname | http://example.com | | wordlist | vulns/apache.txt |

When I launch a "dirb" attack with: """ dirb <hostname> <dirb_wordlists_path>/<wordlist> """

Then the output should contain: """ FOUND: 0 """

.htaccess.htpasswd

.meta.web

access_logcgi

cgi-bincgi-pub

cgi-scriptdummyerror

error_loghtdocshttpd

httpd.pidicons

server-infoserver-status

logsmanualprintenvtest-cgi

tmp~bin~ftp

~nobody~root

Page 66: Rugged by example with Gauntlt (Hacker Headshot)

I have my weakness. But I won't tell you! Ha Ha Ha!

Page 67: Rugged by example with Gauntlt (Hacker Headshot)

Test for SQL

Injection

Page 68: Rugged by example with Gauntlt (Hacker Headshot)

@slow @announceFeature: Run sqlmap against a target Scenario: Identify SQL injection vulnerabilities

Given "sqlmap" is installed And the following profile: | name | value | | target_url | http://example.com?x=1 |

When I launch a "sqlmap" attack with: """ python <sqlmap_path> -u <target_url> --dbms sqlite --batch -v 0 --tables """

Page 69: Rugged by example with Gauntlt (Hacker Headshot)
Page 71: Rugged by example with Gauntlt (Hacker Headshot)

Starter Kit on GitHub

The starter kit is on GitHub:

github.com/gauntlt/gauntlt-starter-kit

Or, download a copy from:

www.gauntlt.org/

Page 72: Rugged by example with Gauntlt (Hacker Headshot)

@gauntlt

future plans

Page 73: Rugged by example with Gauntlt (Hacker Headshot)

Next Features

More output parsers

More attack adapters

JRuby & Java Support

Front end UI / web

reports

Page 75: Rugged by example with Gauntlt (Hacker Headshot)

Contribute

to gauntlt

See ‘FOR DEVELOPERS’ in

the README

Get started in 7 steps

Page 76: Rugged by example with Gauntlt (Hacker Headshot)

If you get

stuck

Check the README

IRC Channel: #gauntlt

on freenode

@gauntlt on twitter

Mailing List (https://groups.google.com/forum/#!forum/

gauntlt)

Office hours with

weekly google hangout

Page 77: Rugged by example with Gauntlt (Hacker Headshot)

get started with gauntlt

github/gauntlt

gauntlt.orgvideos

tutorials

google group@gauntlt

IRC #gauntltwe

help!

start here

cool vids!