MCPcopy Index your code
hub / github.com/AutoRecon/AutoRecon / run

Method run

autorecon/default-plugins/dirbuster.py:43–63  ·  view source on GitHub ↗
(self, service)

Source from the content-addressed store, hash-verified

41 return False
42
43 async def run(self, service):
44 dot_extensions = ','.join(['.' + x for x in self.get_option('ext').split(',')])
45 for wordlist in self.get_option('wordlist'):
46 name = os.path.splitext(os.path.basename(wordlist))[0]
47 if self.get_option('tool') == 'feroxbuster':
48 await service.execute('feroxbuster -u {http_scheme}://{addressv6}:{port}/ -t ' + str(self.get_option('threads')) + ' -w ' + wordlist + ' -x "' + self.get_option('ext') + '" -v -k ' + ('' if self.get_option('recursive') else '-n ') + '-q -e -r -o "{scandir}/{protocol}_{port}_{http_scheme}_feroxbuster_' + name + '.txt"' + (' ' + self.get_option('extras') if self.get_option('extras') else ''))
49
50 elif self.get_option('tool') == 'gobuster':
51 await service.execute('gobuster dir -u {http_scheme}://{addressv6}:{port}/ -t ' + str(self.get_option('threads')) + ' -w ' + wordlist + ' -e -k -x "' + self.get_option('ext') + '" -z -r -o "{scandir}/{protocol}_{port}_{http_scheme}_gobuster_' + name + '.txt"' + (' ' + self.get_option('extras') if self.get_option('extras') else ''))
52
53 elif self.get_option('tool') == 'dirsearch':
54 if service.target.ipversion == 'IPv6':
55 service.error('dirsearch does not support IPv6.')
56 else:
57 await service.execute('dirsearch -u {http_scheme}://{address}:{port}/ -t ' + str(self.get_option('threads')) + ' -e "' + self.get_option('ext') + '" -f -q -F ' + ('-r ' if self.get_option('recursive') else '') + '-w ' + wordlist + ' --format=plain -o "{scandir}/{protocol}_{port}_{http_scheme}_dirsearch_' + name + '.txt"' + (' ' + self.get_option('extras') if self.get_option('extras') else ''))
58
59 elif self.get_option('tool') == 'ffuf':
60 await service.execute('ffuf -u {http_scheme}://{addressv6}:{port}/FUZZ -t ' + str(self.get_option('threads')) + ' -w ' + wordlist + ' -e "' + dot_extensions + '" -v -r ' + ('-recursion ' if self.get_option('recursive') else '') + '-noninteractive' + (' ' + self.get_option('extras') if self.get_option('extras') else '') + ' | tee {scandir}/{protocol}_{port}_{http_scheme}_ffuf_' + name + '.txt')
61
62 elif self.get_option('tool') == 'dirb':
63 await service.execute('dirb {http_scheme}://{addressv6}:{port}/ ' + wordlist + ' -l ' + ('' if self.get_option('recursive') else '-r ') + '-S -X ",' + dot_extensions + '" -f -o "{scandir}/{protocol}_{port}_{http_scheme}_dirb_' + name + '.txt"' + (' ' + self.get_option('extras') if self.get_option('extras') else ''))
64
65 def manual(self, service, plugin_was_run):
66 dot_extensions = ','.join(['.' + x for x in self.get_option('ext').split(',')])

Callers

nothing calls this directly

Calls 3

get_optionMethod · 0.80
executeMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected