onesixtyone
onesixtyone copied to clipboard
multiple ports
SNMP uses ports 161 and 162 as standard. This tool only attempts to scan port 161 by default. There is a -p
option but this only takes one port. The code strtol(optarg, NULL, 10) == 0
will take the first number it finds in the string and set as the port, then drop everything else as soon as a bad character is encountered.
As such, -p161,162
will run, but only scan port 161. This is confusing and unexpected behavior given that the command runs without warning or error. The current code only ever errors out if -p
begins with a non-numeric character.
Suggestion: Implement functionality for multiple ports to be scanned from one program invocation. Allow the tool to take 161,162
and know to scan both ports 161 and 162. Additionally, scan both 161 and 162 by default