This Java application provides a command-line interface for scanning open ports on a target system within a network. The simple version is designed for ease of use in a non-graphical environment, offering a straightforward way to configure, initiate, and view the results of port scans.
Specify the target host, which can be an IP address or a domain name. This is the system you want to scan for open ports.
Define the range of ports to scan by specifying the start and end port numbers. This flexibility allows users to narrow down or broaden the scope of the scan.
View the scan results in the console in real-time. Open ports are listed, providing instant feedback on the status of each port.
Each port connection attempt includes a timeout mechanism, preventing the application from hanging on unresponsive ports and improving overall scanning efficiency.
The application incorporates robust error handling to gracefully manage situations where a connection cannot be established to a specific port, ensuring a smooth user experience.
The timeout mechanism and error handling contribute to the overall scanning efficiency, allowing for a reliable and quick assessment of open ports.
- Java Development Kit (JDK): Ensure that you have the Java Development Kit installed on your system.
-
Clone the Repository:
git clone https://github.com/your-username/NetworkPortScannerJava.git
-
Navigate to the Project Directory:
cd NetworkPortScannerJava -
Configure Scan Parameters:
- Open the
PortScannerJava.javafile in a text editor. - Update the
targetHost,startPort, andendPortvariables with your desired values.
- Open the
-
Initiate Port Scan:
- Save the changes to the
PortScannerJava.javafile. - Execute the following commands in the terminal:
javac PortScannerJava.java java PortScannerJava
- Save the changes to the
-
View Results:
- Results will be displayed in the console, providing detailed information about open ports.
-
Interpret Results:
- Analyze the console output to identify open ports and understand the status of the scanned network.
🠮 Verify Open Ports using CMD
🠮 Open the Command Prompt.
🠮 Type netstat -aon and hit enter.
🠮 Look for the port numbers in the Listening state.
🠮 netstat -ano | find "LISTENING" | sort - To sort by "LISTENING" ports
🠮 netstat -ano | find "ESTABLISHED" | sort - To sort by "ESTABLISHED" ports
🠮 netstat -ano | find "TIME_WAIT" | sort - To sort by "TIME_WAIT" ports
Contributions are welcome! If you have suggestions for improvements, feature requests, or would like to report issues, feel free to create an issue or submit a pull request.
This project is licensed under the MIT License.