-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from nuxy/master
Added support for FreeBSD IPFW
- Loading branch information
Showing
9 changed files
with
213 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,8 @@ fixes, improvements and new features. | |
|
||
**Maintainer:** Jefferson González <[email protected]> | ||
|
||
**Contributor (BSD support):** Marc S. Brooks <[email protected]> | ||
|
||
## About | ||
|
||
(D)DoS Deflate is a lightweight bash shell script designed to assist in | ||
|
@@ -14,11 +16,11 @@ command below to create a list of IP addresses connected to the server, | |
along with their total number of connections. It is one of the simplest | ||
and easiest to install solutions at the software level. | ||
|
||
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | ||
netstat -an | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n | ||
|
||
IP addresses with over a pre-configured number of connections are | ||
automatically blocked in the server's firewall, which can be direct | ||
iptables or Advanced Policy Firewall (APF). (We highly recommend that | ||
automatically blocked in the server's firewall, which can be direct | ||
ipfw, iptables, or Advanced Policy Firewall (APF). (We highly recommend that | ||
you use APF on your server in general, but deflate will work without it.) | ||
|
||
### Notable Features | ||
|
@@ -32,7 +34,7 @@ you use APF on your server in general, but deflate will work without it.) | |
* You can receive email alerts when IP addresses are blocked. | ||
* Control blocking by connection state (see man netstat). | ||
* Auto-detection of firewall. | ||
* Support for APF, CSF and iptables. | ||
* Support for APF, CSF, ipfw, and iptables. | ||
* Logs events to /var/log/ddos.log | ||
* Uses tcpkill to reduce the amount of processes opened by attackers. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
/*dependencies apt-get yum*/ | ||
nslookup dnsutils bind-utils | ||
netstat|ifconfig net-tools net-tools | ||
iptables iptables-persistent iptables-services | ||
tcpkill dsniff dsniff | ||
timeout coreutils coreutils | ||
grep grep grep | ||
awk awk awk | ||
sed sed sed | ||
/*dependencies apt-get yum pkg*/ | ||
nslookup dnsutils bind-utils bind-tools | ||
netstat|ifconfig net-tools net-tools net-tools | ||
iptables iptables-persistent iptables-services ipfw | ||
tcpkill dsniff dsniff dsniff | ||
timeout coreutils coreutils timeout | ||
grep grep grep grep | ||
awk awk awk awk | ||
sed sed sed sed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,7 @@ and easiest to install solutions at the software level. | |
.PP | ||
IP addresses with over a pre-configured number of connections are | ||
automatically blocked in the server's firewall, which can be direct | ||
iptables or Advanced Policy Firewall (APF). (We highly recommend that | ||
ipfw, iptables, or Advanced Policy Firewall (APF). (We highly recommend that | ||
you use APF on your server in general, but deflate will work without it.) | ||
|
||
.SH OPTIONS | ||
|
@@ -135,3 +135,4 @@ Zaf <[email protected]> (Copyright (C) 2005) | |
|
||
.SH CONTRIBUTORS | ||
Jefferson González <[email protected]> (Fixes and improvements) | ||
Marc S. Brooks <[email protected]> (BSD support) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/var/log/ddos.log 640 4 * $W6D0 JN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
# PROVIDE: ddos | ||
# REQUIRE: DAEMON netif | ||
# KEYWORD: nojail | ||
|
||
# Init script to control ddos daemon | ||
# | ||
# Marc S. Brooks <[email protected]> | ||
|
||
. /etc/rc.subr | ||
|
||
name="ddos" | ||
rcvar="${name}_enable" | ||
start_cmd="${name}_start" | ||
stop_cmd="${name}_stop" | ||
restart_cmd="${name}_restart" | ||
status_cmd="${name}_status" | ||
extra_commands="restart status" | ||
ddos_program="/usr/local/sbin/ddos" | ||
# ddos_file is set by rc.conf | ||
|
||
test -x $DAEMON || exit 0 | ||
|
||
ddos_start() | ||
{ | ||
${ddos_program} --start | ||
} | ||
|
||
ddos_stop() | ||
{ | ||
${ddos_program} --stop | ||
} | ||
|
||
ddos_status() | ||
{ | ||
${ddos_program} --status | ||
} | ||
|
||
ddos_restart() | ||
{ | ||
${ddos_program} --stop | ||
${ddos_program} --start | ||
} | ||
|
||
load_rc_config $name | ||
run_rc_command "$1" |
Oops, something went wrong.