From 46a8114a3bbfea4ce369f469e17206fc1b65793d Mon Sep 17 00:00:00 2001 From: Erik Dubois Date: Thu, 1 Feb 2018 16:22:40 +0100 Subject: [PATCH] Add build option for arch linux --- attacks/Captive Portal/attack.sh | 5 +-- bin/arch/PKGBUILD | 66 ++++++++++++++++++++++++++++++++ fluxion | 31 +++++++++------ 3 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 bin/arch/PKGBUILD diff --git a/attacks/Captive Portal/attack.sh b/attacks/Captive Portal/attack.sh index 3f8d2ee..b7636dc 100755 --- a/attacks/Captive Portal/attack.sh +++ b/attacks/Captive Portal/attack.sh @@ -1055,10 +1055,9 @@ captive_portal_generic() { } captive_portal_unset_routes() { - if [ -f "$FLUXIONWorkspacePath/iptables-rules" ]; then - iptables-restore <"$FLUXIONWorkspacePath/iptables-rules" \ + if [ -f "$FLUXIONIPTablesBackup" ]; then + iptables-restore <"$FLUXIONIPTablesBackup" \ &> $FLUXIONOutputDevice - sandbox_remove_workfile "$FLUXIONWorkspacePath/iptables-rules" else iptables --flush iptables --table nat --flush diff --git a/bin/arch/PKGBUILD b/bin/arch/PKGBUILD new file mode 100644 index 0000000..3640785 --- /dev/null +++ b/bin/arch/PKGBUILD @@ -0,0 +1,66 @@ +# Maintainer: Cyberfee + +_pkgname=fluxion +pkgname=$_pkgname-git +pkgver=r1183.63b821f +pkgrel=1 +pkgdesc='Fluxion is a security auditing and social-engineering research tool' +url='https://github.com/FluxionNetwork/fluxion' +license=('GPL3') +source=('git://github.com/FluxionNetwork/fluxion.git#branch=master') + +depends=( + 'aircrack-ng' 'bash>=4.2' 'coreutils' + 'awk' 'iw' 'unzip' + 'curl' 'bc' 'xterm' +) + +makedepends=('binutils' 'coreutils' 'git') +conflicts=('fluxion-git') +provides=('fluxion-git') +sha256sums=('SKIP') +arch=('any') + +prepare() { + if [ -d "$srcdir/$pkgname" ]; then + rm -rf "$srcdir/$pkgname" + fi + + mkdir -p "$srcdir/$pkgname" + cd "$srcdir/$pkgname" +} + +pkgver() { + cd "$srcdir/$_pkgname" + + ( set -o pipefail + git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) +} + +prepare() { + cd "$srcdir/$_pkgname" +} + +package() { + cd "$srcdir/$_pkgname" + + mkdir -p "$pkgdir/usr/bin" + mkdir -p "$pkgdir/usr/share/fluxion" + + install -Dm644 -t "$pkgdir/usr/share/doc/fluxion/" README.md + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/airgeddon/LICENSE" + + rm -rf *.md .git* *.yml .project .editorconfig + + cp -a --no-preserve=ownership * "$pkgdir/usr/share/fluxion" + + cat > "$pkgdir/usr/bin/fluxion" << EOF +#!/bin/sh +cd /usr/share/fluxion +exec bash fluxion.sh "\${@}" +EOF + + chmod a+x "$pkgdir/usr/bin/fluxion" +} \ No newline at end of file diff --git a/fluxion b/fluxion index 9e24cf2..cf44983 100755 --- a/fluxion +++ b/fluxion @@ -12,6 +12,7 @@ readonly FLUXIONPath=$(cd "$(dirname "$0")"; pwd -P) # Path to the temp. directory available to FLUXION & subscripts. readonly FLUXIONWorkspacePath="/tmp/fluxspace" +readonly FLUXIONIPTablesBackup="$FLUXIONPath/iptables-rules" # Path to FLUXION's preferences file, to be loaded afterward. readonly FLUXIONLanguagePreferencesFile="$FLUXIONPath/preferences/LanguagePreference.conf" @@ -22,15 +23,11 @@ readonly FLUXIONNoiseFloor=-90 readonly FLUXIONNoiseCeiling=-60 readonly FLUXIONVersion=4 -readonly FLUXIONRevision=2 +readonly FLUXIONRevision=3 # Declare window ration bigger = smaller windows FLUXIONWindowRatio=4 -# Print help if it is true -FluxionHelpTrue=false - - # ============================================================ # # ================= < Script Sanity Checks > ================= # # ============================================================ # @@ -102,8 +99,7 @@ readonly FLUXIONCLIArguments=${FLUXIONCLIArguments%%--*} # ============= < Argument Loaded Configurables > ============ # eval set -- "$FLUXIONCLIArguments" # Set environment parameters. -#[ "$1" != "" ] && readonly FLUXIONAuto=1 # Auto-mode if using CLI. - +[ "$1" != "" ] && readonly FLUXIONAuto=1 # Auto-mode if using CLI. while [ "$1" != "" -a "$1" != "--" ]; do case "$1" in -v|--version) echo "FLUXION V$FLUXIONVersion.$FLUXIONRevision"; exit;; @@ -211,7 +207,7 @@ fluxion_startup() { if [ "$FLUXIONDebug" ]; then return 1; fi # Make sure that we save the iptable files - iptables-save >"$FLUXIONWorkspacePath/iptables-rules" + iptables-save >"$FLUXIONIPTablesBackup" local banner=() format_center_literals \ @@ -339,6 +335,17 @@ fluxion_shutdown() { done fi + echo -e "$CWht[$CRed-$CWht] $FLUXIONDisablingCleaningIPTablesNotice$CClr" + if [ -f "$FLUXIONIPTablesBackup" ]; then + iptables-restore <"$FLUXIONIPTablesBackup" \ + &> $FLUXIONOutputDevice + else + iptables --flush + iptables --table nat --flush + iptables --delete-chain + iptables --table nat --delete-chain + fi + echo -e "$CWht[$CRed-$CWht] $FLUXIONRestoringTputNotice$CClr" tput cnorm @@ -352,9 +359,11 @@ fluxion_shutdown() { # TODO: Add support for other network managers (wpa_supplicant?). if [ $(which systemctl) ]; then - service network-manager restart &> $FLUXIONOutputDevice & - service networkmanager restart &> $FLUXIONOutputDevice & - service networking restart &> $FLUXIONOutputDevice & + if [ $(which service) ];then + service network-manager restart &> $FLUXIONOutputDevice & + service networkmanager restart &> $FLUXIONOutputDevice & + service networking restart &> $FLUXIONOutputDevice & + fi else systemctl restart network-manager.service &> $FLUXIONOutputDevice & fi