Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cb/wrapper #20

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = E226,E302,E41,W605,C901
max-line-length = 256
exclude = tests/*,.venv/*, .vscode/*
max-complexity = 10
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ newrelic.ini
newrelic_agent.log

www/kits/**
logs/
!logs/.gitkeep

# CI
reports
Expand Down
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,44 @@
</p>

## What is phishpond?
It's a pre-built docker environment which allows you to quickly, easily and safely spin up phishing kits for analysis. Out of the box you can browse, "mitm" web traffic, log mail calls to flat files and debug PHP code remotely.
It's a pre-built dockerised environment which allows you to quickly and easily spin up phishing kits for analysis. Out of the box you can host and browse kits, "mitm" web traffic, log mail and telegram calls to flat files, and debug PHP code.

## Installing
You can use phishpond either as a CLI package, or use the included `docker-compose.yml` to build and manage the containers manually.

### CLI
Clone the repository
```bash
git clone https://github.com/zerofox-oss/phishpond
```

Install the requirements
```bash
pip install -r requirements.txt
```

Install phishpond
```bash
pip install -e .
```

Run phishpond setup
```bash
phishpond --setup
```

Follow the prompts to build the required containers, volumes, networks, and set required variables.

### Compose
Clone the repository
```bash
git clone https://github.com/zerofox-oss/phishpond
```

Run docker-compose
```bash
docker-compose up
```

## How to use
1. `git clone https://github.com/zerofox-oss/phishpond.git`
Expand Down
72 changes: 38 additions & 34 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
version: "3.5"

services:
webserver:
pp_webserver:
build:
context: ./docker/web
context: ./phishpond/docker/web
depends_on:
- mitmproxy
container_name: 'webserver'
- pp_mitmproxy
container_name: 'pp_webserver'
hostname: 'phishpond.local'
restart: 'always'
ports:
- "80:80"
- "443:443"
environment:
- http_proxy=http://mitmproxy:8080
- HTTPS_PROXY=http://mitmproxy:8080
- http_proxy=http://pp_mitmproxy:8080
- HTTPS_PROXY=http://pp_mitmproxy:8080
- XDEBUG_CONFIG="remote_host=localhost remote_port=9000 remote_enable=1"
links:
- mitmproxy
- db
- pp_mitmproxy
- pp_db
volumes:
- ./www:/var/www/html
- ./configs/web/vhosts:/etc/apache2/sites-enabled/
- ./configs/php/php.ini:/usr/local/etc/php/php.ini
- ./configs/php/patch.php:/usr/local/bin/patch.php
- ./configs/php/unpatch.php:/usr/local/bin/unpatch.php
- ./phishpond/docker/configs/web/vhosts:/etc/apache2/sites-enabled/
- ./phishpond/docker/configs/php/php.ini:/usr/local/etc/php/php.ini
- ./phishpond/docker/configs/php/patch.php:/usr/local/bin/patch.php
- ./phishpond/docker/configs/php/unpatch.php:/usr/local/bin/unpatch.php
- ./logs:/var/log/phishpond/
- mitm-volume:/usr/local/share/ca-certificates/extra/
- pp-mitm-volume:/usr/local/share/ca-certificates/extra/
command: >
bash -c "cp /usr/local/share/ca-certificates/extra/mitmproxy-ca-cert.{pem,crt} &&
update-ca-certificates --verbose &&
Expand All @@ -34,67 +37,68 @@ services:
aliases:
- phishpond.local

mitmproxy:
pp_mitmproxy:
build:
context: ./docker/mitmproxy
container_name: 'mitmproxy'
context: ./phishpond/docker/mitmproxy
container_name: 'pp_mitmproxy'
restart: 'always'
command: >
bash -c "mitmweb --web-host 0.0.0.0 --set confdir=/home/mitmproxy/.mitmproxy --set relax_http_form_validation --ignore-hosts '(mozilla\.com|mozilla\.net|detectportal\.firefox\.com)' &&
chmod -R 777 /home/mitmproxy/logs/"
ports:
- "8080:8081"
tty: true
volumes:
- mitm-volume:/home/mitmproxy/.mitmproxy/
- ./configs/mitmproxy/config.yaml:/home/mitmproxy/.mitmproxy/config.yaml
- pp-mitm-volume:/home/mitmproxy/.mitmproxy/
- ./phishpond/docker/configs/mitmproxy/config.yaml:/home/mitmproxy/.mitmproxy/config.yaml
- ./logs:/home/mitmproxy/logs
networks:
- phishpond_network

browser:
pp_browser:
build:
context: https://github.com/jlesage/docker-firefox.git
shm_size: '2gb'
ports:
- "5800:5800"
container_name: 'firefox'
container_name: 'pp_browser'
volumes:
- browser-volume:/config:rw
- mitm-volume:/config/certs/
- pp-browser-data:/config:rw
- pp-mitm-volume:/config/certs/
depends_on:
- mitmproxy
- pp_mitmproxy
links:
- mitmproxy
- webserver
- pp_mitmproxy
- pp_webserver
networks:
- phishpond_network
environment:
- FF_PREF_PROXY_TYPE=network.proxy.type=1
- FF_PREF_HTTP_PROXY=network.proxy.http=\"mitmproxy\"
- FF_PREF_HTTP_PROXY=network.proxy.http=\"pp_mitmproxy\"
- FF_PREF_HTTP_PROXY_PORT=network.proxy.http_port=8080
- FF_PREF_HTTPS_PROXY=network.proxy.ssl=\"mitmproxy\"
- FF_PREF_HTTPS_PROXY=network.proxy.ssl=\"pp_mitmproxy\"
- FF_PREF_HTTPS_PROXY_PORT=network.proxy.ssl_port=8080
- FF_PREF_CAPTIVE_PORTAL=network.captive-portal-service.enabled=false
- DISPLAY_WIDTH=1280
- DISPLAY_HEIGHT=768

db:
pp_db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
- pp-db-data:/var/lib/mysql
restart: always
container_name: 'db'
container_name: 'pp_db'
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: phishpond_db
MYSQL_USER: phishpond
MYSQL_PASSWORD: password
networks:
- phishpond_network

volumes:
mitm-volume:
browser-volume:
db_data:
pp-mitm-volume:
pp-browser-data:
pp-db-data:

networks:
phishpond_network:
46 changes: 0 additions & 46 deletions docker/mitmproxy/addons/block-telegram.py

This file was deleted.

Binary file removed docker/web/ioncube_loader_lin_7.4.so
Binary file not shown.
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip3 install -e .
File renamed without changes.
Empty file added phishpond/__init__.py
Empty file.
46 changes: 46 additions & 0 deletions phishpond/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from rich import print
from .menus import Menus as menus
from .runner import start_stop, print_status
from .client import attach, setup, configure
import argparse

def setup_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'--setup',
help='Perform setup or rebuild operations',
action="store_true",
required=False)
return parser


def main():
p = setup_args()
args = p.parse_args()

if args.setup:
setup()
return

try:
print(menus.banner)
print("Feature requests and PR's welcome!\nhttps://github.com/zerofox-oss/phishpond\n")
while True:
result = menus.launcher()

if result == "Start/Stop":
start_stop()
if result == "Attach":
attach()
if result == "Configure":
configure()
if result == "Status":
print_status()
if result == "Exit":
return
except KeyboardInterrupt:
return


if __name__ == "__main__":
main()
Loading