diff --git a/dev-ruby/metasploit-payloads/Manifest b/dev-ruby/metasploit-payloads/Manifest index 9f194ecc1..1d64d7a75 100644 --- a/dev-ruby/metasploit-payloads/Manifest +++ b/dev-ruby/metasploit-payloads/Manifest @@ -2,3 +2,4 @@ DIST metasploit-payloads-1.3.25.gem 11934720 BLAKE2B 0d11e013e88a5e334727d798bf3 DIST metasploit-payloads-1.3.31.gem 11935232 BLAKE2B a454b03da76d847f85edccd3845adc67608e40c60797665d82ba0c0be985b88b1b032836f0a14fb00abde2ca7f75b73d6e1d39165e57887e54cbb86995039f19 SHA512 062efd0b3e80009f03344bb6c2907ca452650bc581cafacbedbfda6717038dce6a0cc2a9ddbac2ff3bda993935005b1b49f4b7653f08230434295137f48e4c1e DIST metasploit-payloads-1.3.34.gem 11936256 BLAKE2B 386494ebca9c1ee6eda6460057a424f4157059e1600b06d0d46fff5a5503d56bf3e65e48d11b2e78ab524e348f2ac0cbad508e8006103521ed8799cb201a96d3 SHA512 588ed58f98b221f87a756e4d10b39b293b12bf8894b742ec26534f92cdcdcae56897de821e13bfd48083f794f0da41678bd2ffd441c97f5654e389b864287bcc DIST metasploit-payloads-1.3.37.gem 12016640 BLAKE2B bbf6c6cdfc0f8a8c08abe3dcad87b1fe1a97fb7882771a4a9b253b299352b1c6a8f9cbc682f42785a4db4971ca1c43c809d9922d8ff8bda5b96d4583e75d597c SHA512 87a776ef3cdf10c036de9fb7bea9baae022dabb3997449232d11fd511997e9dd3c0e84db6100d1d744b221a15fc94a6d7e09828304e2f3086d1d44fad9f04446 +DIST metasploit-payloads-1.3.40.gem 12027392 BLAKE2B e0d81b5dc398043d3c523663353908d40b61c9dec9f560348e861ef418794f266ec5b92ac8823fc9a5dc5103da2e0efa646f473b1c15933eb484484db663ddba SHA512 b37a6ccb3700dbe138a1888b2c35c2b8ffc4722fa89bae841841eaf7addac18519a3f4e77de74653a6d956ddaaaf32d7f96e1c970a5323c2336a9d34abdab6f4 diff --git a/dev-ruby/metasploit-payloads/metasploit-payloads-1.3.40.ebuild b/dev-ruby/metasploit-payloads/metasploit-payloads-1.3.40.ebuild new file mode 100644 index 000000000..c89ecf792 --- /dev/null +++ b/dev-ruby/metasploit-payloads/metasploit-payloads-1.3.40.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +USE_RUBY="ruby23 ruby24 ruby25" + +RUBY_FAKEGEM_TASK_DOC="" + +RUBY_FAKEGEM_EXTRAINSTALL="data" + +inherit ruby-fakegem + +DESCRIPTION="Compiled binaries for Metasploit's Meterpreter" +HOMEPAGE="https://rubygems.org/gems/metasploit-payloads" + +LICENSE="BSD" + +SLOT="${PV}" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="" + +#no tests +RESTRICT="test strip" + +QA_PREBUILT=" + usr/lib*/ruby/gems/*/gems/${PN}-${SLOT}/data/meterpreter/msflinker_linux_x86.bin + usr/lib*/ruby/gems/*/gems/${PN}-${SLOT}/data/meterpreter/ext_server_sniffer.lso + usr/lib*/ruby/gems/*/gems/${PN}-${SLOT}/data/meterpreter/ext_server_networkpug.lso + usr/lib*/ruby/gems/*/gems/${PN}-${SLOT}/data/meterpreter/ext_server_stdapi.lso + usr/lib*/ruby/gems/*/gems/${PN}-${SLOT}/data/android/libs/armeabi/libndkstager.so + usr/lib*/ruby/gems/*/gems/${PN}-${SLOT}/data/android/libs/mips/libndkstager.so + usr/lib*/ruby/gems/*/gems/${PN}-${SLOT}/data/android/libs/x86/libndkstager.so + " + +src_install() { + ruby-ng_src_install + #tell revdep-rebuild to ignore binaries meant for the target + dodir /etc/revdep-rebuild + cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-${PN}-${SLOT} || die + #These dirs contain prebuilt binaries for running on the TARGET not the HOST + SEARCH_DIRS_MASK="/usr/lib*/ruby/gems/*/gems/${PN}-${SLOT}/data/android/libs" + EOF +} diff --git a/dev-ruby/metasploit_payloads-mettle/Manifest b/dev-ruby/metasploit_payloads-mettle/Manifest index 295379f70..ca869b3cb 100644 --- a/dev-ruby/metasploit_payloads-mettle/Manifest +++ b/dev-ruby/metasploit_payloads-mettle/Manifest @@ -2,3 +2,4 @@ DIST metasploit_payloads-mettle-0.3.3.gem 17652224 BLAKE2B e5e7a9f6e845429a61812 DIST metasploit_payloads-mettle-0.3.7.gem 17677312 BLAKE2B 8c807d6c9f5ca0b615ab8e834dcf5e5be8bb5fa20073015fb3cee621cccd453e250fc55846d9388e4c10ceec26575725478fad7300bc07ba33f7206f405a9d35 SHA512 badb6ee5d56c1883044cc9504328ac4b5d7fd9d930aa3a3678fbe7b93e55f76f86cf7c6fad187812151fc58dcfe00c399f3aaf5d28dd97f958be42cb0e2c6e42 DIST metasploit_payloads-mettle-0.3.8.gem 17235456 BLAKE2B d42dc0b250dd378eea75cc1117f13d719d9d99d6fcb272342ddc4cefaf825193d42750adcaa6dff07688eae92c70bf44194b35bc3e4f2f9e7bdb8899915b865b SHA512 76763636eca7623eadcea92cc2c80f26f55472c0ce93999a7de2a42746be443d33019bbac841c30bb499137d1d14052162cd4fa6c941281e70136cd29f575274 DIST metasploit_payloads-mettle-0.4.0.gem 17248768 BLAKE2B 7149ffeb1b9569b09496c099570e9936d9be31f91c83c3daad83b6deae4232a15cc93316529ead633560fa70453a351e7356292eef65d7396729b8c32890a9dc SHA512 53b52999d86ac3b5bb3ecde855f53cc868ea0003195304ce8aaa5b2b8d72173e0d1fbed6a3033e2755f40db9800be9b60b3ae7ef8168d9e459e56ea3975e559c +DIST metasploit_payloads-mettle-0.4.1.gem 18290176 BLAKE2B 0404f03d74b73b1e3d17e9b22d9ccfec04a290f55a49c783fa2a28ea778704d63d9d529ea9747a47354ecc319ff76ab2f368eb4dd18c95eb9131a3fb957cec2f SHA512 fe7b60115658facda859bfecdd1609735a2034f86b191c4216da23e5be4a082eeae96b903e519e4ab4c8c9902099cbe9ee609a1484680c907b6bda51dd9652fb diff --git a/dev-ruby/metasploit_payloads-mettle/metasploit_payloads-mettle-0.4.1.ebuild b/dev-ruby/metasploit_payloads-mettle/metasploit_payloads-mettle-0.4.1.ebuild new file mode 100644 index 000000000..c7a696e3b --- /dev/null +++ b/dev-ruby/metasploit_payloads-mettle/metasploit_payloads-mettle-0.4.1.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +USE_RUBY="ruby23 ruby24 ruby25" + +RUBY_FAKEGEM_TASK_DOC="" + +RUBY_FAKEGEM_EXTRAINSTALL="build" + +inherit ruby-fakegem + +DESCRIPTION="Compiled binaries for Metasploit's next-gen Meterpreter" +HOMEPAGE="https://rubygems.org/gems/metasploit_payloads-mettle" + +LICENSE="BSD" + +SLOT="${PV}" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="" + +#no tests +RESTRICT="test strip" + +QA_PREBUILT=" + usr/lib*/ruby/gems/*/gems/${P}/build/aarch64-linux-musl/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/aarch64-linux-musl/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/armv5b-linux-musleabi/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/armv5b-linux-musleabi/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/armv5l-linux-musleabi/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/armv5l-linux-musleabi/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/i486-linux-musl/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/i486-linux-musl/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/mips64-linux-muslsf/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/mips64-linux-muslsf/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/mips64-linux-muslsf/bin/sniffer + usr/lib*/ruby/gems/*/gems/${P}/build/mips64-linux-muslsf/bin/sniffer.bin + usr/lib*/ruby/gems/*/gems/${P}/build/mipsel-linux-muslsf/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/mipsel-linux-muslsf/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/mipsel-linux-muslsf/bin/sniffer + usr/lib*/ruby/gems/*/gems/${P}/build/mipsel-linux-muslsf/bin/sniffer.bin + usr/lib*/ruby/gems/*/gems/${P}/build/mips-linux-muslsf/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/mips-linux-muslsf/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/mips-linux-muslsf/bin/sniffer + usr/lib*/ruby/gems/*/gems/${P}/build/mips-linux-muslsf/bin/sniffer.bin + usr/lib*/ruby/gems/*/gems/${P}/build/powerpc64le-linux-musl/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/powerpc64le-linux-musl/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/powerpc-linux-muslsf/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/powerpc-linux-muslsf/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/s390x-linux-musl/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/s390x-linux-musl/bin/mettle.bin + usr/lib*/ruby/gems/*/gems/${P}/build/x86_64-linux-musl/bin/mettle + usr/lib*/ruby/gems/*/gems/${P}/build/x86_64-linux-musl/bin/mettle.bin + " + +src_install() { + ruby-ng_src_install + #tell revdep-rebuild to ignore binaries meant for the target + dodir /etc/revdep-rebuild + cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-${PN}-${SLOT} || die + #These dirs contain prebuilt binaries for running on the TARGET not the HOST + SEARCH_DIRS_MASK="/usr/lib*/ruby/gems/*/gems/${P}/build" + EOF +} diff --git a/net-analyzer/metasploit/Manifest b/net-analyzer/metasploit/Manifest index 9f4971bc7..e63d33002 100644 --- a/net-analyzer/metasploit/Manifest +++ b/net-analyzer/metasploit/Manifest @@ -1,3 +1,2 @@ DIST metasploit-4.16.56.tar.gz 25971575 BLAKE2B d2c3e7c9fc65060677c762fe7bd2aa1c606f12517085a7bf8be5629932795594025fe3dff40421ad8151ab609f6eb77a153fb48b713b11b0af89a955397ebf34 SHA512 fd8740d3c28b8e1a9279226c25ea1bffaa6b6070f63c46c27f4fad6aba0922b77b995eae27c92b2543d3a19aa00a6fc061e02f264fb92fa2afddc015e63589ee -DIST metasploit-4.16.61.tar.gz 26624614 BLAKE2B 9f9f9459a1a7a7d3ef7f5f12314a623f677f485329466714f3da7210fdcf04cf33fb4569cfe1af6d745a371e24bc7415151386048886c7d1d6dc843592fe15c0 SHA512 8935a2dede10bcae69a42aa4c1b7d10751f0d5c6161e0e649efd12e5dd8e0251651a77310bdac1419c7a385a7a57f98191f0b2a0516d23ead24e9257eb5091e1 -DIST metasploit-4.16.63.tar.gz 26642702 BLAKE2B ceab5a38dd450f626d39baf12e6be5b7b9f49bae76888e1378933b726cafb50614b226104fea025c3bff3708d861c5908b5cd499536ba7ae2f6a951fef496b15 SHA512 5c85c8488cd8ee6052024c4d65a5704f9e7222554369eee918477f19a206bcff9b31aea7a08a12f2b76cfc0b9166cceb14e12b670623483eba076716d9a97098 +DIST metasploit-4.16.64.tar.gz 26653776 BLAKE2B aa110e24f0ae11ddf75aeb13e9b6674609778f5779a4d925b2f35362edb5d65bd552883ba13880aa5c1a9278d5135db7013f1b953a039a2c904f2394c33937b3 SHA512 fea8c3836eff9ba00449c1337b60b5e9619a93e6c79443074e5e196e991c3f24f498f7d5faa87ad95be26185038a85782c04d189c4d822e0a64b0699f086692e diff --git a/net-analyzer/metasploit/metasploit-4.16.61.ebuild b/net-analyzer/metasploit/metasploit-4.16.61.ebuild deleted file mode 100644 index 369b29b83..000000000 --- a/net-analyzer/metasploit/metasploit-4.16.61.ebuild +++ /dev/null @@ -1,342 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -#never ever ever have more than one ruby in here -USE_RUBY="ruby23" -inherit eutils ruby-ng - -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git" - EGIT_CHECKOUT_DIR="${WORKDIR}"/all - inherit git-r3 -# KEYWORDS="" - SLOT="9999" -else - ##Tags https://github.com/rapid7/metasploit-framework/releases - MY_PV=${PV/_p/-} - SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~x86" - RUBY_S="${PN}-framework-${MY_PV}" - inherit versionator - SLOT="$(get_version_component_range 1).$(get_version_component_range 2)" -fi - -DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code" -HOMEPAGE="http://www.metasploit.org/" -LICENSE="BSD" -IUSE="development +java nexpose openvas oracle +pcap test" - -#multiple known bugs with tests reported upstream and ignored -#http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible) -RESTRICT="test" - -#grep spec.add_runtime_dependency metasploit-framework.gemspec | sort -RUBY_COMMON_DEPEND="virtual/ruby-ssl - >=dev-ruby/actionpack-4.2.6:4.2 - >=dev-ruby/activerecord-4.2.6:4.2 - >=dev-ruby/activesupport-4.2.6:4.2 - dev-ruby/backports - dev-ruby/bcrypt-ruby - dev-ruby/bcrypt_pbkdf - dev-ruby/bit-struct - dev-ruby/bundler - dev-ruby/dnsruby - dev-ruby/faker - dev-ruby/filesize - dev-ruby/jsobfu:* - dev-ruby/json:* - dev-ruby/metasm:* - dev-ruby/metasploit-concern - =dev-ruby/rake-10.0.0 - >=dev-ruby/factory_girl-4.1.0 )" - #lorcon doesn't support ruby21 - #lorcon? ( net-wireless/lorcon[ruby] ) -ruby_add_bdepend "${RUBY_COMMON_DEPEND} - test? ( >=dev-ruby/factory_girl-4.1.0 - dev-ruby/fivemat - dev-ruby/database_cleaner - >=dev-ruby/rspec-2.12 - dev-ruby/shoulda-matchers - dev-ruby/timecop - >=dev-ruby/rake-10.0.0 )" -ruby_add_rdepend "${RUBY_COMMON_DEPEND}" - -COMMON_DEPEND="dev-db/postgresql[server] - >=app-crypt/johntheripper-1.7.9-r1[-minimal] - net-analyzer/nmap" -RDEPEND+=" ${COMMON_DEPEND} - >=app-eselect/eselect-metasploit-0.16" - -RESTRICT="strip" - -QA_PREBUILT=" - usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x86_solaris.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux_dll.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x86_bsd.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_bsd.bin - usr/lib*/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_mipsle_linux.bin - usr/lib*/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf - usr/lib*/${PN}${SLOT}/data/exploits/mysql/lib_mysqludf_sys_32.so - usr/lib*/${PN}${SLOT}/data/android/libs/x86/libndkstager.so - usr/lib*/${PN}${SLOT}/data/android/libs/mips/libndkstager.so - usr/lib*/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so - usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux_dll.bin - usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux_dll.bin - usr/lib*/${PN}${SLOT}/data/templates/template_aarch64_linux.bin - " - -pkg_setup() { - if use test; then - su postgres -c "dropdb msf_test_database" #this is intentionally allowed to fail - su postgres -c "createuser msf_test_user -d -S -R" - if [ $? -ne 0 ]; then - su postgres -c "dropuser msf_test_user" || die - su postgres -c "createuser msf_test_user -d -S -R" || die - fi - su postgres -c "createdb --owner=msf_test_user msf_test_database" || die - fi - ruby-ng_pkg_setup -} - -all_ruby_unpack() { - if [[ ${PV} == "9999" ]] ; then - git-r3_src_unpack - else - default_src_unpack -# mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all -# rm -r msf3 - #msf_version=$(grep --color=never "CURRENT_VERSION =" ${S}/spec/lib/msf/core/framework_spec.rb) - #msf_version=${msf_version#*=} - fi -} - -all_ruby_prepare() { - # add psexec patch from pull request 2657 to allow custom exe templates from any files, bypassing most AVs - #epatch "${FILESDIR}/agix_psexec_pull-2657.patch" - eapply_user - - #remove random "cpuinfo" binaries which a only needed to detect which bundled john to run - rm -r data/cpuinfo - - #remove unneeded ruby bundler versioning files - #Gemfile.lock contains the versions tested by the msf team but not the hard requirements - #we regen this file in each_ruby_prepare - rm Gemfile.lock - - #The Gemfile contains real known deps - sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die - #use released packetfu - sed -i "s/1.1.13.pre/1.1.13/" metasploit-framework.gemspec || die - #git gems are only for ruby24 support and we are not there yet - sed -i "/git:/d" Gemfile || die - - #now we edit the Gemfile based on use flags - if ! use pcap; then - sed -i -e "/^group :pcap do/,/^end$/d" Gemfile || die - fi - if ! use nexpose; then - sed -i -e "/nexpose/d" metasploit-framework.gemspec || die - fi - #no support for nessus right now - #if ! use nessus; then - sed -i -e "/nessus/d" metasploit-framework.gemspec || die - #fi - if ! use openvas; then - sed -i -e "/openvas-omp/d" metasploit-framework.gemspec || die - fi - #even if we pass --without=blah bundler still calculates the deps and messes us up - if ! use development; then - sed -i -e "/^group :development do/,/^end$/d" Gemfile || die - fi - if ! use test; then - sed -i -e "/^group :test/,/^end$/d" Gemfile || die - fi - if ! use test && ! use development; then - sed -i -e "/^group :development/,/^end$/d" Gemfile || die - fi - #We don't need simplecov - sed -i -e "/^group :coverage/,/^end$/d" Gemfile || die - sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die - - #we need to edit the gemspec too, since it tries to call git instead of anything sane - #probably a better way to fix this... if I care at some point - sed -i -e "/^ spec.files/,/^ }/d" metasploit-framework.gemspec || die - - #https://bugs.gentoo.org/show_bug.cgi?id=584522 no tzinfo-data by choice in gentoo - sed -i '/tzinfo-data/d' metasploit-framework.gemspec - - #let's bogart msfupdate - rm msfupdate - echo "#!/bin/sh" > msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"\"" >> msfupdate - if [[ ${PV} == "9999" ]] ; then - echo "if [ -x /usr/bin/smart-live-rebuild ]; then" >> msfupdate - echo " smart-live-rebuild -f net-analyzer/metasploit" >> msfupdate - echo "else" >> msfupdate - echo " echo \"Please install app-portage/smart-live-rebuild for a better experience.\"" >> msfupdate - echo "emerge --oneshot \"=${CATEGORY}/${PF}\"" >> msfupdate - echo "fi" >> msfupdate - else - echo "echo \"Unable to update tagged version of metasploit.\"" >> msfupdate - echo "echo \"If you want the latest please install and eselect the live version (metasploit9999)\"" >> msfupdate - echo "echo \"emerge metasploit:9999 -vat && eselect metasploit set metasploit9999\"" >> msfupdate - fi - #this is set executable in src_install - - #install our database.yml file before tests are run - cp "${FILESDIR}"/database.yml config/ - -} - -each_ruby_prepare() { - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die - - #force all metasploit executables to use desired ruby version - #https://dev.metasploit.com/redmine/issues/8357 - for file in $(ls -1 msf*) - do - #poorly adapted from python.eclass - sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" -i "${file}" || die "Conversion of shebang in '${file}' failed" - done -} - -each_ruby_test() { - #review dev-python/pymongo for ways to make the test compatible with FEATURES=network-sandbox - - #we bogart msfupdate so no point in trying to test it - rm spec/msfupdate_spec.rb || die - #we don't really want to be uploading to virustotal during the tests - rm spec/tools/virustotal_spec.rb || die - - # https://dev.metasploit.com/redmine/issues/8425 - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:create || die - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:migrate || die - - MSF_DATABASE_CONFIG=config/database.yml BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake || die - su postgres -c "dropuser msf_test_user" || die "failed to cleanup msf_test-user" -} - -each_ruby_install() { - #Tests have already been run, we don't need this stuff - rm -r spec || die - rm -r test || die - rm Gemfile.lock || die - - #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple. - # should be as simple as copying everything into the target... - dodir /usr/$(get_libdir)/${PN}${SLOT} - cp -R * "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed" - rm -Rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/documentation "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/README.md - fowners -R root:0 / - -} - -all_ruby_install() { - # do not remove LICENSE, bug #238137 - dodir /usr/share/doc/${PF} - cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die - dosym usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation - - fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate - - #tell revdep-rebuild to ignore binaries meant for the target - dodir /etc/revdep-rebuild - cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT} - #These dirs contain prebuilt binaries for running on the TARGET not the HOST - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter" - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits" - EOF -} - -pkg_postinst() { - elog "Before use you should run 'env-update' and '. /etc/profile'" - elog "otherwise you may be missing important environmental variables." - - elog "You need to prepare the database by running:" - elog "emerge --config postgresql" - elog "/etc/init.d/postgresql- start" - elog "emerge --config =metasploit-${PV}" - - "${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT} - - einfo - elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml if necessary" -} - -pkg_config() { - einfo "If the following fails, it is likely because you forgot to start/config postgresql first" - su postgres -c "createuser msf_user -D -S -R" - su postgres -c "createdb --owner=msf_user msf_database" -} diff --git a/net-analyzer/metasploit/metasploit-4.16.63.ebuild b/net-analyzer/metasploit/metasploit-4.16.63.ebuild deleted file mode 100644 index 369b29b83..000000000 --- a/net-analyzer/metasploit/metasploit-4.16.63.ebuild +++ /dev/null @@ -1,342 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI="6" - -#never ever ever have more than one ruby in here -USE_RUBY="ruby23" -inherit eutils ruby-ng - -if [[ ${PV} == "9999" ]] ; then - EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git" - EGIT_CHECKOUT_DIR="${WORKDIR}"/all - inherit git-r3 -# KEYWORDS="" - SLOT="9999" -else - ##Tags https://github.com/rapid7/metasploit-framework/releases - MY_PV=${PV/_p/-} - SRC_URI="https://github.com/rapid7/metasploit-framework/archive/${MY_PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~x86" - RUBY_S="${PN}-framework-${MY_PV}" - inherit versionator - SLOT="$(get_version_component_range 1).$(get_version_component_range 2)" -fi - -DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code" -HOMEPAGE="http://www.metasploit.org/" -LICENSE="BSD" -IUSE="development +java nexpose openvas oracle +pcap test" - -#multiple known bugs with tests reported upstream and ignored -#http://dev.metasploit.com/redmine/issues/8418 - worked around (fix user creation when possible) -RESTRICT="test" - -#grep spec.add_runtime_dependency metasploit-framework.gemspec | sort -RUBY_COMMON_DEPEND="virtual/ruby-ssl - >=dev-ruby/actionpack-4.2.6:4.2 - >=dev-ruby/activerecord-4.2.6:4.2 - >=dev-ruby/activesupport-4.2.6:4.2 - dev-ruby/backports - dev-ruby/bcrypt-ruby - dev-ruby/bcrypt_pbkdf - dev-ruby/bit-struct - dev-ruby/bundler - dev-ruby/dnsruby - dev-ruby/faker - dev-ruby/filesize - dev-ruby/jsobfu:* - dev-ruby/json:* - dev-ruby/metasm:* - dev-ruby/metasploit-concern - =dev-ruby/rake-10.0.0 - >=dev-ruby/factory_girl-4.1.0 )" - #lorcon doesn't support ruby21 - #lorcon? ( net-wireless/lorcon[ruby] ) -ruby_add_bdepend "${RUBY_COMMON_DEPEND} - test? ( >=dev-ruby/factory_girl-4.1.0 - dev-ruby/fivemat - dev-ruby/database_cleaner - >=dev-ruby/rspec-2.12 - dev-ruby/shoulda-matchers - dev-ruby/timecop - >=dev-ruby/rake-10.0.0 )" -ruby_add_rdepend "${RUBY_COMMON_DEPEND}" - -COMMON_DEPEND="dev-db/postgresql[server] - >=app-crypt/johntheripper-1.7.9-r1[-minimal] - net-analyzer/nmap" -RDEPEND+=" ${COMMON_DEPEND} - >=app-eselect/eselect-metasploit-0.16" - -RESTRICT="strip" - -QA_PREBUILT=" - usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x86_solaris.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_linux_dll.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x86_bsd.bin - usr/lib*/${PN}${SLOT}/data/templates/template_x64_bsd.bin - usr/lib*/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin - usr/lib*/${PN}${SLOT}/data/templates/template_mipsle_linux.bin - usr/lib*/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso - usr/lib*/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2013-2171.bin - usr/lib*/${PN}${SLOT}/data/exploits/CVE-2014-3153.elf - usr/lib*/${PN}${SLOT}/data/exploits/mysql/lib_mysqludf_sys_32.so - usr/lib*/${PN}${SLOT}/data/android/libs/x86/libndkstager.so - usr/lib*/${PN}${SLOT}/data/android/libs/mips/libndkstager.so - usr/lib*/${PN}${SLOT}/data/android/libs/armeabi/libndkstager.so - usr/lib*/${PN}${SLOT}/data/templates/template_x86_linux_dll.bin - usr/lib*/${PN}${SLOT}/data/templates/template_armle_linux_dll.bin - usr/lib*/${PN}${SLOT}/data/templates/template_aarch64_linux.bin - " - -pkg_setup() { - if use test; then - su postgres -c "dropdb msf_test_database" #this is intentionally allowed to fail - su postgres -c "createuser msf_test_user -d -S -R" - if [ $? -ne 0 ]; then - su postgres -c "dropuser msf_test_user" || die - su postgres -c "createuser msf_test_user -d -S -R" || die - fi - su postgres -c "createdb --owner=msf_test_user msf_test_database" || die - fi - ruby-ng_pkg_setup -} - -all_ruby_unpack() { - if [[ ${PV} == "9999" ]] ; then - git-r3_src_unpack - else - default_src_unpack -# mv "${WORKDIR}"/all/msf3/* "${WORKDIR}"/all -# rm -r msf3 - #msf_version=$(grep --color=never "CURRENT_VERSION =" ${S}/spec/lib/msf/core/framework_spec.rb) - #msf_version=${msf_version#*=} - fi -} - -all_ruby_prepare() { - # add psexec patch from pull request 2657 to allow custom exe templates from any files, bypassing most AVs - #epatch "${FILESDIR}/agix_psexec_pull-2657.patch" - eapply_user - - #remove random "cpuinfo" binaries which a only needed to detect which bundled john to run - rm -r data/cpuinfo - - #remove unneeded ruby bundler versioning files - #Gemfile.lock contains the versions tested by the msf team but not the hard requirements - #we regen this file in each_ruby_prepare - rm Gemfile.lock - - #The Gemfile contains real known deps - sed -i "/gem 'fivemat'/s/, '1.2.1'//" Gemfile || die - #use released packetfu - sed -i "s/1.1.13.pre/1.1.13/" metasploit-framework.gemspec || die - #git gems are only for ruby24 support and we are not there yet - sed -i "/git:/d" Gemfile || die - - #now we edit the Gemfile based on use flags - if ! use pcap; then - sed -i -e "/^group :pcap do/,/^end$/d" Gemfile || die - fi - if ! use nexpose; then - sed -i -e "/nexpose/d" metasploit-framework.gemspec || die - fi - #no support for nessus right now - #if ! use nessus; then - sed -i -e "/nessus/d" metasploit-framework.gemspec || die - #fi - if ! use openvas; then - sed -i -e "/openvas-omp/d" metasploit-framework.gemspec || die - fi - #even if we pass --without=blah bundler still calculates the deps and messes us up - if ! use development; then - sed -i -e "/^group :development do/,/^end$/d" Gemfile || die - fi - if ! use test; then - sed -i -e "/^group :test/,/^end$/d" Gemfile || die - fi - if ! use test && ! use development; then - sed -i -e "/^group :development/,/^end$/d" Gemfile || die - fi - #We don't need simplecov - sed -i -e "/^group :coverage/,/^end$/d" Gemfile || die - sed -i -e "s#require 'simplecov'##" spec/spec_helper.rb || die - - #we need to edit the gemspec too, since it tries to call git instead of anything sane - #probably a better way to fix this... if I care at some point - sed -i -e "/^ spec.files/,/^ }/d" metasploit-framework.gemspec || die - - #https://bugs.gentoo.org/show_bug.cgi?id=584522 no tzinfo-data by choice in gentoo - sed -i '/tzinfo-data/d' metasploit-framework.gemspec - - #let's bogart msfupdate - rm msfupdate - echo "#!/bin/sh" > msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> msfupdate - echo "echo \"[*]\"" >> msfupdate - echo "echo \"\"" >> msfupdate - if [[ ${PV} == "9999" ]] ; then - echo "if [ -x /usr/bin/smart-live-rebuild ]; then" >> msfupdate - echo " smart-live-rebuild -f net-analyzer/metasploit" >> msfupdate - echo "else" >> msfupdate - echo " echo \"Please install app-portage/smart-live-rebuild for a better experience.\"" >> msfupdate - echo "emerge --oneshot \"=${CATEGORY}/${PF}\"" >> msfupdate - echo "fi" >> msfupdate - else - echo "echo \"Unable to update tagged version of metasploit.\"" >> msfupdate - echo "echo \"If you want the latest please install and eselect the live version (metasploit9999)\"" >> msfupdate - echo "echo \"emerge metasploit:9999 -vat && eselect metasploit set metasploit9999\"" >> msfupdate - fi - #this is set executable in src_install - - #install our database.yml file before tests are run - cp "${FILESDIR}"/database.yml config/ - -} - -each_ruby_prepare() { - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die - MSF_ROOT="." BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die - - #force all metasploit executables to use desired ruby version - #https://dev.metasploit.com/redmine/issues/8357 - for file in $(ls -1 msf*) - do - #poorly adapted from python.eclass - sed -e "1s:^#![[:space:]]*\([^[:space:]]*/usr/bin/env[[:space:]]\)\?[[:space:]]*\([^[:space:]]*/\)\?ruby\([[:digit:]]\+\(\.[[:digit:]]\+\)\?\)\?\(\$\|[[:space:]].*\):#!\1\2${RUBY}:" -i "${file}" || die "Conversion of shebang in '${file}' failed" - done -} - -each_ruby_test() { - #review dev-python/pymongo for ways to make the test compatible with FEATURES=network-sandbox - - #we bogart msfupdate so no point in trying to test it - rm spec/msfupdate_spec.rb || die - #we don't really want to be uploading to virustotal during the tests - rm spec/tools/virustotal_spec.rb || die - - # https://dev.metasploit.com/redmine/issues/8425 - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:create || die - BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake db:migrate || die - - MSF_DATABASE_CONFIG=config/database.yml BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle exec rake || die - su postgres -c "dropuser msf_test_user" || die "failed to cleanup msf_test-user" -} - -each_ruby_install() { - #Tests have already been run, we don't need this stuff - rm -r spec || die - rm -r test || die - rm Gemfile.lock || die - - #I'm 99% sure that this will only work for as long as we only support one ruby version. Creativity will be needed if we wish to support multiple. - # should be as simple as copying everything into the target... - dodir /usr/$(get_libdir)/${PN}${SLOT} - cp -R * "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed" - rm -Rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/documentation "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/README.md - fowners -R root:0 / - -} - -all_ruby_install() { - # do not remove LICENSE, bug #238137 - dodir /usr/share/doc/${PF} - cp -R {documentation,README.md} "${ED}"/usr/share/doc/${PF} || die - dosym usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation - - fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate - - #tell revdep-rebuild to ignore binaries meant for the target - dodir /etc/revdep-rebuild - cat <<-EOF > "${ED}"/etc/revdep-rebuild/99-metasploit${SLOT} - #These dirs contain prebuilt binaries for running on the TARGET not the HOST - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/meterpreter" - SEARCH_DIRS_MASK="/usr/lib*/${PN}${SLOT}/data/exploits" - EOF -} - -pkg_postinst() { - elog "Before use you should run 'env-update' and '. /etc/profile'" - elog "otherwise you may be missing important environmental variables." - - elog "You need to prepare the database by running:" - elog "emerge --config postgresql" - elog "/etc/init.d/postgresql- start" - elog "emerge --config =metasploit-${PV}" - - "${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT} - - einfo - elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml if necessary" -} - -pkg_config() { - einfo "If the following fails, it is likely because you forgot to start/config postgresql first" - su postgres -c "createuser msf_user -D -S -R" - su postgres -c "createdb --owner=msf_user msf_database" -} diff --git a/net-analyzer/metasploit/metasploit-4.16.63-r1.ebuild b/net-analyzer/metasploit/metasploit-4.16.64.ebuild similarity index 99% rename from net-analyzer/metasploit/metasploit-4.16.63-r1.ebuild rename to net-analyzer/metasploit/metasploit-4.16.64.ebuild index d12a9e4ab..a68c3e84a 100644 --- a/net-analyzer/metasploit/metasploit-4.16.63-r1.ebuild +++ b/net-analyzer/metasploit/metasploit-4.16.64.ebuild @@ -52,8 +52,8 @@ RUBY_COMMON_DEPEND="virtual/ruby-ssl