Register for your free account! | Forgot your password?

You last visited: Today at 03:42

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Tut]Block Ddos Attacks In Freebsd

Discussion on [Tut]Block Ddos Attacks In Freebsd within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
souotiagocardoso's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 51
Received Thanks: 95
Lightbulb [Tut]Block Ddos Attacks In Freebsd

Hello everybody,
Today i will post one tutorial, how to block ddos attacks in your freebsd.
Do not know if already posted, have not tried, are huge topics, but this works great!
-----------------------------------
First we turn on the firewall (firewall) and we add the following lines to your rc.conf* which is located in the file
/etc/:
Code:
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_flags=""
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
pflog_flags=""
Now let's configure the firewall, so let's /etc/pf.conf and open it with a text editor we use and add the following lines:
Code:
block in all
pass in quick on lo0
pass out quick on lo0
table <bloqueo> persist file "/var/db/antiddos(chamamos-lo como quiser eu dei o nome de antiddos.)"
block quick from <bloqueo>
pass in quick on sis0 proto tcp from any to any port 22 keep state
pass in quick on sis0 proto tcp from any to any port 80 keep state
pass in quick on sis0 proto tcp from any to any port 3690 keep state
pass out all keep state
Thus, block inputs.

Now let's create "antiddos" (or whatever name you chose) and, therefore, give the following permission:
Code:
touch /var/db/antiddos
chmod 644 /var/db/antiddos
Now let's create the script for that call blocking and give you permission to save chmod 751:
Code:
#!/usr/bin/perl

use strict;

my @assholes = ();

open (IN, "/var/log/auth.log");
while (<IN>) {
            if ($_ =~ /Invalid user.*from ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/) {
                            push(@assholes, $1);
            }
            if ($_ =~ /Did not receive identification string from ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/) {
                            push(@assholes, $1);
            }
}
close (IN);

@assholes = sort {lc($a) cmp lc($b)} @assholes;

