• Stars
    star
    121
  • Rank 291,647 (Top 6 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

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

Repository Details

Docker toolbox for pentest of web based application.

🏭 Welcome to my forge

πŸ‘ Image full credits go to Dirk Hoenes: https://pixabay.com/users/ptdh-275507.

MadeWitVSCode MadeWithDocker AutomatedWith AuditedWith

πŸ“‘ Note: Even though this box is primarily intended for offensive operation, many tools and scripts can also be used for defensive purposes, for example, in CI/CD pipelines as security validation.

πŸ”– Quick access:

🎯 The goal of this image is to provide an, always up to date "box", containing materials (tools + scripts) useful in the context of the assessment of a web-based application: site, API, etc.

πŸ“’ The image is based on the alpine base image. Previously, it was based on the kali-rolling image but the final size of the image, once the toolbox was built, was really too heavy (more than 14GB).

πŸ“± Recently, I started to add content for mobile assessment to gather information/tools in a single box.

🏷️ Issues with the label idea, contains general ideas on a project/code/script/payload/research/etc not necessarily directly linked to the toolbox itself. Indeed, as this project is my central toolbox's forge, I used it also to gather/centralize my ideas.

πŸ”‹ Health status

Build and deploy the toolbox image

Audit the toolbox image

Build and deploy the sandboxes image

Build PostgreSQL extension

Build DLL Hijacking library

Build Hash Extender linux binary

Check cheat sheet links validity

Update scripts index

βš’οΈ Box enhancement approach

Projects

Approach

sequenceDiagram
    participant T as Toolbox
    participant P as Param-Miner    
    participant S as SecLists
    participant N as Nuclei templates
    alt Is a missing hidden http parameter/header entry
        T->>P: Propose a PR with the missing element
        P->>T: Get update from the GitHub repository once the PR is merged
    end    
    alt Is a missing discovery dictionary entry
        T->>S: Propose a PR with the missing element
        S->>T: Get update from the GitHub repository once the PR is merged
    end
    alt Is a missing detection generic point
        T->>N: Propose a PR with the missing template
        N->>T: Get update from the GitHub repository once the PR is merged
    end
    alt Is a missing useful existing tool
        T->>T: Add the tool in a way to always use the latest version
    end       
    alt Is a missing specific need or without existing tool
        T->>T: Add a new custom script
    end   

πŸ–₯️ IDE VSCode

πŸ“š What does it contain?

Build

The folder build contains utility internal scripts used to build the docker image.

Tools

All tools are installed in the folder /tools and a transfer zone between the container and the host has been defined via the folder /tools/reports.

Helper scripts

πŸ“‘ Note: The index of all the scripts available is automatically updated, at each push on the master branch, via this workflow.

The folder scripts contains helper scripts for some operations using embedded tools.

Sandboxes with specific OS and/or runtime

Sandbox using custom docker images

The folder sandboxes contains utility docker files with specific OS/Runtime to create a specific sandbox.

The objective is to leverage the containerization to have a collection of quick sandboxes environment to test some specific behavior on a specific OS/runtime, for example, during a code review on an old version of a runtime (like PHP5).

The header of the dockerfile describes the target OS/runtime.

πŸ“‘ All boxes are build and published to DockerHub every month (images starting with righettod/sandbox- name).

Command to use to build and/or run a sandbox:

πŸ’» By default, a ZSH shell with Oh My Zsh is launched.

docker rmi -f righettod/[BoxName]
docker build --force-rm -t righettod/[BoxName] -f [Dockerfile] .
docker run --rm -v "[LOCAL_FOLDER_PATH]:/share" -i -t righettod/[BoxName]

Sandbox using public docker images

The following images can be used:

# Use the following command to obtains a ruby 2.x environment
# Once in the container, you can install software via "apt-get update; apt-get install nano ..."
docker run -it ruby:2 /bin/bash

Misc

The folder misc contains materials that can be used for testing specific cases like for example when an app is using:

Templates

The folder templates contains several scripts/files that can be used as a basis for custom scripts to speed-up the implementation of a POC.

Dictionaries

The folder dictionaries contains several home-made custom dictionaries that can be used for discovery operations.

Technical hints

This file contains several technical hints for different kinds of context/issues/goals.

πŸ’» It's my tailor made cheat sheet.

πŸ”¨ Build image locally

Use the following set of commands:

$ git clone https://github.com/righettod/toolbox-pentest-web.git
$ cd toolbox-pentest-web
$ docker build . -t righettod/toolbox-pentest-web --file Dockerfile
...

πŸ“‘ Container usage

On a docker host for direct access

Native docker on Linux or MacOS

# Create a volume to share files with the container (ex: reports)
$ docker volume create --name shared_space
$ docker volume inspect shared_space
# Run container
$ docker run -v shared_space:/tools/reports -p 127.0.0.1:80:80 -i -t righettod/toolbox-pentest-web /bin/zsh
$ docker run -v shared_space:/tools/reports -p 192.168.206.128:80:80 -p 192.168.206.128:443:443 -i -t righettod/toolbox-pentest-web /bin/zsh
# Build image into local cache
$ docker build -t righettod/toolbox-pentest-web .
# Remove image from local cache
$ docker rmi -f righettod/toolbox-pentest-web

Docker for Windows

rem Run container and defines a shared folder
C:\> docker run -v F:/SharedFolder:/tools/reports -p 127.0.0.1:80:80 -i -t righettod/toolbox-pentest-web /bin/zsh

For remote ssh access

πŸ“ Warning: Private key to use for SSH authentication is here. This box is intended to be used as a toolbox for a short running period.

πŸ“ Warning: When deployed on Kubernetes, the SYS_CHROOT / AUDIT_WRITE / NET_RAW capabilities are required in the security context.

  1. Run the container on the target docker host using the following command line:
$ docker run -p 22:22 righettod/toolbox-pentest-web
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
...
  1. Access the container, via SSH, using the following command:
$ ssh -i ~/.ssh/ssh-private-key.pem root@[DOCKER_HOST_IP]
➜  ~

Add "StrictHostKeyChecking=no" in case of trouble with the remote keys because they are unique for each built image:

$ ssh -o "StrictHostKeyChecking=no" -i ~/.ssh/toolbox-ssh-private-key.pem root@[DOCKER_HOST_IP]
➜  ~

πŸ“¦ DockerHub

Image is published into the following registries, every week, via this workflow:

πŸ›‘οΈ Security

  • Refer here for information about reporting a vulnerability.
  • Image is audited every week, by Snyk and this workflow, to detect presence of any vulnerability.

More Repositories

1

poc-graphql

Research on GraphQL from an AppSec point of view.
Java
404
star
2

burp-piper-custom-scripts

Custom scripts for the PIPER Burp extensions.
Python
97
star
3

virtualhost-payload-generator

BURP extension providing a set of values for the HTTP request "Host" header for the "BURP Intruder" in order to abuse virtual host resolution.
Java
61
star
4

log-requests-to-sqlite

BURP extension to record every HTTP request send via BURP and create an audit trail log of an assessment.
Java
60
star
5

pst-digger

Program to analyze mails stored into a Microsoft Outlook PST file and find one based on search keywords.
Java
55
star
6

document-upload-protection

POC in order to protect an document upload application feature against "malicious" document submission.
Java
40
star
7

log4shell-analysis

Contains all my research and content produced regarding the log4shell vulnerability
Java
32
star
8

website-passive-reconnaissance

Script to automate, when possible, the passive reconnaissance performed on a website prior to an assessment.
Python
31
star
9

poc-csrf

POC in order to materialize CSRF prevention concepts described in the following OWASP CSRF cheatsheet
Java
30
star
10

poc-jwt

POC about usage of JSON Web Tokens (JWT) in a secure way.
Java
26
star
11

access-brute-forcer

Android v7+ application to perform a dictionary brute force attack against a host.
Java
17
star
12

tls-cert-discovery

Script to identify new host using the subjectAltName (Subject Alternate Name) extension of a x509 HTTP TLS certificate.
Python
10
star
13

injection-cheat-sheets

Provide some tips to handle Injection into application code (OWASP TOP 10 - A1).
Java
9
star
14

poc-authz-testing

POC in order to explore and describe a proposition for the automation of the testing of the authorization matrix.
Java
8
star
15

powershell-android-utils

PowerShell module providing utility commands to manipulate a APK file on Windows
PowerShell
7
star
16

poc-idor

POC in order to materialize IDOR prevention concepts described in the following OWASP cheatsheet
Java
7
star
17

toolbox-jwt

Docker toolbox with different scripts having for the objective to perform different kinds of attacks against JWT tokens.
Shell
5
star
18

poc-websocket

POC in order to materialize prevention concepts described in the following OWASP WebSocket cheatsheet
Java
4
star
19

robots-disallowed-dict-builder

Script generating a dictionary containing the most common DISALLOW clauses from robots.txt file found on CISCO Top 1 million sites
Python
4
star
20

clipboard-stalker

Android v6+ application to monitor (stalk) the clipboard and grab the content.
Java
3
star
21

ws-probing-shell

Interactive shell in order to probe/analyze a WebSocket endpoint.
Python
3
star
22

log4shell-payload-grabber

Tool to try to retrieve the java class used as dropper for the RCE in the context of log4shell vulnerability.
Java
3
star
23

external-storage-stalker

Android v6+ application to monitor (stalk) all the external storage locations referenced into the system and list the files that can be accessed in read mode.
Java
2
star
24

poc-argon2

POC in order to materialize prevention concepts described in the following OWASP cheatsheet
Java
2
star
25

poc-argon2-php

POC in order to materialize prevention concepts described in the following OWASP cheatsheet
PHP
2
star
26

poc-error-handling

POC in order to find the right setup to define a global error handler in differents web based technologies
JavaScript
1
star
27

sandbox

Provide network listeners during online training web challenges/labs.
Shell
1
star
28

voxxeddays-lux-2018

Demo project of my talk
Java
1
star
29

pkcheck

Program brute forcing the passphrase of a private key
Go
1
star
30

voxxeddays-lux-2022

Demonstration videos and presentation regarding the talk given at the VOXXED LU 2022 conference.
PHP
1
star