mirror of
https://github.com/nmap/nmap.git
synced 2025-12-24 08:29:04 +00:00
Revert libssh2 branch, for now.
$ svn merge -r r33518:r33513 . and removed added scripts to the script.db. The branch needs further refinement/testing for Windows and Mac before merging into the trunk. There is also the latent EOF bug which is giving performance issues. Further work on the branch will continue in Devin's latest branch: /nmap-exp/devin/nmap-libssh2
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
local shortport = require "shortport"
|
||||
local stdnse = require "stdnse"
|
||||
local libssh2 = stdnse.silent_require "libssh2"
|
||||
|
||||
description = [[
|
||||
Returns authenication methods a ssh server supports.
|
||||
]]
|
||||
|
||||
---
|
||||
-- @usage
|
||||
-- nmap -p 22 --script ssh-auth-methods --script-args="ssh.user=<username>" <target>
|
||||
--
|
||||
-- @output
|
||||
-- 22/tcp open ssh syn-ack
|
||||
-- | ssh-auth-methods:
|
||||
-- | Supported authentication methods:
|
||||
-- | publickey
|
||||
-- |_ password
|
||||
|
||||
author = "Devin Bjelland"
|
||||
license = "Same as Nmap--See http://nmap.org/book/man-legal.html"
|
||||
|
||||
local username = stdnse.get_script_args("ssh.user") or stdnse.generate_random_string(5)
|
||||
portrule = shortport.port_or_service(22, 'ssh')
|
||||
|
||||
categories = {"safe"}
|
||||
|
||||
action = function (host, port)
|
||||
local result = stdnse.output_table()
|
||||
|
||||
local session = libssh2.session_open(host, port.number)
|
||||
local authmethods = libssh2.userauth_list(session, username)
|
||||
|
||||
result["Supported authentication methods"] = authmethods
|
||||
|
||||
return result
|
||||
end
|
||||
Reference in New Issue
Block a user