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

Use latest docker images #198

Merged
merged 1 commit into from
May 21, 2024
Merged
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
14 changes: 8 additions & 6 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
docker:
# Skipped as not working
# - { dockerfile: 'debian-aarch64', previousImage: '' }
- { name: 'debian-armv7', previousDockerhubImage: 'rapid7/msf-debian-armv7-omnibus:2020_03' }
- { name: 'debian-armv7', previousDockerhubImage: 'rapid7/msf-debian-armv7-omnibus:2024_04' }

name: ${{ matrix.os }} - ${{ matrix.docker.name }}
steps:
Expand Down Expand Up @@ -102,6 +102,7 @@ jobs:

- name: Run omnibus
run: |
set -x
echo "Building new image from ${DOCKER_IMAGE}"
mkdir -p metasploit-omnibus/certs
curl -L -o metasploit-omnibus/certs/ca-certificates.crt https://curl.haxx.se/ca/cacert.pem
Expand Down Expand Up @@ -151,26 +152,26 @@ jobs:
# From: 'ls ./docker/'
docker:
- name: 'centos6-x64'
previousDockerhubImage: 'rapid7/msf-centos6-x64-omnibus:2020_03'
previousDockerhubImage: 'rapid7/msf-centos6-x64-omnibus:2024_04'
installer: 'sudo rpm -i metasploit-omnibus/pkg/metasploit-framework*.rpm'
# Currently fails as it uses an older Ruby version:
- name: 'fedora30-x64'
# XXX: Previous dockerhub image fails as using Ruby 2.5.3 still
previousDockerhubImage: 'rapid7/msf-fedora30-x64-omnibus:2019_09'
previousDockerhubImage: 'rapid7/msf-fedora30-x64-omnibus:2024_04'
installer: 'sudo rpm -i metasploit-omnibus/pkg/metasploit-framework*.rpm'
# Currently fails on rate limiting on Kali's side:
# - name: 'kali109-x64'
# previousDockerhubImage: 'rapid7/msf-kali109-x64-omnibus:2020_03'
# installer: 'sudo dpkg -i metasploit-omnibus/pkg/metasploit-framework_*_amd64.deb'
- name: 'ubuntu1204-x64'
previousDockerhubImage: 'rapid7/msf-ubuntu1204-x86-omnibus:2021_11'
previousDockerhubImage: 'rapid7/msf-ubuntu1204-x64-omnibus:2024_04'
installer: 'sudo dpkg -i metasploit-omnibus/pkg/*.deb'
- name: 'ubuntu1204-x86'
previousDockerhubImage: 'rapid7/msf-ubuntu1204-x64-omnibus:2019_01'
previousDockerhubImage: 'rapid7/msf-ubuntu1204-x86-omnibus:2024_04'
linux32: true
installer: 'sudo dpkg -i metasploit-omnibus/pkg/metasploit-framework_*_i386.deb'
- name: 'ubuntu1804-x64'
previousDockerhubImage: 'rapid7/msf-ubuntu1804-x64-omnibus:2019_09'
previousDockerhubImage: 'rapid7/msf-ubuntu1804-x64-omnibus:2024_04'
installer: 'sudo dpkg -i metasploit-omnibus/pkg/metasploit-framework_*_amd64.deb'

name: ${{ matrix.os }} - ${{ matrix.docker.name }}
Expand Down Expand Up @@ -221,6 +222,7 @@ jobs:

- name: Run omnibus
run: |
set -x
mkdir -p metasploit-omnibus/certs
curl -L -o metasploit-omnibus/certs/ca-certificates.crt https://curl.haxx.se/ca/cacert.pem

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ docker run -it --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins metas
Or you can run a new container using pre-built images from [Rapid7's Docker Hub account](https://hub.docker.com/u/rapid7):

```shell
docker run -it --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins rapid7/msf-ubuntu1204-x86-omnibus:2021_11 /bin/bash --login
docker run -it --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins rapid7/msf-ubuntu1204-x86-omnibus:2024_04 /bin/bash --login
```

By default, `metasploit-omnibus` will download the latest version of Metasploit framework from Github, but also supports building with local copies from `/metasploit-framework` - [full details](https://github.com/rapid7/metasploit-omnibus/blob/9cd575bcdd19d8fedf4a94c4ca2d1d6c253628c2/config/software/metasploit-framework.rb#L2-L8).

To build omnibus with a local version of Metasploit framework, you can mount your framework repository as a volume to `/metasploit-framework` within the container. The following command assumes that the repository exists within the parent directory:

```shell
docker run -it --rm --volume $(pwd):$(pwd) --volume=$(pwd)/../metasploit-framework:/metasploit-framework --workdir $(pwd) --user jenkins rapid7/msf-ubuntu1204-x86-omnibus:2021_11 /bin/bash --login
docker run -it --rm --volume $(pwd):$(pwd) --volume=$(pwd)/../metasploit-framework:/metasploit-framework --workdir $(pwd) --user jenkins rapid7/msf-ubuntu1204-x86-omnibus:2024_04 /bin/bash --login
```

When running inside the container, you can perform a normal ommibus build:
Expand Down