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
f6c328f1
Commit
f6c328f1
authored
Sep 08, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update scripts
parent
7233fa30
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
10 deletions
+25
-10
restore_ip.sh
common/restore_ip.sh
+6
-1
check_netstat.sh
ddos/check_netstat.sh
+1
-1
check_nginx-error.sh
ddos/check_nginx-error.sh
+4
-4
check_nginx.sh
ddos/check_nginx.sh
+5
-4
white.list
ddos/white.list
+9
-0
No files found.
common/restore_ip.sh
View file @
f6c328f1
#!/bin/sh
iptables
-D
INPUT
-s
$1
-j
DROP
IP
=
$1
if
echo
$IP
|
grep
-q
"[a-Z]"
;
then
IP
=
$(
resolve
-s
$IP
)
fi
iptables
-D
INPUT
-s
$IP
-j
DROP
ddos/check_netstat.sh
View file @
f6c328f1
...
...
@@ -9,7 +9,7 @@ MAXPERC=10
# инималное колиево дл наала повеки
MINTOTAL
=
700
OURIP1
=
"87.249.47.44"
.
config
get_already_dropped
()
{
...
...
ddos/check_nginx-error.sh
View file @
f6c328f1
...
...
@@ -4,11 +4,11 @@ cd $(dirname $0)
# uncomment one of
#MAXPERC=40
MAXNUM
=
4
0
MAXNUM
=
9
0
MAXLIST
=
30
OURIP1
=
"212.176.200.22"
.
config
get_already_dropped
()
{
...
...
@@ -44,8 +44,8 @@ get_already_dropped
#tail -n 1000 /var/log/nginx/*access.log | awk '{print $1;}' | \
# grep -v "127.0.0.1" | grep -v "0.0.0.0" | grep -v "$OURIP1" | sort > full.list
timeout
10
tail
-f
-n
300 /var/log/nginx/
azbyka.ru
-error.log |
sed
-e
"s|.*client:
\(
[0-9]*
\.
[0-9]*
\.
[0-9]*
\.
[0-9]*
\)
.*|
\1
|g"
|
\
grep
-v
"127.0.0.1"
|
grep
-v
"0.0.0.0"
|
grep
-v
"
$OURIP1
"
|
head
-n
1000 |
sort
>
full.list
timeout
10
tail
-f
-n
300 /var/log/nginx/
*
-error
.log |
sed
-e
"s|.*client:
\(
[0-9]*
\.
[0-9]*
\.
[0-9]*
\.
[0-9]*
\)
.*|
\1
|g"
|
\
grep
-v
"127.0.0.1"
|
grep
-v
"0.0.0.0"
|
grep
-v
"
$OURIP1
"
|
sort
>
full.list
NUMP
=
$(
cat
full.list |
wc
-l
)
...
...
ddos/check_nginx.sh
View file @
f6c328f1
...
...
@@ -3,12 +3,12 @@
cd
$(
dirname
$0
)
# uncomment one of
MAXPERC
=
40
#MAXNUM=10
0
#
MAXPERC=40
MAXNUM
=
6
0
MAXLIST
=
30
OURIP1
=
"212.176.200.22"
.
config
get_already_dropped
()
{
...
...
@@ -31,7 +31,8 @@ echo "Tail *access.log..."
# grep -v "127.0.0.1" | grep -v "0.0.0.0" | grep -v "$OURIP1" | sort > full.list
timeout
3
tail
-f
-n
200 /var/log/nginx/
*
access.log |
awk
'{print $1;}'
|
\
grep
-v
"127.0.0.1"
|
grep
-v
"0.0.0.0"
|
grep
-v
"
$OURIP1
"
|
head
-n
1000 |
sort
>
full.list
#timeout 3 cat /var/log/nginx/access-admin.log | awk '{print $1;}' | \
grep
-v
"127.0.0.1"
|
grep
-v
"0.0.0.0"
|
grep
-v
"
$OURIP1
"
|
sort
>
full.list
NUMP
=
$(
cat
full.list |
wc
-l
)
NUMPUNIQ
=
$(
cat
full.list |
sort
-u
|
wc
-l
)
...
...
ddos/white.list
View file @
f6c328f1
# yandex
93.158.149.31
# mtmon3
5.255.210.93
# opera
80.239.242.142
# opera-mini.net
217.212.231.*
# mts
213.87.133.223
# msn
157.56.93.209
# seni.etersoft.ru
91.232.225.2
91.232.225.6
91.232.225.46
91.232.225.201
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