Open mav8557 opened 2 years ago
Following up a year later while cleaning this up - an Async implementation would probably work for this also, and likely better. It's a good first tool facelift project, implementing both of these and testing to see which is truly fastest in practice.
Right now three goroutines are spawned per user, per box. This is a lot and will get slow with a large network.
A thread pool architecture can help. A certain number of threads, passed as configuration, are spawned at the beginning, and pull Jobs from the same channel. Each Job represents a connection attempt against a particular box, including the Username, IP, and protocol (SSH, SMB, winrm, etc).