info: name: Disable SSH Empty Password author: pussycat0x severity: high description: | Allowing empty passwords in SSH poses a severe security risk, enabling unauthorized access, brute-force attacks, and potential system compromise. It should always be disabled to prevent unauthorized logins. remediation: | Set PermitEmptyPasswords no in/etc/ssh/sshd_config to disable empty password logins and restart the SSH service. reference: - https://vishalraj82.medium.com/hardening-openssh-security-37f5d634015f - https://docs.datadoghq.com/security/default_rules/xccdf-org-ssgproject-content-rule-sshd-disable-empty-passwords/ 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('PermitEmptyPasswords yes')) { result +="Disable SSH Empty Password Access"; } else{ exit(); } result