Skip to content
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

UDPScanner library does not detect broadcast packets #9244

Open
bcoles opened this issue Nov 28, 2017 · 8 comments
Open

UDPScanner library does not detect broadcast packets #9244

bcoles opened this issue Nov 28, 2017 · 8 comments

Comments

@bcoles
Copy link
Contributor

bcoles commented Nov 28, 2017

Current behavior

The UDPScanner library does not detect broadcast packets.

There are services which will send a reply to a broadcast address, not the source IP address, regardless of whether the initial packet was broadcast or was sent to the host directly.

The scanner_process method is not executed when broadcast traffic appears on the network interface. As such, the @results variable is never populated with the replies, and no replies are available in scanner_postscan.

The current approach taken by various auxiliary modules (scanner and discovery) is to use the Msf::Exploit::Capture library and bespoke spaghetti code that's not reusable.

Additionally, this approach requires custom timeouts for the capture. Attempting to combine this approach with the UDPScanner library, so as to take advantage of the request batching, will cause the module to block on the UDPScanner's ScannerRecvWindow timeout duration which is executed for each batch of hosts.

Expected behavior

The UDPScanner library should be able to detect broadcast packets.

Given that several UDPScanner modules already operate on the assumption that only network traffic directed at the metasploit host should be parsed, and given the noisy nature of modern networks thanks to zero-conf, any changes which allow broadcast traffic to be parsed by the UDPScanner library should probably be added as an optional configuration option (off by default).

@bcoles
Copy link
Contributor Author

bcoles commented Nov 28, 2017

@busterb tagging you as this issue is somewhat related to #8828

@busterb
Copy link
Member

busterb commented Dec 19, 2017

sounds useful. Is this different enough to have a different mixin? UDPBroadcastScanner?

@busterb
Copy link
Member

busterb commented Dec 29, 2017

I don't see any precedent for Socket::SO_BROADCAST being used in framework, but rather always raw sockets. Why is that?

@bcoles
Copy link
Contributor Author

bcoles commented Jan 10, 2018

image

@bcoles
Copy link
Contributor Author

bcoles commented Jun 1, 2018

This has since caused an issue on two separate occasions.

Once, on a device I promptly irrecoverably bricked because I'm awesome. Similar to the ASUS Infosvr service, the device replies to 255.255.255.255, rather than directly to the broadcast host.

Secondly, on a HID VertX door controller, as per #10126.

@bcoles
Copy link
Contributor Author

bcoles commented Jun 4, 2018

I'm undecided on UDPBroadcastScanner.

The modules for the protocols mentioned above are dual use - they can be used to gather information from an IP directly, or all IPs that respond to a 255.255.255.255 broadcast packet. In the event that the target IP address is already known, targeting the host directly is stealthier than broadcasting. Splitting a module into two (broadcast/discovery style and scanner/gather style) is overkill.

There's also the issue of whether broadcast modules should be moved to modules/auxiliary/scanner/discovery/; again complicated by dual use. Other such modules include the mDNS Query and WSDD Query modules.

I have no intention of resolving this issue, but will leave the PRs open should someone wish to resolve the issue in the future.

@bcoles
Copy link
Contributor Author

bcoles commented Jun 10, 2018

This issue also affects the scanner/jenkins/jenkins_udp_broadcast_enum module, which could identify all Jenkins servers with a single broadcast packet to 255.255.255.255 in the event that the module is rewritten to use UDPScanner, and the UDPScanner library was rewritten to support broadcast packets.

@github-actions
Copy link

Hi!

This issue has been left open with no activity for a while now.

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 30 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request.

@github-actions github-actions bot added the Stale Marks an issue as stale, to be closed if no action is taken label Dec 11, 2020
@dwelch-r7 dwelch-r7 removed the Stale Marks an issue as stale, to be closed if no action is taken label Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants