Created
June 1, 2020 12:16
-
-
Save nknskn/9de287999ae52fe730fdbc0aa7ae0083 to your computer and use it in GitHub Desktop.
AutoRecon wrapper for OSCP lab
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function Usage () { | |
echo "Usage: $(basename $0) -f <IP list file>" | |
echo | |
echo "Depends on : autorecon.py" | |
echo " If you have not cloned, clone autorecon repository." | |
echo " git clone https://github.com/Tib3rius/AutoRecon" | |
exit 1 | |
} | |
TOOLPATH=$(locate autorecon.py) | |
MONITORINGNAME="autorecon" | |
MAXPROCESSES=4 | |
if echo "${TOOLPATH}" | grep -s -q ${MONITORINGNAME} ; then | |
echo -e "[I] ${MONITORINGNAME} is installed, Scanning will be started.\n" | |
else | |
echo -e "[!] ${MONITORINGNAME} is not installed!" | |
echo -e "[-] Error." | |
echo | |
Usage | |
fi | |
while getopts ":f:h" OPT | |
do | |
case ${OPT} in | |
f) IFS=$IFS_SAVE | |
IFS=$'\n' | |
IPLIST=(`cat "${OPTARG}"`) ;; | |
h) Usage ;; | |
:) echo "[!] Undefined option."; Usage ;; | |
\?) echo "[!] Undefined option."; Usage ;; | |
esac | |
done | |
for line in ${IPLIST[@]} | |
do | |
echo "[I] Scan start: ${line}" | |
${TOOLPATH} ${line} & | |
while [ $(ps -ef | grep -v grep | grep ${MONITORINGNAME} | rev | cut -d" " -f1 | rev | sort -u | wc -l) -gt ${MAXPROCESSES} ] | |
do | |
sleep 60 | |
echo "============================================" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment