Skip to content

Commit 8d982e3

Browse files
author
HD Moore
committed
Pass the framework/module down into LoginScanner
1 parent 985641d commit 8d982e3

31 files changed

+77
-17
lines changed

lib/metasploit/framework/ftp/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def data_connect(mode = nil, nsock = self.sock)
4747
self.datasocket = Rex::Socket::Tcp.create(
4848
'PeerHost' => datahost,
4949
'PeerPort' => dataport,
50-
'Context' => { 'Msf' => framework, 'MsfExploit' => self }
50+
'Context' => { 'Msf' => framework, 'MsfExploit' => framework_module }
5151
)
5252
end
5353
self.datasocket

lib/metasploit/framework/login_scanner/base.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ module Base
1212
include ActiveModel::Validations
1313

1414
included do
15+
# @!attribute framework
16+
# @return [Object] The framework instance object
17+
attr_accessor :framework
18+
# @!attribute framework_module
19+
# @return [Object] The framework module caller, if availale
20+
attr_accessor :framework_module
1521
# @!attribute connection_timeout
1622
# @return [Fixnum] The timeout in seconds for a single SSH connection
1723
attr_accessor :connection_timeout

lib/metasploit/framework/login_scanner/snmp.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def attempt_login(credential)
3838
:Timeout => connection_timeout,
3939
:Retries => 2,
4040
:Transport => ::SNMP::RexUDPTransport,
41-
:Socket => ::Rex::Socket::Udp.create('Context' => { 'Msf' => framework, 'MsfExploit' => self })
41+
:Socket => ::Rex::Socket::Udp.create('Context' => { 'Msf' => framework, 'MsfExploit' => framework_module })
4242
)
4343

4444
result_options[:proof] = test_read_access(snmp_client)

lib/metasploit/framework/tcp/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def connect(global = true, opts={})
9090
'SSLVersion' => opts['SSLVersion'] || ssl_version,
9191
'Proxies' => proxies,
9292
'Timeout' => (opts['ConnectTimeout'] || connection_timeout || 10).to_i,
93-
'Context' => { 'Msf' => framework, 'MsfExploit' => self }
93+
'Context' => { 'Msf' => framework, 'MsfExploit' => framework_module }
9494
)
9595
# enable evasions on this socket
9696
set_tcp_evasions(nsock)

modules/auxiliary/scanner/acpp/login.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ def run_host(ip)
7171
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
7272
connection_timeout: datastore['ConnectTimeout'],
7373
max_send_size: datastore['TCP::max_send_size'],
74-
send_delay: datastore['TCP::send_delay']
74+
send_delay: datastore['TCP::send_delay'],
75+
framework: framework,
76+
framework_module: self,
7577
)
7678

7779
scanner.scan! do |result|

modules/auxiliary/scanner/afp/afp_login.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ def run_host(ip)
6767
connection_timeout: 30,
6868
max_send_size: datastore['TCP::max_send_size'],
6969
send_delay: datastore['TCP::send_delay'],
70+
framework: framework,
71+
framework_module: self,
7072
)
7173

7274
scanner.scan! do |result|

modules/auxiliary/scanner/db2/db2_auth.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ def run_host(ip)
6565
connection_timeout: 30,
6666
max_send_size: datastore['TCP::max_send_size'],
6767
send_delay: datastore['TCP::send_delay'],
68+
framework: framework,
69+
framework_module: self,
6870
)
6971

7072
scanner.scan! do |result|

modules/auxiliary/scanner/ftp/ftp_login.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ def run_host(ip)
7878
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
7979
max_send_size: datastore['TCP::max_send_size'],
8080
send_delay: datastore['TCP::send_delay'],
81-
connection_timeout: 30
81+
connection_timeout: 30,
82+
framework: framework,
83+
framework_module: self,
8284
)
8385

8486
scanner.scan! do |result|

modules/auxiliary/scanner/http/appletv_login.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ def run_host(ip)
8383
stop_on_success: datastore['STOP_ON_SUCCESS'],
8484
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
8585
connection_timeout: 5,
86+
framework: framework,
87+
framework_module: self,
8688
)
8789

8890
scanner.scan! do |result|

modules/auxiliary/scanner/http/axis_login.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ def run_host(ip)
8888
bruteforce_speed: datastore['BRUTEFORCE_SPEED'],
8989
connection_timeout: 5,
9090
user_agent: datastore['UserAgent'],
91-
vhost: datastore['VHOST']
91+
vhost: datastore['VHOST'],
92+
framework: framework,
93+
framework_module: self,
9294
)
9395

9496
scanner.scan! do |result|

0 commit comments

Comments
 (0)