You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run MobSF through command to make it easy for users to use.
I have written a code in bash script
If anyone want to use it then make a file in /usr/local/bin as mobsf and paste this code.
and chmod +x mobsf for execute permission
#!/bin/bash
Function to display usage information
usage() {
echo "Usage: mobsf [options]"
echo "Options:"
echo " -d, --dynamic <IP_ADDRESS> Perform dynamic analysis on the device with the specified IP_ADDRESS"
echo " -p option must be used to specify the port"
echo " -s, --static Perform static analysis"
echo " -h, --help Display this usage message"
}
while [ $# -gt 0 ]; do
case "$1" in
-d|--dynamic)
dynamic_mode=true
shift
ip_address=$1
;;
-p)
shift
port=$1
;;
-s|--static)
static_mode=true
;;
-h|--help)
usage
exit 0
;;
*)
usage
exit 1
;;
esac
shift
done
If dynamic mode is enabled, run dynamic analysis
if [ "$dynamic_mode" = true ]; then
if [ -z "$ip_address" ] && [ -z "$port" ]; then
echo "Please specify both IP address and port for dynamic analysis."
usage
exit 1
elif [ -z "$ip_address" ]; then
echo "Please specify an IP address for dynamic analysis."
usage
exit 1
elif [ -z "$port" ]; then
echo "Please specify a port for dynamic analysis."
usage
exit 1
fi
sudo docker run -it --rm -p 8000:8000 -p $port:$port -e MOBSF_ANALYZER_IDENTIFIER=$ip_address:$port opensecurity/mobile-security-framework-mobsf:latest
If static mode is enabled, run static analysis
elif [ "$static_mode" = true ]; then
sudo docker run -it --rm -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest
else
# If no arguments or invalid arguments are provided, display usage information
usage
exit 1
fi
Goodbye message using username and PC name
echo "Goodbye $username from $pc_name!"
The text was updated successfully, but these errors were encountered:
👋 @sohilshrestha0
Issues is only for reporting a bug/feature request. For limited support, questions, and discussions, please join MobSF Slack channel
Please include all the requested and relevant information when opening a bug report. Improper reports will be closed without any response.
Run MobSF through command to make it easy for users to use.
I have written a code in bash script
If anyone want to use it then make a file in /usr/local/bin as mobsf and paste this code.
and chmod +x mobsf for execute permission
#!/bin/bash
Function to display usage information
usage() {
echo "Usage: mobsf [options]"
echo "Options:"
echo " -d, --dynamic <IP_ADDRESS> Perform dynamic analysis on the device with the specified IP_ADDRESS"
echo " -p option must be used to specify the port"
echo " -s, --static Perform static analysis"
echo " -h, --help Display this usage message"
}
Default values
dynamic_mode=false
static_mode=false
ip_address=""
port=""
Fetch the username of the non-root user
username=$(whoami)
Fetch the hostname (PC name)
pc_name=$(hostname)
Check for command-line arguments
while [ $# -gt 0 ]; do
case "$1" in
-d|--dynamic)
dynamic_mode=true
shift
ip_address=$1
;;
-p)
shift
port=$1
;;
-s|--static)
static_mode=true
;;
-h|--help)
usage
exit 0
;;
*)
usage
exit 1
;;
esac
shift
done
If dynamic mode is enabled, run dynamic analysis
if [ "$dynamic_mode" = true ]; then
if [ -z "$ip_address" ] && [ -z "$port" ]; then
echo "Please specify both IP address and port for dynamic analysis."
usage
exit 1
elif [ -z "$ip_address" ]; then
echo "Please specify an IP address for dynamic analysis."
usage
exit 1
elif [ -z "$port" ]; then
echo "Please specify a port for dynamic analysis."
usage
exit 1
fi
sudo docker run -it --rm -p 8000:8000 -p $port:$port -e MOBSF_ANALYZER_IDENTIFIER=$ip_address:$port opensecurity/mobile-security-framework-mobsf:latest
If static mode is enabled, run static analysis
elif [ "$static_mode" = true ]; then
sudo docker run -it --rm -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest
else
# If no arguments or invalid arguments are provided, display usage information
usage
exit 1
fi
Goodbye message using username and PC name
echo "Goodbye $username from $pc_name!"
The text was updated successfully, but these errors were encountered: