Here’s a user manual for using the PHP-based BugScanner tool to perform various types of network scans. This will guide you through setting up and running different scans (HTTP, Ping, UDP, SSL, WebSocket) on specified hosts and ports.
This BugScanner tool is designed to perform several types of network scans on given hosts and ports. It supports scanning modes such as HTTP requests, ping tests, SSL/TLS checks, UDP port checks, and WebSocket connections.
- Installation Requirements
- Getting Started
- Usage Instructions
- Scanning Modes
- Examples
Before using the BugScanner tool, ensure that your system meets the following requirements:
- PHP 7.4+ installed on your system.
- PCNTL extension for parallel processing. (PCNTL is usually available on Unix-like operating systems.)
- CURL extension for HTTP and WebSocket requests.
- Socket support in PHP for UDP and WebSocket connections.
To check if these requirements are met, you can use:
php -m | grep -E "pcntl|curl"If pcntl or curl does not appear, you may need to install or enable them in your PHP configuration.
- Download the Script: Save the
BugScannerPHP script to your desired directory. - Prepare Your Host List: You can either provide a list of hosts via a file or use a CIDR notation to generate IP ranges for scanning.
- Create a text file (e.g.,
hosts.txt) with a list of IPs or domain names, each on a new line:192.168.1.1 192.168.1.2 example.com
Use the following command-line options to configure your scan:
-for--filename: Path to the file with hosts.-cor--cdir: CIDR notation (e.g.,192.168.1.0/24) to generate IP addresses.-mor--mode: The scan mode. Choices aredirect,ping,udp,ssl, orws.-Mor--method: HTTP method(s) fordirectscan mode (e.g.,GET,HEAD). Multiple methods should be comma-separated.-por--port: Port number(s) to scan, separated by commas (e.g.,80,443).-Tor--threads: Number of threads (child processes) for parallel scanning.-oor--output: Output file name to save scan results.
Run the tool from the command line by specifying the appropriate options. The general syntax is:
php BugScanner.php [options]Description: Performs HTTP or HTTPS requests on specified hosts and ports to check server response codes, headers, and availability.
Options:
-M(HTTP method): Specify HTTP methods such asGET,POST,HEAD, etc.-p(Port): Specify ports, typically80for HTTP and443for HTTPS.
Example:
php BugScanner.php -f hosts.txt -m direct -M GET,HEAD -p 80,443 -T 10This example performs GET and HEAD requests on hosts.txt with ports 80 and 443 using 10 threads.
Description: Sends ICMP ping requests to each host to check reachability.
Options:
-T(Threads): Number of parallel threads for faster ping scanning.
Example:
php BugScanner.php -f hosts.txt -m ping -T 5This command pings each host in hosts.txt with 5 threads.
Description: Sends UDP packets to specified ports on each host to detect open or closed ports.
Options:
-p(Port): Specify UDP ports to check.
Example:
php BugScanner.php -c 192.168.1.0/24 -m udp -p 53,123 -T 5This scans UDP ports 53 (DNS) and 123 (NTP) on each IP in the 192.168.1.0/24 CIDR range with 5 threads.
Description: Checks if an SSL certificate exists and is valid for each host on port 443.
Example:
php BugScanner.php -f hosts.txt -m ssl -T 10This command scans each host in hosts.txt to verify SSL/TLS certificates on port 443 using 10 threads.
Description: Attempts a WebSocket connection to check if the WebSocket protocol is supported on a specified host.
Example:
php BugScanner.php -f hosts.txt -m ws -p 80,443 -T 5This attempts WebSocket connections on ports 80 and 443 for each host in hosts.txt.
php BugScanner.php -f hosts.txt -m direct -M GET -p 80 -T 10This scans each host in hosts.txt with an HTTP GET request on port 80, using 10 threads.
php BugScanner.php -c 192.168.1.0/24 -m ssl -T 5This checks SSL certificates for each host in the 192.168.1.0/24 range on port 443, using 5 threads.
php BugScanner.php -c 10.0.0.0/24 -m udp -p 53,123 -T 5This scans UDP ports 53 and 123 on the 10.0.0.0/24 CIDR range using 5 threads.
php BugScanner.php -f hosts.txt -m ping -o results.txt -T 10This pings each host in hosts.txt using 10 threads and saves the results to results.txt.
php BugScanner.php -f hosts.txt -m ws -p 80,443 -T 10This attempts a WebSocket connection on ports 80 and 443 for each host in hosts.txt using 10 threads.
To save the output to a file, use the -o option followed by the filename. For example:
php BugScanner.php -f hosts.txt -m direct -M GET -p 80 -T 10 -o output.txtThis command will save the HTTP GET scan results on port 80 to output.txt.
This user manual provides all necessary steps to configure and run different scan modes using the BugScanner PHP script. Each example shows common use cases, and the CLI options allow flexibility for custom scans.