This script scans a list of target IP addresses or ranges to determine if they are running vulnerable To CVE-2024-6387.
- Scans IP addresses, domain names, file paths containing IP addresses, or CIDR network ranges.
- Checks a specified port (default: 22) for OpenSSH service.
- Handles multiple targets concurrently using threading for efficient scanning.
- Reports non-vulnerable, vulnerable, and closed ports.
- Supports exclusion of specific OpenSSH versions known to be patched or not vulnerable.
- Python 3.x
argparse
module for command-line argument parsing.ipaddress
module for handling IP addresses and CIDR notation.
usage: openssh_checker.py [-h] [--port PORT] [-t TIMEOUT] [-l LIST] targets [targets ...]
Check if servers are running a vulnerable version of OpenSSH.
positional arguments:
targets IP addresses, domain names, file paths containing IP addresses, or CIDR network ranges.
optional arguments:
-h, --help show this help message and exit
--port PORT Port number to check (default: 22).
-t TIMEOUT, --timeout TIMEOUT
Connection timeout in seconds (default: 1 second).
-l LIST, --list LIST File containing a list of IP addresses to check.
-
Check a single IP address:
python3 openssh_checker.py 192.168.1.1
-
Check multiple IP addresses from a file:
python3 openssh_checker.py -l ip_list.txt
-
Check a CIDR range:
python3 openssh_checker.py 192.168.1.0/24
The script outputs detailed information about each target:
- Servers not vulnerable to OpenSSH exploits.
- Servers likely vulnerable to OpenSSH exploits.
- Servers with closed SSH ports.
- Total number of targets scanned.
- Ensure that you have appropriate permissions to scan the target hosts.
- Use responsibly and only on systems you are authorized to test.