Skip to content

Conversation

@PsypherPunk
Copy link
Collaborator

@PsypherPunk PsypherPunk commented Sep 18, 2024

As mentioned in the linked issue, if an IP appears twice (either duplicated directly or part of an overlapping CIDR), it's scanned multiple times and any open ports appear duplicated.

You can quickly see this via:

rustscan --addresses 127.0.0.1,127.0.0.1 --scripts none

This proposed change loads everything into a BTreeSet before converting it back into a Vec which:

  • drops duplicates
  • maintains the original order (I think) doesn't maintain the original order, just the naturally-sorted order which match existing tests (is the original order important?)

fixes #651

@PsypherPunk PsypherPunk requested a review from bee-san September 18, 2024 16:46
avoid scanning duplicated IPs for overlapping CIDRs.

fixes bee-san#651
@PsypherPunk PsypherPunk force-pushed the 651-duplication-of-ports branch from 3f9362d to b708c70 Compare September 19, 2024 12:17
@bee-san
Copy link
Owner

bee-san commented Sep 21, 2024

maintains the original order (I think) doesn't maintain the original order, just the naturally-sorted order which match existing tests (is the original order important?)

Great question!! I think it should be important, but if current tests fail against that then we should fix it later on. I think if I entered a list of IPs I would want them to be scanned in that order 🤔

@bee-san bee-san merged commit da41cb0 into bee-san:master Sep 21, 2024
@PsypherPunk PsypherPunk deleted the 651-duplication-of-ports branch September 21, 2024 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dublication of ports in output

2 participants