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

Add Memcached amplification scanner #9644

Merged
merged 9 commits into from
Mar 5, 2018
Merged

Add Memcached amplification scanner #9644

merged 9 commits into from
Mar 5, 2018

Conversation

xistence
Copy link
Contributor

@xistence xistence commented Feb 28, 2018

This module will scan Memcached instances for UDP amplification possibilities using a "stats" request packet.

All details for reproducing and testing are in the provided documentation.

@jhart-r7 jhart-r7 changed the title Feature/memcached amp Add Memcached amplification scanner Feb 28, 2018
Copy link
Contributor

@jhart-r7 jhart-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some simplification that can happen in the module to leverage UDPScanner.

Also, module documentation.

])
end

def rport
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already present in UDPScanner. Remove.

@memcached_probe = "\x00\x00\x00\x00\x00\x01\x00\x00stats\r\n"
end

def scanner_prescan(batch)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This largely already exists in UDPScanner. Remove.

@results = {}
end

def scan_host(ip)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you define build_probe, this method can go away as it duplicates what is already in UDPScanner

@jhart-r7
Copy link
Contributor

jhart-r7 commented Mar 1, 2018

I've submitted a PR to fix the UDPScanner duplication as https://github.com/xistence/metasploit-framework/pull/2. Now for some docs.


def scanner_process(data, shost, sport)
# Check the response data for a "STAT" repsonse
if data =~/\x00\x00\x00\x00\x00\x01\x00\x00STAT\x20/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will miss multi-packet responses. Will PR a fix.

@jhart-r7
Copy link
Contributor

jhart-r7 commented Mar 2, 2018

@xistence I've submitted https://github.com/xistence/metasploit-framework/pull/2 to fix the various issues I've pointed out.

@jhart-r7
Copy link
Contributor

jhart-r7 commented Mar 4, 2018

@xistence when you get a chance, please take a look at xistence#2 -- I believe that will address all concerns raised so far. Thanks for you contribution!

Simplify memcached amplification scanner to use UDPScanner for most of the work
@xistence
Copy link
Contributor Author

xistence commented Mar 5, 2018

@jhart-r7 verified all the changes and still works perfectly :)
Thanks for all the help and suggestions!

@jhart-r7 jhart-r7 merged commit 86677b8 into rapid7:master Mar 5, 2018
@jhart-r7
Copy link
Contributor

jhart-r7 commented Mar 5, 2018

Landed. Thanks again @xistence.

@tdoan-r7
Copy link
Contributor

Release Notes

The auxiliary/scanner/memcached/memcached_amp module has been added to the framework. It scans Memcached instances for UDP amplification possibilities using a "stats" request packet.

@tdoan-r7 tdoan-r7 added the rn-enhancement release notes enhancement label Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module rn-enhancement release notes enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants