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/lib/metasploit/framework/login_scanner/ipboard.rb
Views: 1904
require 'metasploit/framework/login_scanner/http'12module Metasploit3module Framework4module LoginScanner56# IP Board login scanner7class IPBoard < HTTP89# @!attribute http_username10# @return [String]11attr_accessor :http_username1213# @!attribute http_password14# @return [String]15attr_accessor :http_password1617# (see Base#attempt_login)18def attempt_login(credential)19result_opts = {20credential: credential,21host: host,22port: port,23protocol: 'tcp'24}25if ssl26result_opts[:service_name] = 'https'27else28result_opts[:service_name] = 'http'29end3031begin3233nonce_response = send_request({34'uri' => uri,35'method' => 'GET'36})3738if nonce_response.body =~ /name='auth_key'\s+value='.*?((?:[a-z0-9]*))'/i39server_nonce = $14041if uri.end_with? '/'42base_uri = uri.gsub(/\/$/, '')43else44base_uri = uri45end4647auth_uri = "#{base_uri}/index.php"4849response = send_request({50'uri' => auth_uri,51'method' => 'POST',52'vars_get' => {53'app' => 'core',54'module' => 'global',55'section' => 'login',56'do' => 'process'57},58'vars_post' => {59'auth_key' => server_nonce,60'ips_username' => credential.public,61'ips_password' => credential.private62}63})6465if response && response.get_cookies.include?('ipsconnect') && response.get_cookies.include?('coppa')66result_opts.merge!(status: Metasploit::Model::Login::Status::SUCCESSFUL, proof: response)67else68result_opts.merge!(status: Metasploit::Model::Login::Status::INCORRECT, proof: response)69end7071else72result_opts.merge!(status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: "Server nonce not present, potentially not an IP Board install or bad URI.")73end74rescue ::EOFError, Rex::ConnectionError, ::Timeout::Error => e75result_opts.merge!(status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT, proof: e)76end7778Result.new(result_opts)7980end818283# (see Base#set_sane_defaults)84def set_sane_defaults85self.uri = "/forum/" if self.uri.nil?86@method = "POST".freeze8788super89end9091# The method *must* be "POST", so don't let the user change it92# @raise [RuntimeError]93def method=(_)94raise RuntimeError, "Method must be POST for IPBoard"95end9697end98end99end100end101102103104