Skip to content

Commit

Permalink
feat(CornerShot): simpler skipping (no port)
Browse files Browse the repository at this point in the history
  • Loading branch information
sagiesec committed Feb 10, 2021
1 parent cfd1e9a commit 5497893
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions cornershot/cornershot.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ def _shots_generator(self, destinations, targets, target_ports, destination_port

def _merge_result(self, dest, target, tport, state):
if self.skip_scanned and PORT_OPEN in state:
tp_pair = target + ":" + str(tport)
if tp_pair not in self.already_scanned:
self.already_scanned.append(tp_pair)
if target not in self.already_scanned:
self.already_scanned.append(target)

if dest not in self.results:
self.results[dest] = {}
Expand All @@ -123,11 +122,10 @@ def _get_next_tasks(self,remaining):
iterated_shots = 0
for bullet in self.shot_list:
if remaining > 0:
trgt = bullet.target + ":" + str(bullet.trgt_port)
if trgt not in self.already_scanned:
if bullet.target not in self.already_scanned:
new_tasks.append(bullet)
else:
logger.info(f"Skipping {trgt}, already scanned...")
logger.info(f"Skipping {bullet.target}, already scanned...")
self.total_shots -= 1
iterated_shots += 1
remaining -= 1
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
setup(
name='cornershot',
python_requires='>=3',
version='0.2.12',
version='0.2.13',
description='Library to test network connectivity',
long_description_content_type='text/markdown',
long_description=long_description,
Expand Down

0 comments on commit 5497893

Please sign in to comment.