diff --git a/app-exploits/empire/Manifest b/app-exploits/empire/Manifest index 81e2fc0a2..b3a5eaeb7 100644 --- a/app-exploits/empire/Manifest +++ b/app-exploits/empire/Manifest @@ -1 +1,2 @@ DIST empire-3.6.0.tar.gz 13462705 BLAKE2B 2772cd0141b26e8788e732eba195c71fc181485364ddaf3045d2ed57da524997551d2f71993d9800af4f29cf677010e454ed369e37afdd789f0a2618f8100af2 SHA512 f9239ea13f1957eb894d3133d2e1c836b04103d85ca4a903b3934e8de8991f509dd9e57717a4a6c5b5488d661f315a1001af77feb0a02b6648fa20194c83630f +DIST empire-3.6.1.tar.gz 13477510 BLAKE2B 0b16a6c62a4d3d3cb964b22c4077d4e08c7b44f9ffeb63c7b6d38e59f7e7846fcfc85313051f7c9998b6820e4e236c4247f9e04f098f0946ba6ccd223209342e SHA512 55770e3ebf1d5ed470f710ba8909d99700b4988682f63f9a407c8fff04b67fd15de4c6b69ae60a7542df9928f06149763640838455ead7220f89c56f7f601392 diff --git a/app-exploits/empire/empire-3.6.1.ebuild b/app-exploits/empire/empire-3.6.1.ebuild new file mode 100644 index 000000000..015f8e37d --- /dev/null +++ b/app-exploits/empire/empire-3.6.1.ebuild @@ -0,0 +1,131 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +#https://github.com/BC-SECURITY/Empire/issues/196 python3.8 +PYTHON_COMPAT=( python3_{6,7} ) +PYTHON_REQ_USE="sqlite" + +inherit eutils python-single-r1 + +DESCRIPTION="A post-exploitation framework" +HOMEPAGE="https://github.com/BC-SECURITY/Empire" +SRC_URI="https://github.com/BC-SECURITY/Empire/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +KEYWORDS="amd64 x86" +LICENSE="BSD" +SLOT="0" +IUSE="powershell java" +REQUIRED_USE="powershell? ( !x86 ) + ${PYTHON_REQUIRED_USE}" + +# waiting for the upstream +# https://bugs.gentoo.org/684734 +# do we need Poetry? +RDEPEND="${PYTHON_DEPS} + $(python_gen_cond_dep ' + dev-python/urllib3[${PYTHON_MULTI_USEDEP}] + dev-python/requests[${PYTHON_MULTI_USEDEP}] + dev-python/python-iptools[${PYTHON_MULTI_USEDEP}] + dev-python/pydispatcher[${PYTHON_MULTI_USEDEP}] + dev-python/flask[${PYTHON_MULTI_USEDEP}] + dev-python/macholib[${PYTHON_MULTI_USEDEP}] + dev-python/dropbox-sdk[${PYTHON_MULTI_USEDEP}] + dev-python/pyopenssl[${PYTHON_MULTI_USEDEP}] + dev-python/pyinstaller[${PYTHON_MULTI_USEDEP}] + dev-python/zlib_wrapper[${PYTHON_MULTI_USEDEP}] + dev-python/netifaces[${PYTHON_MULTI_USEDEP}] + dev-python/m2crypto[${PYTHON_MULTI_USEDEP}] + dev-python/jinja[${PYTHON_MULTI_USEDEP}] + dev-python/cryptography[${PYTHON_MULTI_USEDEP}] + dev-python/pyminifier[${PYTHON_MULTI_USEDEP}] + dev-python/xlutils[${PYTHON_MULTI_USEDEP}] + dev-python/pefile[${PYTHON_MULTI_USEDEP}] + dev-python/simplejson[${PYTHON_MULTI_USEDEP}] + dev-python/bcrypt[${PYTHON_MULTI_USEDEP}] + dev-python/pycryptodome[${PYTHON_MULTI_USEDEP}] + dev-python/pyparsing[${PYTHON_MULTI_USEDEP}] + dev-python/flask-socketio[${PYTHON_MULTI_USEDEP}] + ') + powershell? ( + !x86? ( app-shells/pwsh-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}" + default +} + +#https://github.com/BC-SECURITY/Empire/issues/39 +src_install() { + insinto "/usr/share/${PN}" + doins -r data/ lib/ plugins/ setup/ empire + + python_optimize "${D}/usr/share/${PN}/lib" + + 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" + python3 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.pentoo.ch" \ + -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 "See the following bug report for more details:" + ewarn "https://github.com/BC-SECURITY/Empire/issues/39" + ewarn + 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" +}