Omnimaga

General Discussion => Technology and Development => Other => Topic started by: Keoni29 on September 22, 2014, 05:11:38 pm

Title: Pinging the whole internet
Post by: Keoni29 on September 22, 2014, 05:11:38 pm
The ipv4 version of the internet counts 2^32 individual addresses. I decided to ping all of them, wait for a response and if I get one: log that to a file.

I wrote a script that does this for me. If I run 256 instances of this script simultaneously I can ping the whole internet in about 10 days.
Just some logfiles are not super interesting to watch, but once you convert them into an image it becomes a lot more interesting. This is a test image I generated using the data from the 83.xx.xx.xx range. Each pixel represents a block of 256 ip addresses. The color is determined by how many devices responded in the block.

Pinged all addresses in the 83.xx.xx.xx range:
(http://img.ourl.ca/ip83-fixed.png)
It takes about 1 hour to generate a picture like this. I will release the source once it's done :D



Title: Re: Pinging the whole internet
Post by: DJ Omnimaga on September 22, 2014, 11:47:15 pm
I wonder if that's legal or at least within your ISP rules though? Would they consider this as some form of spam or abusing resources? You can get banned from IRC servers and channels for pinging entire userlists because it causes the client to beep or highlight the person unnecessarily.
Title: Re: Pinging the whole internet
Post by: Keoni29 on September 23, 2014, 02:12:53 am
I checked their policy. They dont actively look for abnormal network behaviour, but if it disturbs the experience of other users they will contact the user that causes it. Pinging several thousand devices every minute should not be a huge load on the servers. It's not like I am attacking a single server with a distributed attack.
Title: Re: Pinging the whole internet
Post by: Juju on September 23, 2014, 08:04:05 am
You can get banned from IRC servers and channels for pinging entire userlists because it causes the client to beep or highlight the person unnecessarily.
That's not really the same thing as a ICMP ping.
Title: Re: Pinging the whole internet
Post by: Sorunome on September 23, 2014, 08:07:20 am
Looking interesting :P
Title: Re: Pinging the whole internet
Post by: utz on September 23, 2014, 03:24:16 pm
InternetCensus2014 Mini  :thumbsup:
Title: Re: Pinging the whole internet
Post by: compu on September 23, 2014, 04:32:49 pm
Keep in mind that some companies might automatically file abuse reports for your IP and/or firewall you if you sequentially scan their IP ranges.
I'm not sure if this is a problem if you do this from a (slow) home connection, but you should randomize your targets if you run this script from a 1gbps server :P
There are some tools like zmap or masscan you could take a look at.
Title: Re: Pinging the whole internet
Post by: DJ Omnimaga on September 23, 2014, 06:02:21 pm
Thanks for the clarification guys. I wasn't too sure if such pigning involved the same thing as doing it on IRC, especially in terms of annoyance of other Internet users. I guess randomizing the targets might be a good idea, though, like compu said.
Title: Re: Pinging the whole internet
Post by: Juju on September 23, 2014, 07:57:35 pm
ICMP pings and IRC pings kinda have the same goal, but are quite different. One is used to check if the target computer has a working Internet connection and does not notify anything other than the target computer sending a single reply packet back and the other is pretty much used to check if the target user is still alive and in front of their computer.

And yeah, despite being not annoying at all, some people still finds ICMP pings annoying for various reasons (such as the risk of DDoS making your equipment slow down or just security, sometimes you don't want to tell everyone you exist at this IP so you block requests). They usually block it on their router or server or they check its rate for DDoSes and attacks.

So yeah, better take precautions so some people wouldn't take it as an attack.
Title: Re: Pinging the whole internet
Post by: Keoni29 on September 24, 2014, 04:15:20 am
I should ping ip's in different order so it appears random. That way nobody will get excessive load on their 1MHz servers :P
Right now I ping it in this order:
Code: [Select]
0.xx.0.(0-255)
0.xx.1.(0-255)
0.xx.2.(0-255)
(...)
0.xx.255.(0-255)

1.xx.0.(0-255)
1.xx.1.(0-255)
(...)
xx means 256 scripts run in parallel.

I could change this to:
Code: [Select]
(0-255).0.xx.0
(0-255).1.xx.0
(0-255).2.xx.0
(...)
(0-255).255.xx.0

(0-255).0.xx.1
(0-255).1.xx.1
(...)
And so on...

The downside of this is that you need to ping the entire ipv4 range before your data makes sense :P
Title: Re: Pinging the whole internet
Post by: Sorunome on September 24, 2014, 10:05:55 am
Have fun with 192.168.x.x
Title: Re: Pinging the whole internet
Post by: Keoni29 on September 24, 2014, 10:38:41 am
I will exclude reserved addresses from the scan. This includes the entire 127.x.x.x range as well.
Title: Re: Pinging the whole internet
Post by: Sorunome on September 24, 2014, 12:55:24 pm
Hint: [nobbc] tags are magic ;)
Title: Re: Pinging the whole internet
Post by: Keoni29 on September 24, 2014, 02:43:44 pm
Fixed. Thanks :)
Title: Re: Pinging the whole internet
Post by: DJ Omnimaga on September 24, 2014, 08:03:02 pm
I wonder what happens when you ping 127.0.0.1... I never tried it :P
Title: Re: Pinging the whole internet
Post by: Keoni29 on September 24, 2014, 08:16:56 pm
You get a really fast reply.
Title: Re: Pinging the whole internet
Post by: Eeems on September 24, 2014, 08:38:33 pm
I wonder what happens when you ping 127.0.0.1... I never tried it :P
You ping your own machine.
I will exclude reserved addresses from the scan. This includes the entire 127.x.x.x range as well.
Make sure to exclude all IPs in the ranges listed here: http://en.wikipedia.org/wiki/IPv4#Special-use_addresses
Title: Re: Pinging the whole internet
Post by: Sorunome on September 25, 2014, 10:10:01 am
I wonder what happens when you ping 127.0.0.1... I never tried it :P
You get very fast replies
Title: Re: Pinging the whole internet
Post by: Juju on September 25, 2014, 10:04:41 pm
You get a really fast reply.
I wonder what happens when you ping 127.0.0.1... I never tried it :P
You get very fast replies

Replies so fast it's almost instant.
Quote from: My computer
juju@derpy ~ % ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.043 ms
64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.044 ms
64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.044 ms
^C
--- 127.0.0.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3000ms
rtt min/avg/max/mdev = 0.026/0.039/0.044/0.008 ms
During that time, light have time to travel about 8-13 km (5-8 miles). Which is not quite enough to reach another computer, if you take in account the time the other computer takes to notice your ping and send a reply.
Title: Re: Pinging the whole internet
Post by: DJ Omnimaga on September 25, 2014, 10:34:48 pm
I wonder what happens when you ping 127.0.0.1... I never tried it :P
You get very fast replies
Do they sometimes appear before you sent the request? :trollface: