diff --git a/app-exploits/empire/empire-4.1.3-r1.ebuild b/app-exploits/empire/empire-4.1.3-r1.ebuild new file mode 100644 index 00000000000..dd3adc74def --- /dev/null +++ b/app-exploits/empire/empire-4.1.3-r1.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_USE_SETUPTOOLS=pyproject.toml +PYTHON_COMPAT=( python3_{8..9} ) +PYTHON_REQ_USE="sqlite" + +inherit distutils-r1 eutils + +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" + +#https://github.com/BC-SECURITY/Empire/issues/39 +#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 +# https://github.com/BC-SECURITY/Empire/issues/196 +RDEPEND=" + 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/jinja[${PYTHON_USEDEP}] + dev-python/pyminifier[${PYTHON_USEDEP}] + dev-python/xlutils[${PYTHON_USEDEP}] + dev-python/pefile[${PYTHON_USEDEP}] + dev-python/bcrypt[${PYTHON_USEDEP}] + dev-python/pyparsing[${PYTHON_USEDEP}] + dev-python/pymysql[${PYTHON_USEDEP}] + dev-python/sqlalchemy[${PYTHON_USEDEP}] + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/sqlalchemy_utc[${PYTHON_USEDEP}] + >=dev-python/prompt_toolkit-3.0.9[${PYTHON_USEDEP}] + >=dev-python/terminaltables-3.1.0[${PYTHON_USEDEP}] + >=dev-python/docopt-0.6.2[${PYTHON_USEDEP}] + >=dev-python/humanize-3.2.0[${PYTHON_USEDEP}] + >=dev-python/pydantic-1.8.1[${PYTHON_USEDEP}] + dev-python/pycryptodome[${PYTHON_USEDEP}] + dev-python/cryptography[${PYTHON_USEDEP}] + dev-python/flask-socketio[${PYTHON_USEDEP}] + dev-python/python-socketio[${PYTHON_USEDEP}] + dev-python/jq[${PYTHON_USEDEP}] + + powershell? ( + !x86? ( app-shells/pwsh-bin ) ) + java? ( + || ( virtual/jre:* virtual/jdk:* ) )" + +DEPEND="${RDEPEND}" + +S="${WORKDIR}/Empire-${PV}" + +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" +}