Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
f235388c
Commit
f235388c
authored
Oct 18, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use config for check_netstat
parent
be5b940c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
10 deletions
+16
-10
check_netstat.sh
ddos/check_netstat.sh
+3
-10
config.template
ddos/config.template
+13
-0
No files found.
ddos/check_netstat.sh
View file @
f235388c
...
...
@@ -2,25 +2,18 @@
cd
$(
dirname
$0
)
# uncomment one of
MAXPERC
=
10
#MAXNUM=4
# инималное колиево дл наала повеки
MINTOTAL
=
700
.
config
.
./config
get_already_dropped
()
{
/sbin/iptables
-L
-n
|
grep
DROP |
awk
'{print $4;}'
>
ipt.dropped.list
/sbin/iptables
-L
-n
|
grep
DROP |
grep
-v
"0.0.0.0"
|
awk
'{print $4;}'
>
ipt.dropped.list
}
do_drop
()
{
grep
-q
"
$1
"
ipt.dropped.list white.list
&&
return
1
echo
"
$1
#
$3
from
$4
(
$2
percent),
$(
date
)
by
$0
"
>>
dropped.list
/sbin/iptables
-A
INPUT
-s
$1
-j
DROP
#
/sbin/iptables -A INPUT -s $1 -j DROP
}
get_already_dropped
...
...
ddos/config.template
0 → 100644
View file @
f235388c
#!/bin/sh
cd
$(
dirname
$0
)
# uncomment one of
MAXPERC
=
10
#MAXNUM=4
# инималное колиево дл наала повеки
MINTOTAL
=
700
OURIP1
=
"87.249.47.44"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment