Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/http/buffalo_login.rb
19535 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
require 'metasploit/framework/credential_collection'
7
require 'metasploit/framework/login_scanner/buffalo'
8
9
class MetasploitModule < Msf::Auxiliary
10
include Msf::Exploit::Remote::HttpClient
11
include Msf::Auxiliary::Scanner
12
include Msf::Auxiliary::Report
13
include Msf::Auxiliary::AuthBrute
14
15
def initialize
16
super(
17
'Name' => 'Buffalo NAS Login Utility',
18
'Description' => %q{
19
This module simply attempts to login to a Buffalo NAS instance using a specific
20
username and password. It has been confirmed to work on version 1.68
21
},
22
'Author' => [ 'Nicholas Starke <starke.nicholas[at]gmail.com>' ],
23
'License' => MSF_LICENSE
24
)
25
26
register_options(
27
[
28
Opt::RPORT(80)
29
]
30
)
31
end
32
33
def run_host(ip)
34
cred_collection = build_credential_collection(
35
username: datastore['USERNAME'],
36
password: datastore['PASSWORD']
37
)
38
39
scanner = Metasploit::Framework::LoginScanner::Buffalo.new(
40
configure_http_login_scanner(
41
cred_details: cred_collection,
42
stop_on_success: datastore['STOP_ON_SUCCESS'],
43
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
44
connection_timeout: 10,
45
http_username: datastore['HttpUsername'],
46
http_password: datastore['HttpPassword']
47
)
48
)
49
50
scanner.scan! do |result|
51
credential_data = result.to_h
52
credential_data.merge!(
53
module_fullname: fullname,
54
workspace_id: myworkspace_id
55
)
56
if result.success?
57
credential_core = create_credential(credential_data)
58
credential_data[:core] = credential_core
59
create_credential_login(credential_data)
60
61
print_good "#{ip}:#{rport} - Login Successful: #{result.credential}"
62
else
63
invalidate_login(credential_data)
64
vprint_error "#{ip}:#{rport} - LOGIN FAILED: #{result.credential} (#{result.status})"
65
end
66
end
67
end
68
end
69
70