Sample Header Ad - 728x90

Automating dirb for scanning several URLs

2 votes
2 answers
3761 views
I have a bit of a problem making this script work and was wondering if anyone knew what the problem is. It is supposed to take a list of urls as input, scan them for sub directories and then output it to different files. for i in $(urls.txt); do echo $i; fn=$(echo $i | sed "s/\///g"); echo $fn; dirb $i /usr/share/wordlists/dirb/small.txt > $fn; done This script does correctly remove slashes for the new file but I get the error (translated from Swedish) that ": no such file or directory". Probably from the > $fn part. for i in $(urls.txt); do echo $i; fn=$(echo $i | sed "s/\///g"); echo $fn; dirb $i /usr/share/wordlists/dirb/small.txt -o $fn; done And trying to use dirb's own output I instead get an error like "OUTPUT_FILE httpwww.website.com (!) FATAL: Error opening output file: httpwww.website.com" And some clarification regarding the one liners: 1) loop through a list of urls 2) output the url to terminal 3) generate filename from url using sed 4) output filename to terminal 5) run url through dirb and try to output it to file name The supposed output file names look fine to me but aren't working. Does anyone know why that is?
Asked by Latedi (121 rep)
Aug 4, 2016, 09:27 AM
Last activity: Apr 23, 2025, 06:32 PM