File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
lib/metasploit/framework/login_scanner
modules/auxiliary/scanner/telnet Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1
1
require 'metasploit/framework/telnet/client'
2
2
require 'metasploit/framework/login_scanner/base'
3
3
require 'metasploit/framework/login_scanner/rex_socket'
4
+
4
5
module Metasploit
5
6
module Framework
6
7
module LoginScanner
7
-
8
8
# This is the LoginScanner class for dealing with Telnet remote terminals.
9
9
# It is responsible for taking a single target, and a list of credentials
10
10
# and attempting them. It then saves the results.
11
11
class Telnet
12
+
12
13
include Metasploit ::Framework ::LoginScanner ::Base
13
14
include Metasploit ::Framework ::LoginScanner ::RexSocket
14
15
include Metasploit ::Framework ::Telnet ::Client
@@ -25,11 +26,13 @@ class Telnet
25
26
#
26
27
# @return [Fixnum]
27
28
attr_accessor :banner_timeout
29
+
28
30
# @!attribute verbosity
29
31
# The timeout to wait for the response from a telnet command.
30
32
#
31
33
# @return [Fixnum]
32
34
attr_accessor :telnet_timeout
35
+
33
36
# @!attribute verbosity
34
37
# Prepend code to call before checking for a user login
35
38
#
@@ -125,10 +128,11 @@ def set_sane_defaults
125
128
create_login_ivars
126
129
end
127
130
128
- def print_error ( message )
129
- return if ! @parent
130
- @parent . print_error message
131
+ def print_error ( message )
132
+ return unless @parent
133
+ @parent . print_error ( message )
131
134
end
135
+
132
136
end
133
137
end
134
138
end
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ def run_host(ip)
113
113
send_delay : datastore [ 'TCP::send_delay' ] ,
114
114
banner_timeout : datastore [ 'TelnetBannerTimeout' ] ,
115
115
telnet_timeout : datastore [ 'TelnetTimeout' ] ,
116
- pre_login : lambda { |s | raw_send ( "enable\r \n " , nsock = s . sock ) } ,
116
+ pre_login : lambda { |s | raw_send ( "enable\r \n " , s . sock ) } ,
117
117
framework : framework ,
118
118
framework_module : self ,
119
119
)
You can’t perform that action at this time.
0 commit comments