metasploit: armitage fixes, ebuild clean up

This commit is contained in:
Anton Bolshakov 2012-01-27 14:48:59 +00:00
parent 4e223e416c
commit d9190ae02a
5 changed files with 83 additions and 63 deletions

View file

@ -1,7 +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 440 RMD160 67e569204d77592e8b0e19d34d87c0c75a722687 SHA1 ff1eea41295270d0b5117ee233b5f5fe44a84834 SHA256 f1148f3f4fe24b2689d6a8f3d8510031f493100a5b48823c0a5bc2085a6439b4
AUX msfrpcd9999.initd 561 RMD160 e9811489784131c4c1e68279d43b4f2ba4c093b1 SHA1 38240c3bba090011c25fffe90d9c898e540ba463 SHA256 89a897977b53a471334caa47eeadcb5595fa783bfafd99c7ae1d5c8f9e7041bc
AUX msfrpcd9999.confd 443 RMD160 03cafbafba9af1f6a4e70810942f11b7086dc98f SHA1 fb4c3aab4b1e38ddeaeafe69b1e72ce81fba3505 SHA256 8d29b5975f1c91ecd6ec552b04e8fc82e0a6fe2c782d6b214544d9a01f73eeb3
AUX msfrpcd9999.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 6600 RMD160 0d2cd429d276e99c715477a7484a2d1127dba430 SHA1 4a6b5862219b2f35dd1fcdffbaca33e9e70bc557 SHA256 e98953ea5ce43f8dac923236142e34d2ed5984c7a4a048a0eb6389ffa99b296a
EBUILD metasploit-9999.ebuild 6359 RMD160 2e56ad2852b741edc88029354d9fecac05e118bd SHA1 f0192f7a3c56ae023bc62113c8b7e2a23014df6b SHA256 d8e5bab0fcdfb22a662395e6073fa71afc9788ed86abfc98863c42cdc0252e71

View file

@ -0,0 +1,24 @@
#
# These settings are for the database used by the Metasploit Framework
# unstable tree included in this installer, not the commercial editions.
#
development:
adapter: "postgresql"
database: "msf_database"
username: "msf_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

View file

@ -10,7 +10,7 @@ PORT=55553
USER="msf"
# Use the following password instead of msf
PASS="msf"
PASS="secure"
# Change the server type to "Web" instead of "Basic"
TYPE="Basic"

View file

@ -1,19 +1,22 @@
#!/sbin/runscript
# Copyright 1999-2005 Gentoo Foundation
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/metasploit/files/msfweb3.initd,v 1.1 2007/09/09 11:56:21 cedk Exp $
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/metasploit/files/msfrpcd-4.1-initd,v 1.1 2012/01/12 08:14:41 patrick Exp $
PIDFILE=/var/run/msfweb3.pid
VERSION=9999
PIDFILE=/var/run/msfrpcd${VERSION}.pid
start() {
ebegin "Starting msfrcpd3"
start-stop-daemon --start --quiet --background --exec /usr/bin/msfrpcd3 \
--pidfile ${PIDFILE} --make-pidfile -- -f ${MSF_OPTS}
ebegin "Starting msfrpcd${VERSION}"
start-stop-daemon --start --quiet --background \
--exec /usr/bin/msfrpcd${VERSION} \
--pidfile ${PIDFILE} \
--make-pidfile -- -f ${MSF_OPTS}
eend $?
}
stop() {
ebegin "Stopping msfrpcd3"
ebegin "Stopping msfrpcd${VERSION}"
start-stop-daemon --stop --quiet -s 9 --pidfile ${PIDFILE}
eend $?
}

View file

