Skip to content

Commit

Permalink
Fixed an issue with cache bleeding when using -l
Browse files Browse the repository at this point in the history
  • Loading branch information
jekyc committed Mar 15, 2015
1 parent aff492d commit 3ad0b5c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion classes/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def _remove_old_caches(self):

def _get_name_for_cache_file(self):
# check if there already is an older version of the cache
# if there is, return the name of this file, such that,
# if there is, return the name of this file.
# it will be overwritten
if not os.path.exists(self.cache_dir):
os.makedirs(self.cache_dir)
Expand Down
2 changes: 1 addition & 1 deletion classes/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def add_results(self):

site = {
'statistics': {
'start_time': None,
'start_time': self.data['timer'],
'run_time': self.data['runtime'],
'urls': self.data['url_count'],
'fingerprints': self.num_fps
Expand Down
8 changes: 7 additions & 1 deletion wig.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def __init__(self, args):

if args.input_file is not None:
interactive = False

with open(args.input_file,'r') as input_file:
urls = []
for url in input_file.readlines():
Expand Down Expand Up @@ -108,7 +109,6 @@ def scan_site(self):
msg = 'Scanning %s...' % (self.options['url'])
print(self.data['colorizer'].format(msg, 'green', True))



# load cache if this is not disabled
self.data['cache'].set_host(self.options['url'])
Expand Down Expand Up @@ -228,12 +228,18 @@ def scan_site(self):
""" ------------------------------------ """


def reset(self):
self.data['results'] = Results(self.options)
self.data['cache'] = Cache()

def run(self):

if self.options['urls'] is not None:
for url in self.options['urls']:
self.reset()
self.options['url'] = url.strip()
self.scan_site()

else:
self.scan_site()

Expand Down

0 comments on commit 3ad0b5c

Please sign in to comment.