mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-20 13:51:00 +02:00
metasploit: huge changes to the ebuild, I like it better this way... gentoo's version kinda sucks.
lorcon and serialport bindings don't work right now, I'm working with upstream for fixes
This commit is contained in:
parent
2757f444e2
commit
aaf26c5a8d
4 changed files with 61 additions and 55 deletions
|
|
@ -1,8 +1,8 @@
|
|||
AUX armitage.yml 481 RMD160 d2f742ce1660a4ad43859b2ff6468d33716c2c74 SHA1 731283171a27cb2f4617c73df4ce0da6dcd3aef7 SHA256 2db3df7b05f28aa5ba6d6dedc32d8d1a2e24e020d6fd8aea15b2e76ed0f6ab46
|
||||
AUX hashdump2_script_6ac6c1d.rb 11382 RMD160 faabc47a80ae4a76f42a6364c08c38b961506555 SHA1 65a2db4982f240767b7e69b694cd900c8f908fa5 SHA256 2535f9d3bac1f559b4e5d827e5847b08fe0477bbcb8585960ad45ff15ab30c63
|
||||
AUX msfrpcd9999.confd 443 RMD160 03cafbafba9af1f6a4e70810942f11b7086dc98f SHA1 fb4c3aab4b1e38ddeaeafe69b1e72ce81fba3505 SHA256 8d29b5975f1c91ecd6ec552b04e8fc82e0a6fe2c782d6b214544d9a01f73eeb3
|
||||
AUX msfrpcd9999.initd 626 RMD160 3cb7d960a52540059f126f62e1e355d43b686a51 SHA1 66a0dfe86c1c8f6a6c1782bc2660bbcffe2556a9 SHA256 3dd1fa19301d92c95b47033248b5fc9f8165fd36557db644c518769ff350af51
|
||||
AUX msfrpcd.confd 443 RMD160 03cafbafba9af1f6a4e70810942f11b7086dc98f SHA1 fb4c3aab4b1e38ddeaeafe69b1e72ce81fba3505 SHA256 8d29b5975f1c91ecd6ec552b04e8fc82e0a6fe2c782d6b214544d9a01f73eeb3
|
||||
AUX msfrpcd.initd 626 RMD160 3cb7d960a52540059f126f62e1e355d43b686a51 SHA1 66a0dfe86c1c8f6a6c1782bc2660bbcffe2556a9 SHA256 3dd1fa19301d92c95b47033248b5fc9f8165fd36557db644c518769ff350af51
|
||||
AUX smart_hasdump_script_6ac6c1d.rb 15510 RMD160 3ff084bf3b86df1fa37499b004ca040161b324b8 SHA1 3795c23ae5160fdc13ba1d9c7f05e3893ff6f4e9 SHA256 66dec160dd9cc2fee2f8de11bf433f40baa1f41734ecf62aca9a32e0ca8a438f
|
||||
DIST jboss_seam_remote_command_rb 3412 RMD160 c577b1bd75943f2ddceea3161bc1037dd0150c2f SHA1 b858c726d3ee26317726635373d5db3b7eeb774d SHA256 c87f1cc1b82ed105c7bf551db7e3bad0a787244c4cdd124015a3ff24cedd23df
|
||||
DIST vbsmem-1.2.1.patch 69002 RMD160 281461151b0d1e453ee613326f4457eebaddebaa SHA1 883a582552e00102be452a2a0105b9e016b3dccc SHA256 7991a5629c562817919c9bb1c8f0a3bdcd1c63cf9b9f32f322d1d266416589d2
|
||||
EBUILD metasploit-9999.ebuild 6361 RMD160 8366d60985bc47c6b4f0756f089a0ea9e6fff94c SHA1 46ed7c29d641eabfbf75d576bd2a626a4e394d72 SHA256 29a6d0e6e7f9fcb70ae012ee3d31e8762af9a0459350733d1af2e01ae8659e53
|
||||
EBUILD metasploit-9999.ebuild 6106 RMD160 5b33dc04dc388f128ca457df60ee666b4dfe477c SHA1 823a4362eec18e28dc618a4ec2db8e33e084d34a SHA256 bd7296992b577168c4aac64ac17c8174c46a802c3c845c88de5ba05d4849b3c5
|
||||
|
|
|
|||
|
|
@ -10,24 +10,17 @@ MY_P=${PN/metasploit/framework}-${PV}
|
|||
MTSLPT_REV=${BASH_REMATCH[2]}
|
||||
ESVN_REPO_URI="https://metasploit.com/svn/framework3/trunk"
|
||||
|
||||
# Temporary section for vbsmem patch
|
||||
# AV payload bypass written by Blair Strang from security-assesstment.com
|
||||
# see more details at https://dev.metasploit.com/redmine/issues/3894
|
||||
#if use unstable; then
|
||||
# ESVN_PATCHES="vbsmem-1.2.1.patch"
|
||||
#fi
|
||||
SRC_URI="https://dev.metasploit.com/redmine/attachments/download/906/vbsmem-1.2.1.patch
|
||||
https://dev.metasploit.com/redmine/attachments/1200/jboss_seam_remote_command_rb"
|
||||
|
||||
DESCRIPTION="Advanced open-source framework for developing, testing, and using vulnerability exploit code"
|
||||
HOMEPAGE="http://www.metasploit.org/"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="BSD"
|
||||
SLOT="9999"
|
||||
KEYWORDS="~amd64 ~arm ~ppc ~sparc ~x86"
|
||||
IUSE="armitage symlink unstable mysql pcaprub postgres"
|
||||
IUSE="+armitage +kissfft unstable lorcon +pcaprub +postgres serialport"
|
||||
|
||||
REQUIRED_USE="armitage? ( || ( mysql postgres ) )"
|
||||
REQUIRED_USE="armitage? ( postgres )"
|
||||
|
||||
# Note we use bundled gems (see data/msfweb/vendor/rails/) as upstream voted for
|
||||
# such solution, bug #247787
|
||||
|
|
@ -36,70 +29,80 @@ RDEPEND="dev-lang/ruby
|
|||
!arm? ( dev-ruby/hpricot
|
||||
!sparc? ( virtual/jdk
|
||||
!ppc? ( dev-ruby/rjb dev-ruby/msgpack ) ) )
|
||||
mysql? ( !arm? ( dev-ruby/mysql-ruby
|
||||
dev-ruby/activerecord[mysql] ) )
|
||||
postgres? ( dev-db/postgresql-server
|
||||
!arm? ( dev-ruby/pg
|
||||
dev-ruby/activerecord[postgres] ) )
|
||||
pcaprub? ( net-libs/libpcap )
|
||||
armitage? ( net-analyzer/nmap
|
||||
!net-analyzer/armitage )
|
||||
symlink? ( !=net-analyzer/metasploit-2.7 )"
|
||||
lorcon? ( net-wireless/lorcon )"
|
||||
DEPEND=""
|
||||
|
||||
RESTRICT="strip"
|
||||
|
||||
QA_EXECSTACK="
|
||||
usr/lib/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin"
|
||||
usr/$(get_libdir)/${PN}/data/meterpreter/msflinker_linux_x86.bin"
|
||||
QA_WX_LOAD="
|
||||
usr/lib/${PN}${SLOT}/data/templates/template_*_linux.bin"
|
||||
usr/$(get_libdir)/${PN}/data/templates/template_*_linux.bin"
|
||||
|
||||
S=${WORKDIR}/${MY_P}
|
||||
|
||||
# Temporary section for vbsmem patch
|
||||
#subversion_src_prepare() {
|
||||
# if use unstable; then
|
||||
# cp "${DISTDIR}"/vbsmem-1.2.1.patch "${S}/" || die "patch not found"
|
||||
# fi
|
||||
# subversion_bootstrap || die "${ESVN}: unknown problem occurred in subversion_bootstrap."
|
||||
#}
|
||||
|
||||
src_compile() {
|
||||
if use pcaprub; then
|
||||
cd "${S}"/external/pcaprub
|
||||
ruby extconf.rb
|
||||
emake
|
||||
fi
|
||||
if use kissfft; then
|
||||
cd "${S}"/external/ruby-kissfft
|
||||
ruby extconf.rb
|
||||
emake
|
||||
fi
|
||||
#if use lorcon-old; then
|
||||
# cd "${S}"/external/ruby-lorcon
|
||||
# ruby extconf.rb
|
||||
# emake
|
||||
#fi
|
||||
if use lorcon; then
|
||||
cd "${S}"/external/ruby-lorcon2
|
||||
ruby extconf.rb
|
||||
emake
|
||||
fi
|
||||
if use serialport; then
|
||||
cd "${S}"/external/serialport
|
||||
ruby extconf.rb
|
||||
emake
|
||||
fi
|
||||
}
|
||||
|
||||
src_install() {
|
||||
# should be as simple as copying everything into the target...
|
||||
dodir /usr/lib/${PN}${SLOT}
|
||||
cp -R "${S}"/* "${D}"/usr/lib/${PN}${SLOT} || die "Copy files failed"
|
||||
rm -Rf "${D}"/usr/lib/${PN}${SLOT}/documentation "${D}"/usr/lib/${PN}${SLOT}/README || die
|
||||
dodir /usr/$(get_libdir)/${PN}
|
||||
cp -R "${S}"/* "${ED}"/usr/$(get_libdir)/${PN} || die "Copy files failed"
|
||||
rm -Rf "${ED}"/usr/$(get_libdir)/${PN}/documentation "${ED}"/usr/$(get_libdir)/${PN}/README || die
|
||||
fowners -R root:0 /
|
||||
|
||||
# do not remove LICENSE, bug #238137
|
||||
dodir /usr/share/doc/${PF}
|
||||
cp -R "${S}"/{documentation,README} "${D}"/usr/share/doc/${PF} || die
|
||||
dosym /usr/share/doc/${PF}/documentation /usr/lib/${PN}${SLOT}/documentation
|
||||
cp -R "${S}"/{documentation,README} "${ED}"/usr/share/doc/${PF} || die
|
||||
dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}/documentation
|
||||
|
||||
dodir /usr/bin/
|
||||
for file in msf*; do
|
||||
dosym /usr/lib/${PN}${SLOT}/${file} /usr/bin/${file}${SLOT}
|
||||
dosym /usr/$(get_libdir)/${PN}/${file} /usr/bin/${file}
|
||||
done
|
||||
|
||||
newinitd "${FILESDIR}"/msfrpcd${SLOT}.initd msfrpcd${SLOT}
|
||||
newconfd "${FILESDIR}"/msfrpcd${SLOT}.confd msfrpcd${SLOT}
|
||||
newinitd "${FILESDIR}"/msfrpcd.initd msfrpcd
|
||||
newconfd "${FILESDIR}"/msfrpcd.confd msfrpcd
|
||||
|
||||
# Avoid useless revdep-rebuild trigger #377617
|
||||
dodir /etc/revdep-rebuild/
|
||||
echo "SEARCH_DIRS_MASK=\"/usr/lib*/${PN}${SLOT}/data/john\"" > \
|
||||
"${D}"/etc/revdep-rebuild/70-${PN}-${SLOT}
|
||||
echo "SEARCH_DIRS_MASK=\"/usr/lib*/${PN}/data/john\"" > \
|
||||
"${ED}"/etc/revdep-rebuild/70-${PN}
|
||||
|
||||
if use armitage; then
|
||||
echo -e "#!/bin/sh \n\nexport MSF_DATABASE_CONFIG=/etc/metasploit/armitage.yml\n" > armitage
|
||||
echo -e "java -Xmx256m -jar /usr/lib/${PN}${SLOT}/data/armitage/armitage.jar \$* &\n" >> armitage
|
||||
echo -e "java -Xmx256m -jar /usr/$(get_libdir)/${PN}/data/armitage/armitage.jar \$* &\n" >> armitage
|
||||
dobin armitage
|
||||
insinto /etc/metasploit
|
||||
doins "${FILESDIR}"/armitage.yml
|
||||
|
|
@ -110,8 +113,8 @@ src_install() {
|
|||
|
||||
#smart hasdump from http://www.darkoperator.com/blog/2011/5/19/metasploit-post-module-smart_hashdump.html
|
||||
#https://github.com/darkoperator/Meterpreter-Scripts
|
||||
cp "${FILESDIR}"/smart_hasdump_script_6ac6c1d.rb "${D}"/usr/lib/${PN}${SLOT}/scripts/meterpreter/smart_hasdump.rb || die "Copy files failed"
|
||||
cp "${FILESDIR}"/hashdump2_script_6ac6c1d.rb "${D}"/usr/lib/${PN}${SLOT}/scripts/meterpreter/hashdump2.rb || die "Copy files failed"
|
||||
cp "${FILESDIR}"/smart_hasdump_script_6ac6c1d.rb "${ED}"/usr/$(get_libdir)/${PN}/scripts/meterpreter/smart_hasdump.rb || die "Copy files failed"
|
||||
cp "${FILESDIR}"/hashdump2_script_6ac6c1d.rb "${ED}"/usr/$(get_libdir)/${PN}/scripts/meterpreter/hashdump2.rb || die "Copy files failed"
|
||||
|
||||
#Slow HTTP POST Denial Of Service
|
||||
#https://dev.metasploit.com/redmine/issues/3638
|
||||
|
|
@ -121,35 +124,38 @@ src_install() {
|
|||
|
||||
#JBoss remote command execution exploit
|
||||
#https://dev.metasploit.com/redmine/issues/4585
|
||||
cp "${DISTDIR}"/jboss_seam_remote_command_rb "${D}"/usr/lib/${PN}${SLOT}/modules/exploits/multi/http/jboss_seam_remote_command.rb || die "Copy files failed"
|
||||
cp "${DISTDIR}"/jboss_seam_remote_command_rb "${ED}"/usr/$(get_libdir)/${PN}/modules/exploits/multi/http/jboss_seam_remote_command.rb || die "Copy files failed"
|
||||
|
||||
fi
|
||||
#fi unstable
|
||||
|
||||
if use pcaprub; then
|
||||
cd "${S}"/external/pcaprub
|
||||
emake DESTDIR="${D}" install
|
||||
emake DESTDIR="${ED}" install
|
||||
fi
|
||||
#if use lorcon-old; then
|
||||
# cd "${S}"/external/ruby-lorcon
|
||||
# emake DESTDIR="${ED}" install
|
||||
#fi
|
||||
if use lorcon; then
|
||||
cd "${S}"/external/ruby-lorcon2
|
||||
emake DESTDIR="${ED}" install
|
||||
fi
|
||||
if use kissfft; then
|
||||
cd "${S}"/external/ruby-kissfft
|
||||
emake DESTDIR="${ED}" install
|
||||
fi
|
||||
if use serialport; then
|
||||
cd "${S}"/external/serialport
|
||||
emake DESTDIR="${ED}" install
|
||||
fi
|
||||
|
||||
}
|
||||
pkg_postinst() {
|
||||
# quick path fix for SET and other tools
|
||||
# copied from kenrel-2.eclass
|
||||
if use symlink; then
|
||||
[[ -h ${ROOT}usr/lib/metasploit ]] && rm ${ROOT}usr/lib/metasploit
|
||||
# if the link doesnt exist, lets create it
|
||||
[[ ! -h ${ROOT}usr/lib/metasploit ]] && MAKELINK=1
|
||||
if [[ ${MAKELINK} == 1 ]]; then
|
||||
cd "${ROOT}"usr/lib/
|
||||
ln -sf metasploit${SLOT} metasploit
|
||||
#cd OLDPWD
|
||||
fi
|
||||
fi
|
||||
|
||||
if use postgres||mysql; then
|
||||
if use postgres; then
|
||||
elog "You need to prepare the database as described on the following page:"
|
||||
use postgres && elog "https://community.rapid7.com/docs/DOC-1268"
|
||||
use mysql && elog "https://community.rapid7.com/docs/DOC-1265"
|
||||
elog
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue