id: ssh-server-enumeration

info:
  name: SSH Server Software Enumeration
  author: Ice3man543,tarunKoyalwar
  severity: info
  metadata:
    verified: true
    max-request: 2
    shodan-query: product:"OpenSSH"
  tags: js,ssh,enum,network,discovery

javascript:
  - pre-condition: |
      isPortOpen(Host,Port);
    code: |
      var m = require("nuclei/ssh");
      var c = m.SSHClient();
      var response = c.ConnectSSHInfoMode(Host, Port);
      Export(response);
    args:
      Host: "{{Host}}"
      Port: "22"

    extractors:
      - type: json
        json:
          - '.ServerID.Raw'
# digest: 490a004630440220188989414264386583dbc9af34d089a49fed7061d6009deda76af102d3e7cdfd02207a8db0bc3aef7a300f8ade209a1d7e1e710ead834f10dc099020d933c01d27ea:922c64590222798bb761d5b6d8e72950