• Stars
    star
    156
  • Rank 239,589 (Top 5 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

d(ockerp)wn - a docker pwn tool manager


πŸ₯½ dwn

d(ockerp)wn - a docker attack tool manager

@leonjza PyPI version


introduction

dwn is a "docker-compose for hackers". Using a simple YAML "plan" format similar to docker-compose, image names, versions and volume / port mappings are defined to setup a tool for use.

features

With dwn you can:

  • Configure common pentest tools for use in a docker container
  • Have context aware volume mounts
  • Dynamically modify port bindings without container restarts
  • And more!

installation

Simply run pip3 install dwn.

usage

dwn is actually really simple. The primary concept is that of "plans" where information about a tool (such as name, version, mounts and binds) are defined. There are a few built-in plans already available, but you can also roll your own. Without arguments, just running dwn would look like this.

❯ dwn
Usage: dwn [OPTIONS] COMMAND [ARGS]...

       __
   ___/ /    _____
  / _  / |/|/ / _ \
  \_,_/|__,__/_//_/
    docker pwn tool manager
    by @leonjza / @sensepost

Options:
  --debug  enable debug logging
  --help   Show this message and exit.

Commands:
  check    Check plans and Docker environment
  network  Work with networks
  plans    Work with plans
  run      Run a plan
  show     Show running plans
  stop     Stop a plan

To list the available plans, run dwn plans show.

❯ dwn plans show
                                    dwn plans
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ name             ┃ path                                  ┃
┑━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
β”‚ sqlmap           β”‚ /tools/dwn/plans/sqlmap.yml           β”‚
β”‚ wpscan           β”‚ /tools/dwn/plans/wpscan.yml           β”‚
β”‚ gowitness-report β”‚ /tools/dwn/plans/gowitness-report.yml β”‚
β”‚ msfconsole       β”‚ /tools/dwn/plans/msfconsole.yml       β”‚
β”‚ gowitness        β”‚ /tools/dwn/plans/gowitness.yml        β”‚
β”‚ nginx            β”‚ /tools/dwn/plans/nginx.yml            β”‚
β”‚ cme              β”‚ /tools/dwn/plans/cme.yml              β”‚
β”‚ netcat-reverse   β”‚ /tools/dwn/plans/netcat-reverse.yml   β”‚
β”‚ semgrep-sec      β”‚ /tools/dwn/plans/semgrep-sec.yml      β”‚
β”‚ semgrep-ci       β”‚ ~/.dwn/plans/semgrep-ci.yml           β”‚
β”‚ neo4j            β”‚ ~/.dwn/plans/neo4j.yml                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     11 plans

To run a plan such as gowitness screenshotting https://google.com, run dwn run gowitness --disable-db single https://www.google.com. This plan will exit when done, so you don’t have to dwn stop gowitness.

❯ dwn run gowitness --disable-db single https://www.google.com
(i) found plan for gowitness
(i) volume: ~/scratch -> /data
(i) streaming container logs
08 Feb 2021 10:46:18 INF preflight result statuscode=200 title=Google url=https://www.google.com
❯
❯ ls screenshots
https-www.google.com.png

A plan such as netcat-reverse however will stay alive. You can connect to the plans TTY after it is started to interact with any shells you may receive. Example usage would be:

❯ dwn run netcat-reverse
(i) found plan for netcat-reverse
(i) port: 4444<-4444
(i) container booted! attach & detach commands are:
(i) attach: docker attach dwn_wghz_netcat-reverse
(i) detach: ctrl + p, ctrl + q

Attaching to the plan (and executing nc -e somewhere else)

❯ docker attach dwn_wghz_netcat-reverse
connect to [::ffff:172.19.0.2]:4444 from dwn_wghz_netcat-reverse_net_4444_4444.dwn:46318 ([::ffff:172.19.0.3]:46318)

env | grep -i shell
SHELL=/bin/zsh

read escape sequence

You can get a running plan report too

❯ dwn show
                                running plan report
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┓
┃ plan           ┃ container(s)                          ┃ port(s)    ┃ volume(s) ┃
┑━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━┩
β”‚ netcat-reverse β”‚ dwn_wghz_netcat-reverse_net_4444_4444 β”‚ 4444<-4444 β”‚           β”‚
β”‚                β”‚ dwn_wghz_netcat-reverse               β”‚            β”‚           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

And finally, stop a plan.

❯ dwn stop netcat-reverse -y
(i) stopping 2 containers for plan netcat-reverse

networking

dwn lets you dynamically map ports to plans without any container restarts. Networking commands live under the dwn network subcommand. Taking the nginx plan as an example, we can add a port mapping dynamically. First, start the nginx plan.

❯ dwn run nginx
(i) found plan for nginx
(i) volume: ~/scratch -> /usr/share/nginx/html
(i) port: 80<-8888
(i) container dwn_wghz_nginx started for plan nginx, detaching

Next, test the communication with cURL

❯ curl localhost:8888/poo.txt
haha, you touched it!

❯ curl localhost:9000/poo.txt
curl: (7) Failed to connect to localhost port 9000: Connection refused

Port 9000 is not open, so let's add a new port binding and test connectivity

❯ dwn network add nginx -i 80 -o 9000
(i) port binding for 9000->nginx:80 created
❯
❯ curl localhost:9000/poo.txt
haha, you touched it!

updating plans

The dwn plans pull command can be used to update the images defined in plans. To only update a single plan, add the plan name after pull. Eg: dwn plans pull nginx.

writing plans

A dwn plans new command exists to quickly scaffold a new plan. While only a few options are needed to get a plan up and running, all of the options that exist in the Python Docker SDK for the run call are valid tags that can be used.

license

dwn is licensed under a GNU General Public v3 License. Permissions beyond the scope of this license may be available at http://sensepost.com/contact/.

More Repositories

1

objection

πŸ“± objection - runtime mobile exploration
Python
7,492
star
2

gowitness

πŸ” gowitness - a golang, web screenshot utility using Chrome Headless
Go
3,159
star
3

reGeorg

The successor to reDuh, pwn a bastion webserver and create SOCKS proxies through the DMZ. Pivot and pwn.
Python
3,015
star
4

ruler

A tool to abuse Exchange services
Go
2,164
star
5

mana

*DEPRECATED* mana toolkit for wifi rogue AP attacks and MitM
HTML
1,087
star
6

DET

(extensible) Data Exfiltration Toolkit (DET)
Python
819
star
7

godoh

πŸ•³ godoh - A DNS-over-HTTPS C2
Go
752
star
8

kwetza

Python script to inject existing Android applications with a Meterpreter payload.
Smali
638
star
9

Snoopy

Snoopy: A distributed tracking and data interception framework
Python
597
star
10

hostapd-mana

SensePost's modified hostapd for wifi attacks.
C
543
star
11

rattler

Automated DLL Enumerator
C++
522
star
12

DNS-Shell

DNS-Shell is an interactive Shell over DNS channel
Python
521
star
13

USaBUSe

Universal Serial aBUSe is a project to demonstrate the risks of hardware bypasses of software security by Rogan Dawes at SensePost.
C
493
star
14

snoopy-ng

Snoopy v2.0 - modular digital terrestrial tracking framework
Python
430
star
15

reDuh

Create a TCP circuit through validly formed HTTP requests
Java
343
star
16

Frack

Frack - Keep and Maintain your breach data
Python
309
star
17

autoDANE

Auto Domain Admin and Network Exploitation.
Python
295
star
18

impersonate

A windows token impersonation tool
Python
279
star
19

SPartan

Frontpage and Sharepoint fingerprinting and attack tool.
Python
277
star
20

wiresocks

A sock, with a wire, so you can tunnel all you desire.
Shell
272
star
21

mallet

Mallet is an intercepting proxy for arbitrary protocols
Java
262
star
22

UserEnum

Domain user enumeration tool
Python
212
star
23

jack

Drag and Drop ClickJacking PoC development assistance tool.
CSS
190
star
24

wpa_sycophant

Evil client portion of EAP relay attack
C
189
star
25

wikto

Nikto for Windows with some extra features.
C#
175
star
26

routopsy

Routopsy - Hacking Routers with Routers
Python
167
star
27

heartbleed-poc

Test for SSL heartbeat vulnerability (CVE-2014-0160)
Ruby
159
star
28

gdi-palettes-exp

DC25 5A1F - Demystifying Windows Kernel Exploitation by Abusing GDI Objects
C++
143
star
29

assless-chaps

Crack MSCHAPv2 challenge/responses quickly using a database of NT hashes
Python
127
star
30

wadi

Wadi Fuzzing Harness
JavaScript
127
star
31

birp

Big Iron Recon & Pwnage
Python
123
star
32

go-out

β˜„οΈ go-out - A Golang egress buster.
Go
122
star
33

mail-in-the-middle

Python
100
star
34

mydumbedr

C
99
star
35

liniaal

Liniaal - A communication extension to Ruler
Go
96
star
36

frida-windows-playground

A collection of Frida hooks for experimentation on Windows platforms.
C
95
star
37

ms16-098

Windows 8.1 x64 Exploit for MS16-098 RNGOBJ_Integer_Overflow
C
92
star
38

notruler

The opposite of Ruler, provides blue teams with the ability to detect Ruler usage against Exchange.
Go
91
star
39

offensive-rpc

Offensive RPC PoC
C++
83
star
40

anapickle

Toolset for writing shellcode in Python's Pickle language and for manipulating pickles to inject shellcode.
Python
79
star
41

autoresponder

Quick python script to automatically load NTLM hashes from Responder logs and fires up Hashcat to crack them
Python
78
star
42

xrdp

A rudimentary remote desktop tool for the X11 protocol exploiting unauthenticated x11 sessions
Python
76
star
43

apostille

Java
72
star
44

peanuts

Peanuts is a free and open source wifi tracking tool. Based on the SensePosts Snoopy-NG project that is now closed.
Python
69
star
45

WiFi-Rifle

Creating a wireless rifle de-authentication gun, which utilized a yagi antenna and a Raspberry Pi.
Python
68
star
46

punch-q

πŸ‘Š A small utility to play with IBM MQ
Python
61
star
47

hash-cracker

Script to perform some hashcracking logic automagically
C
61
star
48

common-substr

Simple tool to extract the most common substrings from an input text. Built for password cracking.
Go
61
star
49

shinai-fi

Docker images for learning wifi hacking
Shell
60
star
50

thumbscr-ews

Exchangelib wrapper for pentesting
Python
56
star
51

wsproxy

A websocket proxy
JavaScript
55
star
52

BiLE-suite

The Bi-directional Link Extractor.
Perl
53
star
53

go-derper

Memcache hacking tool.
Ruby
47
star
54

yeti

SensePost's network footprinting and enumeration tool. You can't pwn what you don't know about.
Java
43
star
55

understanding-eap

A repository with toy implementations of MSCHAPv2, MPEE and WPA/2 to understand EAP better
Python
37
star
56

sockstlsproxy

C#
37
star
57

ntcrack

Left To My Own Devices - NT hash tools
Rust
31
star
58

dual-pod-shock

C
27
star
59

policies

Collection of information security policies.
27
star
60

Suru

Suru is one of the original Man In The Middle (MITM) proxies that sits between the user's browser and the web application.
C#
26
star
61

steampipe-plugin-projectdiscovery

A steampipe plugin to query projectdiscovery.io tools.
Go
26
star
62

squeeza

SQL Injection without the pain of syringes.
Ruby
24
star
63

x11-active-displays

Checks X11 and outputs a screenshot to of the display if allowed and the display is active
Lua
22
star
64

wpa3-vuln

hostapd and wpa_supplicant 2.7 vulnerable to Mathy's WPA3 bugs
C
21
star
65

SapCap

SApCap is a SAP packet sniffer and decompression tool for analysing SAP GUI (DIAG) traffic
C++
16
star
66

6thSense

A while back antirez, in a post to Bugtraq, detailed a new Tcp portscan method.
Perl
16
star
67

maltego-mvs

Tools to combine MVS data with external sources and visualise the output in Maltego.
Python
16
star
68

password-tools

Service desk password tools.
JavaScript
15
star
69

cipherchecks

visually see issues with supported cipher suites
Python
15
star
70

ntp_monlist

Basic script to pull addresses from a NTP server using the monlist command.
Python
14
star
71

XAPSpy

Runtime analysis of windows phone 7 applications.
C#
13
star
72

esp-vnc

Our fork of the esp-link firmware with a built in VNC server for passing input events to an AVR. Part of our Universal Serial aBUSe project.
C
11
star
73

casper

Casper is a tiny system tray application that can be used to view the invisible windows on your desktop.
C#
11
star
74

SAPProx

SAPProx is a proof of concept tool for intercepting and modifying SAP GUI (DIAG protocol) traffic.
C++
11
star
75

JBaah

HTTP Brute Forcer (Java replacement for SP's CrowBar).
Java
11
star
76

SP-DNS-mine

Google DNS name / sub domain miner.
Perl
10
star
77

SpUD

SensePost Unified Data API (SPUD) is a wrapper for apps requiring use of the deprecated Google API.
C#
10
star
78

neverevercookie

GUI for cleaning out evercookie persistence locations.
Java
10
star
79

dresscode

Python
10
star
80

berate_radius

Alpine hostapd-mana based RADIUS server
Shell
9
star
81

Manifestor

Android Manifest.xml tool
Python
9
star
82

ClashofSpamTitan

Python
9
star
83

BilePublic

BiLE stands for Bi-directional Link Extraction. It is used in the footprinting process to find non-obvious relationships between different web sites.
Perl
9
star
84

glypeahead

Port scan through Glype proxies.
PHP
8
star
85

finder

Finder.pl remotely checks IIS Servers for most of the methods used by WebDAV.
Perl
8
star
86

jcertchecker

JCertChecker is used to check HTTPS certificates.
Java
7
star
87

desperate

Perl
7
star
88

MonSoen

Proxy Server network scanner and tunnelling tool.
Python
7
star
89

Scully

Scully is a client interface to MSSQL and MySQL database servers.
C#
7
star
90

hash-cracker-apple-silicon

Script to perform some hashcracking logic automagically
Python
6
star
91

sconwar

a bring your own client programming game
Go
6
star
92

CarbanakCheck

Check squid logs for possible Carbanak malware.
Python
6
star
93

go

Seriously primitive portscanner using Squid proxy.
Perl
6
star
94

pudding

IDS evasion for web-based exploits via encoding built into a "proxy"
5
star
95

gr-protocoldecoder

A simple way to decode a known protocol in GRC in real time.
CMake
4
star
96

mpdchecker

Confirm the presence of HTTP methods per directory.
Python
4
star
97

unitools

For working with IIS servers with the Unicode bug
Perl
4
star
98

file-read-experiments

A few short scripts to look at the performance of various file read strategies.
Rust
4
star
99

ctf-challenges

A collection of CTF challenges
CSS
3
star
100

sensedecode

Sensedecode includes 2 perl scripts which exploit the IIS url decoding bug.
Perl
3
star