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:
20
CursedScreech/includes/scripts/bigToLittleEndian.sh
Executable file
20
CursedScreech/includes/scripts/bigToLittleEndian.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <serial>";
|
||||
exit;
|
||||
fi
|
||||
|
||||
orig=$1
|
||||
serial=""
|
||||
|
||||
i=${#orig}
|
||||
|
||||
while [ $i -gt 0 ]
|
||||
do
|
||||
i=$(($i-2));
|
||||
serial="$serial${orig:$i:2}-"
|
||||
done
|
||||
|
||||
|
||||
echo $serial"00"
|
||||
41
CursedScreech/includes/scripts/cfgUploadLimit.py
Executable file
41
CursedScreech/includes/scripts/cfgUploadLimit.py
Executable file
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
from subprocess import call
|
||||
|
||||
php = "/etc/php.ini"
|
||||
nginx = "/etc/nginx/nginx.conf"
|
||||
|
||||
lines = [f for f in open(php)]
|
||||
with open(php, "w") as out:
|
||||
for line in lines:
|
||||
if "upload_max_filesize" in line:
|
||||
parts = line.split("=")
|
||||
parts[1] = " 20M\n"
|
||||
line = "=".join(parts)
|
||||
if "post_max_size" in line:
|
||||
parts = line.split("=")
|
||||
parts[1] = " 26M\n"
|
||||
line = "=".join(parts)
|
||||
out.write(line)
|
||||
call(["/etc/init.d/php5-fpm", "reload"])
|
||||
|
||||
httpBlock = False
|
||||
needsCfg = True
|
||||
index = innerIndex = 0
|
||||
lines = [f for f in open(nginx)]
|
||||
for line in lines:
|
||||
if "client_max_body_size" in line:
|
||||
needsCfg = False
|
||||
break
|
||||
if needsCfg is True:
|
||||
with open(nginx, "w") as out:
|
||||
for line in lines:
|
||||
if "http {" in line:
|
||||
httpBlock = True
|
||||
if httpBlock is True:
|
||||
if innerIndex == 4:
|
||||
lines.insert(index + 1, "\tclient_max_body_size 20M;\n")
|
||||
innerIndex = innerIndex + 1
|
||||
index = index + 1
|
||||
out.write(line)
|
||||
call(["/etc/init.d/nginx", "reload"])
|
||||
9
CursedScreech/includes/scripts/checkDepends.sh
Executable file
9
CursedScreech/includes/scripts/checkDepends.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
testZip=$(opkg list-installed | grep 'zip')
|
||||
|
||||
if [ -z "$testZip" ]; then
|
||||
echo "Not Installed";
|
||||
else
|
||||
echo "Installed";
|
||||
fi
|
||||
14
CursedScreech/includes/scripts/getCertSerial.sh
Executable file
14
CursedScreech/includes/scripts/getCertSerial.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ $# -lt 1 ]]; then
|
||||
echo "Usage: $0 <path to cert>";
|
||||
exit;
|
||||
fi
|
||||
|
||||
if ! [[ -e $1 ]]; then
|
||||
echo "File does not exist"
|
||||
exit;
|
||||
fi
|
||||
|
||||
print=$(echo $(openssl x509 -noout -in $1 -serial) | sed 's/://g')
|
||||
echo $print | tr "=" " " | awk '{print $2}'
|
||||
8
CursedScreech/includes/scripts/getFingerprint.sh
Executable file
8
CursedScreech/includes/scripts/getFingerprint.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <certificate>";
|
||||
exit;
|
||||
fi
|
||||
|
||||
openssl x509 -in $1 -noout -fingerprint | awk '{print $2}'
|
||||
9
CursedScreech/includes/scripts/getInterfaceIP.sh
Executable file
9
CursedScreech/includes/scripts/getInterfaceIP.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "Usage: $0 <iface>";
|
||||
exit;
|
||||
fi
|
||||
|
||||
|
||||
ifconfig $1 | grep inet | awk '{split($2,a,":"); print a[2]}'
|
||||
11
CursedScreech/includes/scripts/getListeningInterfaces.sh
Executable file
11
CursedScreech/includes/scripts/getListeningInterfaces.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
IFCS=$(ifconfig | cut -d " " -f1 | awk 'NF==1{print $1}')
|
||||
for iface in ${IFCS[@]}; do
|
||||
if [[ $iface == "lo" ]]; then
|
||||
continue
|
||||
fi
|
||||
if [[ $(ifconfig $iface | grep inet) != "" ]]; then
|
||||
echo $iface
|
||||
fi
|
||||
done
|
||||
8
CursedScreech/includes/scripts/installDepends.sh
Executable file
8
CursedScreech/includes/scripts/installDepends.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Author: sud0nick
|
||||
# Date: Jan 2016
|
||||
|
||||
opkg update > /dev/null;
|
||||
opkg install zip > /dev/null;
|
||||
echo "Complete"
|
||||
49
CursedScreech/includes/scripts/packPayload.sh
Executable file
49
CursedScreech/includes/scripts/packPayload.sh
Executable file
@@ -0,0 +1,49 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Author: sud0nick
|
||||
# Date: Jan 2016
|
||||
|
||||
help() {
|
||||
echo "Usage: $0 <dir> <opts>";
|
||||
echo '';
|
||||
echo 'Parameters:';
|
||||
echo '';
|
||||
echo -e '\tdir:\tDirectory where the files reside';
|
||||
echo -e '\t-f:\tFile names as string value';
|
||||
echo -e '\t-o:\tName of output file';
|
||||
echo '';
|
||||
}
|
||||
|
||||
if [ "$#" -lt 1 ]; then
|
||||
help;
|
||||
exit;
|
||||
fi
|
||||
|
||||
# Define and clear out the download directory
|
||||
DL_DIR="/pineapple/modules/CursedScreech/includes/api/downloads/";
|
||||
rm -rf $DL_DIR*
|
||||
|
||||
# Get the key directory and shift it out of the argument vectors
|
||||
API_DIR="$1";
|
||||
shift;
|
||||
|
||||
FILES='';
|
||||
OUTPUT='';
|
||||
export IFS=" ";
|
||||
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
|
||||
if [[ "$1" == "-f" ]]; then
|
||||
for word in $2; do
|
||||
FILES="$FILES $API_DIR$word";
|
||||
done
|
||||
fi
|
||||
if [[ "$1" == "-o" ]]; then
|
||||
OUTPUT="$2";
|
||||
fi
|
||||
|
||||
shift
|
||||
done;
|
||||
|
||||
zip -j $DL_DIR$OUTPUT $FILES > /dev/null;
|
||||
6
CursedScreech/includes/scripts/removeDepends.sh
Executable file
6
CursedScreech/includes/scripts/removeDepends.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Author: sud0nick
|
||||
# Date: Jan 2016
|
||||
|
||||
opkg remove zip > /dev/null;
|
||||
35
CursedScreech/includes/scripts/testEncrypt.sh
Executable file
35
CursedScreech/includes/scripts/testEncrypt.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
|
||||
help() {
|
||||
echo "Usage: ./testEncrypt.sh <opts>";
|
||||
echo '';
|
||||
echo 'Parameters:';
|
||||
echo '';
|
||||
echo -e '\t-d:\tDirectory where key resides';
|
||||
echo -e '\t-k:\tName of key to test';
|
||||
echo '';
|
||||
}
|
||||
|
||||
if [ "$#" -lt 2 ]; then
|
||||
help;
|
||||
exit;
|
||||
fi
|
||||
|
||||
KEY=''
|
||||
KEYDIR=''
|
||||
|
||||
while [ "$#" -gt 0 ]
|
||||
do
|
||||
|
||||
if [[ "$1" == "-k" ]]; then
|
||||
KEY="$2.pem"
|
||||
fi
|
||||
if [[ "$1" == "-d" ]]; then
|
||||
KEYDIR="$2"
|
||||
fi
|
||||
|
||||
shift
|
||||
done;
|
||||
|
||||
openssl rsa -in $KEYDIR$KEY -passin pass: | awk 'NR==0;'
|
||||
Reference in New Issue
Block a user