|
| 1 | +Docker deployment instructions |
| 2 | +===== |
| 3 | + |
| 4 | +## tl;dr |
| 5 | +```bash |
| 6 | +git clone https://github.com/NullArray/AutoSploit.git |
| 7 | +cd Autosploit/Docker |
| 8 | +# If you wish to edit default postgres service details, edit database.yml. Should work out of the box |
| 9 | +# nano database.yml |
| 10 | +docker network create -d bridge haknet |
| 11 | +docker run --network haknet --name msfdb -e POSTGRES_PASSWORD=s3cr3t -d postgres |
| 12 | +docker run -it -p 80:80 -p 443:443 -p 4444:4444 autosploit |
| 13 | +``` |
| 14 | + |
| 15 | + |
| 16 | +## Abstract |
| 17 | + |
| 18 | +* Launching `Autosploit` as a Docker container makes it very easy to use the tool in a hosted cloud environment (AWS, Azure, ...) |
| 19 | +* Separate `postgres` database into individual service for data persistence and potential async updating of the database |
| 20 | +* Create a small bridge network ``haknet`` so the service discovery is automatic |
| 21 | +* Launch `postgres` and `Autosploit` container, both linked by `haknet` |
| 22 | +* Autosploit will automatically launch preconfigured `msfconsole` to the external `postgres` container through `haknet` transparent network |
| 23 | +* Total image size of Kali + Metasploit + Autosploit : 1.75GB |
| 24 | + |
| 25 | +## Deploy |
| 26 | + |
| 27 | +##### Step 1 - Create bridge network |
| 28 | +This will enable the Metasploit Framework to talk to the `postgres` database using its hostname, making it abstract. |
| 29 | + |
| 30 | +A Tor Socks Proxy can also be added to perform transparent proxy when launching exploits (not for reverse shells though, obviously). |
| 31 | + |
| 32 | +```bash |
| 33 | +docker network create -d bridge haknet |
| 34 | +``` |
| 35 | + |
| 36 | +##### Step 2 - Launch services |
| 37 | + |
| 38 | +All automagically linked |
| 39 | + |
| 40 | + |
| 41 | +###### Step 2.1 - Launch postgres |
| 42 | + |
| 43 | +Launch a vanilla `postgres` service, linked to `haknet` |
| 44 | +```bash |
| 45 | +docker run --network haknet --name msfdb -e POSTGRES_PASSWORD=s3cr3t -d postgres |
| 46 | +``` |
| 47 | +###### Step 2.2 - Launch Autosploit |
| 48 | + |
| 49 | +Launch `Autosploit`. |
| 50 | + |
| 51 | +This Dockerfile will copy the default database config to ```~/.msf4/database.yml```. You can edit the configuration file `database.yml` to your liking before building. |
| 52 | + |
| 53 | +Please be aware that the first build will take some time (~10mn) |
| 54 | + |
| 55 | +Building will be faster if done on a hosted server as it benefits from the -grade bandwidth |
| 56 | + |
| 57 | +```bash |
| 58 | +git clone https://github.com/NullArray/AutoSploit.git |
| 59 | +cd Autosploit/Docker |
| 60 | +nano database.yml # Exemple configuration should work fine |
| 61 | +docker run -it -p 80:80 -p 443:443 -p 4444:4444 autosploit |
| 62 | +``` |
0 commit comments