Skip to content

Config file not working as expected with specified ports #649

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

Open
israelrg opened this issue Aug 20, 2024 · 2 comments
Open

Config file not working as expected with specified ports #649

israelrg opened this issue Aug 20, 2024 · 2 comments

Comments

@israelrg
Copy link
Contributor

Describe the bug
Specifying the ports in the config file does not work correctly. It will scan all ports

To Reproduce
Config file:

addresses = ["8.8.8.8"]

[ports]
53 = 1 

Execute ./rustscan

Expected behavior
It should only try to scan the port 53

Screenshots
imagen

Desktop (please complete the following information):

  • OS: Fedora
  • Version 39

Additional context
Add any other context about the problem here.

@PsypherPunk
Copy link
Collaborator

I think you're correct that this isn't quite working but I'm a little stumped as to the config.

When passed in as a flag, ports is aVec<u16>:

pub ports: Option<Vec<u16>>,

…but when read from the config. it's a HashMap<String, u16>:

ports: Option<HashMap<String, u16>>,

It's not clear what that Map is mapping though…?!

@NewBieCoderXD
Copy link

I think you need to use argument --top for ports in config to be used.
Can you try ./rustscan --top?

But @PsypherPunk has a point, is there a reason current config use hashmap instead of vector?
Wouldn't it be better if config is like

ports = [8080,3000]

instead of

[ports]
8080 = 1
3000 = 1

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

No branches or pull requests

3 participants