Files
nuclei-templates/javascript/audit/ssh/disable-ssh-protocol-1.yaml
2025-02-24 11:54:19 +05:30

50 lines
1.3 KiB
YAML

id: disable-ssh-protocol-1
info:
name: Disable SSH Protocol 1
author: pussycat0x
severity: low
description: |
Using SSH Protocol 1 is insecure as it lacks strong encryption and integrity checks, making it vulnerable to man-in-the-middle attacks, session hijacking, and other exploits. It is recommended to use SSH Protocol 2 for enhanced security.
remediation: |
Set Protocol 2 in /etc/ssh/sshd_config to disable SSH Protocol 1 and restart the SSH service.
reference:
- https://vishalraj82.medium.com/hardening-openssh-security-37f5d634015f
- https://www.ktchost.com/blog/enable-ssh-protocol-2/
metadata:
verified: true
tags: audit,config,ssh,auth
javascript:
- pre-condition: |
isPortOpen(Host,Port)
code: |
var m = require("nuclei/ssh");
var c = m.SSHClient();
c.Connect(Host,Port,User,Pass);
const sshConfig = c.Run('cat /etc/ssh/sshd_config')
sshConfig
let result = "";
if (!sshConfig.includes('Protocol 2')) {
result += "Disable SSH Protocol 1; ";
}
else{
exit();
}
result
args:
Host: "{{Host}}"
Port: "22"
User: "{{usernames}}"
Pass: "{{passwords}}"
matchers:
- type: dsl
dsl:
- "success == true"
extractors:
- type: dsl
dsl:
- response