Managing Your Pentest Data with Kvasir: Toorcon 15

41
Managing Penetration Testing Data with Kvasir Toorcon 15 (San Diego) @grutz

description

We’ve all done it a few times. Lost that nmap scan, can’t recall what file had that account and password combination, sat in front of a screen for a few days while your co-worker gathered tons of data and didn’t share because he’s a big fat jerk. Kvasir is a centralized, penetration tester-focused data homogenizing application to help collect, unify and make sense of the important data gathered during tests. It’s a small footprint application designed for quick deployment. It integrates directly with NeXpose and Metasploit (for now). This application is used daily by Cisco Systems engineers on customer penetration tests. It hasn’t solved the big fat jerk problem but it has helped us work better as a team. Presented at Toorcon 15, October 20, 2013

Transcript of Managing Your Pentest Data with Kvasir: Toorcon 15

Page 1: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing Penetration Testing Data with Kvasir

Toorcon 15 (San Diego)@grutz

Page 2: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 2

BACKGROUND

Toorcon 15 -- @grutz

Page 3: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 3

$ whois grutz

Corporate penetration tester for ~15 years~10 years internal with Federal Reserve and Pacific Gas & Electric5 years consulting to customers for

Developed Squirtle, the NTLM Attack toolSmashed up some Huawei/H3C/HP gear

Toorcon 15 -- @grutz

Page 4: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 4

DEFINING THE PROBLEM

Toorcon 15 -- @grutz

Page 5: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 5

Testing is all about collecting data…

Toorcon 15 -- @grutz

Page 6: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 6

As pentesters we collect a TON of data…

Toorcon 15 -- @grutz

Page 7: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 7

So you sort them into directories…

Toorcon 15 -- @grutz

…which can be difficult to manage…

Page 8: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 8

Sharing data across your team

Toorcon 15 -- @grutz

…can have its challenges

Page 9: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 9

Did you get everything you need?

Toorcon 15 -- @grutz

Great! Now write a report, monkey!

Page 10: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 10

CURRENT OPTIONS?

Toorcon 15 -- @grutz

Page 11: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 11

Currently…

• Metasploit Pro, Cobalt Strike, STRATEGIC, CORE, etc• Nexpose, Nessus, QualysGuard, Saint, Fortigate, etc• ThreadFix, Archer, RiskIO, Secunia VIM, etc• Issue / Bug tracking tools (and their wikis)

• TRAC, Redmine, Bugzilla, etc• Wikis!• Spreadsheets!• Roll your own!

Toorcon 15 -- @grutz

Page 12: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 12

Issues with these tools

• Not designed to manage PT data• You have to conform your data to the tool• Vulnerability Management != Penetration Test Data!

• Requires enhancements / add-ons• Develop your own add-ons• Maintain support and training

• Changes are difficult to implement• No access to source code for when things break• High complexity, vendor demands, delays

• “In the cloud” or “vendor hosted” solutions• Spreadsheets??? Really?!?!Toorcon 15 -- @grutz

Page 13: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 13

ENTER KVASIR

Toorcon 15 -- @grutz

Page 14: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 14

0118 999 881 999 119 725 3

Toorcon 15 -- @grutz

Page 15: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 15

ACHTUNG!

I am an ADHD coder. Large bits of Kvasir were thought of after working at a customer’s site and developed with little sleep and lots of caffeine and/or alcohol. I am also not a really good UI coder.

Toorcon 15 -- @grutz

Page 16: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 16

Kvasir’s Cisco Pedigree

• Recognized long ago that managing disparate data is essential to effective testing results

• Began from our acquisition of “The Wheel Group” back in 1999

• Multiple iterations:• AttackAll, AutoSPA, Halo/Banshee,

AutoSPAng• Close source / proprietary

Toorcon 15 -- @grutz

Page 17: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 17

Design Philosophy

• Take disparate data and cram it into a (mostly) consistent relational database format.

• Focus on PENETRATION TEST tools and data• Be quick• Be adaptable• Try not to get in the way of the hacking• No cross-contamination of customer data

Toorcon 15 -- @grutz

Page 18: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 18

Benefits to using Kvasir

• Alcohol infused coding practices• Designed by and for Penetration Testers

OPEN SOURCE! FREE!!!• Data access through web2py shell == awesome!

http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer

Toorcon 15 -- @grutz

Page 19: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 19

High-level Database Design

Hosts

Accounts Operating Systems

CPE Data

SNMP Services

VulnDB

Exploits References

Evidence NetBIOS

