Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/metasploit/framework/login_scanner/advantech_webaccess.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def check_setup
})

if res && res.body =~ /Welcome to Advantech WebAccess/i
report_service(service_opts)
return false
end

Expand Down Expand Up @@ -67,9 +68,7 @@ def attempt_login(credential)
credential: credential,
status: Metasploit::Model::Login::Status::INCORRECT,
proof: nil,
host: host,
port: port,
protocol: 'tcp'
**service_as_result(service_opts)
}

begin
Expand All @@ -82,6 +81,10 @@ def attempt_login(credential)
Result.new(result_opts)
end

def service_opts
build_service_opts('advantech_webaccess')
end

end
end
end
Expand Down
13 changes: 5 additions & 8 deletions lib/metasploit/framework/login_scanner/axis2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@ class Axis2 < HTTP
def attempt_login(credential)
result_opts = {
credential: credential,
host: host,
port: port,
protocol: 'tcp'
**service_as_result(service_opts)
}
if ssl
result_opts[:service_name] = 'https'
else
result_opts[:service_name] = 'http'
end

begin
# Refactor to access Metasploit::Framework::LoginScanner::HTTP#send_request()
Expand Down Expand Up @@ -69,6 +62,10 @@ def method=(_)
raise RuntimeError, "Method must be POST for Axis2"
end

def service_opts
build_service_opts('axis2')
end

end
end
end
Expand Down
4 changes: 4 additions & 0 deletions lib/metasploit/framework/login_scanner/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ def sleep_between_attempts(time=self.sleep_time)
::IO.select(nil,nil,nil,time) unless sleep_time.zero?
end

def workspace
framework_module&.workspace || framework&.db&.workspace&.name
end

def each_credential
cred_details.each do |raw_cred|

Expand Down
10 changes: 7 additions & 3 deletions lib/metasploit/framework/login_scanner/bavision_cameras.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ def check_setup
return "Unable to locate \"realm=IPCamera Login\" in headers. (Is this really a BAVision camera?)"
end

report_service(service_opts)

false
end

Expand Down Expand Up @@ -105,9 +107,7 @@ def attempt_login(credential)
credential: credential,
status: Metasploit::Model::Login::Status::INCORRECT,
proof: nil,
host: host,
port: port,
protocol: 'tcp'
**service_as_result(service_opts)
}

begin
Expand All @@ -120,6 +120,10 @@ def attempt_login(credential)
Result.new(result_opts)
end

def service_opts
build_service_opts('bavision_cameras')
end

end
end
end
Expand Down
13 changes: 5 additions & 8 deletions lib/metasploit/framework/login_scanner/buffalo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,8 @@ def set_sane_defaults
def attempt_login(credential)
result_opts = {
credential: credential,
host: host,
port: port,
protocol: 'tcp'
**service_as_result(service_opts)
}
if ssl
result_opts[:service_name] = 'https'
else
result_opts[:service_name] = 'http'
end
begin
res = send_request({
'method'=>'POST',
Expand All @@ -57,6 +50,10 @@ def attempt_login(credential)
end
Result.new(result_opts)
end

def service_opts
build_service_opts('buffalo')
end
end
end
end
Expand Down
14 changes: 5 additions & 9 deletions lib/metasploit/framework/login_scanner/caidao.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,20 @@ def attempt_login(credential)
credential: credential,
status: Metasploit::Model::Login::Status::INCORRECT,
proof: nil,
host: host,
port: port,
protocol: 'tcp'
**service_as_result(service_opts)
}

if ssl
result_opts[:service_name] = 'https'
else
result_opts[:service_name] = 'http'
end

begin
result_opts.merge!(try_login(credential.public, credential.private))
rescue ::Rex::ConnectionError => e
result_opts.merge!(status: LOGIN_STATUS::UNABLE_TO_CONNECT, proof: e.message)
end
Result.new(result_opts)
end

def service_opts
build_service_opts('caidao')
end
end
end
end
Expand Down
10 changes: 7 additions & 3 deletions lib/metasploit/framework/login_scanner/chef_webui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def attempt_login(credential)
credential: credential,
status: Metasploit::Model::Login::Status::INCORRECT,
proof: nil,
host: host,
port: port,
protocol: 'tcp'
**service_as_result(service_opts)
}

begin
Expand Down Expand Up @@ -63,6 +61,8 @@ def check_setup
return "Unable to connect to target"
end

report_service(service_opts)

false
end

Expand Down Expand Up @@ -144,6 +144,10 @@ def try_login(credential)
{:status => Metasploit::Model::Login::Status::INCORRECT, :proof => res.body}
end

def service_opts
build_service_opts('chef_webui')
end

end
end
end
Expand Down
9 changes: 6 additions & 3 deletions lib/metasploit/framework/login_scanner/cisco_firepower.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def check_setup
})

if res && res.code == 200 && res.body.include?('/img/favicon.png?v=6.0.1-1213')
report_service(service_opts)
return false
end

Expand Down Expand Up @@ -58,9 +59,7 @@ def attempt_login(credential)
credential: credential,
status: Metasploit::Model::Login::Status::INCORRECT,
proof: nil,
host: host,
port: port,
protocol: 'tcp'
**service_as_result(service_opts)
}

begin
Expand All @@ -73,6 +72,10 @@ def attempt_login(credential)
Result.new(result_opts)
end

def service_opts
build_service_opts('cisco_firepower')
end

end
end
end
Expand Down
10 changes: 6 additions & 4 deletions lib/metasploit/framework/login_scanner/directadmin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def check_setup
res = send_request({'uri'=> login_uri})

if res && res.body.include?('DirectAdmin Login')
report_service(service_opts)
return false
end

Expand Down Expand Up @@ -99,10 +100,7 @@ def attempt_login(credential)
credential: credential,
status: Metasploit::Model::Login::Status::INCORRECT,
proof: nil,
host: host,
port: port,
protocol: 'tcp',
service_name: ssl ? 'https' : 'http'
**service_as_result(service_opts)
}

begin
Expand All @@ -115,6 +113,10 @@ def attempt_login(credential)
Result.new(result_opts)
end

def service_opts
build_service_opts('directadmin')
end

end
end
end
Expand Down
9 changes: 5 additions & 4 deletions lib/metasploit/framework/login_scanner/gitlab.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ def set_sane_defaults
def attempt_login(credential)
result_opts = {
credential: credential,
host: host,
port: port,
protocol: 'tcp',
service_name: ssl ? 'https' : 'http'
**service_as_result(service_opts)
}
begin
# Get a valid session cookie and authenticity_token for the next step
Expand Down Expand Up @@ -77,6 +74,10 @@ def attempt_login(credential)
end
Result.new(result_opts)
end

def service_opts
build_service_opts('gitlab')
end
end
end
end
Expand Down
10 changes: 9 additions & 1 deletion lib/metasploit/framework/login_scanner/glassfish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ def check_setup
return "Unable to connect to target"
end

report_service(service_opts)

false
end

Expand Down Expand Up @@ -203,7 +205,10 @@ def try_glassfish_3(credential)
# @param credential [Metasploit::Framework::Credential] The credential object
# @return [Result]
def attempt_login(credential)
result_opts = { credential: credential }
result_opts = {
credential: credential,
**service_as_result(service_opts)
}

begin
case self.version
Expand Down Expand Up @@ -248,6 +253,9 @@ def extract_version(banner)
return @version
end

def service_opts
build_service_opts('glassfish')
end

end
end
Expand Down
Loading
Loading