0

I have this script. I use it not to annoy but to make abusive processes (run by users with few-to-not-at-all consideration to the rest of the users) to timeout and eventually crash in my own network, so the bandwidth is not eaten.

#!/usr/bin/python
import socket

MSG = "Suck my ****s!! " * 1024
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

count = 0

while True:
    print "Punch! %d" % count
    count += 1
    if count == 256:
        count = 0
    sock.sendto(MSG, ("192.168.255.255", 4321))

And it worked for months. Almost 1 year I'd say.

However, now I get an error like this:

Punch! 0
Traceback (most recent call last):
  File "Escritorio/punch.py", line 14, in <module>
    sock.sendto(MSG, ("192.168.255.255", 4321))
socket.error: [Errno 13] Permission denied

(Where the "Punch! 0" is an expected output)

My OS is Ubuntu 12.04, with Python 2.7.3.

What should I check? Even running the script as sudo produces such error.

hjpotter92
  • 78,589
  • 36
  • 144
  • 183
Luis Masuelli
  • 12,079
  • 10
  • 49
  • 87
  • 1
    Might be helpful http://stackoverflow.com/questions/11457676/python-socket-error-errno-13-permission-denied – C.B. Sep 28 '15 at 16:28
  • "I use it not to annoy but to make abusive processes to timeout and eventually crash in my own network" There has got to be a better way. It sounds like you are flooding the local network in order to stop others from saturating it. – msw Sep 28 '15 at 16:42
  • Actually, it IS what you said (made it as a dumb experiment I had serious doubts it would work - still can't figure what kind of clients they use since they seem to crash on timeouts or saturations). I stop briefly to check if network got stable again. It is quicker than installing wireshark and the appropiate stats plugin :p. It is even faster than starting Wireshark. It is even-even faster than finding Wireshark in the Applications menu bar xD. Also, I don't know whose is the offending IP (and usually, people here does neither know), since it is a somewhat big group of users here. – Luis Masuelli Sep 28 '15 at 16:47

0 Answers0