Skip to content
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

Port Scan #33

Closed
DeityLink2018 opened this issue Oct 19, 2020 · 7 comments
Closed

Port Scan #33

DeityLink2018 opened this issue Oct 19, 2020 · 7 comments

Comments

@DeityLink2018
Copy link

Is there a way that you can scan all 65535 ports using python3-nmap or am I just missing the right function to do so?

@nmmapper
Copy link
Owner

It's possible

 import nmap3
 nmap = nmap3.Nmap()
 results = nmap.scan_top_ports("host", args="-p 65535")

@DeityLink2018
Copy link
Author

Gotcha, thank you!

@DeityLink2018
Copy link
Author

So, the args="-p 65535" doesn't work. When ever i start a nc listener on a RHP my script is not picking anything up. It still only searches for the top common ports

@DeityLink2018
Copy link
Author

I think I know the problem. You are using --top-ports for the nmap command. When running a normal nmap command, --top-ports only reads the first "#" in this case its the default variable of 10. If i test this I get the same results as my script. If I change that default value in my command to 65535, it picks everything up. I don't know a good change for this personally but this information may help.

@S4eedb
Copy link

S4eedb commented Oct 20, 2020

you can use default

import nmap3
nmap = nmap3.Nmap()
results = nmap.scan_top_ports("ip", default="65535")

@nmmapper
Copy link
Owner

Try the the solution from @S4eedb if that does not work(probably it should) then try below.

  import nmap3
  nmap = nmap3.NmapScanTechniques()
  result = nmap.nmap_tcp_scan("192.168.178.1", args="-p 65535")

Might need to add a function for scan_all_ports(default="65535"). Because the script defines each nmap command sometimes nmap args as function simple functions.

@DeityLink2018
Copy link
Author

Ill give the solution a try, Ive been playing around with the code this morning and and I keep running into the problem that --top-port wont pick up anything beyond 65000 for some reason the moment I set nc to 65001, it wont pick it up anymore

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