my @allowedIPs = ();
open (IN, "/var/db/allowed-ips");
while (<IN>) {
            if ($_ =~ /[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/) {
                            push(@allowedIPs, $_);
            }
}
close (IN);

chop(@allowedIPs);

my $tmp = "";
foreach my $asshole (@assholes) {
            if ($asshole eq $tmp) {
                            $asshole = "";
            } else {
                            if ($asshole =~ /127\.0\.0\.1/) {
                                            $asshole = "";
                            }
                            if ($asshole =~ /192\.168\.[0-9]+\.[0-9]+/) {
                                            $asshole = "";
                            }
                            foreach my $allowedIP (@allowedIPs) {
                                            if ($asshole =~ /$allowedIP/) {
                                                            $asshole = "";
                                            }
                            }
                            $tmp = $asshole;
            }
}

@assholes = sort {lc($b) cmp lc($a)} @assholes;

my $popCount = 0;
foreach my $asshole (reverse @assholes) {
            if ($asshole eq "") {
                            $popCount++;
            }
}

for (my $i = 0; $i < $popCount; $i++) {
            pop (@assholes);
}

my $list = "";
foreach my $asshole (@assholes) {
            $list = $list . $asshole . " ";
}

exec "/sbin/pfctl -t bloqueo -T add $list";
Now let /etc/syslog.conf and open it for editing and add the following line:
Code:
auth.info;authpriv.info                                          | exec /usr/bin/perl /sbin/bloqueo.pl
thereby running the script to block external ips.

I hope you have learned.*
Work perfectly.

Source: universojuegos, cybergamers
Credit: DjZed, Rancoroso
Translated by Tiago
souotiagocardoso is offline  
Thanks
18 Users
Old 02/09/2013, 19:36   #2
 
souotiagocardoso's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 51
Received Thanks: 95
Quote:
Originally Posted by Teh Plex View Post

Tuts zum Ddosen oder abblocken ?!
It's for block atacks, protection
souotiagocardoso is offline  
Old 02/09/2013, 19:37   #3
 
.iDamage's Avatar
 
elite*gold: 0
The Black Market: 488/0/0
Join Date: Dec 2011
Posts: 7,096
Received Thanks: 1,019
Quote:
Originally Posted by Teh Plex View Post

Tuts zum Ddosen oder abblocken ?!
Wer lesen kann ist klar im Vorteil, Kleiner.
.iDamage is offline  
Thanks
13 Users
Old 02/09/2013, 19:38   #4
 
souotiagocardoso's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 51
Received Thanks: 95
Quote:
Originally Posted by .iDαmαɢe View Post
Wer lesen kann ist klar im Vorteil, Kleiner.
True Story
souotiagocardoso is offline  
Thanks
2 Users
Old 02/09/2013, 19:46   #5

 
.Kaycon's Avatar
 
elite*gold: 0
Join Date: Oct 2012
Posts: 355
Received Thanks: 426
sieht interessant aus, hätte ich grad nen Server würd ich es mal testen.
Thanks für die Mühe
.Kaycon is offline  
Thanks
1 User
Old 02/09/2013, 19:49   #6
 
souotiagocardoso's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 51
Received Thanks: 95
Quote:
Originally Posted by Imbattle View Post
sieht interessant aus, hätte ich grad nen Server würd ich es mal testen.
Thanks für die Mühe
No problem
souotiagocardoso is offline  
Old 02/09/2013, 19:53   #7
 
.Mr'Zerpexx's Avatar
 
elite*gold: 12
Join Date: Aug 2011
Posts: 701
Received Thanks: 104
Thank You.
I will use it Soon
.Mr'Zerpexx is offline  
Old 02/09/2013, 19:54   #8
 
Mi4uric3's Avatar
 
elite*gold: 405
Join Date: Dec 2007
Posts: 6,615
Received Thanks: 6,356
Quote:
Originally Posted by Teh Plex View Post

Tuts zum Ddosen oder abblocken ?!
Man wtf, even the title says "block".
Mi4uric3 is offline  
Thanks
5 Users
Old 02/09/2013, 19:55   #9

 
Zynko™'s Avatar
 
elite*gold: 53
Join Date: Nov 2012
Posts: 2,793
Received Thanks: 766
Ob das klappt mh werden wohl ausprobieren
tortzdem thx
Zynko™ is offline  
Old 02/09/2013, 19:55   #10
 
elite*gold: 0
Join Date: Nov 2012
Posts: 243
Received Thanks: 371
Sehr nützlich, soweit wie ich es sehe ( nicht getestet, was ich aber gleich machen werde ) sollte es wirklich Funktionieren.

Danke!
.SeveN is offline  
Old 02/09/2013, 19:57   #11
 
TraxWall's Avatar
 
elite*gold: 0
Join Date: Oct 2010
Posts: 178
Received Thanks: 86
....
TraxWall is offline  
Old 02/09/2013, 19:58   #12
 
souotiagocardoso's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 51
Received Thanks: 95
Quote:
Originally Posted by .SeveN View Post
Sehr nützlich, soweit wie ich es sehe ( nicht getestet, was ich aber gleich machen werde ) sollte es wirklich Funktionieren.

Danke!
Whenever orders!
souotiagocardoso is offline  
Old 02/09/2013, 20:30   #13
 
elite*gold: 315
Join Date: Dec 2011
Posts: 2,905
Received Thanks: 1,066
Habe gelesen Black Ddos Attack xD
Sorry
Teh Plex is offline  
Old 02/09/2013, 21:04   #14
 
souotiagocardoso's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 51
Received Thanks: 95
Quote:
Originally Posted by Teh Plex View Post
Habe gelesen Black Ddos Attack xD
Sorry
ahah, no problem
souotiagocardoso is offline  
Old 02/09/2013, 21:35   #15
 
*~.ιηνιη¢ιвℓє.~*'s Avatar
 
elite*gold: 5
Join Date: Dec 2011
Posts: 1,822
Received Thanks: 951
das könnte RoP im moment gebrauchen #yolo

#danke
*~.ιηνιη¢ιвℓє.~* is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
DDoS attacks again?
12/16/2012 - SRO Private Server - 29 Replies
Hello, i've recently received pretty much strong DDoS attacks to my server from maxhosting.ru servers, so i'm just wondering if there's anybody else getting that from the same source? If so we should union up and start doing some real action against their company itself, since they're letting their free customers to use their own hosts as free 1gbps botnets to take down other services. My server's down already for 24hours, i wrote them a message, at beginning they answered me that they'll...
[Security Release]Stop the recent attacks(That are not ddos attacks.)
12/04/2012 - Shaiya PServer Guides & Releases - 1 Replies
Hi everyone here is a little tutorial on the recent attacks as i've seen and were i played on servers which have gotten attacked, so to prevent this issue here is the tutorial below. Get the program called rKill, which i have provided below And block in firewall this IP *fetching ip* Range: xxx.xxx.xxx.x - xx.xx.xxx.xxx Range: xx.xxx.xxx.x - xxx.xxx.xxx.xxx Range: xx.x.xxx.x - xx.x.xxx.xx As far as rKill, use it only under attack, It may block you out for a few seconds, and make players...
Looking for information regarding DDOS attacks
07/13/2012 - SRO Private Server - 72 Replies
It's bullshit that all servers are getting ddosed. only our server (Epic Road) is getting ddosed and we know that it's not playsro. our server is down for a few hours every day, it's impossible to continue like this. any information or hints are welcome.
[HELP!]DDos attacks on closed port?!
01/21/2012 - Metin2 Private Server - 0 Replies
Hello, I am writing this message for a problem. There are 3 days that my server is under ddos attack, hundreds of different ip, always on the same port: 25345, but the problem is that the port is closed!, turned antispoof rules,sent packets from 2k and response packets 500k. I use ipfw as a firewall .. Those are the rules that I've put in my IPFW : $IPF 12 deny all from any to any dst-port 25345 in keep-state $IPF 13 deny all from any to any dst-port 25345 out keep-state $IPF 14...
ddos attacks on aionbot sites
10/22/2009 - Aion - 3 Replies
Seriously this is ridiculous whats going on.. example: nofap bot released new version of his bot which cost money now -> 1day later nofap.com getting ddos crazy.. whats your opinion to this ?



All times are GMT +2. The time now is 03:42.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.