Telnet Service Banner Detection - Metasploit
This page contains detailed information about how to use the auxiliary/scanner/telnet/telnet_version metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.
Module Overview
Name: Telnet Service Banner Detection
Module: auxiliary/scanner/telnet/telnet_version
Source code: modules/auxiliary/scanner/telnet/telnet_version.rb
Disclosure date: -
Last modification time: 2020-06-11 13:09:25 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: telnet
Target network port(s): 23
List of CVEs: -
Detect telnet services
Module Ranking and Traits
Module Ranking:
- normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.
Basic Usage
This module is a scanner module, and is capable of testing against multiple hosts.
msf > use auxiliary/scanner/telnet/telnet_version
msf auxiliary(telnet_version) > show options
... show and set options ...
msf auxiliary(telnet_version) > set RHOSTS ip-range
msf auxiliary(telnet_version) > exploit
Other examples of setting the RHOSTS option:
Example 1:
msf auxiliary(telnet_version) > set RHOSTS 192.168.1.3-192.168.1.200
Example 2:
msf auxiliary(telnet_version) > set RHOSTS 192.168.1.1/24
Example 3:
msf auxiliary(telnet_version) > set RHOSTS file:/tmp/ip_list.txt
Required Options
- RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
Knowledge Base
Description
This module will scan a range of machines and prints the banner, usually containing the version of any telnet servers that are running on it.
Verification Steps
- Do:
use auxiliary/scanner/telnet/telnet_version
- Do:
set RHOSTS [IP]
- Do:
set THREADS [number of threads]
- Do:
run
Scenarios
msf > use auxiliary/scanner/telnet/telnet_version
msf auxiliary(scanner/telnet/telnet_version) > set RHOSTS 1.1.1.0/24
RHOSTS => 1.1.1.0/24
msf auxiliary(scanner/telnet/telnet_version) > set THREADS 254
THREADS => 254
msf auxiliary(scanner/telnet/telnet_version) > run
[*] 1.1.1.2:23 TELNET (GSM7224) \x0aUser:
[*] 1.1.1.56:23 TELNET Ubuntu 8.04\x0ametasploitable login:
[*] 1.1.1.116:23 TELNET Welcome to GoodTech Systems Telnet Server for Windows NT/2000/XP (Evaluation Copy)\x0a\x0a(C) Copyright 1996-2002 GoodTech Systems, Inc.\x0a\x0a\x0aLogin username:
[*] Scanned 254 of 256 hosts (099% complete)
[*] Scanned 255 of 256 hosts (099% complete)
[*] Scanned 256 of 256 hosts (100% complete)
[*] Auxiliary module execution completed
msf auxiliary(scanner/telnet/telnet_version) >
Go back to menu.
Msfconsole Usage
Here is how the scanner/telnet/telnet_version auxiliary module looks in the msfconsole:
msf6 > use auxiliary/scanner/telnet/telnet_version
msf6 auxiliary(scanner/telnet/telnet_version) > show info
Name: Telnet Service Banner Detection
Module: auxiliary/scanner/telnet/telnet_version
License: Metasploit Framework License (BSD)
Rank: Normal
Provided by:
hdm <[email protected]>
Check supported:
No
Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
PASSWORD no The password for the specified username
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 23 yes The target port (TCP)
THREADS 1 yes The number of concurrent threads (max one per host)
TIMEOUT 30 yes Timeout for the Telnet probe
USERNAME no The username to authenticate as
Description:
Detect telnet services
Module Options
This is a complete list of options available in the scanner/telnet/telnet_version auxiliary module:
msf6 auxiliary(scanner/telnet/telnet_version) > show options
Module options (auxiliary/scanner/telnet/telnet_version):
Name Current Setting Required Description
---- --------------- -------- -----------
PASSWORD no The password for the specified username
RHOSTS yes The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
RPORT 23 yes The target port (TCP)
THREADS 1 yes The number of concurrent threads (max one per host)
TIMEOUT 30 yes Timeout for the Telnet probe
USERNAME no The username to authenticate as
Advanced Options
Here is a complete list of advanced options supported by the scanner/telnet/telnet_version auxiliary module:
msf6 auxiliary(scanner/telnet/telnet_version) > show advanced
Module advanced options (auxiliary/scanner/telnet/telnet_version):
Name Current Setting Required Description
---- --------------- -------- -----------
CHOST no The local client address
CPORT no The local client port
ConnectTimeout 10 yes Maximum number of seconds to establish a TCP connection
Proxies no A proxy chain of format type:host:port[,type:host:port][...]
SSL false no Negotiate SSL/TLS for outgoing connections
SSLCipher no String for SSL cipher - "DHE-RSA-AES256-SHA" or "ADH"
SSLVerifyMode PEER no SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
SSLVersion Auto yes Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
ShowProgress true yes Display progress messages during a scan
ShowProgressPercent 10 yes The interval in percent that progress should be shown
TelnetBannerTimeout 25 yes The number of seconds to wait for the initial banner
TelnetTimeout 10 yes The number of seconds to wait for a reply from a Telnet command
VERBOSE false no Enable detailed status messages
WORKSPACE no Specify the workspace for this module
Auxiliary Actions
This is a list of all auxiliary actions that the scanner/telnet/telnet_version module can do:
msf6 auxiliary(scanner/telnet/telnet_version) > show actions
Auxiliary actions:
Name Description
---- -----------
Evasion Options
Here is the full list of possible evasion options supported by the scanner/telnet/telnet_version auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):
msf6 auxiliary(scanner/telnet/telnet_version) > show evasion
Module evasion options:
Name Current Setting Required Description
---- --------------- -------- -----------
TCP::max_send_size 0 no Maxiumum tcp segment size. (0 = disable)
TCP::send_delay 0 no Delays inserted before every send. (0 = disable)
Go back to menu.
Error Messages
This module may fail with the following error messages:
Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.
A network issue has occurred: <E.MESSAGE>
Here is a relevant code snippet related to the "A network issue has occurred: <E.MESSAGE>" error message:
35: banner_santized = Rex::Text.to_hex_ascii(banner.to_s)
36: print_good("#{ip}:#{rport} TELNET #{banner_santized}")
37: report_service(:host => rhost, :port => rport, :name => "telnet", :info => banner_santized)
38: end
39: rescue ::Rex::ConnectionError, ::Errno::ECONNRESET => e
40: print_error("A network issue has occurred: #{e.message}")
41: elog("A network issue has occurred", error: e)
42: rescue Timeout::Error => e
43: print_error("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.")
44: elog("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.", error: e)
45: rescue ::Exception => e
A network issue has occurred
Here is a relevant code snippet related to the "A network issue has occurred" error message:
36: print_good("#{ip}:#{rport} TELNET #{banner_santized}")
37: report_service(:host => rhost, :port => rport, :name => "telnet", :info => banner_santized)
38: end
39: rescue ::Rex::ConnectionError, ::Errno::ECONNRESET => e
40: print_error("A network issue has occurred: #{e.message}")
41: elog("A network issue has occurred", error: e)
42: rescue Timeout::Error => e
43: print_error("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.")
44: elog("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.", error: e)
45: rescue ::Exception => e
46: print_error("#{e} #{e.backtrace}")
<TARGET_HOST>:<RPORT>, Server timed out after <TO> seconds. Skipping.
Here is a relevant code snippet related to the "<TARGET_HOST>:<RPORT>, Server timed out after <TO> seconds. Skipping." error message:
38: end
39: rescue ::Rex::ConnectionError, ::Errno::ECONNRESET => e
40: print_error("A network issue has occurred: #{e.message}")
41: elog("A network issue has occurred", error: e)
42: rescue Timeout::Error => e
43: print_error("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.")
44: elog("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.", error: e)
45: rescue ::Exception => e
46: print_error("#{e} #{e.backtrace}")
47: elog(e)
48: end
<TARGET_HOST>:<RPORT>, Server timed out after <TO> seconds. Skipping.
Here is a relevant code snippet related to the "<TARGET_HOST>:<RPORT>, Server timed out after <TO> seconds. Skipping." error message:
39: rescue ::Rex::ConnectionError, ::Errno::ECONNRESET => e
40: print_error("A network issue has occurred: #{e.message}")
41: elog("A network issue has occurred", error: e)
42: rescue Timeout::Error => e
43: print_error("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.")
44: elog("#{target_host}:#{rport}, Server timed out after #{to} seconds. Skipping.", error: e)
45: rescue ::Exception => e
46: print_error("#{e} #{e.backtrace}")
47: elog(e)
48: end
49: end
Go back to menu.
Related Pull Requests
- #13608 Merged Pull Request: Standardise Error Logging
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #8116 Merged Pull Request: Fix #8061, Handle ::Errno::ECONNRESET in telnet_version
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #2525 Merged Pull Request: Change module boilerplate
- #1228 Merged Pull Request: MSFTIDY cleanup #1 - auxiliary
- #498 Merged Pull Request: Add DNS/TCP to enum_dns
- #404 Merged Pull Request: Banner encoding fix when running against dd-wrt on ruby 1.9.3
Go back to menu.
See Also
Check also the following modules related to this module:
- auxiliary/scanner/telnet/telnet_encrypt_overflow
- auxiliary/scanner/telnet/telnet_login
- auxiliary/scanner/telnet/telnet_ruggedcom
- auxiliary/scanner/telnet/brocade_enable_login
- auxiliary/scanner/telnet/lantronix_telnet_password
- auxiliary/scanner/telnet/lantronix_telnet_version
- auxiliary/scanner/telnet/satel_cmd_exec
- exploit/freebsd/telnet/telnet_encrypt_keyid
- exploit/linux/telnet/telnet_encrypt_keyid
- exploit/linux/telnet/netgear_telnetenable
- exploit/solaris/telnet/fuser
- exploit/solaris/telnet/ttyprompt
- exploit/windows/telnet/gamsoft_telsrv_username
- exploit/windows/telnet/goodtech_telnet
- auxiliary/dos/cisco/ios_telnet_rocem
- auxiliary/server/capture/telnet
- exploit/freebsd/ftp/proftp_telnet_iac
- exploit/linux/ftp/proftp_telnet_iac
- exploit/linux/http/dlink_dir300_exec_telnet
- exploit/linux/http/tp_link_sc2020n_authenticated_telnet_injection
- exploit/windows/proxy/ccproxy_telnet_ping
- payload/cmd/unix/bind_busybox_telnetd
- payload/cmd/unix/reverse_bash_telnet_ssl
- payload/cmd/unix/reverse_ssl_double_telnet
Authors
hdm
Version
This page has been produced using Metasploit Framework version 6.1.24-dev. For more modules, visit the Metasploit Module Library.
Go back to menu.