im a begginer at bash scripting, i was able to do a subdomain bruteforce but now im stuck at directory bruteforce, im using "curl" to do a get request and get a response (200,400,301) but im not able to make it work
domain=$1
curl=$(curl --write-out %{http_code} --silent --output /dev/null $domain/$dir)
while read dir;do
$curl
if [ $curl != 400 ];then
echo "Dominios encontrados: " $domain/$dir
fi
done < listadiretorios.txt
I know its too stupid but ive already looked for answers and did not find anything :)
"$domain/$dir"
. URLs are especially likely to contain shell metacharacters (like&
) that will affect the shell's operation. See Why does my shell script choke on whitespace or other special characters?. Also, why are you setting variable $curl to be the output from acurl
command, and then trying to execute the contents of that variable inside awhile read
loop? – cas May 20 '22 at 03:50