Inspired by Tom7's Harder Drive project, this repo provides the utilities to ping every IP address in the IPv4 address space.
There are 2^32 possible IP addresses, or around 4.2 billion addresses. The output list will be stored in ip_list.txt
.
To skip addresses and create a list within a range of range^4
, use the list.py
script:
sudo python3 list.py <range>
Provide a 0-256 range value. NOTE: This script requires elevated privilages to write to the output file
Example Usage:
sudo python3 list.py 1
Output:
0.0.0.0
To create an IP list between a defined IP range, use the range.py
script:
sudo python3 range.py <start_range> <end_range>
Provide a start and end range between 0.0.0.0
to 255.255.255.255
.
Example Usage:
sudo python3 range.py 0.0.0.0 0.0.0.5
Output:
0.0.0.0
0.0.0.1
0.0.0.2
0.0.0.3
0.0.0.4
0.0.0.5
All responses will output to icmp_responses.txt
. See the sample output below.
NOTE: Sending ICMP echo requires elevated permissions, use sudo
1
is alive, 0
is dead.
0.0.0.0,0
0.0.0.1,0
0.0.1.0,0
0.0.1.1,0
0.1.0.0,0
0.1.0.1,0
0.1.1.0,0
0.1.1.1,0
1.0.0.0,0
1.0.0.1,1
1.0.1.0,0
1.0.1.1,0
1.1.0.0,0
1.1.0.1,0
1.1.1.0,1
1.1.1.1,1
Run with the following command:
sudo python3 ping.py
To run the process in docker, follow the steps below.
To create the image, run the build process by running:
docker build -t pingy .
To run the image after building it, run the following command:
docker run -d pingy
To view the results as a bitmap image with black pixels representing dead hosts, and white pixels representing alive hosts, use the map.py
script:
NOTE: If you run this with elevated privilages, you will get permission issues viewing the image.
python3 bitmaps/map.py
View the sample outputs below:
Active spaces are ranges that are most populated, returning in active responses.
- 104.16.181.0 - 104.16.220.15 (10,000 Addresses)
- 104.16.181.0 - 104.18.59.159 (100,000 Addresses)
Dead spaces are ranges that aren't commonly populated, returning minimal responses.
Benchmarks from Active Spaces
Addresses | Time (seconds) | Network (bytes) | Network (MB) | Memory (bytes) | Memory (MB) |
---|---|---|---|---|---|
10,000 | 73.40 | 1025024 | 1.025 | 152223744 | 152.22 |
100,000 | 632.77 | 10585088 | 10.59 | 100925440 | 100.93 |
Benchmarks from Dead Spaces
Addresses | Time (seconds) | Network (bytes) | Network (MB) | Memory (bytes) | Memory (MB) |
---|---|---|---|---|---|
6,561 | 533.64 | 1108992 | 1.11 | 39305216 | 39.31 |