8000 fix: avoid duplicate IP addresses by PsypherPunk · Pull Request #660 · bee-san/RustScan · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: avoid duplicate IP addresses #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 21, 2024

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
6 checks passed
@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
0