
This proof-of-concept script exploits a vulnerability in OpenSSH versions prior to 7.4 (CVE-2016-10708) by sending unexpected `SSH_MSG_NEWKEYS` packets.
This proof-of-concept script exploits a vulnerability in OpenSSH versions prior to 7.4 (CVE-2016-10708) by sending unexpected SSH_MSG_NEWKEYS packets which can result in DoS. It can operate in two modes:
NEWKEYS messages to trigger a denial-of-service condition.This tool is provided for research and educational purposes only. Unauthorized scanning or attacking of systems that you do not own or have explicit permission to test may violate applicable laws and regulations.
Use this script responsibly:
-t, --targets
Comma-separated list of target IPs or hostnames (required)
-p, --port
SSH port to connect to (default: 22)
-m, --mode
Operation mode: scan or attack (required)
--sockets
Number of TCP connections to open per target (default: 5)
--threads
Maximum number of concurrent worker threads (default: 10)
-v, --verbose
Enable debug-level logging output
Banner Exchange In scan mode the script connects to each target and reads the SSH banner to extract the OpenSSH version.
Connection Setup
In attack mode it opens the specified number of TCP sockets per target and immediately sends a fake client banner (SSH-2.0-OpenSSH_8.9), then holds the connections open.
Packet Crafting
It builds raw SSH transport packets containing only the SSH_MSG_NEWKEYS payload. Packet length, padding length, and random padding are calculated to conform to the SSH binary packet protocol.
Flood Loop
The script enters an infinite loop, sending the crafted NEWKEYS packet on every socket with randomized sub-millisecond delays. Unpatched sshd instances will mishandle the out-of-order NEWKEYS messages and eventually crash or become unstable.