empire: cleanup old, python2 only

This commit is contained in:
blshkv 2020-01-07 17:15:04 +08:00
parent e1945e082f
commit 2bc807ac95
No known key found for this signature in database
GPG key ID: 273E3E90D1A6294F
2 changed files with 0 additions and 127 deletions

View file

@ -1,3 +1,2 @@
DIST empire-2.5.tar.gz 8286024 BLAKE2B a16677ef32f6f7f9f34d247d0804763fa475d7699ec52dce246cbf3c2f3d9c3e0cb7e2dcc0def01a7df7aa32040e996e64507b0b73f7c6db2a18d610a1ef0d94 SHA512 aeb3f861d407971376e26b970d597716bdd6e3668dc5208de09c3e9ccf23f11d8467ab5f29c76cc192bb33de95a89388c382a5aae55f8629bff1c638228a4b81
DIST empire-3.0.0.tar.gz 16456034 BLAKE2B 5d0067e42d93681a88ee2760a4dc171a8f4bfa096f95181f374ef0b01e71b60a3dff5e9abfc35fefed6fa1369a00089f86cfb4359c6b9086695f210fc7d0f4ab SHA512 63b5ca28feb9afcb3b6b98d6cba0d326e6bf5ecb556dfe9c2771ef128c5a676975a17da522d6afcd8e6c7eba3f1c1d44d45bd0576ad180b9b291c2d8c08574c1
DIST empire-3.0.1.tar.gz 16456045 BLAKE2B 281bad041d9d408699df1f34f3d69e9f4470b08c6bef396ed440bcdbbd8e4e21e7cfc91ea2bff1067b9d6750f89226d43be30c940a66d8adaaac1117572aa20f SHA512 ea0e84e13c522a712c95cbfbf1268f44c1b653bdf3acdcc65e9e66044a917eaa6217d2205859cc51c5240cba27afc3d66584ca5c0e7ee4b84a2c2786cff6715f

View file

@ -1,126 +0,0 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python2_7 )
PYTHON_REQ_USE="sqlite"
inherit eutils python-single-r1
DESCRIPTION="A post-exploitation framework"
HOMEPAGE="https://github.com/EmpireProject/Empire"
SRC_URI="https://github.com/EmpireProject/Empire/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~x86"
LICENSE="BSD"
SLOT="0"
IUSE="powershell java"
REQUIRED_USE="powershell? ( amd64 )"
RDEPEND="${PYTHON_DEPS}
dev-python/xlrd[${PYTHON_USEDEP}]
dev-python/xlwt[${PYTHON_USEDEP}]
dev-python/urllib3[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}]
dev-python/python-iptools[${PYTHON_USEDEP}]
dev-python/pydispatcher[${PYTHON_USEDEP}]
dev-python/flask[${PYTHON_USEDEP}]
dev-python/macholib[${PYTHON_USEDEP}]
dev-python/dropbox-sdk[${PYTHON_USEDEP}]
dev-python/pyopenssl[${PYTHON_USEDEP}]
dev-python/pyinstaller[${PYTHON_USEDEP}]
dev-python/zlib_wrapper[${PYTHON_USEDEP}]
dev-python/netifaces[${PYTHON_USEDEP}]
dev-python/m2crypto[${PYTHON_USEDEP}]
dev-python/jinja[${PYTHON_USEDEP}]
dev-python/cryptography[${PYTHON_USEDEP}]
dev-python/pyminifier[${PYTHON_USEDEP}]
dev-python/xlutils[${PYTHON_USEDEP}]
dev-python/pycryptodome[${PYTHON_USEDEP}]
dev-python/pefile[${PYTHON_USEDEP}]
powershell? (
amd64? ( dev-lang/powershell-bin ) )
java? (
|| ( virtual/jre:* virtual/jdk:* ) )"
DEPEND="${RDEPEND}"
S="${WORKDIR}/Empire-${PV}"
pkg_setup() {
python-single-r1_pkg_setup
}
src_prepare() {
python_fix_shebang "${S}"
sed -i \
-e "s|STAGING_KEY, INSTALL_PATH|STAGING_KEY, \"/usr/share/${PN}/\"|" \
setup/setup_database.py || die
# set empty password for database
echo | ${PYTHON} setup/setup_database.py || die
default
}
src_install() {
insinto "/usr/share/${PN}"
doins -r data/ lib/ plugins/ setup/ empire
python_optimize "${D}/usr/share/${PN}/lib" > /dev/null 2>&1
make_wrapper $PN \
"${PYTHON} /usr/share/${PN}/empire" \
"/usr/share/${PN}"
dodoc README.md Dockerfile changelog
}
pkg_config() {
local _yesno_ask
local _em_home="${EROOT}/usr/share/${PN}"
pushd "${_em_home}" >/dev/null || die
if [ -f "${_em_home}/data/empire.db" ]; then
ewarn "Drop old database "${_em_home}/data/empire.db" for new configuring ..."
read -r -p " [>] Are you sure? [y/N] " _yesno_ask
if [[ ${_yesno_ask,,} =~ ^(yes|y)$ ]]; then
rm -f data/empire.db > /dev/null 2>&1 || die
else
return
fi
fi
ebegin "Press ENTER to create password for database or Control-C to abort now"
python2 setup/setup_database.py
eend ${?} || die
if [ -f "${_em_home}/data/empire-chain.pem" ] || [ -f "${_em_home}/data/empire-priv.key" ]; then
ewarn "Drop old ${_em_home}/data/empire-chain.pem and generate new cert ..."
read -r -p " [>] Are you sure? [y/N] " _yesno_ask
if [[ ${_yesno_ask,,} =~ ^(yes|y)$ ]]; then
rm -f data/{empire-chain.pem,empire-priv.key} > /dev/null 2>&1 || die
else
return
fi
fi
openssl req -newkey rsa:2048 -new -nodes -x509 \
-subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" \
-keyout data/empire-priv.key \
-out data/empire-chain.pem || die
popd >/dev/null || die
}
pkg_postinst() {
ewarn "\nWarning. This software does not support system-wide installation"
ewarn "You need to run it from /usr/share/${PN} directory under 'root' account"
ewarn "\nPlease configure your installation before using:"
ewarn " emerge --config \"=${CATEGORY}/${PF}\"\n"
}