leyyce / gort

⚡ Fast and concurrent Go based port scanner cli / lib with port service, MAC address and vendor lookup support
MIT License
11 stars 0 forks source link

Add support for IPv4 ranges and other features #4

Open bawzz234 opened 3 years ago

bawzz234 commented 3 years ago

Hello,

Thanks for creating this app. I was actually looking for a GOlang's port scanner. Simply because of its excellent performance on threads and accuracy. And the speed is incomparable to other languages.

It would be very useful if you could add these features:

So the command may look like this for IPv4 Ranges: gort.exe -threads=100 -protocol=tcp -host=123.123.12.23-123.123.12.255 -ports=8080,80,443

Hope you could add this features. There are lots of other port scanners from different languages, but rarely on golang. These features will surely bring this go app to the top.

Best Regards

leyyce commented 3 years ago

Hey, thanks for your detailed feedback. I will consider adding everything you addressed if I find the time.

Like you already noticed TCP-SYN scans at this time aren't supported yet but are definitely on my todo list. As I'm busy with university stuff at the moment I can't as actively work on this as I did before so excuse me if this may take some time and you won't hear back from me immediately about this.

About some of the other stuff you mentioned:

Add support for ipv4 Ranges. For example: 123.123.12.23-123.123.16.255

This already can be done in a way that slightly differs from what you requested and that would include some additional IPs trough specifying the IP range like this 123.123.12-16.23-255 but I will add the way you asked for as an additional option. Consider this as a kind of workaround for the moment.

Add function to save the open port results to a file (IP:Port) format. For example, the command used: gort.exe -threads=100 -protocol=tcp -host=123.123.12.23-123.123.12.255 -ports=8080,80,443 -output=result.txt if the open ports found from IPs they will be saved as IP:Port format. If multiple open ports found from same IP, then they will be added in new line like this: 123.123.12.132:80 123.123.12.132:8080

The functionality to export the scan results to a file is already present. This can be archived trough appending -file to your execution options. The scan result will be saved in a folder called scans that will be created in the current working directory. On the other hand I agree with your notion that the output could be formatted into something more programmatically usable. If I'm going this step I could format it like you suggested, one IP and port per line but I'm thinking about going with something even more structured here. What would you think about scan results outputted to JSON for example?

[
  {
    "target": "123.123.12.132",
    "open": [80, 8080],
    "closed": []
  },
  {
    "target": "123.123.12.133",
    "open": [80],
    "closed": [8080]
  }
]

a custom -timeout= option

Also a good idea but lowest on my priority list.