Infinitely Looped Ping
A few months ago when I moved home, I had noticed an extreme drop in the bandwidth of our wireless network. Initially it had been assumed that it was due to the addition of another PC to the network (and I do use quite a bit of bandwidth). Well after a week had gone by I decided to look into the issue to see if I could speed things up a bit.
Right off the bat I noticed that the network no longer had its WEP key. For those of you that have no clue what a WEP key does: A WEP key uses an algorithm, now deprecated by WPA and WPA2, to secure the wireless transmissions from eavesdroppers and to keep things private. While it is deprecated and WPA or WPA2 should be used, it will do just fine for a home network in an area where your neighbors aren’t hackers or script kiddies.
Seeing as there no longer was any sort of encryption, I decided to see exactly how many people were on the network. I counted 6, we only had 2 PCs active. Obviously we needed to put the encryption back on to prevent people from sniping our bandwidth. Seeing as I just finished up a Redhat course and was just itching to try out some bash scripts, I whipped up this:
#!/bin/bash # Filename: loopping while [ 1 ] do ping $1 -s 64 -t 5 sleep 300 done
Meet my “Infinite Ping” script or ‘loopping’. What it does is allows you to pick an ip or PC name and send 64 bytes of data to your target for 5 minutes, while sleeping for that 5 minutes and repeating once more until a connection is lost. I used it to ‘kick’ unauthorized users from my wireless network.
What this does is flood the target PC’s connections with a constant stream of data packets, of course your PC also slows down a bit cause you are sending all of the packets. All you have to do is substitute ‘pcname’ with an ip or the PC’s actual name. To use it, put it in either the /bin or your local /home/username/bin directory and simply type:
$ loopping pcname
Download the bash script here.
Disclaimer: Please note that this script is purely for educational purposes only and bumping freeloaders off your network. All responsibility for misuse of this script is that of its users.
