diff --git a/net-wireless/hostapd-mana/files/crackapd.conf b/net-wireless/hostapd-mana/files/crackapd.conf new file mode 100755 index 000000000..4768f26d5 --- /dev/null +++ b/net-wireless/hostapd-mana/files/crackapd.conf @@ -0,0 +1,41 @@ +# SensePost PythonTemplate +# +# Copyright (C) 2012 SensePost +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# This file contains configuration options for the script. +# Configuration options should be valid python variable declarations + +# Control verboseness +VERBOSE=1 + +# Thread Count - this will control how many threads are spawned. +THREADS=10 + +# Thread Control - this file will be created when crackapd is run. +# Removing this file will cause crackapd to exit. +RUNFILE="/tmp/crackapd.run" + +# HostAPD - This is where the hostapd configuration file is +HOSTAPD="/etc/hostapd-mana/hostapd-karma-eap.conf" + +# The EAP User file (to add cracked credentials to. +EAPUSER="/etc/hostapd-mana/hostapd.eap_user" + +# The script used to crack the hashes +CRACKEX="/usr/sbin/asleap" + +# The wordlist to use for cracking +WORDLST="/usr/share/wordlists/rockyou.txt" diff --git a/net-wireless/hostapd-mana/files/crackapd_pentoo.patch b/net-wireless/hostapd-mana/files/crackapd_pentoo.patch new file mode 100644 index 000000000..2a8a31a76 --- /dev/null +++ b/net-wireless/hostapd-mana/files/crackapd_pentoo.patch @@ -0,0 +1,34 @@ +diff -ur a/crackapd/crackapd.py b/crackapd/crackapd.py +--- a/crackapd/crackapd.py 2019-01-10 16:26:23.000000000 +0300 ++++ b/crackapd/crackapd.py 2019-09-22 08:11:09.714715885 +0300 +@@ -50,7 +50,7 @@ + f = open(s_file, 'a') + f.write(str(s_string) + "\n") + f.close() +- s = str("pkill -SIGHUP hostapd") ++ s = str("pkill -SIGHUP hostapd-mana") + p = os.popen(s, "r") + while 1: + line = p.readline() +@@ -102,16 +102,16 @@ + + # We start off getting the path of the file being executed, and replace python script name with nada + # The will give us a base directory we can work from +- THEPATH=str(os.path.realpath(__file__)).replace("crackapd.py", "") ++ THEPATH=str("/etc/hostapd-mana/") + + # Global Variables. These get overwritten in config file... + VERBOSE=1 + THREADS=10 + RUNFILE="/tmp/crackapd.run" +- HOSTAPD="/etc/mana-toolkit/hostapd-karma-eap.conf" +- EAPUSER="/etc/mana-toolkit/hostapd.eap_user" +- ENNODES="/var/lib/mana-toolkit/ennode.node" +- CRACKEX="/usr/bin/asleap" ++ HOSTAPD="/etc/hostapd-mana/hostapd-karma-eap.conf" ++ EAPUSER="/etc/hostapd-mana/hostapd.eap_user" ++ ENNODES="/var/lib/hostapd-mana/ennode.node" ++ CRACKEX="/usr/sbin/asleap" + WORDLST="/usr/share/wordlists/rockyou.txt" + + # Global Variables. These are calculated... :P diff --git a/net-wireless/hostapd-mana/files/update_hostapd.conf.patch b/net-wireless/hostapd-mana/files/update_hostapd.conf.patch new file mode 100644 index 000000000..ffd4960f4 --- /dev/null +++ b/net-wireless/hostapd-mana/files/update_hostapd.conf.patch @@ -0,0 +1,21 @@ +diff -ur a/hostapd/hostapd.conf b/hostapd/hostapd.conf +--- a/hostapd/hostapd.conf 2019-01-10 16:26:23.000000000 +0300 ++++ b/hostapd/hostapd.conf 2019-09-22 10:01:40.958822235 +0300 +@@ -65,7 +65,7 @@ + # Enabled Sycophant + # Allows relaying of inner EAP authentication methods with a modified wpa_supplicant + # wpa_sycophant is available at https://github.com/sensepost/wpa_sycophant +-#enable_sycophant=1 ++enable_sycophant=1 + + # Sycophant state file directory + # Sycophant communicates with wpa_sycophant through several files +@@ -138,7 +138,7 @@ + # than one interface is used. + # /var/run/hostapd is the recommended directory for sockets and by default, + # hostapd_cli will use it when trying to connect with hostapd. +-ctrl_interface=/var/run/hostapd ++ctrl_interface=/var/run/hostapd-mana + + # Access control for the control interface can be configured by setting the + # directory to allow only members of a group to use sockets. This way, it is diff --git a/net-wireless/hostapd-mana/hostapd-mana-2.6.5.ebuild b/net-wireless/hostapd-mana/hostapd-mana-2.6.5.ebuild deleted file mode 100644 index cd6e17f53..000000000 --- a/net-wireless/hostapd-mana/hostapd-mana-2.6.5.ebuild +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python2_7 ) - -inherit python-r1 toolchain-funcs systemd savedconfig - -DESCRIPTION="SensePost's modified hostapd for wifi attacks" -HOMEPAGE="https://w1f1.net https://github.com/sensepost/hostapd-mana" - -if [[ $PV == *9999 ]]; then - inherit git-r3 - EGIT_REPO_URI="https://github.com/sensepost/hostapd-mana.git" -else - SRC_URI="https://github.com/sensepost/hostapd-mana/archive/${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~x86" -fi - -LICENSE="BSD" -SLOT="0" -IUSE="+crackapd" - -DEPEND=" - crackapd? ( ${PYTHON_DEPS} ) - dev-libs/openssl:0=[-bindist] - dev-libs/libnl:3" - -RDEPEND="${DEPEND}" - -MY_PN="${PN%-mana}" -S="${S}/${MY_PN}" - -src_prepare() { - #sed -e "s:/etc/hostapd:/etc/${PN}:g" \ - # -i "${S}/hostapd.conf" || die - - if use crackapd; then - sed -e "s/THEPATH + str('crackapd.conf')/str('\/etc\/mana-toolkit\/crackapd.conf')/" \ - -i ../crackapd/crackapd.py || die - fi - - # Allow users to apply patches to src/drivers for example, - # i.e. anything outside ${S}/${MY_PN} - pushd ../ >/dev/null || die - default - popd >/dev/null || die -} - -src_configure() { - restore_config .config - default_src_configure -} - -src_compile() { - emake V=1 -} - -src_install() { - #insinto "/etc/${PN}" - #doins ${MY_PN}.{conf,accept,deny,eap_user,radius_clients,sim_db,wpa_psk} - - newsbin ${MY_PN} hostapd-mana - newbin ${MY_PN}_cli hostapd-mana_cli - - if use crackapd; then - insinto "/etc/${PN}" - - pushd ../crackapd >/dev/null || die - doins crackapd.conf - python_foreach_impl python_newscript crackapd.py crackapd - - popd >/dev/null || die - fi - - fperms -R 600 "/etc/${PN}" - - doman ${MY_PN}{.8,_cli.1} - - dodoc ChangeLog README - - docinto examples - dodoc wired.conf - - save_config .config -} diff --git a/net-wireless/hostapd-mana/hostapd-mana-2.6.5.ebuild b/net-wireless/hostapd-mana/hostapd-mana-2.6.5.ebuild new file mode 120000 index 000000000..fba7ed3fa --- /dev/null +++ b/net-wireless/hostapd-mana/hostapd-mana-2.6.5.ebuild @@ -0,0 +1 @@ +./hostapd-mana-9999.ebuild \ No newline at end of file diff --git a/net-wireless/hostapd-mana/hostapd-mana-9999.ebuild b/net-wireless/hostapd-mana/hostapd-mana-9999.ebuild new file mode 100644 index 000000000..44b72b26d --- /dev/null +++ b/net-wireless/hostapd-mana/hostapd-mana-9999.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python2_7 ) + +inherit python-r1 toolchain-funcs savedconfig + +DESCRIPTION="SensePost's modified hostapd for wifi attacks" +HOMEPAGE="https://w1f1.net https://github.com/sensepost/hostapd-mana" + +if [[ $PV == *9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://github.com/sensepost/hostapd-mana.git" +else + SRC_URI="https://github.com/sensepost/hostapd-mana/archive/${PV}.tar.gz -> ${P}.tar.gz" + KEYWORDS="~amd64 ~x86" +fi + +LICENSE="BSD" +SLOT="0" +IUSE="+crackapd" + +DEPEND=" + crackapd? ( + ${PYTHON_DEPS} + app-crypt/asleap + ) + dev-libs/openssl:0=[-bindist] + dev-libs/libnl:3 + net-libs/libnfnetlink" + +RDEPEND="${DEPEND}" + +MY_PN="${PN%-mana}" +S="${S}/${MY_PN}" + +src_prepare() { + sed -e "s:/etc/hostapd:/etc/${PN}:g" \ + -i "${S}/hostapd.conf" || die + + # Allow users to apply patches to src/drivers for example, + # i.e. anything outside ${S}/${MY_PN} + pushd ../ >/dev/null || die + + eapply "${FILESDIR}"/crackapd_pentoo.patch + eapply "${FILESDIR}"/update_hostapd.conf.patch + + default + + popd >/dev/null || die +} + +src_configure() { + restore_config .config + default_src_configure +} + +src_compile() { + emake V=1 +} + +src_install() { + insinto "/etc/${PN}" + doins ${MY_PN}.{conf,accept,deny,eap_user,radius_clients,sim_db,wpa_psk} + + newsbin ${MY_PN} hostapd-mana + newbin ${MY_PN}_cli hostapd-mana_cli + + if use crackapd; then + insinto "/etc/${PN}" + + pushd ../crackapd >/dev/null || die + doins "${FILESDIR}"/crackapd.conf + python_foreach_impl python_newscript crackapd.py crackapd + + popd >/dev/null || die + fi + + fperms -R 600 "/etc/${PN}" + + dodoc ChangeLog README + + save_config .config +}