How do I block syn floods? Preferably without running in Admin mode. Or do I not have to worry abut this?

38 views Asked by At

zzzI am worried soeone is going to syn flood my TCP server rendering it useless. I would like to find a way to protect against this.

I woud like to protect my TCP server from SYN floods. I have tried:

from rawsocketpy import RawRequestHandler, RawAsyncServerCallback
import time

def callback(handler, server):
    print("Testing")
    handler.setup()
    handler.handle()
    handler.finish()

class LongTaskTest(RawRequestHandler):
    def handle(self):
        time.sleep(1)
        print(self.packet)

    def finish(self):
        print("End")

    def setup(self):
        print("Begin") 

def main():
    rs = RawAsyncServerCallback("wlp2s0", 0xEEFA, LongTaskTest, callback)
    rs.spin()

if __name__ == '__main__':
    main()`

But have not been able to test fpr syn floods.

0

There are 0 answers