@ -3,24 +3,19 @@
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/metasploit/metasploit-3.1_p5699-r1.ebuild,v 1.3 2008/11/09 14:52:13 nixnut Exp $
EAPI="4"
inherit eutils subversion
MY_P=${PN/metasploit/framework}-${PV}
# Metasploit uses subversion as a *normal* update mechanism for stable branches
# of the package. This ebuild uses _p<number> inside $PV to install updated up
# to revision <number> version of framework. For more information, take a look
# at bug #195924.
inherit subversion
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
#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"
@ -34,41 +29,40 @@ IUSE="armitage symlink unstable mysql pcaprub postgres"
REQUIRED_USE="armitage? ( || ( mysql postgres ) )"
# blocker on ruby-1.8.7:
# http://spool.metasploit.com/pipermail/framework/2008-September/003671.html
DEPEND=""
# Note we use bundled gems (see data/msfweb/vendor/rails/) as upstream voted for
# such solution, bug #247787
RDEPEND="dev-lang/ruby
dev-ruby/rubygems
!arm? ( dev-ruby/hpricot
!sparc? ( virtual/jdk
!ppc? ( dev-ruby/rjb ) ) )
!ppc? ( dev-ruby/rjb dev-ruby/msgpack ) ) )
mysql? ( !arm? ( dev-ruby/mysql-ruby
dev-ruby/activerecord ) )
dev-ruby/activerecord[mysql] ) )
postgres? ( dev-db/postgresql-server
!arm? ( dev-ruby/pg
dev-ruby/activerecord ) )
dev-ruby/activerecord[postgres] ) )
pcaprub? ( net-libs/libpcap )
armitage? ( net-analyzer/nmap
!net-analyzer/armitage )
symlink? ( !=net-analyzer/metasploit-2.7 )"
DEPEND=""
RESTRICT="strip"
QA_EXECSTACK="
usr/lib/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin"
QA_WX_LOAD="
usr/lib/${PN}${SLOT}/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."
}
#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
@ -83,6 +77,7 @@ src_install() {
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
fowners -R root:0 /
# do not remove LICENSE, bug #238137
dodir /usr/share/doc/${PF}
@ -90,15 +85,14 @@ src_install() {
dosym /usr/share/doc/${PF}/documentation /usr/lib/${PN}${SLOT}/documentation
dodir /usr/bin/
for file in `ls msf*`; do
for file in msf*; do
dosym /usr/lib/${PN}${SLOT}/${file} /usr/bin/${file}${SLOT}
dosym /usr/lib/${PN}${SLOT}/${file} /usr/bin/${file}
done
fowners -R root:0 /
newinitd "${FILESDIR}"/msfrpcd${SLOT}.initd msfrpcd${SLOT}
newconfd "${FILESDIR}"/msfrpcd${SLOT}.confd msfrpcd${SLOT}
insinto /etc/metasploit
doins "${FILESDIR}"/armitage.yml
# Avoid useless revdep-rebuild trigger #377617
dodir /etc/revdep-rebuild/
@ -106,7 +100,8 @@ src_install() {
"${D}"/etc/revdep-rebuild/70-${PN}-${SLOT}
if use armitage; then
echo -e "#!/bin/sh \n\njava -Xmx256m -jar /usr/lib/${PN}${SLOT}/data/armitage/armitage.jar \$*\n" > armitage
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
dobin armitage
fi
@ -157,29 +152,26 @@ pkg_postinst() {
use mysql && elog "https://community.rapid7.com/docs/DOC-1265"
elog
fi
if [[ "${SRC_URI}" == "" ]] ; then
elog "If you wish to update ${PN} manually simply run:"
elog
elog "ESVN_REVISION=<rev> emerge =${PF}"
elog
elog "where <rev> is either HEAD (in case you wish to get all updates)"
elog "or specific revision number. But NOTE, this update will vanish"
elog "next time you reemerge ${PN}. To make update permanent either"
elog "create ebuild with specific revision number inside your overlay"
elog "or report revision bump bug at http://bugs.gentoo.org ."
elog
elog "In case you use portage it's also possible to create"
elog "/etc/portage/env/${CATEGORY}/${PN} file with ESVN_REVISION=<rev>"
elog "content. Then each time you run emerge ${PN} you'll have said"
elog "<rev> installed. For example, if you run"
elog " # mkdir -p /etc/portage/env/${CATEGORY}"
elog " # echo ESVN_REVISION=HEAD >> /etc/portage/env/${CATEGORY}/${PN}"
elog "each time you reemerge ${PN} it'll be updated to get all possible"
elog "updates for framework-${PV%_p*} branch."
elog "You can do similar things in paludis using /etc/paludis/bashrc."
else
ewarn "${PN} version you installed is for testing purposes only"
ewarn "as it's impossible to update it. For day by day work use"
ewarn "different version."
fi
elog "If you wish to update ${PN} manually simply run:"
elog
elog "ESVN_REVISION=<rev> emerge =${PF}"
elog
elog "where <rev> is either HEAD (in case you wish to get all updates)"
elog "or specific revision number. But NOTE, this update will vanish"
elog "next time you reemerge ${PN}. To make update permanent either"
elog "create ebuild with specific revision number inside your overlay"
elog "or report revision bump bug at http://bugs.gentoo.org ."
elog
elog "In case you use portage it's also possible to create"
elog "/etc/portage/env/${CATEGORY}/${PN} file with ESVN_REVISION=<rev>"
elog "content. Then each time you run emerge ${PN} you'll have said"
elog "<rev> installed. For example, if you run"
elog " # mkdir -p /etc/portage/env/${CATEGORY}"
elog " # echo ESVN_REVISION=HEAD >> /etc/portage/env/${CATEGORY}/${PN}"
elog "each time you reemerge ${PN} it'll be updated to get all possible"
elog "updates for framework-${PV%_p*} branch."
elog "You can do similar things in paludis using /etc/paludis/bashrc."
elog
elog "Adjust /etc/metasploit/armitage.yml and /etc/conf.d/msfrpcd${PV} files if necessary"
}