Fix encoding and permission issues

This commit is contained in:
deltax 2017-06-28 15:51:34 +02:00
parent 9534d9109b
commit 6e5465f933
16 changed files with 37 additions and 392 deletions

0
Makefile Normal file → Executable file
View File

View File

@ -1 +0,0 @@
theme: jekyll-theme-slate

9
bash
View File

@ -1,9 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /fluxion was not found on this server.</p>
<p>Additionally, a 404 Not Found
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>

View File

@ -1,20 +0,0 @@
----------------------- General -----------------------
revision=1
---------------------- Changelog ----------------------
[Version: 2 , Revision 1]
- rewrite code
- move files
- exitmode to lib/
- source files to language
- improve handeling
- remove disclaimer
- remove git support
- add checkupdate function
- fix airmon file
---------------------- Changelog ----------------------

View File

@ -36,7 +36,7 @@ HANDSHAKE_PATH="/root/handshakes"
PASSLOG_PATH="/root/pwlog"
WORK_DIR=`pwd`
DEAUTHTIME="9999999999999"
revision=8
revision=9
version=2
IP=192.168.1.1
RANG_IP=$(echo $IP | cut -d "." -f 1,2,3)
@ -55,7 +55,6 @@ Fiuscha="\033[0;35m"
blue="\033[1;34m"
transparent="\e[0m"
general_back="Back"
general_error_1="Not_Found"
general_case_error="Unknown option. Choose again"
@ -88,7 +87,7 @@ function conditional_clear() {
}
function airmon {
chmod +x lib/airmon/airmon
chmod +x lib/airmon/airmon.sh
}
airmon
@ -132,7 +131,7 @@ fi
#Function to executed in case of unexpected termination
trap exitmode SIGINT SIGHUP
source lib/exitmode
source lib/exitmode.sh
#Languages for the web interface
source language/source
@ -151,13 +150,6 @@ function top(){
}
##################################### < END OF CONFIGURATION SECTION > #####################################
############################################## < START > ##############################################
# Check requirements
@ -425,14 +417,12 @@ if [ $FLUX_DEBUG != 1 ]; then
echo -ne "$transparent"
doupdate=${doupdate:-"Y"}
if [ "$doupdate" = "Y" ]; then
cp $0 $HOME/flux_rev-$revision.backup
curl "https://raw.githubusercontent.com/FluxionNetwork/fluxion/master/fluxion" -s -o $0
echo
echo
echo -e ""$red"
Updated successfully! Restarting the script to apply the changes ..."$transparent""
Updated successfully! Restarting the script to apply the changes ..."$transparent""
sleep 3
chmod +x $0
exec $0
@ -459,14 +449,6 @@ function infoap {
echo -e " "$blue"BSSID"$transparent" = $mac (\e[1;33m$Host_MAC_MODEL $transparent)"
echo
}
############################################## < START > ##############################################
############################################### < MENU > ###############################################
# Windows + Resolution
@ -612,8 +594,8 @@ function setinterface {
done
# Create a variable with the list of physical network interfaces
readarray -t wirelessifaces < <(./lib/airmon/airmon |grep "-" | cut -d- -f1)
INTERFACESNUMBER=`./lib/airmon/airmon | grep -c "-"`
readarray -t wirelessifaces < <(./lib/airmon/airmon.sh |grep "-" | cut -d- -f1)
INTERFACESNUMBER=`./lib/airmon/airmon.sh | grep -c "-"`
if [ "$INTERFACESNUMBER" -gt "0" ]; then
@ -649,8 +631,8 @@ function setinterface {
setinterface
fi
readarray -t naggysoftware < <(./lib/airmon/airmon check $PREWIFI | tail -n +8 | grep -v "on interface" | awk '{ print $2 }')
WIFIDRIVER=$(./lib/airmon/airmon | grep "$PREWIFI" | awk '{print($(NF-2))}')
readarray -t naggysoftware < <(./lib/airmon/airmon.sh check $PREWIFI | tail -n +8 | grep -v "on interface" | awk '{ print $2 }')
WIFIDRIVER=$(./lib/airmon/airmon.sh | grep "$PREWIFI" | awk '{print($(NF-2))}')
if [ ! "$(echo $WIFIDRIVER | egrep 'rt2800|rt73')" ]; then
rmmod -f "$WIFIDRIVER" &>$flux_output_device 2>&1
@ -675,7 +657,7 @@ function setinterface {
break;
done
WIFIMONITOR=$(./lib/airmon/airmon start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
WIFIMONITOR=$(./lib/airmon/airmon.sh start $PREWIFI | grep "enabled on" | cut -d " " -f 5 | cut -d ")" -f 1)
WIFI_MONITOR=$WIFIMONITOR
WIFI=$PREWIFI
@ -1328,7 +1310,7 @@ function creassl {
function webinterface {
chmod 400 /root/server.pem
chmod 400 $DUMP_PATH/server.pem
if [ "$FLUX_AUTO" = "1" ];then
matartodo; ConnectionRESET; selection

0
language/bind → language/bundle.sh Normal file → Executable file
View File

0
lib/exitmode → lib/exitmode.sh Normal file → Executable file
View File

0
locale/de_DE.py Normal file → Executable file
View File

0
locale/en_EN.py Normal file → Executable file
View File

0
locale/en_EN.pyc Normal file → Executable file
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -1,307 +0,0 @@
#!/usr/bin/env python
# -*- coding: cp852 -*-
import sys
import getopt
import os
import subprocess
sys.path.insert(0, './locale')
# ###################
# ## OPTIONS ########
# ###################
site_name = ''
site_language = ''
installed_sites = 0
flux_cont = ''
#flux_comp_versions = ['0.24']
flinstall_version = '0.11'
# ###################
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
def main(argv):
global site_name, site_language
if os.geteuid() != 0:
exit('You need to have root privileges to run this script.\nPlease try again, this time using \'sudo\'. Exiting....')
sys.exit()
usage = '>>>\tUsage:\n' +'\t\tsiteinstaller.py -f <filename>' +'\n\t\tsiteinstaller.py --file <file>\n\n>>>\tOnly *.tar.gz compressed files!'
try:
opts, args = getopt.getopt(sys.argv[1:], 'f:h', ['file=', 'help'])
if(len(opts) <= 0):
print(usage)
sys.exit()
except getopt.GetoptError:
print(usage)
sys.exit(2)
for opt, arg in opts:
if opt in ('-h', '--help'):
print(usage)
sys.exit(2)
elif opt in ('-f', '--file'):
if not('.tar.gz' in arg):
print('ONLY *.tar.gz files supported.')
sys.exit()
if(os.path.isfile(arg) == False):
print('Your file does not exist, maybe a typo?')
sys.exit()
site_name = arg[:arg.rfind('.tar.gz')]
site_language = site_name[site_name.rfind('_')+1:]
else:
print(usage)
if __name__ == "__main__":
main(sys.argv[1:])
# Language Selector
print('\033[1;91m [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]')
print(' [ ]')
print(' [ FluxIon - Site Installer v' + flinstall_version + ' ]')
print('\033[94m [ ]')
print(' [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]')
print('\033[39m')
print(' # Select your language:')
print('')
print('[1] English')
print('[2] German')
print('')
lang = raw_input(' [#]:')
if(lang == '1'):
from en_EN import language
elif(lang == '2'):
from de_DE import language
else:
from en_EN import language
# ###############
def check_fluxion():
global installed_sites, flux_cont
try:
fl = open('fluxion','rw')
flux_cont = fl.read()
fl.close()
except:
print(language.COULD_NOT_OPEN_FLUX)
sys.exit()
if(flux_cont <= 100):
print(language.NO_FLUXION_FOUND)
sys.exit()
flv = ''
flr = ''
fld = ''
if('version=' in flux_cont) and ('revision=' in flux_cont):
flv = flux_cont[flux_cont.find('version=')+8:]
flv = flv[:flv.find('\n')]
flr = flux_cont[flux_cont.find('revision=')+9:]
flr = flr[:flr.find('\n')]
else:
print(language.CORRUPTED_FLUX)
sys.exit()
# Version check
#vchk = False
#for version in flux_comp_versions:
# if(version == flv):
# vchk = True
#if(vchk == False):
# print('Your fluxion version '+color.BOLD + flv + color.END + '. \nSupported versions are - ' + ' - '.join(reversed(flux_comp_versions)))
# sys.exit()
# ###############
installed_sites = int(flux_cont.count('elif [ "$webconf" ='))
fls = str(installed_sites + 1)
# Check on double installation!
fld = flux_cont[flux_cont.find('$DUMP_PATH/data/index.htm'):]
if(site_name in fld):
usdc = raw_input(language.DOUBLE_INSTALL + ' "' + site_name + '" ' + language.CONTINUE_ANYWAY + ' [Y\\n]')
if(len(usdc) <= 0) or (usdc == 'y') or (usdc == 'yes'):
pass
else:
sys.exit()
# ###############
return flv + '#' + flr + '#' + fls
def welcome():
flc = check_fluxion().split('#')
wsn = int(22 - len(site_name))
whitespacen = ''
wsl = int((22+6) - len(site_language))
whitespacel = ''
for i in xrange(wsn):
whitespacen += ' '
if(i+1 == wsn) and (i+1 <= wsn):
whitespacen += '#'
for i in xrange(wsl):
whitespacel += ' '
if(i+1 == wsl) and (i+1 <= wsl):
whitespacel += '#'
print('\033[1;91m [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]')
print(' [ ]')
print(' [ FluxIon - Site Installer v'+ flinstall_version + ' ]')
print('\033[94m [ ]')
print(' [~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]')
print('\033[39m')
print(' # ############## FluxIon found! ##############')
print(' # \033[39mVersion: '+ flc[0] +' #')
print(' # \033[39mRevision: '+ flc[1] +' #')
print(' # \033[39mInstalled Sites: '+ flc[2] +' #')
print(' # ############################################')
print('')
print(' # ############################################')
print(' # \033[39mSiteName to install: ' + site_name + whitespacen)
print(' # \033[39mLanguage flag: ' + site_language + whitespacel)
print(' # ############################################')
print('')
print(' # ########### Everything correct? ############')
print('')
usc = raw_input(' # ' + language.BEGIN_INSTALL + '? [Y\\n]').lower()
if(len(usc) <= 0) or (usc == 'y') or (usc == 'yes'):
pass
else:
print('\n\t # ' + language.NOTHING_CHANGED)
sys.exit()
# ########################################################################################
# ########################################################################################
# ########################################################################################
# ########################################################################################
# ########################################################################################
# ########################################################################################
# ########################################################################################
welcome()
# ###### First INSERT
def insert_at_secondlast_pos1():
global flux_cont, site_name, site_language
whitespaces = ''
search_string = 'echo -e " "$red"["$yellow"$n"$red"]"$transparent"\e'
ws = int(12 - len(site_name))
for i in xrange(ws):
whitespaces+=' '
insert_site = 'echo -e " "$red"["$yellow"$n"$red"]"$transparent" ' + site_name + whitespaces + '[' + site_language + '] ";n=` expr $n + 1`\n'
before = flux_cont[:int(flux_cont.rfind(search_string))]
after = '\t\t\t' + flux_cont[int(flux_cont.rfind(search_string)):]
flux_cont = before + insert_site + after
# ##########################################
# ###### Second INSERT
def insert_at_secondlast_pos2():
global installed_sites, flux_cont, site_name
site_number = str(installed_sites +1)
insert_site = 'elif [ "$webconf" = "'+ site_number +'" ]; then\n\t\t\t\t' + site_name + '\n\t\t\t\tbreak\n\n\t\t\t'
flux_cont = flux_cont[:int(flux_cont.rfind('elif [ "$webconf" ='))] + insert_site + flux_cont[int(flux_cont.rfind('elif [ "$webconf" =')):]
def last_option_correct_number2():
global installed_sites, flux_cont
acc = int(flux_cont.rfind('elif [ "$webconf" ='))
acc0 = int(flux_cont[acc:].find('" = "')+5)
before = flux_cont[:acc+acc0]
after = flux_cont[acc+acc0+2:]
flux_cont = before + str(installed_sites+2) + after
# ##########################################
# ###### Third INSERT
def insert_at_last_pos3():
global flux_cont, site_name
insert_site = '\n\nfunction ' + site_name + ' {\n\tmkdir $DUMP_PATH/data &>$flux_output_device\n\tcp $WORK_DIR/Sites/' + site_name + '/* $DUMP_PATH/data\n\t}'
before = flux_cont[:int(flux_cont.rfind('}'))+1]
after = flux_cont[int(flux_cont.rfind('}'))+1:]
flux_cont = before + insert_site + after
# ##########################################
print('')
print(' # '+ language.CREATING_BACKUP +'...')
try:
subprocess.Popen(['cp','fluxion', 'bckp_fluxion'])
except:
print(language.NO_PERM)
sys.exit()
print(' # ' + language.DONE + '!')
print('')
print(' # ' + language.COPYING_FILES + '...')
try:
subprocess.Popen(['tar','xfz', site_name + '.tar.gz', '-C', 'Sites/'])
except:
print(language.COULD_NOT_COPY + '...')
sys.exit()
print(' # ' + language.DONE + '!')
print('')
print(' # ' + language.RECONFIGURE_FLUXION_BASH + '...')
try:
insert_at_secondlast_pos1()
insert_at_secondlast_pos2()
last_option_correct_number2()
insert_at_last_pos3()
except:
print(language.INTERNAL_FAILURE + '...')
e = sys.exc_info()[0]
print(language.ERROR + ": %s" % e )
sys.exit()
print(' # ' + language.DONE + '!')
print('')
print(' # '+ language.REWRITING_FLUXION_BASH + '...')
try:
wflux = open('fluxion','w')
wflux.write(flux_cont)
wflux.close()
except:
print(language.FATAL_ERROR + '[501]...')
print(language.TRYING_TO_RESTORE_BACKUP)
try:
subprocess.Popen(['mv','bckp_fluxion', 'fluxion'])
print('FluxIon ' + language.BACKUP_RESTORED + '...')
except:
print(language.FATAL_ERROR + '[502]...')
sys.exit()
print(' # ' + language.DONE + '!')
print('')
print(' # ' + language.SETTING_MODES + '...')
try:
subprocess.Popen(['chmod','755', 'Sites/' + site_name +'/'])
subprocess.Popen(['chmod','644', '-R', 'Sites/' + site_name +'/'])
print(' # ' + DONE + '!')
except:
pass
#print('ERROR[506]... ' + language.CONTINUE + '...')
#print("Unexpected error:", sys.exc_info()[0])
print('')
print(' # ' + language.VERIFYING_INTEG + '...')
try:
fluxit = open('fluxion','r')
integ_fluxion = fluxit.read()
fluxit.close()
if(len(integ_fluxion) == len(flux_cont)):
print(' # ' + language.DONE + '!')
print(' # ' + language.DELETING_BACKUP + '...')
subprocess.Popen(['rm','bckp_fluxion'])
else:
print(language.FATAL_ERROR + '[509]...')
sys.exit()
except:
print(language.FATAL_ERROR + '[503]...')
sys.exit()
print('\n # ' + site_name + '" ' + language.SUCCESS + '!')

0
ui/fluxion.py Normal file → Executable file
View File