Lucene search
K

sshv1 NSE Script

🗓️ 06 Nov 2008 02:52:59Reported by Brandon EnrightType 
nmap
 nmap
🔗 nmap.org👁 1526 Views

Checks if an SSH server supports the obsolete and less secure SSH Protocol Version

Related
Code
ReporterTitlePublishedViews
Family
GithubExploit
Exploit for Code Injection in Samba
2 Dec 202509:55
githubexploit
GithubExploit
Exploit for Code Injection in Samba
25 May 201713:20
githubexploit
GithubExploit
Exploit for Code Injection in Samba
15 May 202106:52
githubexploit
GithubExploit
Exploit for Code Injection in Samba
30 May 201715:08
githubexploit
GithubExploit
Exploit for Code Injection in Samba
25 May 201713:20
githubexploit
GithubExploit
Exploit for CVE-2017-0143
16 May 201719:34
githubexploit
GithubExploit
Exploit for Code Injection in Samba
9 May 202102:32
githubexploit
GithubExploit
Exploit for Code Injection in Samba
5 Jun 201716:25
githubexploit
GithubExploit
Exploit for Code Injection in Samba
26 May 201700:58
githubexploit
GithubExploit
Exploit for Code Injection in Samba
1 Nov 202223:17
githubexploit
Rows per page
local nmap = require "nmap"
local shortport = require "shortport"
local string = require "string"

description = [[
Checks if an SSH server supports the obsolete and less secure SSH Protocol Version 1.
]]
author = "Brandon Enright"
license = "Same as Nmap--See https://nmap.org/book/man-legal.html"
categories = {"default", "safe"}

---
-- @output
-- PORT   STATE SERVICE
-- 22/tcp open  ssh
-- |_sshv1: Server supports SSHv1
--
-- @xmloutput
-- true


portrule = shortport.ssh

action = function(host, port)
  local socket = nmap.new_socket()
  local result;
  local status = true;

  socket:connect(host, port)
  status, result = socket:receive_lines(1);

  if (not status) then
    socket:close()
    return
  end

  if (result == "TIMEOUT") then
    socket:close()
    return
  end

  if  not string.match(result, "^SSH%-.+\n$") then
    socket:close()
    return
  end

  socket:send("SSH-1.5-NmapNSE_1.0\n")

  -- should be able to consume at least 13 bytes
  -- key length is a 4 byte integer
  -- padding is between 1 and 8 bytes
  -- type is one byte
  -- key is at least several bytes
  status, result = socket:receive_bytes(13);

  if (not status) then
    socket:close()
    return
  end

  if (result == "TIMEOUT") then
    socket:close()
    return
  end

  if  not string.match(result, "^....[\0]+\002") then
    socket:close()
    return
  end

  socket:close();

  return true, "Server supports SSHv1"
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

10 Jan 2020 05:32Current
9.4High risk
Vulners AI Score9.4
EPSS0.94176
1526