GithubHelp home page GithubHelp logo

gsdddoss's Introduction

GSDDDOSS (GoldSource Denied Distributed Denial of Service Script)

GSDDDOSS is a simple python script that monitors your goldsrc/svengine game server's udp log output for the following attacks: Bad Rcon, Split Packets, and A2S abuse / Reflected DDoS

Any ip associated with any of these attacks will be automagically blocked in the firewall.

(blame H2 for the name :P)

If you find a bug, or have improved on the script - feel free to make a pull request!

Requirements:

python 3.6 or greater.

Support:

Windows (tested)

Linux (untested, but should work)

Installation:

Download & run the script, it will automatically start listening on udp port 8008. In your server.cfg file add the line: logaddress_add 127.0.0.1 8008

and either restart the server, or rcon the same line in the server console.

note: ideally you wanna run the python command in a loop in case it crashes or something, use screen or tmux on linux.

Windows .bat trick for lazy administrator:

(this assumes python3 is added in PATH)

Make a new .bat file containing:

@echo off
title GSDDDOSS
:watch
python gsdddoss.py
goto watch

After that make a shortcut to the bat file, and go to the shortcut properties.

In the shortcut properties find the button labeled "Advanced" and tick off "Run as administrator".

Then you just run the shortcut and press yes during UAC

gsdddoss's People

Contributors

zode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gsdddoss's Issues

UnicodeDecodeError: invalid continuation byte

Sometimes I am getting the error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd8 in position 221: invalid continuation byte and the script fatally exits. Would be great to make this error non-fatal, maybe by using try/expect or something.

Jan 23 17:12:55 twlz python3[1573471]: Udp started: 127.0.0.1:8008
Jan 23 17:12:55 twlz python3[1573471]: INFINITE LOOP; ^C WILL MOST LIKELY NOT WORK!
Jan 23 17:12:55 twlz python3[1573471]: Traceback (most recent call last):
Jan 23 17:12:55 twlz python3[1573471]:   File "/home/svends/gsdddoss.py", line 101, in <module>
Jan 23 17:12:55 twlz python3[1573471]:     for data in udp_server():
Jan 23 17:12:55 twlz python3[1573471]:   File "/home/svends/gsdddoss.py", line 99, in udp_server
Jan 23 17:12:55 twlz python3[1573471]:     yield data[4:-1].decode("utf-8") # has garbag header + ending
Jan 23 17:12:55 twlz python3[1573471]: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd8 in position 221: invalid continuation byte
Jan 23 17:12:55 twlz systemd[1]: gsdddoss.service: Main process exited, code=exited, status=1/FAILURE
Jan 23 17:12:55 twlz systemd[1]: gsdddoss.service: Failed with result 'exit-code'.
Jan 23 17:13:00 twlz systemd[1]: gsdddoss.service: Scheduled restart job, restart counter is at 82.
Jan 23 17:13:00 twlz systemd[1]: Stopped gsdddoss.
Jan 23 17:13:00 twlz systemd[1]: Started gsdddoss.

Additional infos:
Linux, Python 3.10.9,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.