Toorcon 15 -- @grutz

Page 20: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 20

Data Directory Structure

All script output is stored under “data”

Local to the web server

Session-logs/ contain ‘script’ file output from launched terminals

Toorcon 15 -- @grutz

Page 21: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 21

Supported Host/Vulnerability Scanners

Right NowNexposeNmapNessusMetasploit (hosts only)ShodanHQ

HorizonQualysGuardMetasploit Pro (Webscan)BurpSuite Pro (Report XML)

Toorcon 15 -- @grutz

Others?

Page 22: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 22

Metasploit Pro API Integration

• Kvasir utilizes some MSF Pro-only API functions:• Bruteforce / Exploit• Import XML, PWDUMP, Screenshots• Sending Accounts / Scan data results

• TODO:• Sending exploits to Framework API• Direct MSF DB access (who uses ‘pass’

as a field name? MSF!)

Toorcon 15 -- @grutz

Page 23: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 23

THE KVASIR WORKFLOW

Toorcon 15 -- @grutz

Page 24: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 24

Installation and setup

https://github.com/KvasirSecurity/Kvasir/wiki/Installation

• Kvasir begins life as a completely blank slate• You must add users, CPE, Vulndata, Exploits, etc• Mostly automated through parts of the UI

• For multiple team members on a test:• One central person runs the SQL database• All team members have their own Kvasir instance and point to the

SQL DB in settings.database_uri

Toorcon 15 -- @grutz

Page 25: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 25

Importing Support Data

• Vulnerability data can be:• Imported prior to engagement start• Imported as part of a Vulnerability Scan results

• Exploits XML data imported:• Nexpose’s exploits.xml file• ImmunitySec CANVAS download / file

• CPE OS Data• Downloaded and parsed from MITRE

Toorcon 15 -- @grutz

Page 26: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 26

Populating Engagement Data

• Vulnerability Scanner Imports• Import direct from scanners or files

• Nmap Scanning Imports• Import XML output file (-oX)• Kick-off a scan and import the results

• Bruteforce/Account Tools• THC Hydra• Medusa• Metasploit creds.csv output• PW recovery tool output (John POT, user:password, etc)

Toorcon 15 -- @grutz

Page 27: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 27

Valkyries

Tasks who results feed back to KvasirNot designed to replace Metasploit / CANVAS / CORE, etc.

WebShot: Grab images of HTTP instance using phantomjsVNCShot: Grab images of open VNC Servers using vncdotool

Others planned, just not completed

Toorcon 15 -- @grutz

Page 28: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 28

SCREENSHOTS!

Toorcon 15 -- @grutz

Page 29: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 29

Main Index

Toorcon 15 -- @grutz

Page 30: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 30

Host List

Toorcon 15 -- @grutz

Page 31: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 31

Host Detail

Toorcon 15 -- @grutz

Terminal launch – click or hot-key L

Flags are hot-keyed: C, D, F

Tabs switch with hot-keys: a, s, v, e, o, t, m, b

Notes submit after enter

Hot-key: ^N

Page 32: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 32

Services

Toorcon 15 -- @grutz

Page 33: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 33

Accounts

Toorcon 15 -- @grutz

Page 34: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 34

Windows Domain Memberships

Toorcon 15 -- @grutz

Page 35: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 35

Evidence (Screenshots, Docs, etc)

Toorcon 15 -- @grutz

Page 36: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 36

Password Statistics

Toorcon 15 -- @grutz

Page 37: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 37

Vulnerability Statistics

Toorcon 15 -- @grutz

Page 38: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 38

Vulnerability Circles

“In progress”

Diameter calculated by service counts, CVSS details, accounts, severity, etc

Toorcon 15 -- @grutz

Page 39: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 39

ON THE HORIZON

Toorcon 15 -- @grutz

Page 40: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 40

Lots to still do…

• Consistent vulnerability database (VulnDB?) that maps to vendor tags (QID, NessusID, Nexpose ID)

• Additional vulnerability scanner support• Metasploit to release their new MDM structure• Maltego Integration• Probably an overhaul of the user interface• Whatever is in TODO.md that I thought of while sleepless on a 10hr flight

back home

Toorcon 15 -- @grutz

Page 41: Managing Your Pentest Data with Kvasir: Toorcon 15

Managing PT Data with Kvasir 41

THANK YOU!

http://github.com/KvasirSecurity/Kvasir

http://kvasirsecurity.github.io/assets/presentations/toorcon-15- kvasir.pdf

Toorcon 15 -- @grutz