{"id":13405770,"url":"https://github.com/rapid7/metasploit-omnibus","last_synced_at":"2025-04-08T01:35:53.332Z","repository":{"id":27891084,"uuid":"31382589","full_name":"rapid7/metasploit-omnibus","owner":"rapid7","description":"Packaging metasploit-framework with omnibus","archived":false,"fork":false,"pushed_at":"2024-12-12T09:34:23.000Z","size":1561,"stargazers_count":253,"open_issues_count":24,"forks_count":208,"subscribers_count":92,"default_branch":"master","last_synced_at":"2024-12-18T06:23:43.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rapid7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-26T18:42:09.000Z","updated_at":"2024-12-12T22:39:15.000Z","dependencies_parsed_at":"2024-01-03T11:44:59.694Z","dependency_job_id":"9ad6f74a-d9af-4b31-a86b-ab8126b4c1ca","html_url":"https://github.com/rapid7/metasploit-omnibus","commit_stats":null,"previous_names":[],"tags_count":637,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fmetasploit-omnibus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fmetasploit-omnibus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fmetasploit-omnibus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rapid7%2Fmetasploit-omnibus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rapid7","download_url":"https://codeload.github.com/rapid7/metasploit-omnibus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247761051,"owners_count":20991531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T19:02:11.110Z","updated_at":"2025-04-08T01:35:53.307Z","avatar_url":"https://github.com/rapid7.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"metasploit-framework Omnibus project\n==========================\nThis project creates full-stack platform-specific packages for\n`metasploit-framework`. This is not the same as Metasploit Pro.\nIt only contains the framework command-line interface and the\nassociated tools and modules.\n\n# Installing the package\n\nIf you just want to install this package, we provide a number of pre-built binaries for Metasploit that are rebuilt every night. See https://github.com/rapid7/metasploit-framework/wiki/Nightly-Installers for installation information.\n\n# Developer Upgrade Guide\n\nIf you are updating software dependencies you will need to:\n\n1. Verify if the software has been updated upstream https://github.com/chef/omnibus-software\n1. Download the build artifacts and merge into the artifact cache https://github.com/rapid7/metasploit-omnibus-cache\n1. Update the git submodule within as a [prerequisite][#Prerequisites]\n1. Modify the `default_version` and `SHA` for your software\n1. Apply any additional changes required to build your software using chef/omnibus-software as a baseline were appropriate\n1. Verify that the build works locally following the build steps below. If there are issues, cross-reference the Github actions configuration as an indicator for how to build locally\n1. Verify that the update works on CI\n\nIf you are updating omnibus itself:\n\n1. Clone the latest Rapid7 fork and branch from https://github.com/rapid7/omnibus/branches/all which will be referenced in the `Gemfile` ([example](https://github.com/rapid7/metasploit-omnibus/blob/3e30801521fb50291708b2e93c0940afdd11df37/Gemfile#L5))\n1. Verify the latest available code from https://github.com/chef/omnibus\n1. Create a new R7 custom branch with the additional R7 custom patches applied\n1. Update the `Gemfile` to use your new branch - [example](https://github.com/rapid7/metasploit-omnibus/blame/master/Gemfile#L5)\n1. Apply any DSL changes to the software config files in the metasploit-omnibus repo, similar to steps required update software dependencies steps above\n1. Ensure CI passes\n\n# Building the package\n\n## Prerequisites\n\nThis project has a package cache that should be pulled in before building. Run 'git submodule update -i' to download the git submodule that contains these packages. We cache these both for performance, and because occasionally upstream locations go away, and this allows the build to continue without broken dependencies.\n\n## Building on Docker\n\nThe Dockerfiles for `metasploit-omnibus` are located within the `docker` directory of this repository.\n\nYou can build images yourself:\n\n```shell\ngit clone https://github.com/rapid7/metasploit-omnibus.git\ncd metasploit-omnibus\ndocker build --tag metasploit-omnibus-builder - \u003c ./docker/ubuntu1204-x86/Dockerfile\n```\n\nOr on OSX you can use the following script to build all images following the latest Docker image naming convention:\n\n```shell\nexport BUILD_DATE=$(date \"+%Y_%m\"); ls ./docker | xargs -I IMAGE_NAME /bin/bash -x -c \"docker build --tag rapid7/msf-IMAGE_NAME-omnibus:$BUILD_DATE -f ./docker/IMAGE_NAME/Dockerfile ./docker/IMAGE_NAME\"\n```\n\nPushing\n\n```shell\nexport BUILD_DATE=$(date \"+%Y_%m\"); ls ./docker | xargs -I IMAGE_NAME /bin/bash -x -c \"docker push rapid7/msf-IMAGE_NAME-omnibus:$BUILD_DATE\"\n```\n\nYou can then run a new container using the above tagged image, whilst mounting the current directory as a volume:\n\n```shell\ndocker run -it --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins metasploit-omnibus-builder /bin/bash --login\n```\n\nOr you can run a new container using pre-built images from [Rapid7's Docker Hub account](https://hub.docker.com/u/rapid7):\n\n```shell\ndocker run -it --rm --volume $(pwd):$(pwd) --workdir $(pwd) --user jenkins rapid7/msf-ubuntu1204-x86-omnibus:2024_04 /bin/bash --login\n```\n\nBy 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).\n\nTo 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:\n\n```shell\ndocker 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\n```\n\nWhen running inside the container, you can perform a normal ommibus build:\n\n```\n# Download the git submodule that contains cached packages\ngit submodule update -i\n\n# install omnibus' dependencies\nbundle install\nbundle binstubs --all\n\n# build the metasploit-framework package\nbin/omnibus build metasploit-framework\n```\n\nWhen complete, there will be a new installable `.deb` file under the 'pkg' directory. Note that the use of Docker volumes may cause builds to run slower.\n\nTo test the `.deb` file, install it - and then open msfconsole:\n\n```\n# install\nsudo dpkg -i pkg/metasploit-framework_6.3.39~20231017232715.git.3.47e0cd3~1rapid7-1_amd64.deb\n\n# Run to verify\nmsfconsole\n```\n\n## Building on Ubuntu / Debian systems\n\nIn general, a build environment needs a working C/C++ compiler, Ruby 1.9 or higher and the ruby development headers, bundler, git, bison and flex. A quad-core CPU and 4GB of ram are recommended.\n\nThe following steps should produce a successful build with Ubuntu and other Debian derivatives, starting from a fresh installation:\n```shell\n# install required packages to build on Ubuntu / Debian systems\nsudo apt-get -y install build-essential git ruby bundler ruby-dev bison flex autoconf automake\n```\n\nConfigure the omnibus cache and target directories if you want to build as non-root user (recommended).\n```shell\n# setup build directories you can write to\nsudo mkdir -p /var/cache/omnibus\nsudo mkdir -p /opt/metasploit-framework\nsudo chown `whoami` /var/cache/omnibus\nsudo chown `whoami` /opt/metasploit-framework\n```\n\nNext setup git if you need to.\n```shell\n# setup git (ignore if you already have it configured)\ngit config --global user.name \"Nobody\"\ngit config --global user.email \"nobody@example.com\"\n```\n\nCheckout the metasploit-framework installer builder and install omnibus' dependencies.\n```shell\n# checkout the builder repository\ngit clone https://github.com/rapid7/metasploit-omnibus.git\ncd metasploit-omnibus\n# install omnibus' dependencies\nbundle install \u0026\u0026 bundle binstubs --all\n```\n\nFinally, build the installer itself:\n```shell\n# build the metasploit-framework package\nbin/omnibus build metasploit-framework\n```\nwhen complete, there will be a new installable .deb file under the 'pkg' directory.\n\n## Building on Windows\n\nFrom Windows 10, install ruby, msys2, ruby-devkit, wixtoolset, git. Add the following command to the the preparation steps before executing the `build` command.\n```\nxz -d local/cache/*.xz\n```\n\n## Building on OS X\n\nFrom OS X, first install XCode and the command line development tools. I use ruby, bundler, git, bison and flex from the Mac Homebrew project. The rest of the steps are identical to building on Ubuntu. A .pkg file will be under the pkg directory instead.\n\n## Clean\n\nYou can clean up all temporary files generated during the build process with\nthe `clean` command:\n\n```shell\n$ bin/omnibus clean metasploit-framework\n```\n\nAdding the `--purge` purge option removes __ALL__ files generated during the\nbuild including the project install directory (`/opt/metasploit-framework`) and\nthe package cache directory (`/var/cache/omnibus/pkg`) as well as __ALL__ files\nin the local package cache directory (`./local/cache`):\n\n```shell\n$ bin/omnibus clean metasploit-framework --purge\n```\n\nRestore the git submodule that contains the local package cache:\n```shell\n$ git submodule update -i\n```\n\n## Publish\n\nOmnibus has a built-in mechanism for releasing to a variety of \"backends\", such\nas Amazon S3. You must set the proper credentials in your `omnibus.rb` config\nfile or specify them via the command line.\n\n```shell\n$ bin/omnibus publish path/to/*.deb --backend s3\n```\n\n## Help\n\nFull help for the Omnibus command line interface can be accessed with the\n`help` command:\n\n```shell\n$ bin/omnibus help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fmetasploit-omnibus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapid7%2Fmetasploit-omnibus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapid7%2Fmetasploit-omnibus/lists"}