CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/scanner/http/buffalo_login.rb
Views: 1904
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
end
31
32
def run_host(ip)
33
cred_collection = build_credential_collection(
34
username: datastore['USERNAME'],
35
password: datastore['PASSWORD']
36
)
37
38
scanner = Metasploit::Framework::LoginScanner::Buffalo.new(
39
configure_http_login_scanner(
40
cred_details: cred_collection,
41
stop_on_success: datastore['STOP_ON_SUCCESS'],
42
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
43
connection_timeout: 10,
44
http_username: datastore['HttpUsername'],
45
http_password: datastore['HttpPassword']
46
)
47
)
48
49
scanner.scan! do |result|
50
credential_data = result.to_h
51
credential_data.merge!(
52
module_fullname: fullname,
53
workspace_id: myworkspace_id
54
)
55
if result.success?
56
credential_core = create_credential(credential_data)
57
credential_data[:core] = credential_core
58
create_credential_login(credential_data)
59
60
print_good "#{ip}:#{rport} - Login Successful: #{result.credential}"
61
else
62
invalidate_login(credential_data)
63
vprint_error "#{ip}:#{rport} - LOGIN FAILED: #{result.credential} (#{result.status})"
64
end
65
end
66
end
67
end
68
69