Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/scanner/memcached/memcached_udp_version.rb
Views: 11784
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Auxiliary::Report7include Msf::Exploit::Capture8include Msf::Auxiliary::UDPScanner910def initialize11super(12'Name' => 'Memcached UDP Version Scanner',13'Description' => %q(14This module can be used to discover Memcached servers which expose the15unrestricted UDP port 11211. A basic "version" request is executed to obtain16the version of memcached.17),18'Author' =>19[20'Jon Hart <[email protected]>' # Metasploit scanner module21],22'License' => MSF_LICENSE,23'DisclosureDate' => 'Jul 23 2003',24'References' =>25[26['URL', 'https://github.com/memcached/memcached/blob/master/doc/protocol.txt']27]28)2930register_options(31[32Opt::RPORT(11211)33]34)35end3637def build_probe38# Memcached version probe, per https://github.com/memcached/memcached/blob/master/doc/protocol.txt39@memcached_probe ||= [40rand(2**16), # random request ID410, # sequence number421, # number of datagrams in this sequence430, # reserved; must be 044"version\r\n"45].pack("nnnna*")46end4748def scanner_process(data, shost, sport)49# Check the response data for a "VERSION" response50if /VERSION (?<version>[\d\.]+)\r\n/ =~ data51print_good("#{shost}:#{sport}/udp memcached version #{version}")52report_service(53host: shost,54proto: 'udp',55port: rport,56info: version,57name: 'memcached'58)59end60end61end626364