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/chargen/chargen_probe.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::Scanner7include Msf::Exploit::Capture8include Msf::Auxiliary::Report9include Msf::Exploit::Remote::Udp10include Msf::Auxiliary::DRDoS11include Msf::Auxiliary::UDPScanner1213def initialize14super(15'Name' => 'Chargen Probe Utility',16'Description' => %q{17Chargen is a debugging and measurement tool and a character18generator service. A character generator service simply sends19data without regard to the input.20Chargen is susceptible to spoofing the source of transmissions21as well as use in a reflection attack vector. The misuse of the22testing features of the Chargen service may allow attackers to23craft malicious network payloads and reflect them by spoofing24the transmission source to effectively direct it to a target.25This can result in traffic loops and service degradation with26large amounts of network traffic.27},28'Author' => 'Matteo Cantoni <goony[at]nothink.org>',29'License' => MSF_LICENSE,30'References' =>31[32[ 'CVE', '1999-0103' ], # Note, does not actually trigger a flood.33[ 'URL', 'http://tools.ietf.org/html/rfc864' ]34],35'DisclosureDate' => 'Feb 08 1996')3637register_options([38Opt::RPORT(19)39])40end4142def run_host(rhost)43data = Rex::Text.rand_text_alpha_lower(1)44if spoofed?45scanner_spoof_send(data, rhost, datastore['RPORT'], datastore['SRCIP'], datastore['NUM_REQUESTS'])46else47begin48connect_udp49udp_sock.write(data)50r = udp_sock.recvfrom(65535, 0.1)5152if r and r[1]53vprint_status("#{rhost}:#{rport} - Response: #{r[0].to_s}")54res = r[0].to_s.strip55if (res.match(/ABCDEFGHIJKLMNOPQRSTUVWXYZ/i) || res.match(/0123456789/))56print_good("#{rhost}:#{rport} answers with #{res.length} bytes (headers + UDP payload)")57report_service(:host => rhost, :port => rport, :proto => "udp", :name => "chargen", :info => res.length)58end59end60rescue ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionRefused61nil62ensure63disconnect_udp if self.udp_sock64end65end66end67end686970