mirror of
https://github.com/hak5/nano-tetra-modules.git
synced 2025-10-29 16:58:09 +00:00
Add modules to repository
This commit is contained in:
109
Occupineapple/scripts/autostart_occupineapple.sh
Executable file
109
Occupineapple/scripts/autostart_occupineapple.sh
Executable file
@@ -0,0 +1,109 @@
|
||||
#!/bin/sh
|
||||
#2015 - Whistle Master
|
||||
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib
|
||||
export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin
|
||||
|
||||
LOG=/tmp/occupineapple.log
|
||||
MYPATH='/pineapple/modules/Occupineapple/'
|
||||
|
||||
MYMONITOR=''
|
||||
MYINTERFACE=`uci get occupineapple.autostart.interface`
|
||||
MYLIST=`uci get occupineapple.autostart.list`
|
||||
|
||||
SPEED=`uci get occupineapple.settings.speed`
|
||||
CHANNEL=`uci get occupineapple.settings.channel`
|
||||
|
||||
OPTIONS=''
|
||||
WPAAES=`uci get occupineapple.settings.wpaAES`
|
||||
VALIDMAC=`uci get occupineapple.settings.validMAC`
|
||||
ADHOC=`uci get occupineapple.settings.adHoc`
|
||||
WEPBIT=`uci get occupineapple.settings.wepBit`
|
||||
WPATKIP=`uci get occupineapple.settings.wpaTKIP`
|
||||
|
||||
killall -9 mdk3
|
||||
rm ${LOG}
|
||||
|
||||
echo -e "Starting Occupineapple..." > ${LOG}
|
||||
|
||||
if [ -z "$MYINTERFACE" ]; then
|
||||
MYINTERFACE=`iwconfig 2> /dev/null | grep "Mode:Master" | awk '{print $1}' | head -1`
|
||||
else
|
||||
MYFLAG=`iwconfig 2> /dev/null | awk '{print $1}' | grep ${MYINTERFACE}`
|
||||
|
||||
if [ -z "$MYFLAG" ]; then
|
||||
MYINTERFACE=`iwconfig 2> /dev/null | grep "Mode:Master" | awk '{print $1}' | head -1`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$MYMONITOR" ]; then
|
||||
MYMONITOR=`iwconfig 2> /dev/null | grep "Mode:Monitor" | awk '{print $1}' | head -1`
|
||||
|
||||
MYFLAG=`iwconfig 2> /dev/null | awk '{print $1}' | grep ${MYMONITOR}`
|
||||
|
||||
if [ -z "$MYFLAG" ]; then
|
||||
airmon-ng start ${MYINTERFACE}
|
||||
MYMONITOR=`iwconfig 2> /dev/null | grep "Mode:Monitor" | awk '{print $1}' | head -1`
|
||||
fi
|
||||
else
|
||||
MYFLAG=`iwconfig 2> /dev/null | awk '{print $1}' | grep ${MYMONITOR}`
|
||||
|
||||
if [ -z "$MYFLAG" ]; then
|
||||
airmon-ng start ${MYINTERFACE}
|
||||
MYMONITOR=`iwconfig 2> /dev/null | grep "Mode:Monitor" | awk '{print $1}' | head -1`
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "Interface : ${MYINTERFACE}" >> ${LOG}
|
||||
echo -e "Monitor : ${MYMONITOR}" >> ${LOG}
|
||||
|
||||
if [ "$MYLIST" != "--" ] && [ -n "$MYLIST" ]; then
|
||||
echo -e "List : ${MYLIST}" >> ${LOG}
|
||||
|
||||
uci set occupineapple.run.list=${MYLIST}
|
||||
uci commit occupineapple.run.list
|
||||
|
||||
MYFLAG=`echo ${MYLIST} | awk '{print match($0,".mlist")}'`;
|
||||
|
||||
if [ ${MYFLAG} -gt 0 ];then
|
||||
MYLIST="-v ${MYPATH}lists/${MYLIST}"
|
||||
else
|
||||
MYLIST="-f ${MYPATH}lists/${MYLIST}"
|
||||
fi
|
||||
else
|
||||
echo -e "List : random" >> ${LOG}
|
||||
MYLIST=
|
||||
|
||||
uci set occupineapple.run.list=${MYLIST}
|
||||
uci commit occupineapple.run.list
|
||||
fi
|
||||
|
||||
if [ -n "$SPEED" ]; then
|
||||
echo -e "Speed : ${SPEED}" >> ${LOG}
|
||||
SPEED="-s ${SPEED}"
|
||||
else
|
||||
echo -e "Speed : default" >> ${LOG}
|
||||
SPEED=
|
||||
fi
|
||||
|
||||
if [ -n "$CHANNEL" ]; then
|
||||
echo -e "Channel : ${CHANNEL}" >> ${LOG}
|
||||
CHANNEL="-c ${CHANNEL}"
|
||||
else
|
||||
echo -e "Channel : default" >> ${LOG}
|
||||
CHANNEL=
|
||||
fi
|
||||
|
||||
if [ "$WPAAES" != "0" ]; then OPTIONS="-a"; fi
|
||||
if [ "$VALIDMAC" != "0" ]; then OPTIONS="${OPTIONS} -m"; fi
|
||||
if [ "$ADHOC" != "0" ]; then OPTIONS="${OPTIONS} -d"; fi
|
||||
if [ "$WEPBIT" != "0" ]; then OPTIONS="${OPTIONS} -w"; fi
|
||||
if [ "$WPATKIP" != "0" ]; then OPTIONS="${OPTIONS} -t"; fi
|
||||
|
||||
ifconfig ${MYINTERFACE} down
|
||||
ifconfig ${MYINTERFACE} up
|
||||
|
||||
uci set occupineapple.run.interface=${MYMONITOR}
|
||||
uci commit occupineapple.run.interface
|
||||
|
||||
mdk3 ${MYMONITOR} b ${SPEED} ${CHANNEL} ${OPTIONS} ${MYLIST} >> ${LOG} &
|
||||
36
Occupineapple/scripts/dependencies.sh
Executable file
36
Occupineapple/scripts/dependencies.sh
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
#2015 - Whistle Master
|
||||
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib
|
||||
export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin
|
||||
|
||||
[[ -f /tmp/Occupineapple.progress ]] && {
|
||||
exit 0
|
||||
}
|
||||
|
||||
touch /tmp/Occupineapple.progress
|
||||
|
||||
if [ "$1" = "install" ]; then
|
||||
if [ "$2" = "internal" ]; then
|
||||
opkg update
|
||||
opkg install mdk3
|
||||
elif [ "$2" = "sd" ]; then
|
||||
opkg update
|
||||
opkg install mdk3 --dest sd
|
||||
fi
|
||||
|
||||
touch /etc/config/occupineapple
|
||||
echo "config occupineapple 'run'" > /etc/config/occupineapple
|
||||
echo "config occupineapple 'settings'" >> /etc/config/occupineapple
|
||||
echo "config occupineapple 'autostart'" >> /etc/config/occupineapple
|
||||
echo "config occupineapple 'module'" >> /etc/config/occupineapple
|
||||
|
||||
uci set occupineapple.module.installed=1
|
||||
uci commit occupineapple.module.installed
|
||||
|
||||
elif [ "$1" = "remove" ]; then
|
||||
opkg remove mdk3
|
||||
rm -rf /etc/config/occupineapple
|
||||
fi
|
||||
|
||||
rm /tmp/Occupineapple.progress
|
||||
111
Occupineapple/scripts/occupineapple.sh
Executable file
111
Occupineapple/scripts/occupineapple.sh
Executable file
@@ -0,0 +1,111 @@
|
||||
#!/bin/sh
|
||||
#2015 - Whistle Master
|
||||
|
||||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/sd/lib:/sd/usr/lib
|
||||
export PATH=$PATH:/sd/usr/bin:/sd/usr/sbin
|
||||
|
||||
LOG=/tmp/occupineapple.log
|
||||
MYPATH='/pineapple/modules/Occupineapple/'
|
||||
|
||||
MYMONITOR=''
|
||||
MYINTERFACE=`uci get occupineapple.run.interface`
|
||||
MYLIST=`uci get occupineapple.run.list`
|
||||
|
||||
SPEED=`uci get occupineapple.settings.speed`
|
||||
CHANNEL=`uci get occupineapple.settings.channel`
|
||||
|
||||
OPTIONS=''
|
||||
WPAAES=`uci get occupineapple.settings.wpaAES`
|
||||
VALIDMAC=`uci get occupineapple.settings.validMAC`
|
||||
ADHOC=`uci get occupineapple.settings.adHoc`
|
||||
WEPBIT=`uci get occupineapple.settings.wepBit`
|
||||
WPATKIP=`uci get occupineapple.settings.wpaTKIP`
|
||||
|
||||
if [ "$1" = "start" ]; then
|
||||
|
||||
killall -9 mdk3
|
||||
rm ${LOG}
|
||||
|
||||
echo -e "Starting Occupineapple..." > ${LOG}
|
||||
|
||||
if [ -z "$MYINTERFACE" ]; then
|
||||
MYINTERFACE=`iwconfig 2> /dev/null | grep "Mode:Master" | awk '{print $1}' | head -1`
|
||||
else
|
||||
MYFLAG=`iwconfig 2> /dev/null | awk '{print $1}' | grep ${MYINTERFACE}`
|
||||
|
||||
if [ -z "$MYFLAG" ]; then
|
||||
MYINTERFACE=`iwconfig 2> /dev/null | grep "Mode:Master" | awk '{print $1}' | head -1`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$MYMONITOR" ]; then
|
||||
MYMONITOR=`iwconfig 2> /dev/null | grep "Mode:Monitor" | awk '{print $1}' | head -1`
|
||||
|
||||
MYFLAG=`iwconfig 2> /dev/null | awk '{print $1}' | grep ${MYMONITOR}`
|
||||
|
||||
if [ -z "$MYFLAG" ]; then
|
||||
airmon-ng start ${MYINTERFACE}
|
||||
MYMONITOR=`iwconfig 2> /dev/null | grep "Mode:Monitor" | awk '{print $1}' | head -1`
|
||||
fi
|
||||
else
|
||||
MYFLAG=`iwconfig 2> /dev/null | awk '{print $1}' | grep ${MYMONITOR}`
|
||||
|
||||
if [ -z "$MYFLAG" ]; then
|
||||
airmon-ng start ${MYINTERFACE}
|
||||
MYMONITOR=`iwconfig 2> /dev/null | grep "Mode:Monitor" | awk '{print $1}' | head -1`
|
||||
fi
|
||||
fi
|
||||
|
||||
echo -e "Interface : ${MYINTERFACE}" >> ${LOG}
|
||||
echo -e "Monitor : ${MYMONITOR}" >> ${LOG}
|
||||
|
||||
if [ "$MYLIST" != "--" ] && [ -n "$MYLIST" ]; then
|
||||
echo -e "List : ${MYLIST}" >> ${LOG}
|
||||
|
||||
MYFLAG=`echo ${MYLIST} | awk '{print match($0,".mlist")}'`;
|
||||
|
||||
if [ ${MYFLAG} -gt 0 ];then
|
||||
MYLIST="-v ${MYPATH}lists/${MYLIST}"
|
||||
else
|
||||
MYLIST="-f ${MYPATH}lists/${MYLIST}"
|
||||
fi
|
||||
else
|
||||
echo -e "List : random" >> ${LOG}
|
||||
MYLIST=
|
||||
fi
|
||||
|
||||
if [ -n "$SPEED" ]; then
|
||||
echo -e "Speed : ${SPEED}" >> ${LOG}
|
||||
SPEED="-s ${SPEED}"
|
||||
else
|
||||
echo -e "Speed : default" >> ${LOG}
|
||||
SPEED=
|
||||
fi
|
||||
|
||||
if [ -n "$CHANNEL" ]; then
|
||||
echo -e "Channel : ${CHANNEL}" >> ${LOG}
|
||||
CHANNEL="-c ${CHANNEL}"
|
||||
else
|
||||
echo -e "Channel : default" >> ${LOG}
|
||||
CHANNEL=
|
||||
fi
|
||||
|
||||
if [ "$WPAAES" -ne 0 ]; then OPTIONS="${OPTIONS} -a"; fi
|
||||
if [ "$VALIDMAC" -ne 0 ]; then OPTIONS="${OPTIONS} -m"; fi
|
||||
if [ "$ADHOC" -ne 0 ]; then OPTIONS="${OPTIONS} -d"; fi
|
||||
if [ "$WEPBIT" -ne 0 ]; then OPTIONS="${OPTIONS} -w"; fi
|
||||
if [ "$WPATKIP" -ne 0 ]; then OPTIONS="${OPTIONS} -t"; fi
|
||||
|
||||
ifconfig ${MYINTERFACE} down
|
||||
ifconfig ${MYINTERFACE} up
|
||||
|
||||
uci set occupineapple.run.interface=${MYMONITOR}
|
||||
uci commit occupineapple.run.interface
|
||||
|
||||
mdk3 ${MYMONITOR} b ${SPEED} ${CHANNEL} ${OPTIONS} ${MYLIST} >> ${LOG} &
|
||||
|
||||
elif [ "$1" = "stop" ]; then
|
||||
killall mdk3
|
||||
rm -rf /tmp/occupineapple.run
|
||||
rm ${LOG}
|
||||
fi
|
||||
Reference in New Issue
Block a user