Shell Script




Automating Binary Analysis :)


Ok i worked on this Shell script for a half a day and finally its working !!!!



animate() { cyan='\033[0;36m' NC='\033[0m' b=0 while [ $b -lt 2 ]; do for a in \\ \| \/ -; do echo -ne "\033[s[${cyan} $a ${NC}]\033[u"; sleep 0.2 ; done; b=$(( $b+1)) ; done } aslr() { green='\033[1;32m' NC='\033[0m' echo -ne "${green} Enter 1-on or 0-off or c-to-check : ${NC}" ; read pass if test "$pass" = "c" then cat /proc/sys/kernel/randomize_va_space fi if test "$pass" = "1" then echo "switching on aslr" echo 1 |sudo tee /proc/sys/kernel/randomize_va_space fi if test "$pass" = "0" then echo "switching off aslr" echo 0 |sudo tee /proc/sys/kernel/randomize_va_space fi } file_find=`find / -type f -name $1 2>/dev/null` echo "found : $file_find" green='\033[1;32m' NC='\033[0m' yellow='\033[1;33m' echo -e "\n" echo -n -e " ${yellow} ANALYSING BINARY ${NC}" animate echo -e "\n" echo -e "${green} Granting $file_find binary file : exeutable Permision \n ${NC}" chmod 777 $file_find ls -al $1 echo -e "\n" echo -e "${green} This the binary file Type :\n ${NC}" file $file_find echo -e "\n" echo -e "${green} This are the only binary file Protections :)\n ${NC}" /bin/checksec -f $file_find aslr