Skip to content

Commit c1074c1

Browse files
committed
Move the options into the mixin
1 parent 7fdb1e0 commit c1074c1

File tree

2 files changed

+19
-22
lines changed

2 files changed

+19
-22
lines changed

lib/msf/core/exploit/remote/http_client.rb

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module Exploit::Remote::HttpClient
1616
include Msf::Auxiliary::Report
1717
include Msf::Auxiliary::LoginScanner
1818
include Msf::Exploit::Remote::Kerberos::Ticket::Storage
19+
include Msf::Exploit::Remote::Kerberos::ServiceAuthenticator::Options
1920

2021
#
2122
# Initializes an exploit module that exploits a vulnerability in an HTTP
@@ -36,6 +37,8 @@ def initialize(info = {})
3637

3738
register_advanced_options(
3839
[
40+
*kerberos_storage_options(protocol: 'HTTP'),
41+
*kerberos_auth_options(protocol: 'HTTP', auth_methods: Msf::Exploit::Remote::AuthOption::HTTP_OPTIONS),
3942
OptString.new('UserAgent', [false, 'The User-Agent header to use for all requests',
4043
Rex::UserAgent.session_agent
4144
]),
@@ -156,24 +159,22 @@ def connect(opts={})
156159

157160
http_logger_subscriber = Rex::Proto::Http::HttpLoggerSubscriber.new(logger: self)
158161

159-
if datastore['HTTP::Auth'] == Msf::Exploit::Remote::AuthOption::KERBEROS
160-
kerberos_authenticator = Msf::Exploit::Remote::Kerberos::ServiceAuthenticator::HTTP.new(
161-
host: datastore['DomainControllerRhost'],
162-
hostname: datastore['HTTP::Rhostname'],
163-
proxies: datastore['Proxies'],
164-
realm: datastore['DOMAIN'],
165-
username: datastore['HttpUsername'],
166-
password: datastore['HttpPassword'],
167-
timeout: 20, # datastore['timeout']
168-
framework: framework,
169-
framework_module: self,
170-
cache_file: datastore['HTTP::Krb5Ccname'].blank? ? nil : datastore['HTTP::Krb5Ccname'],
171-
mutual_auth: true,
172-
use_gss_checksum: true,
173-
ticket_storage: kerberos_ticket_storage,
174-
offered_etypes: Msf::Exploit::Remote::AuthOption.as_default_offered_etypes(datastore['HTTP::KrbOfferedEncryptionTypes'])
175-
)
176-
end
162+
kerberos_authenticator = Msf::Exploit::Remote::Kerberos::ServiceAuthenticator::HTTP.new(
163+
host: datastore['DomainControllerRhost'],
164+
hostname: datastore['HTTP::Rhostname'],
165+
proxies: datastore['Proxies'],
166+
realm: datastore['DOMAIN'],
167+
username: datastore['HttpUsername'],
168+
password: datastore['HttpPassword'],
169+
timeout: 20, # datastore['timeout']
170+
framework: framework,
171+
framework_module: self,
172+
cache_file: datastore['HTTP::Krb5Ccname'].blank? ? nil : datastore['HTTP::Krb5Ccname'],
173+
mutual_auth: true,
174+
use_gss_checksum: true,
175+
ticket_storage: kerberos_ticket_storage,
176+
offered_etypes: Msf::Exploit::Remote::AuthOption.as_default_offered_etypes(datastore['HTTP::KrbOfferedEncryptionTypes'])
177+
)
177178

178179
nclient = Rex::Proto::Http::Client.new(
179180
opts['rhost'] || rhost,

modules/auxiliary/scanner/http/title.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ class MetasploitModule < Msf::Auxiliary
88
include Msf::Exploit::Remote::HttpClient
99
# Scanner mixin should be near last
1010
include Msf::Auxiliary::Scanner
11-
include Msf::Exploit::Remote::Kerberos::Ticket::Storage
12-
include Msf::Exploit::Remote::Kerberos::ServiceAuthenticator::Options
1311

1412
def initialize
1513
super(
@@ -33,8 +31,6 @@ def initialize
3331

3432
register_advanced_options(
3533
[
36-
*kerberos_storage_options(protocol: 'HTTP'),
37-
*kerberos_auth_options(protocol: 'HTTP', auth_methods: Msf::Exploit::Remote::AuthOption::HTTP_OPTIONS),
3834
OptString.new('HttpQueryString', [ false, 'The HTTP query string', nil ]),
3935
OptBool.new('FollowRedirect', [ false, 'Follow a HTTP redirect', false ]),
4036
OptInt.new('FollowRedirectDepth', [false, 'Follow HTTP redirect depth', 1]),

0 commit comments

Comments
 (0)