This C program scans specified IP addresses or network ranges to check if the servers are running a potentially vulnerable version of OpenSSH. It checks if the SSH port (default is 22) is open, retrieves the SSH banner, and determines if the server is running a version known to have vulnerabilities.
To compile the program, use the following command:
gcc check_vuln.c -o check_vuln -lpthread
To scan multiple IP addresses, pass them as arguments:
./check_vuln 192.168.1.1 192.168.1.2 10.0.0.1
If you want to specify a different port, use the --port
option:
./check_vuln 192.168.1.1 192.168.1.2 10.0.0.1 --port 2222
If you have a file with a list of IP addresses (one per line), you can pass the filename as an argument:
./check_vuln ip_list.txt
You can also specify CIDR notation to scan an entire subnet:
./check_vuln 192.168.1.0/24
-
Scan multiple IP addresses on the default port (22):
./check_vuln 192.168.1.1 192.168.1.2 10.0.0.1
-
Scan multiple IP addresses on a custom port (e.g., 2222):
./check_vuln 192.168.1.1 192.168.1.2 10.0.0.1 --port 2222
-
Scan IP addresses from a file:
./check_vuln ip_list.txt
-
Scan an entire subnet using CIDR notation:
./check_vuln 192.168.1.0/24
The program will print the results of the scan, including the number of servers that are not vulnerable, likely vulnerable, and those with port 22 closed. For example:
🛡️ Servers not vulnerable: 1
[+] Server at 192.168.1.1
🚨 Servers likely vulnerable: 1
[+] Server at 192.168.1.2
🔒 Servers with port 22 closed: 1
📊 Total scanned targets: 3
This project is licensed under the MIT License - see the LICENSE file for details.
This tool is intended for educational and ethical testing purposes only. Unauthorized use of this tool to scan systems without permission is illegal and unethical.