-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Add TCP protocol to SNMP login scanner #10841
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
Conversation
|
Jenkins test this please. |
|
Looks reasonable, but there does not seem to be a way to select or disable connecting with both protocols in parallel. Do you think there should be a way to select them? |
|
Answering my own question, I see you have it as a checkbox
|
|
It looks like the bigger issue is all of the UDP packets sent by this scanner appear to have an incorrect checksum, which explains why you originally saw the scanner error out as well. EDIT - hah, fooled again by Checksum offload, that looks fine. |
|
@busterb can you give a check-off list to make this merge-able ? 😃 |
|
Any suggestion ? |
|
Please have a look at this. |
|
|
The real issue that also side-tracked me when reviewing this was that this scanner only supports SNMPv2, which is pretty obsolete, even among the already-obsolete gear I tested it against which only supported SNMPv3. It made me question whether a higher-priority fix for this module would be in adding SNMPv3 support rather than TCP support. Tl;DR - I'd find SMNPv3 support more useful in this module than TCP today. At least it'd be easier to test in real-world scenarios. |
|
I took a good stab at fixing this up this morning, but there are some additional problems I found during testing. Namely, this uses an unconnected tcp socket via sendto, which doesn't appear to send any data, then uses recvfrom with a fixed buffer size, which when you do fix the socket connection problem, causes the whole scanner to hang indefinitely. I'm going to close this one for now. I think my best overall suggestion is that the scanner code here needs a lot more work than just swapping in the socket type. I might even suggest evaluating existing SNMP implementations for Ruby that actually implement the protocol properly, and changing the login scanner to use one of those instead of the minimal implementation present inside of this login scanner. https://rubygems.org/search?utf8=%E2%9C%93&query=snmp Thanks. |
This aims to add TCP protocol to snmp login scanner as requested in #9649 .
I tried to test the initial code without this changes on host running SNMP over UDP but couldn't get any result. But SNMP is properly configured and can be verified from following snap :
and MSF snmp scanner errors out with
Added the initial code with reference to already existing code for UDP.
will need help in following thing to polish this more :
May require lot of work to be able to merge. This is my first PR of many to come to this awesome Project 😄
Cheers 🍻