Last active
May 31, 2020 22:40
-
-
Save bing0o/b630e9db69bfa19c9da39013ce47403e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
Usage(){ | |
echo -e "$blue | |
#Options: | |
\r -l, --list - List of Assets. | |
\r -u, --use - Use a Specific Function (split/probe). | |
\r -t, --thread - Thread Number For HTTProbe. | |
\r -n, --number - The Number of How Many Hosts in Each Part. | |
\r -o, --output - The output Directory to save the Results. | |
"$end | |
exit | |
} | |
SPLIT() { | |
[ -d "$out" ] || mkdir "$out" | |
cd $out | |
split ../$list -l $number -d "probe." | |
} | |
PROBE() { | |
for i in probe.* | |
do | |
cat $i | httprobe -c $thread >> hosts & | |
done | |
} | |
MAIN() { | |
[ "$list" == False ] && { printf "[!] Argument -l/--list required!\n"; Usage; } | |
case "$use" in | |
split) | |
SPLIT ;; | |
probe) | |
PROBE ;; | |
False) | |
SPLIT | |
PROBE ;; | |
esac | |
} | |
list=False | |
use=False | |
thread=100 | |
number=1000 | |
out=httprobe | |
while [ -n "$1" ]; do | |
case $1 in | |
-l|--list) | |
list=$2 | |
shift ;; | |
-u|--use) | |
use=$2 | |
shift ;; | |
-t|--thread) | |
thread=$2 | |
shift ;; | |
-n|--number) | |
number=$2 | |
shift ;; | |
-o|--output) | |
out=$2 | |
shift ;; | |
-h|--help) | |
Usage;; | |
*) | |
echo "[-] Unknown Option: $1" | |
Usage;; | |
esac | |
shift | |
done | |
MAIN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment