Nmap ssh-auth-methods NSE Script


This page contains detailed information about how to use the ssh-auth-methods NSE script. For list of all NSE scripts, visit the Nmap NSE Library.

Select:
Overview
Error Messages

Script Overview


Script source code: https://github.com/nmap/nmap/tree/master/scripts/ssh-auth-methods.nse
Script categories: auth, intrusive
Target service / protocol: ssh
Target network port(s): 22
List of CVEs: -

Script Description


The ssh-auth-methods.nse script returns authentication methods that a SSH server supports.

This is in the "intrusive" category because it starts an authentication with a username which may be invalid. The abandoned connection will likely be logged.

Ssh-auth-methods NSE Script Arguments


The ssh-auth-methods.nse script does not have any arguments.

Ssh-auth-methods NSE Script Example Usage


Here's an example of how to use the ssh-auth-methods.nse script:

nmap -p 22 --script ssh-auth-methods --script-args="ssh.user=<username>" <target>

Ssh-auth-methods NSE Script Example Output


Here's a sample output from the ssh-auth-methods.nse script:

22/tcp open  ssh     syn-ack
| ssh-auth-methods:
|   Supported authentication methods:
|     publickey
|_    password

Ssh-auth-methods NSE Script Example XML Output


There is no sample XML output for this module. However, by providing the -oX <file> option, Nmap will produce a XML output and save it in the file.xml file.

Author


  • Devin Bjelland

References


See Also


Related NSE scripts to the ssh-auth-methods.nse script:

Visit Nmap NSE Library for more scripts.

The ssh-auth-methods.nse script may fail with the following error messages. Check for the possible causes by using the code snippets highlighted below found in the script source code. This can often times help in identifying the root cause of the problem.

Failed to connect to ssh server


Here is a relevant code snippet related to the "Failed to connect to ssh server" error message:

30:	
31:	function action (host, port)
32:	  local result = stdnse.output_table()
33:	  local helper = libssh2_util.SSHConnection:new()
34:	  if not helper:connect(host, port) then
35:	    return "Failed to connect to ssh server"
36:	  end
37:	
38:	  local authmethods = helper:list(username)
39:	
40:	  result["Supported authentication methods"] = authmethods

Version


This page has been created based on Nmap version 7.92.

Go back to menu.