Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Add support for scanning multiple IPs #27

Closed
claudijd opened this issue Feb 23, 2016 · 28 comments
Closed

Add support for scanning multiple IPs #27

claudijd opened this issue Feb 23, 2016 · 28 comments

Comments

@claudijd
Copy link
Contributor

Compliments of @leighalytle.

It should support scanning more than one host at a time.

1.) -t switch should support NMAP syntax targeting
2.) should add a -f switch to accept targeting info via file (should support NMAP style syntax)

@claudijd claudijd changed the title Add support for scanning a network Add support for scanning multiple IPs Feb 23, 2016
@claudijd
Copy link
Contributor Author

Requirements:

1.) Need a native mechanism to detect open ports
2.) Need better exception/error handling/output
3.) Need parsing logic and classes for NMAP-style targeting info

@claudijd
Copy link
Contributor Author

claudijd commented Mar 8, 2016

+1 (ran into a need for this again today)

@claudijd
Copy link
Contributor Author

claudijd commented Apr 18, 2016

4.) Have a way to detect SSH protocol (go a step beyond just knowing a service has port 22 open before we attempt to scan) <= an SSH protocol fingerprinter

@jinankjain
Copy link
Collaborator

@claudijd When doing a request over multiple IPs do you want result for each ip in different array or final result to get combined in one result array

@claudijd
Copy link
Contributor Author

@jinankjain I would like the resultant output of a multi-ip scan to be a single JSON document and an array of what we normally get from a scan seems like the right fit.

@jinankjain
Copy link
Collaborator

@claudijd so results for all the IP would be combined that single json array?

@claudijd
Copy link
Contributor Author

@jinankjain is making some progress on IP comma separated targeting in #65.

Other syntax we should consider supporting could include....

192.168.1.0/24 (== 192.168.1.1 thru 192.168.1.255)
192.168.1.1-255 (== 192.168.1.1 thru 192.168.1.255)
192.168.1.1,2 (== 192.168.1.1 && 192.168.1.2)

To gain the above, we'll probably need to implement some sort of IP parsing logic (at least for the CIDR notation). Consider Ruby IPAddr and CIDR gems to help with that. Might consider some customer parsing logic for the others.

@claudijd
Copy link
Contributor Author

claudijd commented Aug 11, 2016

Perhaps we should also have a command-line switch to load targets from a file. Looks like -f it still open. Might also consider having a -o flag for writing our JSON documents to disk.

@claudijd
Copy link
Contributor Author

@jinankjain yes, a single JSON array.

jinankjain added a commit to jinankjain/ssh_scan that referenced this issue Aug 11, 2016
jinankjain added a commit to jinankjain/ssh_scan that referenced this issue Aug 11, 2016
@jinankjain
Copy link
Collaborator

@claudijd I have implemented -f for loading targets via file but waiting for #65 to land so that could use that piece of code 😄

@claudijd claudijd reopened this Aug 12, 2016
@claudijd
Copy link
Contributor Author

Re-opening this issue, because it includes more than what was added in #65 I also realized we might consider updating the -h output to include an example of multi-ip usage.

@claudijd
Copy link
Contributor Author

@jinankjain sounds great about the -f stuff, looking forward to seeing/reviewing it.

@claudijd
Copy link
Contributor Author

#65 and #69 are getting us closer and closer to the eventual end state desire for this issue. What remains are the following...

  • Support for NMAP style targeting
  • Some better error handling and usage when specifying -f file that doesn't exist or has bad targeting info
  • Expand on -f to include multi-line file input support

@jinankjain
Copy link
Collaborator

@claudijd In the above list we need one more thing:

  • Update README example

@claudijd
Copy link
Contributor Author

@jinankjain exactly, thanks for adding that

@claudijd
Copy link
Contributor Author

Partial NMAP-style targeted added in #76

@claudijd
Copy link
Contributor Author

claudijd commented Aug 15, 2016

Remaining todo's include:

  • Finish for NMAP style targeting via custom targeting parser
  • Some better error handling and usage when specifying -f file that doesn't exist or has bad targeting info
  • Expand on -f to include multi-line file input support
  • Need a fast way to detect open-ports/protocol fingerprint and timeout when we don't see what we expect
  • Update README example to make sure it's fully up to date with above changes

@claudijd
Copy link
Contributor Author

Also, added threading concept, but I think it's out of scope for this issue.

@jinankjain
Copy link
Collaborator

jinankjain commented Aug 16, 2016

Remaining TODO's include:

  • Finish for NMAP style targeting via custom targeting parser
  • Need a fast way to detect open-ports/protocol fingerprint and timeout when we don't see what we expect

@jinankjain
Copy link
Collaborator

@claudijd I don't think so we would be able to support 192.168.1.1,2 (== 192.168.1.1 && 192.168.1.2) this syntax as we are using comma as separator for different IP address or HostName or Ranges. If we want this then we can do this under some another flag but not -t

@claudijd
Copy link
Contributor Author

I'm fine with dropping 192.168.1.1,2 syntax as a requirement for the custom parser if it makes it easier, it's certainly one of the less common use cases with IP, CIDR, and "-" notation being preferred.

@jinankjain
Copy link
Collaborator

@claudijd We can close this now

@claudijd
Copy link
Contributor Author

@jinankjain I think we're still missing a fast way to detect open services, there is a pending PR for this in #92 but it's not mergable because a lot of the dependent code changed recently.

@jinankjain
Copy link
Collaborator

@claudijd Let's see I will try to rebase that PR hope that works

@claudijd
Copy link
Contributor Author

@jinankjain it likely needs a re-write because a lot of that code changed in the past couple days

@jinankjain
Copy link
Collaborator

@claudijd I looked at the code and felt the same as we have completely refactored scan_engine so it needs a rewrite

@jinankjain
Copy link
Collaborator

@claudijd This can also be closed now with #92

@claudijd
Copy link
Contributor Author

@jinankjain thanks for all your help with this, I really appreciate you championing this much needed feature set and hunting it down!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants