Files
Mobile-Security-Framework-M…/run.sh
T
Ajin Abraham d1f8f87d2d Multiple Feature Improvements around Binary Analysis and NIAP support (#1558)
* NIAP Analysis for Android based on https://www.niap-ccevs.org/MMO/PP/394.R/pp_app_v1.2_table-reqs.htm
* Improved Android Code Analysis Rules
* Code QA
* Android App Compare QA
* Improved Android SO binary analysis. (Thanks to https://lief.quarkslab.com/ and https://gist.github.com/apogiatzis/fb617cd118a9882749b5cb167dae0c5d)
* Android Strings now includes strings from shared objects.
* URLs and emails are now extracted from shared objects as well.
* Refactor iOS Binary Analysis with LIEF (Thanks to https://gist.github.com/ChiChou/15f0772db25343be0bb7072f15992a4e)
* Fixes Bugs #621, #1242 #1516
* Remove Otool Requirements and jtool2
2020-10-08 09:28:26 -04:00

49 lines
946 B
Bash
Executable File

#!/bin/bash
var="$1"
function validate_ip () {
local IP=$1
local stat=1
if [[ $IP =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
OIFS=$IFS
IFS='.'
ip=($IP)
IFS=$OIFS
[[ ${ip[0]} -le 255 && ${ip[1]} -le 255 \
&& ${ip[2]} -le 255 && ${ip[3]} -le 255 ]]
stat=$?
fi
if [ "$stat" -eq 0 ]; then
return $stat
else
echo 'Bad IP'
exit 1
fi
}
function validate_port () {
local PORT=$1
if [ -z "$PORT" ]; then
echo 'Port can not be empty'
exit 1
fi
if [ "$PORT" -gt 1024 ] && [ "$PORT" -lt 65535 ]; then
return 0
else
echo 'Invalid Port'
exit 1
fi
}
if [ ! -z "$var" ]; then
IP=$(echo $var | awk -F':' '{print $1}')
PORT=$(echo $var | awk -F':' '{print $2}')
validate_ip $IP
validate_port $PORT
else
IP='0.0.0.0'
PORT='8000'
fi
. venv/bin/activate && gunicorn -b ${IP}:${PORT} MobSF.wsgi:application --workers=1 --threads=10 --timeout=3600