mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-21 14:21:02 +02:00
metasploit: give up and remove completely, https://github.com/rapid7/metasploit-framework/issues/13175
This commit is contained in:
parent
b1dde4f7b8
commit
9e770bba65
25 changed files with 1 additions and 907 deletions
|
|
@ -1,3 +1 @@
|
|||
DIST veil-3.1.12.tar.gz 199166 BLAKE2B 7cc5bfe5214dd583e0c7e4ea3f88688c7aecfe3143734944b905bb9d6329a54b4b634680ea1227f1dbb2669ec98a807f1f2201f0a3fefeb193c5769b939bd072 SHA512 3a74e69ad5d80d2ea0d560e6043a47241c10ef4b99064926ddfab4df0f9d4591afd616d94ad3ce3b10ce10042ed171dadc7adf5ed7a6e04c959b2ec4179c6be3
|
||||
DIST veil-3.1.13.tar.gz 199276 BLAKE2B 77e3629fad29bc2432c446ab4c00be778549bcb9738203fb4feeefb614eb94ef54f623cc98422d8b66e19affdc4298627690eb2ad8127ce142d5f4489a07a41e SHA512 2a37e76b6e14b32472c2e1ac38cc50d35fe6e6c5c9e0a7cf8cda70eae7736e48e9471918b1a70535ca0536e55bd6ac50b1d6ede989d96a07dd346afe6f452a62
|
||||
DIST veil-3.1.14.tar.gz 199315 BLAKE2B cc75d5f43d4d32bcb107cdae9026b1a8f80279de032c80e6e5de60a7210aed9a8d882e04629bebb4ad083f162fa067bb310fc11ed9b4a16558018d67b5d8dfce SHA512 1f324ec84b19b284a0b2c342e7cabaeb84dd5952352e64080b7473bd583f26c0c9bcd54c04696548c333b1ed715062c95303ee7f0e1a1d77c6587144820294cc
|
||||
|
|
|
|||
|
|
@ -1,68 +0,0 @@
|
|||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python3_5 python3_6 )
|
||||
inherit eutils python-single-r1
|
||||
|
||||
DESCRIPTION="A tool for payloads generation that bypass common anti-virus solutions"
|
||||
HOMEPAGE="https://github.com/Veil-Framework/Veil"
|
||||
SRC_URI="https://github.com/Veil-Framework/Veil/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE="tools"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-python/pycryptodome
|
||||
dev-python/pefile
|
||||
tools? (
|
||||
dev-lang/go
|
||||
net-analyzer/metasploit )
|
||||
"
|
||||
|
||||
#mingw-w64 monodevelop mono-mcs ruby
|
||||
# ca-certificates winbind
|
||||
|
||||
# dev-python/symmetricjsonrpc
|
||||
# dev-python/capstone-python
|
||||
# windows? (
|
||||
# dev-python/pyinstaller
|
||||
# app-emulation/wine
|
||||
# )
|
||||
|
||||
S="${WORKDIR}/Veil-${PV}"
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}"/veil-3-nodeps.patch
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_install() {
|
||||
rm -r config/
|
||||
# rm -r setup/
|
||||
|
||||
dodir /usr/$(get_libdir)/${PN}
|
||||
cp -R * "${ED}"/usr/$(get_libdir)/${PN} || die "Copy files failed"
|
||||
|
||||
#use our custom settings
|
||||
insinto /etc/veil
|
||||
newins "${FILESDIR}"/${PN}-3_settings.py settings.py
|
||||
|
||||
# dosym "${EPREFIX}"/usr/$(get_libdir)/veil/Veil.py /usr/bin/veil
|
||||
newbin - veil <<-EOF
|
||||
#!/bin/sh
|
||||
cd /usr/lib/veil
|
||||
python ./Veil.py \${@}
|
||||
EOF
|
||||
}
|
||||
|
||||
pkg_postinst(){
|
||||
einfo "you need to setup wine env for pyinstaller"
|
||||
einfo "wine msiexec /i python-2.7.12.msi"
|
||||
#https://github.com/Veil-Framework/Veil/issues/259
|
||||
einfo "Please also create the follow directories:"
|
||||
einfo "mkdir -p ~/.veil/output/{compiled,handlers,source}/"
|
||||
}
|
||||
|
|
@ -18,9 +18,7 @@ IUSE="tools"
|
|||
DEPEND=""
|
||||
RDEPEND="dev-python/pycryptodome
|
||||
dev-python/pefile
|
||||
tools? (
|
||||
dev-lang/go
|
||||
net-analyzer/metasploit )
|
||||
tools? ( dev-lang/go )
|
||||
"
|
||||
|
||||
#mingw-w64 monodevelop mono-mcs ruby
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
# Copyright 1999-2018 Gentoo Foundation
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=6
|
||||
|
||||
PYTHON_COMPAT=( python3_5 python3_6 )
|
||||
inherit eutils python-single-r1
|
||||
|
||||
DESCRIPTION="A tool for payloads generation that bypass common anti-virus solutions"
|
||||
HOMEPAGE="https://github.com/Veil-Framework/Veil"
|
||||
SRC_URI="https://github.com/Veil-Framework/Veil/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="GPL-3"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64"
|
||||
IUSE="tools"
|
||||
|
||||
DEPEND=""
|
||||
RDEPEND="dev-python/pycryptodome
|
||||
dev-python/pefile
|
||||
tools? (
|
||||
dev-lang/go
|
||||
net-analyzer/metasploit )
|
||||
"
|
||||
|
||||
#mingw-w64 monodevelop mono-mcs ruby
|
||||
# ca-certificates winbind
|
||||
|
||||
# dev-python/symmetricjsonrpc
|
||||
# dev-python/capstone-python
|
||||
# windows? (
|
||||
# dev-python/pyinstaller
|
||||
# app-emulation/wine
|
||||
# )
|
||||
|
||||
S="${WORKDIR}/Veil-${PV}"
|
||||
|
||||
src_prepare() {
|
||||
epatch "${FILESDIR}"/veil-3-nodeps.patch
|
||||
eapply_user
|
||||
}
|
||||
|
||||
src_install() {
|
||||
rm -r config/
|
||||
# rm -r setup/
|
||||
|
||||
dodir /usr/$(get_libdir)/${PN}
|
||||
cp -R * "${ED}"/usr/$(get_libdir)/${PN} || die "Copy files failed"
|
||||
|
||||
#use our custom settings
|
||||
insinto /etc/veil
|
||||
newins "${FILESDIR}"/${PN}-3_settings.py settings.py
|
||||
|
||||
# dosym "${EPREFIX}"/usr/$(get_libdir)/veil/Veil.py /usr/bin/veil
|
||||
newbin - veil <<-EOF
|
||||
#!/bin/sh
|
||||
cd /usr/lib/veil
|
||||
python ./Veil.py \${@}
|
||||
EOF
|
||||
}
|
||||
|
||||
pkg_postinst(){
|
||||
einfo "you need to setup wine env for pyinstaller"
|
||||
einfo "wine msiexec /i python-2.7.12.msi"
|
||||
#https://github.com/Veil-Framework/Veil/issues/259
|
||||
einfo "Please also create the follow directories:"
|
||||
einfo "mkdir -p ~/.veil/output/{compiled,handlers,source}/"
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST metasploit-concern-2.0.5.gem 18944 BLAKE2B 090dccb8e43426da0f51604b3257e717989d35e1430597734743df4447735cbf1dcc2e31124ae7012d6a945828dc55f80f095cf6b89584341fc5059f1275e2b8 SHA512 1d8025dd075475fcae1c663789154f7fc8dbb334f9a069a1c1a21f4b101e9b85dc7cdfc6097bbfa9387463d3050e7a715e68a0b09ebfa66aa27ccaa74a1ffe91
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>zerochaos@gentoo.org</email>
|
||||
<name>Rick Farina</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="github">rapid7/metasploit-concern</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
USE_RUBY="ruby24 ruby25 ruby26"
|
||||
|
||||
RUBY_FAKEGEM_EXTRAINSTALL="app spec"
|
||||
|
||||
inherit ruby-fakegem
|
||||
|
||||
DESCRIPTION="Metasploit concern allows you to define concerns in app/concerns. "
|
||||
HOMEPAGE="https://github.com/rapid7/metasploit-concern"
|
||||
SRC_URI="https://rubygems.org/gems/${P}.gem"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="$(ver_cut 1-2)"
|
||||
KEYWORDS="~amd64 ~arm ~x86"
|
||||
#IUSE="development test"
|
||||
RESTRICT=test
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="${RDEPEND} !dev-ruby/metasploit-concern:0"
|
||||
|
||||
ruby_add_rdepend ">=dev-ruby/railties-4.2.6:4.2
|
||||
>=dev-ruby/activesupport-4.2.6:4.2
|
||||
>=dev-ruby/activemodel-2.4.6:4.2"
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST metasploit-credential-2.0.14.gem 110592 BLAKE2B 09f3eee0f288ab26695177b014b98dc871f6f009f34aaad4fbd7dfcda8acc63f75524fe7d181b1dccca863cc83eb50f249e0c07cbb0f07e9c79856a4389cdcd9 SHA512 66670fc89dc61d6d32577c9b46dc6ddfab15b9c0118ba15cc7398e10ec8de63cd7150fbfaddbd01a573ead6d98619dd9c19a5835be58baaa1fc4a9c777839b00
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>zerochaos@gentoo.org</email>
|
||||
<name>Rick Farina</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="github">rapid7/metasploit-credential</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
USE_RUBY="ruby24 ruby25 ruby26"
|
||||
|
||||
RUBY_FAKEGEM_RECIPE_DOC="rdoc"
|
||||
|
||||
inherit ruby-fakegem
|
||||
|
||||
RUBY_FAKEGEM_EXTRAINSTALL="app config db spec"
|
||||
|
||||
DESCRIPTION="Code for modeling and managing credentials in Metasploit"
|
||||
HOMEPAGE="https://github.com/rapid7/metasploit-credential"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="${PV}"
|
||||
KEYWORDS="~amd64 ~arm ~x86"
|
||||
IUSE=""
|
||||
RESTRICT=test
|
||||
|
||||
ruby_add_rdepend "dev-ruby/metasploit-concern:2.0
|
||||
<=dev-ruby/metasploit_data_models-3.0.0:*
|
||||
>=dev-ruby/metasploit-model-1.0.0
|
||||
dev-ruby/rubyzip:1
|
||||
dev-ruby/rubyntlm
|
||||
>=dev-ruby/railties-4.2.6:4.2
|
||||
dev-ruby/pg:*"
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST metasploit-model-2.0.4.gem 81408 BLAKE2B 5a4be9e61649710470618d4334279054cbefc1027a1d4674b6be0c6a4c632219fd2dc3ac5f9f56dc9018712e5cbcbe191d5749ed2ed10cf98f884a06e41ec736 SHA512 70f6d948227bc99f877c3b5631a964087c0ebfdb091f128c72bc5da276bf57a5055aea5cdda4dc66e1fb177606afec9b7b3ee4076211f43928a2defb93294ac5
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>zerochaos@gentoo.org</email>
|
||||
<name>Rick Farina</name>
|
||||
</maintainer>
|
||||
<longdescription lang="en">
|
||||
Common code, such as validators and mixins, that are shared between ActiveModels in metasploit-framework and ActiveRecords in metasploit_data_models
|
||||
</longdescription>
|
||||
<upstream>
|
||||
<remote-id type="github">rapid7/metasploit-model</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
USE_RUBY="ruby24 ruby25 ruby26"
|
||||
|
||||
inherit ruby-fakegem
|
||||
|
||||
RUBY_FAKEGEM_EXTRAINSTALL="app config script spec"
|
||||
|
||||
DESCRIPTION="Common code, such as validators and mixins"
|
||||
HOMEPAGE="https://github.com/rapid7/metasploit-model"
|
||||
SRC_URI="https://rubygems.org/gems/${P}.gem"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="$(ver_cut 1-2)"
|
||||
KEYWORDS="~amd64 ~arm ~x86"
|
||||
#IUSE="development test"
|
||||
RESTRICT=test
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="${RDEPEND} !dev-ruby/metasploit-model:0"
|
||||
|
||||
ruby_add_rdepend ">=dev-ruby/railties-4.2.6:4.2
|
||||
>=dev-ruby/activesupport-4.2.6:4.2
|
||||
>=dev-ruby/activemodel-4.2.6:4.2"
|
||||
# development? ( dev-ruby/bundler
|
||||
# dev-ruby/rake
|
||||
# dev-ruby/i18n
|
||||
# dev-ruby/multi_json
|
||||
# dev-ruby/builder
|
||||
# dev-ruby/erubis
|
||||
# dev-ruby/journey
|
||||
# dev-ruby/rack
|
||||
# dev-ruby/rack-cache
|
||||
# dev-ruby/rack-test
|
||||
# dev-ruby/hike
|
||||
# dev-ruby/tilt
|
||||
# dev-ruby/sprockets:*
|
||||
# dev-ruby/actionpack:4.0
|
||||
# dev-ruby/json
|
||||
# dev-ruby/rack-ssl:*
|
||||
# dev-ruby/rdoc
|
||||
# dev-ruby/thor
|
||||
# dev-ruby/redcarpet
|
||||
# <dev-ruby/yard-0.8.7.4 )"
|
||||
|
||||
ruby_add_bdepend "dev-ruby/bundler"
|
||||
|
||||
all_ruby_prepare() {
|
||||
[ -f Gemfile.lock ] && rm Gemfile.lock
|
||||
#For now, we don't support development or testing at all
|
||||
#if ! use development; then
|
||||
sed -i -e "/^group :development do/,/^end$/d" Gemfile || die
|
||||
sed -i -e "/s.add_development_dependency/d" "${PN}".gemspec || die
|
||||
sed -i -e "/spec.add_development_dependency/d" "${PN}".gemspec || die
|
||||
#fi
|
||||
#if ! use test; then
|
||||
sed -i -e "/^group :test do/,/^end$/d" Gemfile || die
|
||||
#fi
|
||||
#if ! use test && ! use development; then
|
||||
sed -i -e "/^group :development, :test do/,/^end$/d" Gemfile || die
|
||||
#fi
|
||||
}
|
||||
|
||||
each_ruby_prepare() {
|
||||
if [ -f Gemfile ]
|
||||
then
|
||||
BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die
|
||||
BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die
|
||||
fi
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST metasploit-payloads-1.3.53.gem 12161024 BLAKE2B a98c24faeba68cc00240324235bfc887c31dde4240ee37a1decd38c0738a0ffdad9dbe2b3e6026dc99c4299e38025d3aa13a39589b948950d83ac9f69b6baa49 SHA512 698f91348ebcb2e0a74b506f391fa7eded7c5974821d283ce4890a8c63472db891c8837ef2f67fbe27996e72ec09ecbb4c32721311d57ab6633e5ed2fd426769
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>zerochaos@gentoo.org</email>
|
||||
<name>Rick Farina</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="github">rapid7/metasploit-payloads</remote-id>
|
||||
<remote-id type="rubygems">metasploit-payloads</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
|
@ -1,44 +0,0 @@
|
|||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
USE_RUBY="ruby24 ruby25 ruby26"
|
||||
|
||||
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
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST metasploit_data_models-2.0.16.gem 182272 BLAKE2B 918c57e62552e2b3288ca24e8ff7abeb30b0b6221906890c7b2e15c674356de6861a10500735d5a912b0deefb6b378b64111bd18770c65b10dcdbc911e6439d6 SHA512 bf2c2c162d23750eceeb315b9a5ba9e8b80bf4ace9e32f8c1e97c35939338d026d640675b3e5eaf61c6897007db07e186d4d5be944dc3bca16c138f1f6ae6ada
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>zerochaos@gentoo.org</email>
|
||||
<name>Rick Farina</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="github">rapid7/metasploit_data_models</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
USE_RUBY="ruby24 ruby25 ruby26"
|
||||
|
||||
inherit ruby-fakegem
|
||||
|
||||
RUBY_FAKEGEM_EXTRAINSTALL="app config db script spec"
|
||||
RUBY_FAKEGEM_GEMSPEC="${PN}".gemspec
|
||||
DESCRIPTION="The database layer for Metasploit"
|
||||
HOMEPAGE="https://github.com/rapid7/metasploit_data_models"
|
||||
SRC_URI="https://rubygems.org/gems/${P}.gem"
|
||||
|
||||
LICENSE="BSD"
|
||||
SLOT="${PV}"
|
||||
KEYWORDS="~amd64 ~arm ~x86"
|
||||
RESTRICT=test
|
||||
#IUSE="development test"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="${RDEPEND} !dev-ruby/metasploit_data_models:0"
|
||||
|
||||
ruby_add_rdepend "
|
||||
>=dev-ruby/activerecord-4.2.6:4.2[postgres]
|
||||
>=dev-ruby/activesupport-4.2.6:4.2
|
||||
dev-ruby/pg:*
|
||||
dev-ruby/postgres_ext
|
||||
>=dev-ruby/railties-4.2.6:4.2
|
||||
>=dev-ruby/recog-2.0.0:*
|
||||
dev-ruby/arel-helpers
|
||||
>=dev-ruby/metasploit-concern-2.0.0
|
||||
>=dev-ruby/metasploit-model-2.0.0
|
||||
<dev-ruby/thor-2.0"
|
||||
|
||||
ruby_add_bdepend "dev-ruby/bundler"
|
||||
|
||||
all_ruby_prepare() {
|
||||
[ -f Gemfile.lock ] && rm Gemfile.lock
|
||||
#if ! use development; then
|
||||
sed -i -e "/^group :development do/,/^end$/d" Gemfile || die
|
||||
sed -i -e "/s.add_development_dependency/d" "${PN}".gemspec || die
|
||||
#fi
|
||||
#if ! use test; then
|
||||
sed -i -e "/^group :test do/,/^end$/d" Gemfile || die
|
||||
#fi
|
||||
#if ! use test && ! use development; then
|
||||
sed -i -e "/^group :development, :test do/,/^end$/d" Gemfile || die
|
||||
#fi
|
||||
#use the stable version of pg
|
||||
sed -i "s/'pg', \"0.20.0\"/'pg', '0.21.0'/" metasploit_data_models.gemspec || die
|
||||
}
|
||||
|
||||
each_ruby_prepare() {
|
||||
if [ -f Gemfile ]
|
||||
then
|
||||
BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle install --local || die
|
||||
BUNDLE_GEMFILE=Gemfile ${RUBY} -S bundle check || die
|
||||
fi
|
||||
}
|
||||
|
||||
all_ruby_install() {
|
||||
ruby_fakegem_binwrapper mdm_console mdm_console-${SLOT}
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST metasploit_payloads-mettle-0.4.2.gem 18293760 BLAKE2B 98de479bbc72fd2ac916efaa4ac64f1aaf0d7267926ee5b56bfc2ec2b91450039c0a4d9d4322174355b4b089e5f9951145d5cbf87759e2bfe4da78e5b8cceec4 SHA512 8a0f8c1ca75d7664d33392e6c0c5a3de56ddd0a5c0f97f96091041caee89e74a2f3a42277a1f0c3eb57ca68706b344f0235b8ebc92870c6b8a89fa7bc20de5f0
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
|
||||
<pkgmetadata>
|
||||
<maintainer type="person">
|
||||
<email>zerochaos@gentoo.org</email>
|
||||
<name>Rick Farina</name>
|
||||
</maintainer>
|
||||
<upstream>
|
||||
<remote-id type="github">rapid7/mettle</remote-id>
|
||||
<remote-id type="rubygems">metasploit_payloads-mettle</remote-id>
|
||||
</upstream>
|
||||
</pkgmetadata>
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
USE_RUBY="ruby24 ruby25 ruby26"
|
||||
|
||||
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
|
||||
}
|
||||
|
|
@ -1 +0,0 @@
|
|||
DIST metasploit-4.17.21.tar.gz 28812125 BLAKE2B 15ff8ccac99d783b7b9cd20d6512df551b3143b4947d2f347b2558d1bafd2861d41fe6b051034c75cd25030ad85d26f261ffe9149dd27d551f92f17fcc0b4075 SHA512 00763f515bc6b556d4dbe15a7c58fac3c7febb64fb339fd5c05ad2b18b5b55bdf8815daca35f24bb22bea3d376db4f4610918730d813079e5ac3f8d5ad16d2d9
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
#
|
||||
# The tests currently use the development user
|
||||
# https://dev.metasploit.com/redmine/issues/8418
|
||||
#
|
||||
|
||||
development:
|
||||
adapter: "postgresql"
|
||||
database: "msf_test_database"
|
||||
username: "msf_test_user"
|
||||
password: "secure"
|
||||
port: 5432
|
||||
host: "localhost"
|
||||
pool: 256
|
||||
timeout: 5
|
||||
|
||||
production:
|
||||
adapter: "postgresql"
|
||||
database: "msf_database"
|
||||
username: "msf_user"
|
||||
password: "secure"
|
||||
port: 5432
|
||||
host: "localhost"
|
||||
pool: 256
|
||||
timeout: 5
|
||||
|
||||
test:
|
||||
adapter: "postgresql"
|
||||
database: "msf_test_database"
|
||||
username: "msf_test_user"
|
||||
password: "secure"
|
||||
port: 5432
|
||||
host: "localhost"
|
||||
pool: 256
|
||||
timeout: 5
|
||||
|
|
@ -1,351 +0,0 @@
|
|||
# Copyright 1999-2020 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
#never ever ever have more than one ruby in here
|
||||
#TODO: use ruby-single instead?
|
||||
USE_RUBY="ruby25"
|
||||
inherit eutils ruby-ng
|
||||
|
||||
if [[ ${PV} == "9999" ]] ; then
|
||||
EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git"
|
||||
EGIT_BRANCH="4.x"
|
||||
EGIT_CHECKOUT_DIR="${WORKDIR}"/all
|
||||
inherit git-r3
|
||||
KEYWORDS="~arm"
|
||||
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 ~arm ~x86"
|
||||
RUBY_S="${PN}-framework-${MY_PV}"
|
||||
SLOT="$(ver_cut 1).$(ver_cut 2)"
|
||||
fi
|
||||
|
||||
DESCRIPTION="Advanced framework for developing, testing, and using vulnerability exploit code"
|
||||
HOMEPAGE="http://www.metasploit.org/"
|
||||
LICENSE="BSD"
|
||||
IUSE="development +java nexpose 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:0
|
||||
dev-ruby/faraday
|
||||
dev-ruby/filesize:*
|
||||
dev-ruby/jsobfu:*
|
||||
dev-ruby/json:*
|
||||
dev-ruby/metasm:*
|
||||
dev-ruby/metasploit-concern
|
||||
<dev-ruby/metasploit-credential-3.0.0
|
||||
<dev-ruby/metasploit_data_models-3.0.0
|
||||
dev-ruby/metasploit-model
|
||||
dev-ruby/metasploit-payloads:1.3.53
|
||||
dev-ruby/metasploit_payloads-mettle:0.4.2
|
||||
dev-ruby/mqtt
|
||||
dev-ruby/msgpack
|
||||
dev-ruby/net-ssh:*
|
||||
dev-ruby/ed25519
|
||||
dev-ruby/nokogiri
|
||||
dev-ruby/octokit
|
||||
dev-ruby/openssl-ccm:1.2.1
|
||||
dev-ruby/packetfu:1.1.13
|
||||
dev-ruby/patch_finder
|
||||
dev-ruby/pdf-reader:*
|
||||
~dev-ruby/pg-0.21.0
|
||||
dev-ruby/railties:*
|
||||
dev-ruby/rb-readline
|
||||
dev-ruby/recog:*
|
||||
dev-ruby/redcarpet
|
||||
dev-ruby/rex-arch
|
||||
dev-ruby/rex-bin_tools
|
||||
dev-ruby/rex-core
|
||||
dev-ruby/rex-encoder
|
||||
dev-ruby/rex-exploitation
|
||||
dev-ruby/rex-java
|
||||
dev-ruby/rex-mime
|
||||
dev-ruby/rex-nop
|
||||
dev-ruby/rex-ole
|
||||
<dev-ruby/rex-powershell-0.1.78
|
||||
dev-ruby/rex-random_identifier
|
||||
dev-ruby/rex-registry
|
||||
dev-ruby/rex-rop_builder
|
||||
dev-ruby/rex-socket
|
||||
dev-ruby/rex-sslscan
|
||||
dev-ruby/rex-struct2
|
||||
dev-ruby/rex-text
|
||||
dev-ruby/rex-zip
|
||||
dev-ruby/ruby-macho
|
||||
dev-ruby/rubyntlm
|
||||
dev-ruby/ruby_smb:*
|
||||
dev-ruby/rubyzip:*
|
||||
dev-ruby/sqlite3
|
||||
dev-ruby/sshkey
|
||||
dev-ruby/tzinfo:*
|
||||
dev-ruby/windows_error
|
||||
dev-ruby/xdr:2.0.0
|
||||
dev-ruby/xmlrpc
|
||||
java? ( dev-ruby/rjb )
|
||||
nexpose? ( dev-ruby/nexpose )
|
||||
oracle? ( dev-ruby/ruby-oci8 )
|
||||
pcap? ( dev-ruby/pcaprub:*
|
||||
dev-ruby/network_interface )
|
||||
development? ( dev-ruby/fivemat
|
||||
dev-ruby/pry
|
||||
dev-ruby/redcarpet
|
||||
dev-ruby/yard
|
||||
>=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-jumbo >=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/exploits/*
|
||||
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
|
||||
#use the stable pg
|
||||
#https://github.com/rapid7/metasploit-framework/issues/10234
|
||||
sed -i "s/dependency 'pg', '0.20.0'/dependency 'pg', '0.21.0'/" 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
|
||||
#this version is old, remove it
|
||||
sed -i -e "/openvas-omp/d" metasploit-framework.gemspec || die
|
||||
#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
|
||||
|
||||
#fails without faraday in Gemfile.lock
|
||||
#despite activesupport(?) needing it, it doesn't end up there :-(
|
||||
sed -i "/'activesupport'/a \ \ spec.add_runtime_dependency 'faraday'" 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/lib/${PN}${SLOT}
|
||||
cp -R * "${ED}"/usr/lib/${PN}${SLOT} || die "Copy files failed"
|
||||
rm -Rf "${ED}"/usr/lib/${PN}${SLOT}/documentation "${ED}"/usr/lib${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
|
||||
ln -s "../../share/doc/${PF}/documentation" "${ED}/usr/lib/${PN}${SLOT}/documentation"
|
||||
|
||||
fperms +x /usr/lib/${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-<version> 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"
|
||||
}
|
||||
Loading…
Reference in a new issue