From d542c9e69f33e5561c80ef05f024f99d1e0dc9bd Mon Sep 17 00:00:00 2001 From: grimmlin Date: Mon, 29 Dec 2008 15:25:17 +0000 Subject: [PATCH] * Added bleeding edge msf --- net-analyzer/metasploit/Manifest | 5 + net-analyzer/metasploit/files/msfweb.confd | 13 +++ net-analyzer/metasploit/files/msfweb.initd | 18 +++ net-analyzer/metasploit/files/msfweb3.confd | 10 ++ net-analyzer/metasploit/files/msfweb3.initd | 19 ++++ .../metasploit/metasploit-9999.ebuild | 104 ++++++++++++++++++ 6 files changed, 169 insertions(+) create mode 100644 net-analyzer/metasploit/Manifest create mode 100644 net-analyzer/metasploit/files/msfweb.confd create mode 100644 net-analyzer/metasploit/files/msfweb.initd create mode 100644 net-analyzer/metasploit/files/msfweb3.confd create mode 100644 net-analyzer/metasploit/files/msfweb3.initd create mode 100644 net-analyzer/metasploit/metasploit-9999.ebuild diff --git a/net-analyzer/metasploit/Manifest b/net-analyzer/metasploit/Manifest new file mode 100644 index 000000000..1b8ad66aa --- /dev/null +++ b/net-analyzer/metasploit/Manifest @@ -0,0 +1,5 @@ +AUX msfweb.confd 273 RMD160 35c10406c74e431aa592c7af6d14f813ad18b984 SHA1 66cff0fe0423baa89ffdd3745b7195ae0f0bf273 SHA256 006040ecd27dc0279c2bea6d69365fe1f0d66f507c039ae43720662abe9f4460 +AUX msfweb.initd 533 RMD160 44f94381ae9488fb2e3c6f700458798b692971d7 SHA1 9b62d7d85af34430dda55a192460caae258ba978 SHA256 4fd9668e4b467ecfa5160e2c108ac8ace71fbeaefaf829d2f7bfb566d44bb13c +AUX msfweb3.confd 234 RMD160 2cad154dc7ac4e836e8b4dd8c4366521742f90b3 SHA1 c3bac2879f00f56ff0a0737eea6a4d200f5761c9 SHA256 bc911b32a2c81d337135c7614e0982e102056fb174d274177cc2b8aca717e97f +AUX msfweb3.initd 578 RMD160 47baabd2beb338fd8a067694830400801a028c1a SHA1 6a5ec10c2c82925e6e731c46f8b0fcfa607b9502 SHA256 79c74ded23d8541cf470e6c24aa2ebf45bcb4460e456c273ec0e1da4d156f066 +EBUILD metasploit-9999.ebuild 3806 RMD160 107b26020bdd6c65c0e2bad49c9e68344dfdeb56 SHA1 50e7ecbcfdc49c3eb1acfd62404c762f19d6e94a SHA256 8b94dbc79474aa6a2f814d74e41f0fb3403e634c5c91154437b6fe0256a0561c diff --git a/net-analyzer/metasploit/files/msfweb.confd b/net-analyzer/metasploit/files/msfweb.confd new file mode 100644 index 000000000..3e9fa64d9 --- /dev/null +++ b/net-analyzer/metasploit/files/msfweb.confd @@ -0,0 +1,13 @@ +# Config file for /etc/init.d/metasploit + +# Pidfile +PIDFILE=/var/run/msfweb.pid + +# Bind to the following IP instead of the loopback address +IPADDR=127.0.0.1 + +# Bind to the following TCP port instead of default 55555 +PORT=55555 + +# All options +MSF_OPTS="-a $IPADDR -p $PORT" diff --git a/net-analyzer/metasploit/files/msfweb.initd b/net-analyzer/metasploit/files/msfweb.initd new file mode 100644 index 000000000..e94ab33e8 --- /dev/null +++ b/net-analyzer/metasploit/files/msfweb.initd @@ -0,0 +1,18 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-analyzer/metasploit/files/msfweb.initd,v 1.3 2006/11/03 12:08:57 pva Exp $ + +start() { + ebegin "Starting msfweb" + start-stop-daemon --start --quiet --background --exec /usr/bin/msfweb \ + --pidfile ${PIDFILE} --make-pidfile -- ${MSF_OPTS} + eend $? +} + +stop() { + ebegin "Stopping msfweb" + start-stop-daemon --stop --quiet --pidfile ${PIDFILE} + rm -f ${PIDFILE} + eend $? +} diff --git a/net-analyzer/metasploit/files/msfweb3.confd b/net-analyzer/metasploit/files/msfweb3.confd new file mode 100644 index 000000000..b0cf87e6d --- /dev/null +++ b/net-analyzer/metasploit/files/msfweb3.confd @@ -0,0 +1,10 @@ +# Config file for /etc/init.d/metasploit + +# Bind to the following IP instead of the loopback address +IPADDR=127.0.0.1 + +# Bind to the following TCP port instead of default 55555 +PORT=55555 + +# All options +MSF_OPTS="-a $IPADDR -p $PORT" diff --git a/net-analyzer/metasploit/files/msfweb3.initd b/net-analyzer/metasploit/files/msfweb3.initd new file mode 100644 index 000000000..67cba7696 --- /dev/null +++ b/net-analyzer/metasploit/files/msfweb3.initd @@ -0,0 +1,19 @@ +#!/sbin/runscript +# Copyright 1999-2005 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 $ + +PIDFILE=/var/run/msfweb3.pid + +start() { + ebegin "Starting msfweb3" + start-stop-daemon --start --quiet --background --startas /usr/bin/msfweb3 --exec /usr/bin/ruby \ + --pidfile ${PIDFILE} --make-pidfile -- ${MSF_OPTS} + eend $? +} + +stop() { + ebegin "Stopping msfweb" + start-stop-daemon --stop --quiet -s 9 --pidfile ${PIDFILE} + eend $? +} diff --git a/net-analyzer/metasploit/metasploit-9999.ebuild b/net-analyzer/metasploit/metasploit-9999.ebuild new file mode 100644 index 000000000..dc0dbf316 --- /dev/null +++ b/net-analyzer/metasploit/metasploit-9999.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $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 $ + +MY_P=${PN/metasploit/framework}-${PV} + +# Metasploit uses subversion as a *normal* update mechanism for stable branches +# of the package. This ebuild uses _p inside $PV to install updated up +# to revision version of framework. For more information, take a look +# at bug #195924. +inherit subversion +SRC_URI="" +MTSLPT_REV=${BASH_REMATCH[2]} +ESVN_REPO_URI="https://metasploit.com/svn/framework3/trunk/" + +DESCRIPTION="Advanced open-source framework for developing, testing, and using vulnerability exploit code" +HOMEPAGE="http://www.metasploit.org/" + +LICENSE="MSF-1.2" +SLOT="3" +KEYWORDS="amd64 ppc ~sparc x86" +IUSE="gtk sqlite sqlite3 postgres httpd" + +# blocker on ruby-1.8.7: +# http://spool.metasploit.com/pipermail/framework/2008-September/003671.html +RDEPEND="dev-lang/ruby + !>=dev-lang/ruby-1.8.7 + gtk? ( dev-ruby/ruby-libglade2 ) + httpd? ( =dev-ruby/rails-1.2* ) + sqlite? ( dev-ruby/sqlite-ruby + dev-ruby/activerecord ) + sqlite3? ( dev-ruby/sqlite3-ruby + dev-ruby/activerecord ) + postgres? ( dev-ruby/ruby-postgres + dev-ruby/activerecord )" +DEPEND="" + +S=${WORKDIR}/${MY_P} + +src_compile() { + sed -i -e "s/RAILS_GEM_VERSION = '1.2.2'/RAILS_GEM_VERSION = '1.2'/" \ + data/msfweb/config/environment.rb || die "sed failed" + sed -i \ + 's#http://metasploit3.com/msf/support#http://metasploit.com/framework/support#' \ + lib/msf/ui/gtk2/app.rb +} + +src_install() { + if [[ "${SRC_URI}" != "" ]] ; then + find "${S}" -type d -name ".svn" -print0 | xargs -0 -n1 rm -R + fi + + # 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 + + # do not remove LICENSE, bug #238137 + dodir /usr/share/doc/${PF} + cp -R "${S}"/{documentation,README} "${D}"/usr/share/doc/${PF} + dosym /usr/share/doc/${PF}/documentation /usr/lib/${PN}${SLOT}/documentation + + dodir /usr/bin/ + for file in `ls msf*`; do + dosym /usr/lib/${PN}${SLOT}/${file} /usr/bin/${file}${SLOT} + done + + chown -R root:0 "${D}" + + if use httpd; then + newinitd "${FILESDIR}"/msfweb${SLOT}.initd msfweb${SLOT} \ + || die "newinitd failed" + newconfd "${FILESDIR}"/msfweb${SLOT}.confd msfweb${SLOT} \ + || die "newconfd failed" + fi +} + +pkg_postinst() { + if [[ "${SRC_URI}" == "" ]] ; then + elog "If you wish to update ${PN} manually simply run:" + elog + elog "ESVN_REVISION= emerge =${PF}" + elog + elog "where 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=" + elog "content. Then each time you run emerge ${PN} you'll have said" + elog " 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 +}