30 Commits

Author SHA1 Message Date
ƬHE ЯAW ☣ 915f5179ef Delete nginx-ban.conf 2020-06-16 19:21:21 +02:00
ƬHE ЯAW ☣ efbe8d1215 Delete install 2020-06-16 19:21:13 +02:00
ƬHE ЯAW ☣ dd42d12564 Delete jail.local 2020-06-16 19:21:05 +02:00
ƬHE ЯAW ☣ 9d09c37798 Delete rules 2020-06-16 19:20:59 +02:00
ƬHE ЯAW ☣ d0f207c1db Delete README.md 2020-06-16 19:20:51 +02:00
ƬHE ЯAW ☣ 080341b9f4 Delete nginx.service 2020-06-16 19:20:44 +02:00
ƬHE ЯAW ☣ a8741748ea Delete bot.conf 2020-06-16 19:20:33 +02:00
ƬHE ЯAW ☣ 238364533e Delete whitelist-ips.conf 2020-06-16 19:20:24 +02:00
ƬHE ЯAW ☣ 493bc739cb Delete install 2020-06-16 19:20:15 +02:00
ƬHE ЯAW ☣ d134f6ad1c Delete install 2020-06-16 19:20:02 +02:00
ƬHE ЯAW ☣ b38eefde23 Delete nginx.conf 2020-06-16 19:19:53 +02:00
ƬHE ЯAW ☣ d04d7dcd24 Delete nginx.service 2020-06-16 19:19:45 +02:00
ƬHE ЯAW ☣ c5887201b1 Delete config 2020-06-16 19:19:36 +02:00
ƬHE ЯAW ☣ 200200249f Delete install 2020-06-16 19:19:30 +02:00
ƬHE ЯAW ☣ f822528b2d Delete error-report.md 2020-06-16 19:19:21 +02:00
ƬHE ЯAW ☣ 5f2e8c867c Delete feature_request.md 2020-06-16 19:19:14 +02:00
ƬHE ЯAW ☣ 81fe187290 Delete config 2020-06-10 21:28:55 +02:00
ƬHE ЯAW ☣ 2ce209f3fd Delete install 2020-06-10 21:28:39 +02:00
ƬHE ЯAW ☣ 76401bbac8 Create setup 2020-06-10 21:28:29 +02:00
ƬHE ЯAW ☣ 96e90dac9a Update sysctl.conf 2020-05-20 22:23:14 +02:00
theraw c23274bd71 Delete FUNDING.yml 2019-11-17 11:29:01 +01:00
theraw d20c1b95f2 Update sysctl.conf 2019-07-11 04:48:25 +02:00
theraw 22dd775f52 Update README.md 2019-07-11 04:40:49 +02:00
theraw 51d1891976 Update install 2019-06-04 23:09:14 +02:00
theraw fcfead4725 Update install 2019-06-02 14:11:32 +02:00
theraw edab3852db Create FUNDING.yml 2019-05-24 00:39:29 +02:00
theraw 466973036b Update install 2019-05-23 23:54:56 +02:00
theraw 48af67f447 Update README.md 2019-05-07 12:18:07 +02:00
theraw 9731764613 Update install 2019-05-06 06:27:59 +02:00
theraw 81a224247e Update rules 2019-05-03 07:29:16 +02:00
21 changed files with 89 additions and 2119 deletions
-14
View File
@@ -1,14 +0,0 @@
---
name: Error report
about: Create a report to help us improve
---
**Describe the Error**
What you expected and what you got? Please write it here.
```bash
Make sure you include a output of your terminal where you see the error
```
*I'm not the one who created nginx or any of those modules so don't expect much if i'm not able to help your request will be forwarded somewhere else based on kind of it.*
-17
View File
@@ -1,17 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
-2
View File
@@ -1,2 +0,0 @@
export user=raw
-176
View File
@@ -1,176 +0,0 @@
#!/bin/bash
case "`grep ID_LIKE /etc/*-release | awk -F '=' '{print $2}'`" in
archlinux)
if [ "$(whoami)" != "root" ]
then
echo "You should Login as root to use this script!";
echo "May you already have access for sudo, but commands aren't designed with sudo! so..";
echo "sudo -i";
exit 1
fi
if [ -d "/nginx/" ]; then
echo "We've detect a folder '/nginx/' which means"
echo "Maybe you have use this script before!"
echo "You can fix this by executing!"
echo "./setup clean"
exit 1
fi
if [ -d "/etc/nginx" ]; then
echo "We've detect a folder '/etc/nginx' which means"
echo "Maybe you have use this script before!"
echo "./setup clean"
exit 1
fi
if [ -d "/opt/nginx/" ]; then
echo "We've detect a folder '/opt/nginx/' which means"
echo "Maybe you have use this script before!"
echo "./setup clean"
exit 1
fi
mkdir -p /hostdata/
mkdir -p /var/log/nginx/
mkdir -p /opt/nginx/modules/
useradd -m -g users -s /bin/bash $user
yes|pacman -Syy
yes|pacman -Syyu
yes|pacman -S curl wget zip unzip git gcc make cmake automake sudo
yes|pacman -S geoip geoip-database zlib geoip-database-extra autoconf libtool
yes|pacman -S yajl lmdb glibc libxml2 icu ncurses readline xz python3 python-pip
yes|pacman -S net-tools lua htop iftop gd
yes|pacman -S libmaxminddb geoip2-database mmdblookup libxml2 libxslt
su $user <<'EOF'
git clone https://aur.archlinux.org/ssdeep.git /home/$user/ssdeep
cd /home/$user/ssdeep/ && makepkg --syncdeps
yes|makepkg --install
makepkg --clean
rm -Rf /home/$user/ssdeep
EOF
cd /opt/
git clone https://github.com/SpiderLabs/ModSecurity
cd /opt/ModSecurity/
git checkout -b v3/master origin/v3/master
sh build.sh
git submodule init
git submodule update
./configure
make -j`nproc`
make install
cd /opt/nginx/modules/
wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.zip
unzip v0.3.0.zip; rm -Rf v0.3.0.zip
mv /opt/nginx/modules/ngx_devel_kit-0.3.0/ /opt/nginx/modules/ngx_devel_kit/
#Pagespeed Library
cd /opt/nginx/modules/
wget https://github.com/pagespeed/ngx_pagespeed/archive/v1.13.35.1-beta.zip
unzip v1.13.35.1-beta.zip
rm -Rf v1.13.35.1-beta.zip
mv /opt/nginx/modules/incubator-pagespeed-ngx-1.13.35.1-beta /opt/nginx/modules/ngx_pagespeed-1.13.35.1-beta
cd /opt/nginx/modules/ngx_pagespeed-1.13.35.1-beta
wget https://dl.google.com/dl/page-speed/psol/1.13.35.1-x64.tar.gz
tar -xzvf 1.13.35.1-x64.tar.gz; rm -Rf 1.13.35.1-x64.tar.gz
#LuaJIT Library
cd /opt/nginx/modules/
git clone http://luajit.org/git/luajit-2.0.git
cd luajit-2.0/
make -j`nproc`
sudo make install
ldconfig
#Naxsi Mod
cd /opt/nginx/modules/
wget https://github.com/nbs-system/naxsi/archive/master.zip
unzip master.zip; rm -Rf master.zip
mv /opt/nginx/modules/naxsi-master /opt/nginx/modules/naxsi
mkdir -p /opt/nginx/modules/
cd /opt/nginx/modules/
rm -Rf nginx_redis/
git clone https://github.com/openresty/set-misc-nginx-module.git
git clone https://github.com/FRiCKLE/ngx_cache_purge.git
git clone https://github.com/kyprizel/testcookie-nginx-module.git
git clone https://github.com/openresty/headers-more-nginx-module.git
git clone https://github.com/openresty/echo-nginx-module.git
git clone https://github.com/leev/ngx_http_geoip2_module.git
git clone https://github.com/openresty/lua-nginx-module.git
git clone https://github.com/arut/nginx-mtask-module.git
git clone https://github.com/arut/nginx-mysql-module.git
git clone https://github.com/SpiderLabs/ModSecurity-nginx.git
git clone https://github.com/openresty/encrypted-session-nginx-module.git
git clone https://github.com/flant/nginx-http-rdns.git
# OpenSSL 1.0.2h
mkdir -p /opt/nginx/
cd /opt/nginx/; wget wget https://github.com/openssl/openssl/archive/OpenSSL_1_0_2h.zip
unzip OpenSSL_1_0_2h.zip; rm -Rf OpenSSL_1_0_2h.zip
# Download Nginx
mkdir -p /opt/nginx/sources/
cd /opt/nginx/sources/
wget 'http://nginx.org/download/nginx-1.13.8.tar.gz'
tar -xzvf nginx-1.13.8.tar.gz; rm -Rf nginx-1.13.8.tar.gz
cd /opt/nginx/sources/nginx-1.13.8/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nbuild.sh
chmod +x nbuild.sh
./nbuild.sh
make -j`nproc`
make install
ldconfig
mkdir -p /nginx
mkdir -p /nginx/live
mkdir -p /nginx/logs
mkdir -p /nginx/cache
mkdir -p /nginx/conf.d
touch /nginx/logs/access.log
touch /nginx/logs/error.log
useradd -r nginx
rm -Rf /etc/init.d/nginx
cd /etc/init.d/; wget https://raw.githubusercontent.com/systemroot/my-nginx/master/nginx-as-firewall/static/nginx
chmod +x /etc/init.d/nginx
cd /nginx/; mkdir conf.d; rm -Rf nginx.conf*; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/ArchLinux/static/nginx.conf
mkdir -p /nginx/live/
cd /nginx/live/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/vhost/default
mkdir -p /hostdata/default
mkdir -p /hostdata/default/public_html
mkdir -p /hostdata/default/logs
mkdir -p /hostdata/default/cache
mkdir -p /nginx/modsecurity/
cd /hostdata/default/public_html/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/html/index.html
sudo update-rc.d nginx defaults
mkdir -p /tmp/; cd /tmp; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/sysctl.conf
cat /tmp/sysctl.conf >> /etc/sysctl.conf
sysctl -p
clear
cd /nginx/; mkdir db/; cd db/; wget https://github.com/theraw/The-World-Is-Yours/raw/master/static/GeoLite2-Country.mmdb
cd /nginx/; rm -Rf *.default
cp /opt/nginx/modules/naxsi/naxsi_config/naxsi_core.rules /nginx/naxsi_core.rules
cp /opt/ModSecurity/modsecurity.conf-recommended /nginx/modsecurity/modsecurity.conf
cd /opt/; git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
cp -a /opt/owasp-modsecurity-crs/rules/ /nginx/modsecurity/
cp -a /opt/owasp-modsecurity-crs/crs-setup.conf.example /nginx/modsecurity/crs-setup.conf
clear
#mkdir -p /tmp/; cd /tmp; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/iptables/install
#chmod +x install; ./install
#clear
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/ArchLinux/static/nginx.service > /usr/lib/systemd/system/nginx.service
clear
systemctl enable nginx
nginx -t
;;
esac
-120
View File
@@ -1,120 +0,0 @@
# Suggestions? => https://github.com/theraw/The-World-Is-Yours/issues
# Problems? => https://github.com/theraw/The-World-Is-Yours/issues
# Errors? => https://github.com/theraw/The-World-Is-Yours/issues
user root;
worker_processes auto;
worker_rlimit_nofile 65535;
events {
multi_accept on;
use epoll;
worker_connections 65535;
}
http {
# ////////////////////////////////////////////////////// #
# =================== START L7 ========================= #
# turn this 'on' if you want to use L7 For every domain hosted in your server
testcookie off;
testcookie_name DOPEHOSTING;
testcookie_secret random;
testcookie_session $remote_addr;
#testcookie_arg GO;
testcookie_httponly_flag on;
testcookie_max_attempts 3;
testcookie_secure_flag on;
testcookie_get_only on;
testcookie_p3p 'CP="CUR ADM OUR NOR STA NID", policyref="/w3c/p3p.xml"';
testcookie_fallback /cookies.html?backurl=$scheme://$host$request_uri;
# Those are some ip's whitelisted by me. mostly are search engines. But not everything!
testcookie_whitelist {
8.8.8.8/32;
127.0.0.1/32;
# I don't suggest using alot of IPs here as this whitelist can fail!.
}
testcookie_redirect_via_refresh on;
testcookie_refresh_encrypt_cookie on;
testcookie_refresh_encrypt_cookie_key random;
testcookie_refresh_encrypt_cookie_iv random;
testcookie_refresh_template '<html><head><meta http-equiv="refresh" content="0; $testcookie_nexturl"><title>Just a moment please...</title></head><body> </script><script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script><script type=\"text/javascript\" src="//proxy2.dopehosting.net/aes.min.js" ></script><script>function toNumbers(d){var e=[];d.replace(/(..)/g,function(d){e.push(parseInt(d,16))});return e}function toHex(){for(var d=[],d=1==arguments.length&&arguments[0].constructor==Array?arguments[0]:arguments,e="",f=0;f<d.length;f++)e+=(16>d[f]?"0":"")+d[f].toString(16);return e.toLowerCase()}var a=toNumbers("$testcookie_enc_key"),b=toNumbers("$testcookie_enc_iv"),c=toNumbers("$testcookie_enc_set");document.cookie="DOPEHOSTING="+toHex(slowAES.decrypt(c,2,a,b))+"; expires=Thu, 31-Dec-37 23:55:55 GMT; path=/";</script></body></html>';
# ===================== END L7 ========================= #
# ////////////////////////////////////////////////////// #
# ////////////////////////////////////////////////////// #
# ===================== LOGS =========================== #
log_format main '$remote_addr |==| $status |==| $request |==| $time_local';
# -------------------------------------------------------#
log_format agent '$remote_addr |==| $status |==| $request |==| $http_user_agent';
# -------------------------------------------------------#
log_format full '$remote_addr |==| $remote_user |==| $time_local |==| $request |==| $status |==| $body_bytes_sent |==| $http_referer |==| $http_user_agent |==| $http_x_forwarded_for';
# =================== END LOGS ========================= #
# ////////////////////////////////////////////////////// #
# ////////////////////////////////////////////////////// #
# ===================== GEIP =========================== #
geoip2 /nginx/db/GeoLite2-Country.mmdb {
$geoip2_data_country_code default=US country iso_code;
$geoip2_data_country_name country names en;
}
# EX Ban China!
#map $geoip2_data_country_code $allowed_country {
# default yes;
# CN no;
#}
# =================== END GEIP ========================= #
# ////////////////////////////////////////////////////// #
# ////////////////////////////////////////////////////// #
# ===================== EXTRA ========================== #
# Don't Go with "Nginx Can Handle Everything" !
limit_conn_zone $server_name zone=max:1m;
limit_req_zone $binary_remote_addr zone=one:1m rate=1r/s;
# =================== END EXTRA ======================== #
# ////////////////////////////////////////////////////// #
# ////////////////////////////////////////////////////// #
# ==================== BACKENDS ======================== #
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Example Of Backend
#upstream varnish {
# zone tcp_servers 64k;
# server 10.10.10.39:80;
#}
# =================== END BACKENDS ===================== #
# ////////////////////////////////////////////////////// #
# ////////////////////////////////////////////////////// #
# ==================== GENERAL ========================= #
client_body_buffer_size 1M;
client_header_buffer_size 1M;
client_body_timeout 90s;
client_header_timeout 90s;
client_max_body_size 2M;
keepalive_timeout 10s;
port_in_redirect off;
sendfile on;
server_names_hash_bucket_size 6969;
server_name_in_redirect off;
server_tokens off;
tcp_nodelay on;
tcp_nopush on;
types_hash_max_size 2048;
resolver 8.8.8.8 8.8.4.4;
default_type application/octet-stream;
include /nginx/mime.types;
# =================== END GENERAL ====================== #
# ////////////////////////////////////////////////////// #
# ////////////////////////////////////////////////////// #
# =================== LOAD CONFIGS ===================== #
include /nginx/live/*;
include /nginx/conf.d/*;
include /nginx/naxsi_core.rules;
# =================== END CONFIGS ====================== #
# ////////////////////////////////////////////////////// #
}
-17
View File
@@ -1,17 +0,0 @@
[Unit]
Description=A high performance web server and a reverse proxy server
After=network.target network-online.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
PrivateDevices=yes
SyslogLevel=err
ExecStart=/usr/bin/nginx -g 'pid /run/nginx.pid; error_log stderr;'
ExecReload=/usr/bin/nginx -s reload
KillSignal=SIGQUIT
KillMode=mixed
[Install]
WantedBy=multi-user.target
-6
View File
@@ -1,6 +0,0 @@
#!/bin/bash
yum -y update; yum -y upgrade; yum -y install epel-release wget zip unzip git nano
yum -y install lvemanager
yum -y install cagefs
yum -y groupinstall alt-php
+5 -6
View File
@@ -1,24 +1,23 @@
# Nginx L7 DDoS Protection! :boom: :zap:
*(Please Read Whole Page, All Things Are Important Then If You Want You Can Use IT.)*
# This is it!
There will be no other version of this PR, This is the only and one and the best that you can find for free where you can see/do/change anything on your will and not some encrypted piece of code! This is pure open source code as you can open any file and read anything, This script automatically compiles nginx from source with lots of modules helpful but mostly who play a big role in L7 Anti-DDoS, including the L7 nginx module which you can configure as simple as https://github.com/theraw/The-World-Is-Yours/issues/10#issuecomment-442579528 more then that consider a [Donate](https://github.com/theraw/The-World-Is-Yours/blob/master/.github/FUNDING.yml) and you can contact me for further support!
Summer is here, after that i may be working and i don't see having much of free time to play with nginx!
# To-Do
- [x] Nginx Version, Always Latest.
- [x] Support Ubuntu Trusty. (14.04)
- [x] Support Ubuntu Xenial. (16.04)
- [x] Support Ubuntu Cosmic. (18.10)
- [ ] Support Debian.
- [ ] Support Centos.
- [x] Support Arch Linux.
- [x] ModSecurity Support.
- [x] Naxsi Support.
- [x] L7 Protection.
- [x] AutoBan System.
- [x] Integrate Fail2Ban > IpTables.
- [ ] GUI ?
- [ ] Monitor requests in live time from browser.
- [ ] L7 Protection (TestCookie Module) Add Recaptcha!
- [ ] .....
# Installation
-4
View File
@@ -1,4 +0,0 @@
geo $white_bot {
default 0;
include /nginx/whitelist/whitelist-ips.conf;
}
-63
View File
@@ -1,63 +0,0 @@
#!/bin/bash
ireqs() {
mkdir -p /tmp/nginx-plus/; cd /tmp/nginx-plus
wget
apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y
apt-get autoremove -y
apt-get install apt-utils build-essential -y
apt-get install git -y
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg libxml2 zlib1g-dev -y
apt-get install -y unzip
apt-get install -y libicu-dev libcurl4-gnutls-dev libtool
apt-get install -y libmozjs-24-dev
apt-get install -y libmozjs-24-bin; sudo ln -sf /usr/bin/js24 /usr/bin/js
apt-get install openssl libssl-dev libperl-dev libexpat-dev -y
apt-get install mercurial meld -y
apt-get install libxslt-dev -y
apt-get install libgd2-xpm -y
apt-get install libgd2-xpm-dev -y
apt-get install libgeoip-dev -y
apt-get install libssl libssl-dev -y
apt-get install dh-autoreconf -y
apt-get install -y software-properties-common
apt-get install -y python-software-properties
apt-get install -y libcairo2 libcairo2-dev
apt-get install -y python-dev
sudo add-apt-repository ppa:maxmind/ppa -y
apt-get install aptitude -y
aptitude update -y
aptitude upgrade -y
aptitude install libmaxminddb0 libmaxminddb-dev mmdb-bin -y
apt-get install libmysqlclient-dev -y
apt-get install libmariadbclient-dev -y
apt-get install g++ flex bison curl doxygen libyajl-dev libgeoip-dev libtool dh-autoreconf libcurl4-gnutls-dev libxml2 libpcre++-dev libxml2-dev -y
}
# Nginx Env's Extra Stuff.
#ngx-envs() {
#
#}
download() {
cd /
wget https://github.com/systemroot/my-nginx/raw/master/nginx-plus/nginx-plus.zip
unzip -P ****** nginx-plus.zip; rm -Rf nginx-plus.zip
clear
}
rebuild-conf() {
}
download-mods() {
}
compile-mods() {
}
move-mods() {
}
-498
View File
@@ -1,498 +0,0 @@
# ====================================
# GOOGLE.
# ====================================
108.177.8.0/21 1;
54.36.0.0/16 1;
104.132.0.0/23 1;
104.132.11.0/24 1;
104.132.141.0/24 1;
104.132.34.0/24 1;
104.132.5.0/24 1;
104.132.51.0/24 1;
104.132.7.0/24 1;
104.132.8.0/24 1;
104.133.0.0/24 1;
104.133.2.0/23 1;
104.154.0.0/15 1;
104.196.0.0/14 1;
107.167.160.0/19 1;
107.178.192.0/18 1;
108.170.192.0/18 1;
108.177.0.0/17 1;
108.177.10.0/24 1;
108.177.103.0/24 1;
108.177.104.0/24 1;
108.177.11.0/24 1;
108.177.112.0/24 1;
108.177.119.0/24 1;
108.177.120.0/24 1;
108.177.12.0/24 1;
108.177.121.0/24 1;
108.177.125.0/24 1;
108.177.126.0/24 1;
108.177.127.0/24 1;
108.177.13.0/24 1;
108.177.14.0/24 1;
108.177.15.0/24 1;
108.177.28.0/24 1;
108.177.30.0/24 1;
108.177.8.0/24 1;
108.177.9.0/24 1;
108.177.96.0/24 1;
108.177.97.0/24 1;
108.177.98.0/24 1;
108.59.80.0/20 1;
130.211.0.0/16 1;
142.250.0.0/15 1;
146.148.0.0/17 1;
162.216.148.0/22 1;
162.222.176.0/21 1;
172.102.10.0/24 1;
172.102.11.0/24 1;
172.102.12.0/23 1;
172.102.14.0/23 1;
172.102.8.0/21 1;
172.102.8.0/24 1;
172.110.32.0/21 1;
172.217.0.0/16 1;
172.217.0.0/24 1;
172.217.10.0/24 1;
172.217.1.0/24 1;
172.217.11.0/24 1;
172.217.12.0/24 1;
172.217.13.0/24 1;
172.217.14.0/24 1;
172.217.15.0/24 1;
172.217.16.0/24 1;
172.217.17.0/24 1;
172.217.18.0/24 1;
172.217.19.0/24 1;
172.217.20.0/24 1;
172.217.2.0/24 1;
172.217.21.0/24 1;
172.217.22.0/24 1;
172.217.23.0/24 1;
172.217.24.0/24 1;
172.217.25.0/24 1;
172.217.26.0/24 1;
172.217.27.0/24 1;
172.217.28.0/24 1;
172.217.29.0/24 1;
172.217.30.0/24 1;
172.217.3.0/24 1;
172.217.31.0/24 1;
172.217.4.0/24 1;
172.217.5.0/24 1;
172.217.6.0/24 1;
172.217.7.0/24 1;
172.217.8.0/24 1;
172.217.9.0/24 1;
172.253.0.0/16 1;
173.194.112.0/24 1;
173.194.113.0/24 1;
173.194.117.0/24 1;
173.194.118.0/24 1;
173.194.119.0/24 1;
173.194.120.0/24 1;
173.194.121.0/24 1;
173.194.124.0/24 1;
173.194.132.0/24 1;
173.194.136.0/24 1;
173.194.140.0/24 1;
173.194.141.0/24 1;
173.194.142.0/24 1;
173.194.175.0/24 1;
173.194.192.0/24 1;
173.194.193.0/24 1;
173.194.194.0/24 1;
173.194.195.0/24 1;
173.194.196.0/24 1;
173.194.197.0/24 1;
173.194.198.0/24 1;
173.194.199.0/24 1;
173.194.200.0/24 1;
173.194.201.0/24 1;
173.194.202.0/24 1;
173.194.203.0/24 1;
173.194.204.0/24 1;
173.194.205.0/24 1;
173.194.206.0/24 1;
173.194.207.0/24 1;
173.194.208.0/24 1;
173.194.209.0/24 1;
173.194.210.0/24 1;
173.194.211.0/24 1;
173.194.212.0/24 1;
173.194.213.0/24 1;
173.194.214.0/24 1;
173.194.215.0/24 1;
173.194.216.0/24 1;
173.194.217.0/24 1;
173.194.218.0/24 1;
173.194.219.0/24 1;
173.194.220.0/24 1;
173.194.221.0/24 1;
173.194.222.0/24 1;
173.194.223.0/24 1;
173.194.32.0/24 1;
173.194.34.0/24 1;
173.194.35.0/24 1;
173.194.36.0/24 1;
173.194.37.0/24 1;
173.194.38.0/24 1;
173.194.39.0/24 1;
173.194.40.0/24 1;
173.194.41.0/24 1;
173.194.42.0/24 1;
173.194.44.0/24 1;
173.194.46.0/24 1;
173.194.53.0/24 1;
173.194.63.0/24 1;
173.194.66.0/24 1;
173.194.67.0/24 1;
173.194.68.0/24 1;
173.194.69.0/24 1;
173.194.70.0/24 1;
173.194.7.0/24 1;
173.194.73.0/24 1;
173.194.74.0/24 1;
173.194.76.0/24 1;
173.194.78.0/24 1;
173.194.79.0/24 1;
173.255.112.0/20 1;
185.150.148.0/22 1;
185.25.28.0/23 1;
192.104.160.0/23 1;
192.158.28.0/22 1;
192.178.0.0/15 1;
199.192.112.0/22 1;
199.223.232.0/21 1;
207.223.160.0/20 1;
208.68.108.0/22 1;
208.81.188.0/22 1;
209.107.176.0/20 1;
209.107.176.0/23 1;
209.107.182.0/23 1;
209.107.184.0/23 1;
209.107.185.0/24 1;
209.85.144.0/24 1;
209.85.145.0/24 1;
209.85.147.0/24 1;
209.85.200.0/24 1;
209.85.201.0/24 1;
209.85.202.0/24 1;
209.85.203.0/24 1;
209.85.232.0/24 1;
209.85.233.0/24 1;
209.85.234.0/24 1;
209.85.235.0/24 1;
216.239.32.0/24 1;
216.239.33.0/24 1;
216.239.34.0/24 1;
216.239.35.0/24 1;
216.239.36.0/24 1;
216.239.38.0/24 1;
216.239.39.0/24 1;
216.252.220.0/22 1;
216.252.220.0/24 1;
216.252.222.0/24 1;
216.58.200.0/24 1;
216.58.208.0/24 1;
216.58.209.0/24 1;
216.58.210.0/24 1;
216.58.211.0/24 1;
216.58.212.0/24 1;
216.58.213.0/24 1;
216.58.214.0/24 1;
216.58.215.0/24 1;
216.58.216.0/24 1;
216.58.217.0/24 1;
216.58.218.0/24 1;
216.58.219.0/24 1;
216.58.220.0/24 1;
216.58.221.0/24 1;
216.58.222.0/24 1;
216.58.223.0/24 1;
216.73.80.0/20 1;
23.236.48.0/20 1;
23.251.128.0/19 1;
35.184.0.0/13 1;
35.192.0.0/13 1;
35.200.0.0/14 1;
35.204.0.0/15 1;
35.224.0.0/14 1;
35.228.0.0/14 1;
35.232.0.0/14 1;
35.236.0.0/14 1;
35.240.0.0/14 1;
35.244.0.0/14 1;
64.233.161.0/24 1;
64.233.162.0/24 1;
64.233.163.0/24 1;
64.233.164.0/24 1;
64.233.165.0/24 1;
64.233.166.0/24 1;
64.233.167.0/24 1;
64.233.168.0/24 1;
64.233.169.0/24 1;
64.233.170.0/24 1;
64.233.171.0/24 1;
64.233.176.0/24 1;
64.233.177.0/24 1;
64.233.178.0/24 1;
64.233.179.0/24 1;
64.233.180.0/24 1;
64.233.181.0/24 1;
64.233.182.0/24 1;
64.233.183.0/24 1;
64.233.184.0/24 1;
64.233.185.0/24 1;
64.233.186.0/24 1;
64.233.187.0/24 1;
64.233.188.0/24 1;
64.233.189.0/24 1;
64.233.190.0/24 1;
64.233.191.0/24 1;
66.102.1.0/24 1;
66.102.12.0/24 1;
66.102.2.0/24 1;
66.102.3.0/24 1;
66.102.4.0/24 1;
66.249.64.0/19 1;
70.32.128.0/19 1;
70.32.131.0/24 1;
70.32.145.0/24 1;
70.32.146.0/23 1;
70.32.151.0/24 1;
74.114.24.0/21 1;
74.125.124.0/24 1;
74.125.126.0/24 1;
74.125.127.0/24 1;
74.125.128.0/24 1;
74.125.129.0/24 1;
74.125.130.0/24 1;
74.125.131.0/24 1;
74.125.132.0/24 1;
74.125.133.0/24 1;
74.125.134.0/24 1;
74.125.135.0/24 1;
74.125.136.0/24 1;
74.125.138.0/24 1;
74.125.139.0/24 1;
74.125.140.0/24 1;
74.125.141.0/24 1;
74.125.143.0/24 1;
74.125.192.0/24 1;
74.125.196.0/24 1;
74.125.197.0/24 1;
74.125.198.0/24 1;
74.125.199.0/24 1;
74.125.200.0/24 1;
74.125.201.0/24 1;
74.125.202.0/24 1;
74.125.203.0/24 1;
74.125.204.0/24 1;
74.125.205.0/24 1;
74.125.206.0/24 1;
74.125.21.0/24 1;
74.125.22.0/24 1;
74.125.225.0/24 1;
74.125.226.0/24 1;
74.125.227.0/24 1;
74.125.228.0/24 1;
74.125.230.0/24 1;
74.125.23.0/24 1;
74.125.232.0/24 1;
74.125.234.0/24 1;
74.125.235.0/24 1;
74.125.236.0/24 1;
74.125.238.0/24 1;
74.125.24.0/24 1;
74.125.26.0/24 1;
74.125.27.0/24 1;
74.125.28.0/24 1;
74.125.29.0/24 1;
74.125.30.0/24 1;
74.125.31.0/24 1;
74.125.39.0/24 1;
74.125.6.0/24 1;
74.125.68.0/24 1;
74.125.69.0/24 1;
74.125.70.0/24 1;
74.125.71.0/24 1;
8.34.208.0/21 1;
8.34.216.0/21 1;
8.35.192.0/21 1;
8.35.200.0/21 1;
8.8.4.0/24 1;
8.8.8.0/24 1;
108.177.96.0/19 1;
172.217.0.0/19 1;
173.194.0.0/16 1;
2001:4860:4000::/36 1;
203.208.60.0/24 1;
207.126.144.0/20 1;
209.85.128.0/17 1;
216.239.32.0/19 1;
216.58.192.0/19 1;
2404:6800:4000::/36 1;
2607:f8b0:4000::/36 1;
2800:3f0:4000::/36 1;
2a00:1450:4000::/36 1;
2c0f:fb50:4000::/36 1;
64.18.0.0/20 1;
64.233.160.0/19 1;
64.68.80.0/21 1;
66.102.0.0/20 1;
66.249.64.0/18 1;
72.14.192.0/18 1;
74.125.0.0/16 1;
# ====================================
# END GOOGLE.
# ====================================
# ====================================
# START BING.
# ====================================
131.253.24.0/22 1;
131.253.46.0/23 1;
157.54.0.0/15 1;
157.56.0.0/14 1;
157.60.0.0/16 1;
199.30.16.0/24 1;
199.30.27.0/24 1;
207.46.0.0/16 1;
40.112.0.0/13 1;
40.120.0.0/14 1;
40.124.0.0/16 1;
40.125.0.0/17 1;
40.74.0.0/15 1;
40.76.0.0/14 1;
40.80.0.0/12 1;
40.96.0.0/12 1;
65.52.104.0/24 1;
65.52.108.0/22 1;
65.55.213.0/24 1;
65.55.217.0/24 1;
65.55.24.0/24 1;
65.55.52.0/24 1;
65.55.55.0/24 1;
# ====================================
# END BING.
# ====================================
# ====================================
# START CLOUDFLARE.
# ====================================
103.21.244.0/22 1;
103.22.200.0/22 1;
103.31.4.0/22 1;
104.16.0.0/12 1;
108.162.192.0/18 1;
131.0.72.0/22 1;
141.101.64.0/18 1;
162.158.0.0/15 1;
172.64.0.0/13 1;
173.245.48.0/20 1;
188.114.96.0/20 1;
190.93.240.0/20 1;
197.234.240.0/22 1;
198.41.128.0/17 1;
# ====================================
# END CLOUDFLARE.
# ====================================
# ====================================
# START UPTIME ROBOT.
# ====================================
216.144.250.150 1;
69.162.124.226 1;
69.162.124.227 1;
69.162.124.228 1;
69.162.124.229 1;
69.162.124.230 1;
69.162.124.231 1;
69.162.124.232 1;
69.162.124.233 1;
69.162.124.234 1;
69.162.124.235 1;
69.162.124.236 1;
69.162.124.237 1;
63.143.42.242 1;
63.143.42.243 1;
63.143.42.244 1;
63.143.42.245 1;
63.143.42.246 1;
63.143.42.247 1;
63.143.42.248 1;
63.143.42.249 1;
63.143.42.250 1;
63.143.42.251 1;
63.143.42.252 1;
63.143.42.253 1;
46.137.190.132 1;
122.248.234.23 1;
188.226.183.141 1;
178.62.52.237 1;
54.79.28.129 1;
54.94.142.218 1;
104.131.107.63 1;
54.67.10.127 1;
54.64.67.106 1;
159.203.30.41 1;
46.101.250.135 1;
18.221.56.27 1;
52.60.129.180 1;
159.89.8.111 1;
146.185.143.14 1;
139.59.173.249 1;
165.227.83.148 1;
128.199.195.156 1;
138.197.150.151 1;
34.233.66.117 1;
# ====================================
# END UPTIME ROBOT.
# ====================================
# ====================================
# START DOPEHOSTING.NET
# ====================================
54.37.223.16/30 1;
37.59.144.72/30 1;
137.74.180.224 1;
54.36.45.68 1;
46.105.102.209 1;
188.165.209.76 1;
178.32.143.180 1;
94.23.174.121 1;
145.239.109.72/30 1;
51.254.165.84/30 1;
176.31.143.0/30 1;
151.80.88.22 1;
151.80.88.23 1;
164.132.205.172 1;
91.134.123.247 1;
145.239.77.50 1;
178.33.104.93 1;
178.33.104.96 1;
178.33.104.181 1;
178.33.106.145 1;
51.254.94.129 1;
178.32.56.33 1;
164.132.30.228 1;
137.74.234.202 1;
94.23.172.79 1;
46.105.53.116 1;
91.134.201.79 1;
137.74.234.209 1;
54.36.100.120 1;
94.23.172.83 1;
46.105.51.193 1;
178.32.53.54 1;
# ====================================
# END DOPEHOSTING.NET
# ====================================
-1
View File
@@ -1 +0,0 @@
`
-16
View File
@@ -1,16 +0,0 @@
[Unit]
Description=A high performance web server and a reverse proxy server
After=network.target
[Service]
Type=forking
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid
TimeoutStopSec=5
KillMode=mixed
[Install]
WantedBy=multi-user.target
-37
View File
@@ -1,37 +0,0 @@
#!/bin/bash
# ===============================================================================
# YOU SHOULD CHANGE THOSE.
# ===============================================================================
export NS_PORT='80' # $BIND_IP:80.
export ADMIN_PORT='8282' # $BIND_IP:8282.
export BIND_IP='145.239.109.73' # $BIND_IP:$NS_PORT Will be used for your nginx vhosts configs.
export MY_OS='UBUNTU14' # (UBUNTU14 = Ubuntu 14.04, CENTOS7 = Centos 7.x, Debian7 = Debian 7.9).
export SYM_IT='/nginx' # (Easy way to find nginx 'cd /nginx').
# ===============================================================================
# ===============================================================================
# ===============================================================================
# I DON'T GAVE SUPPORT IF YOU CHANGE THOSE.
# ===============================================================================
export OWNER='root' # Under which user will nginx run!
export PHP_OWNER='root' # Under which group will nginx run!
export HOSTDATA='/hostdata/' # In which folder will website files stored!
export HOSTDATA_DEF='/hostdata/default/public_html/' # Where is the default_server folder.
# CONFIGS.
# ===============================================================================
export NGINX_CONF='/nginx/nginx.conf' # nginx.conf
export VHOST_LIVE_DIR='/nginx/live/' # Live sites.conf folder.
export DEFAULT_SERVER='/nginx/live/default.conf' # Where is the default_server conf.
# EXAMPLE OF EXTRA CONFIGS.
# ===============================================================================
export NGINX_RAILS_UNICORN_CONF_FILE='/etc/nginx/conf.d/rails-unicorn.conf'
export NGINX_RAILS_THIN_CONF_FILE='/etc/nginx/conf.d/rails-thin.conf'
export NGINX_PYRAMID_CONF_FILE='/etc/nginx/conf.d/pyramid.conf'
export NGINX_DJANGO_CONF_FILE='/etc/nginx/conf.d/django.conf'
export NGINX_PHP_CONF_FILE='/etc/nginx/conf.d/php-fpm.conf'
# ===============================================================================
# ===============================================================================
-576
View File
@@ -1,576 +0,0 @@
#!/bin/bash
case "`grep DISTRIB_CODENAME /etc/*-release | awk -F '=' '{print $2}'`" in
trusty)
if [ "$(whoami)" != "root" ]
then
echo "You should Login as root to use this script!";
echo "May you already have access for sudo, but commands aren't designed with sudo! so..";
echo "sudo -i";
exit 1
fi
if [ -d "/nginx/" ]; then
echo "We've detect a folder '/nginx/' which means"
echo "Maybe you have use this script before!"
echo "You can fix this by executing!"
echo "./setup clean"
exit 1
fi
if [ -d "/etc/nginx" ]; then
echo "We've detect a folder '/etc/nginx' which means"
echo "Maybe you have use this script before!"
echo "./setup clean"
exit 1
fi
if [ -d "/opt/nginx/" ]; then
echo "We've detect a folder '/opt/nginx/' which means"
echo "Maybe you have use this script before!"
echo "./setup clean"
exit 1
fi
apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y;
apt-get install sudo -y
apt-get install build-essential libssl-dev curl nano wget zip unzip git -y
apt-get purge --remove nginx -y
apt-get purge --remove apache2 -y
cd ~/;
wget https://raw.githubusercontent.com/systemroot/my-nginx/master/nginx-as-firewall/setup
chmod +x setup
./setup clean
rm -Rf ~/setup
apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y
apt-get autoremove -y
apt-get install apt-utils build-essential -y
apt-get install git -y
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg libxml2 zlib1g-dev -y
apt-get install -y unzip
apt-get install -y libicu-dev libcurl4-gnutls-dev libtool
apt-get install -y libmozjs-24-dev
apt-get install -y libmozjs-24-bin; sudo ln -sf /usr/bin/js24 /usr/bin/js
apt-get install openssl libssl-dev libperl-dev libexpat-dev -y
apt-get install mercurial meld -y
apt-get install libxslt-dev -y
apt-get install libgd2-xpm -y
apt-get install libgd2-xpm-dev -y
apt-get install libgeoip-dev -y
apt-get install libssl libssl-dev -y
apt-get install dh-autoreconf -y
apt-get install -y software-properties-common
apt-get install -y python-software-properties
apt-get install -y libcairo2 libcairo2-dev
apt-get install -y python-dev
sudo add-apt-repository ppa:maxmind/ppa -y
apt-get install aptitude -y
aptitude update -y
aptitude upgrade -y
aptitude install libmaxminddb0 libmaxminddb-dev mmdb-bin -y
apt-get install libmysqlclient-dev -y
apt-get install libmariadbclient-dev -y
apt-get install g++ flex bison curl doxygen libyajl-dev libgeoip-dev libtool dh-autoreconf libcurl4-gnutls-dev libxml2 libpcre++-dev libxml2-dev -y
apt-get install libuuid1 uuid-dev -y
apt-get install libgd-dev libc6 -y
mkdir -p /hostdata/
mkdir -p /var/log/nginx/
mkdir -p /opt/nginx/modules/
cd /opt/
git clone https://github.com/SpiderLabs/ModSecurity
cd /opt/ModSecurity/
git checkout -b v3/master origin/v3/master
sh build.sh
git submodule init
git submodule update
./configure
make -j`nproc`
make install
cd /opt/nginx/modules/
wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.1rc1.zip
unzip v0.3.1rc1.zip; rm -Rf v0.3.1rc1.zip
mv /opt/nginx/modules/ngx_devel_kit-0.3.1rc1/ /opt/nginx/modules/ngx_devel_kit/
#Pagespeed Library
cd /opt/nginx/modules/
wget https://github.com/apache/incubator-pagespeed-ngx/archive/v1.13.35.2-stable.zip
unzip v1.13.35.2-stable.zip
rm -Rf v1.13.35.2-stable.zip
mv /opt/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable /opt/nginx/modules/ngx_pagespeed-1.13.35.2-stable
cd /opt/nginx/modules/ngx_pagespeed-1.13.35.2-stable
wget https://dl.google.com/dl/page-speed/psol/1.13.35.2-x64.tar.gz
tar -xzvf 1.13.35.2-x64.tar.gz; rm -Rf 1.13.35.2-x64.tar.gz
#LuaJIT Library
cd /opt/nginx/modules/
git clone http://luajit.org/git/luajit-2.0.git
cd luajit-2.0/
make -j`nproc`
sudo make install
ldconfig
#Naxsi Mod
cd /opt/nginx/modules/
wget https://github.com/nbs-system/naxsi/archive/master.zip
unzip master.zip; rm -Rf master.zip
mv /opt/nginx/modules/naxsi-master /opt/nginx/modules/naxsi
mkdir -p /opt/nginx/modules/
cd /opt/nginx/modules/
rm -Rf nginx_redis/
git clone https://github.com/openresty/set-misc-nginx-module.git
git clone https://github.com/FRiCKLE/ngx_cache_purge.git
git clone https://github.com/kyprizel/testcookie-nginx-module.git
git clone https://github.com/openresty/headers-more-nginx-module.git
git clone https://github.com/openresty/echo-nginx-module.git
git clone https://github.com/leev/ngx_http_geoip2_module.git
git clone https://github.com/openresty/lua-nginx-module.git
git clone https://github.com/SpiderLabs/ModSecurity-nginx.git
git clone https://github.com/openresty/encrypted-session-nginx-module.git
git clone https://github.com/flant/nginx-http-rdns.git
# Download Nginx
mkdir -p /opt/nginx/sources/
cd /opt/nginx/sources/
wget 'http://nginx.org/download/nginx-1.15.5.tar.gz'
tar -xzvf nginx-1.15.5.tar.gz; rm -Rf nginx-1.15.5.tar.gz
cd /opt/nginx/sources/nginx-1.15.5/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nbuild.sh
chmod +x nbuild.sh
./nbuild.sh
make -j`nproc`
make install
ldconfig
mkdir -p /nginx/live
mkdir -p /nginx/logs
mkdir -p /nginx/conf.d
touch /nginx/logs/access.log
touch /nginx/logs/error.log
useradd -r nginx
rm -Rf /etc/init.d/nginx
cd /etc/init.d/; wget https://raw.githubusercontent.com/systemroot/my-nginx/master/nginx-as-firewall/static/nginx
chmod +x /etc/init.d/nginx
cd /nginx/; mkdir conf.d; rm -Rf nginx.conf*; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nginx.conf
mkdir -p /nginx/live/
cd /nginx/live/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/vhost/default
mkdir -p /hostdata/default
mkdir -p /hostdata/default/public_html
mkdir -p /hostdata/default/logs
mkdir -p /hostdata/default/cache
mkdir -p /nginx/modsecurity/
cd /hostdata/default/public_html/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/html/index.html
sudo update-rc.d nginx defaults
cd /nginx/; mkdir db/; cd db/; wget https://github.com/theraw/The-World-Is-Yours/raw/master/static/GeoLite2-Country.mmdb
cd /nginx/; rm -Rf *.default
cp /opt/nginx/modules/naxsi/naxsi_config/naxsi_core.rules /nginx/naxsi_core.rules
cp /opt/ModSecurity/modsecurity.conf-recommended /nginx/modsecurity/modsecurity.conf
cd /opt/; git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
cp -a /opt/owasp-modsecurity-crs/rules/ /nginx/modsecurity/
cp -a /opt/owasp-modsecurity-crs/crs-setup.conf.example /nginx/modsecurity/crs-setup.conf
clear
#mkdir -p /tmp/; cd /tmp; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/iptables/install
#chmod +x install; ./install
clear
sudo apt-get install fail2ban -y
sudo service fail2ban stop
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/iptables/jail.local > /etc/fail2ban/jail.local
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/iptables/filter.d/nginx-limits.conf > /etc/fail2ban/filter.d/nginx-limits.conf
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/iptables/filter.d/nginx-ban.conf > /etc/fail2ban/filter.d/nginx-ban.conf
touch /nginx/logs/error.log
clear
sudo service fail2ban start
clear
service fail2ban status
nginx -t
service nginx stop
service nginx start
;;
xenial)
if [ "$(whoami)" != "root" ]
then
echo "You should Login as root to use this script!";
echo "May you already have access for sudo, but commands aren't designed with sudo! so..";
echo "sudo -i";
exit 1
fi
if [ -d "/nginx/" ]; then
echo "We've detect a folder '/nginx/' which means"
echo "Maybe you have use this script before!"
echo "You can fix this by executing!"
echo "./setup clean"
exit 1
fi
if [ -d "/etc/nginx" ]; then
echo "We've detect a folder '/etc/nginx' which means"
echo "Maybe you have use this script before!"
echo "./setup clean"
exit 1
fi
if [ -d "/opt/nginx/" ]; then
echo "We've detect a folder '/opt/nginx/' which means"
echo "Maybe you have use this script before!"
echo "./setup clean"
exit 1
fi
apt update
apt upgrade -y
apt dist-upgrade -y
apt install build-essential apt-utils libssl-dev curl nano wget zip unzip git htop iftop whois screen sudo -y
apt purge --remove nginx -y
apt purge --remove apache2 -y
apt autoremove -y
cd ~/;
wget https://raw.githubusercontent.com/systemroot/my-nginx/master/nginx-as-firewall/setup
chmod +x setup
./setup clean
rm -Rf ~/setup
apt install -y checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg libxml2 zlib1g-dev
apt install -y libicu-dev libcurl4-gnutls-dev libtool
apt install -y libmozjs-24-dev
apt install -y libmozjs-24-bin; sudo ln -sf /usr/bin/js24 /usr/bin/js
apt install openssl libssl-dev libperl-dev libexpat-dev -y
apt install mercurial meld -y
apt install libxslt-dev -y
apt install libgd2-xpm -y
apt install libgd2-xpm-dev -y
apt install libgeoip-dev -y
apt install dh-autoreconf -y
apt install -y software-properties-common
apt install -y python-software-properties
apt install -y libcairo2 libcairo2-dev
apt install -y python-dev
sudo add-apt-repository ppa:maxmind/ppa -y
apt update; apt upgrade -y; apt dist-upgrade -y
apt install aptitude -y
aptitude update -y
aptitude upgrade -y
aptitude install libmaxminddb0 libmaxminddb-dev mmdb-bin -y
apt install libmysqlclient-dev -y
apt install libmariadbclient-dev -y
apt install g++ flex bison curl doxygen libyajl-dev libgeoip-dev libtool dh-autoreconf libcurl4-gnutls-dev libxml2 libpcre++-dev libxml2-dev -y
apt install libuuid1 uuid-dev -y
mkdir -p /hostdata/
mkdir -p /var/log/nginx/
mkdir -p /opt/nginx/modules/
cd /opt/
git clone https://github.com/SpiderLabs/ModSecurity
cd /opt/ModSecurity/
git checkout -b v3/master origin/v3/master
sh build.sh
git submodule init
git submodule update
./configure
make -j`nproc`
make install
cd /opt/nginx/modules/
wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.1rc1.zip
unzip v0.3.1rc1.zip; rm -Rf v0.3.1rc1.zip
mv /opt/nginx/modules/ngx_devel_kit-0.3.1rc1/ /opt/nginx/modules/ngx_devel_kit/
cd /opt/nginx/modules/
wget https://github.com/apache/incubator-pagespeed-ngx/archive/v1.13.35.2-stable.zip
unzip v1.13.35.2-stable.zip
rm -Rf v1.13.35.2-stable.zip
mv /opt/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable /opt/nginx/modules/ngx_pagespeed-1.13.35.2-stable
cd /opt/nginx/modules/ngx_pagespeed-1.13.35.2-stable
wget https://dl.google.com/dl/page-speed/psol/1.13.35.2-x64.tar.gz
tar -xzvf 1.13.35.2-x64.tar.gz; rm -Rf 1.13.35.2-x64.tar.gz
#LuaJIT Library
cd /opt/nginx/modules/
git clone http://luajit.org/git/luajit-2.0.git
cd luajit-2.0/
make -j`nproc`
sudo make install
ldconfig
cd /opt/nginx/modules/
wget https://github.com/nbs-system/naxsi/archive/master.zip
unzip master.zip; rm -Rf master.zip
mv /opt/nginx/modules/naxsi-master /opt/nginx/modules/naxsi
mkdir -p /opt/nginx/modules/
cd /opt/nginx/modules/
rm -Rf nginx_redis/
git clone https://github.com/openresty/set-misc-nginx-module.git
git clone https://github.com/FRiCKLE/ngx_cache_purge.git
git clone https://github.com/kyprizel/testcookie-nginx-module.git
git clone https://github.com/openresty/headers-more-nginx-module.git
git clone https://github.com/openresty/echo-nginx-module.git
git clone https://github.com/leev/ngx_http_geoip2_module.git
git clone https://github.com/openresty/lua-nginx-module.git
git clone https://github.com/SpiderLabs/ModSecurity-nginx.git
git clone https://github.com/openresty/encrypted-session-nginx-module.git
git clone https://github.com/flant/nginx-http-rdns.git
# Download Nginx
mkdir -p /opt/nginx/sources/
cd /opt/nginx/sources/
wget 'http://nginx.org/download/nginx-1.14.0.tar.gz'
tar -xzvf nginx-1.14.0.tar.gz; rm -Rf nginx-1.14.0.tar.gz
cd /opt/nginx/sources/nginx-1.14.0/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nbuild.sh
chmod +x nbuild.sh
./nbuild.sh
make -j`nproc`
make install
ldconfig
mkdir -p /nginx/live
mkdir -p /nginx/logs
mkdir -p /nginx/conf.d
touch /nginx/logs/access.log
touch /nginx/logs/error.log
useradd -r nginx
rm -Rf /etc/init.d/nginx
cd /etc/init.d/; wget https://raw.githubusercontent.com/systemroot/my-nginx/master/nginx-as-firewall/static/nginx
chmod +x /etc/init.d/nginx
cd /nginx/; mkdir conf.d; rm -Rf nginx.conf*; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nginx.conf
cd /nginx/live/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/vhost/default
mkdir -p /hostdata/default
mkdir -p /hostdata/default/public_html
mkdir -p /hostdata/default/logs
mkdir -p /hostdata/default/cache
mkdir -p /nginx/modsecurity/
cd /hostdata/default/public_html/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/html/index.html
sudo update-rc.d nginx defaults
cd /nginx/; mkdir db/; cd db/; wget https://github.com/theraw/The-World-Is-Yours/raw/master/static/GeoLite2-Country.mmdb
cd /nginx/; rm -Rf *.default
cp /opt/nginx/modules/naxsi/naxsi_config/naxsi_core.rules /nginx/naxsi_core.rules
cp /opt/ModSecurity/modsecurity.conf-recommended /nginx/modsecurity/modsecurity.conf
cd /opt/; git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
cp -a /opt/owasp-modsecurity-crs/rules/ /nginx/modsecurity/
cp -a /opt/owasp-modsecurity-crs/crs-setup.conf.example /nginx/modsecurity/crs-setup.conf
clear
cd /etc/systemd/system/; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/UBUNTU16/nginx.service
sudo systemctl start nginx.service && sudo systemctl enable nginx.service
killall nginx
systemctl daemon-reload
service nginx stop
service nginx start
;;
cosmic)
if [ "$(whoami)" != "root" ]
then
echo "You should Login as root to use this script!";
echo "May you already have access for sudo, but commands aren't designed with sudo! so..";
echo "sudo -i";
exit 1
fi
if [ -d "/nginx/" ]; then
echo "We've detect a folder '/nginx/' which means"
echo "Maybe you have use this script before!"
echo "You can fix this by executing!"
echo "./setup clean"
exit 1
fi
if [ -d "/etc/nginx" ]; then
echo "We've detect a folder '/etc/nginx' which means"
echo "Maybe you have use this script before!"
echo "./setup clean"
exit 1
fi
if [ -d "/opt/nginx/" ]; then
echo "We've detect a folder '/opt/nginx/' which means"
echo "Maybe you have use this script before!"
echo "./setup clean"
exit 1
fi
apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y;
apt-get install sudo -y
apt-get install build-essential libssl-dev curl nano wget zip unzip git -y
apt-get purge --remove nginx -y
apt-get purge --remove apache2 -y
cd ~/;
wget https://raw.githubusercontent.com/systemroot/my-nginx/master/nginx-as-firewall/setup
chmod +x setup
./setup clean
rm -Rf ~/setup
apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y
apt-get autoremove -y
apt-get install apt-utils build-essential -y
apt-get install git -y
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg libxml2 zlib1g-dev -y
apt-get install -y unzip
apt-get install -y libicu-dev libcurl4-gnutls-dev libtool
apt-get install -y libmozjs-24-dev
apt-get install -y libmozjs-24-bin; sudo ln -sf /usr/bin/js24 /usr/bin/js
apt-get install openssl libssl-dev libperl-dev libexpat-dev -y
apt-get install mercurial meld -y
apt-get install libxslt-dev -y
apt-get install libgd2-xpm -y
apt-get install libgd2-xpm-dev -y
apt-get install libgeoip-dev -y
apt-get install libssl libssl-dev -y
apt-get install dh-autoreconf -y
apt-get install -y software-properties-common
apt-get install -y python-software-properties
apt-get install -y libcairo2 libcairo2-dev
apt-get install -y python-dev
sudo add-apt-repository ppa:maxmind/ppa -y
apt-get install aptitude -y
aptitude update -y
aptitude upgrade -y
aptitude install libmaxminddb0 libmaxminddb-dev mmdb-bin -y
apt-get install libmysqlclient-dev -y
apt-get install libmariadbclient-dev -y
apt-get install g++ flex bison curl doxygen libyajl-dev libgeoip-dev libtool dh-autoreconf libcurl4-gnutls-dev libxml2 libpcre++-dev libxml2-dev -y
apt-get install libuuid1 uuid-dev -y
apt-get install libgd-dev libc6 -y
mkdir -p /hostdata/
mkdir -p /var/log/nginx/
mkdir -p /opt/nginx/modules/
cd /opt/
git clone https://github.com/SpiderLabs/ModSecurity
cd /opt/ModSecurity/
git checkout -b v3/master origin/v3/master
sh build.sh
git submodule init
git submodule update
./configure
make -j`nproc`
make install
cd /opt/nginx/modules/
wget https://github.com/simplresty/ngx_devel_kit/archive/v0.3.1rc1.zip
unzip v0.3.1rc1.zip; rm -Rf v0.3.1rc1.zip
mv /opt/nginx/modules/ngx_devel_kit-0.3.1rc1/ /opt/nginx/modules/ngx_devel_kit/
#Pagespeed Library
cd /opt/nginx/modules/
wget https://github.com/apache/incubator-pagespeed-ngx/archive/v1.13.35.2-stable.zip
unzip v1.13.35.2-stable.zip
rm -Rf v1.13.35.2-stable.zip
mv /opt/nginx/modules/incubator-pagespeed-ngx-1.13.35.2-stable /opt/nginx/modules/ngx_pagespeed-1.13.35.2-stable
cd /opt/nginx/modules/ngx_pagespeed-1.13.35.2-stable
wget https://dl.google.com/dl/page-speed/psol/1.13.35.2-x64.tar.gz
tar -xzvf 1.13.35.2-x64.tar.gz; rm -Rf 1.13.35.2-x64.tar.gz
#LuaJIT Library
cd /opt/nginx/modules/
git clone http://luajit.org/git/luajit-2.0.git
cd luajit-2.0/
make -j`nproc`
sudo make install
ldconfig
#Naxsi Mod
cd /opt/nginx/modules/
wget https://github.com/nbs-system/naxsi/archive/master.zip
unzip master.zip; rm -Rf master.zip
mv /opt/nginx/modules/naxsi-master /opt/nginx/modules/naxsi
mkdir -p /opt/nginx/modules/
cd /opt/nginx/modules/
rm -Rf nginx_redis/
git clone https://github.com/openresty/set-misc-nginx-module.git
git clone https://github.com/FRiCKLE/ngx_cache_purge.git
git clone https://github.com/kyprizel/testcookie-nginx-module.git
git clone https://github.com/openresty/headers-more-nginx-module.git
git clone https://github.com/openresty/echo-nginx-module.git
git clone https://github.com/leev/ngx_http_geoip2_module.git
git clone https://github.com/openresty/lua-nginx-module.git
git clone https://github.com/SpiderLabs/ModSecurity-nginx.git
git clone https://github.com/openresty/encrypted-session-nginx-module.git
git clone https://github.com/flant/nginx-http-rdns.git
# Download Nginx
mkdir -p /opt/nginx/sources/
cd /opt/nginx/sources/
wget 'http://nginx.org/download/nginx-1.15.5.tar.gz'
tar -xzvf nginx-1.15.5.tar.gz; rm -Rf nginx-1.15.5.tar.gz
cd /opt/nginx/sources/nginx-1.15.5/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nbuild.sh
chmod +x nbuild.sh
./nbuild.sh
make -j`nproc`
make install
ldconfig
mkdir -p /nginx/live
mkdir -p /nginx/logs
mkdir -p /nginx/conf.d
touch /nginx/logs/access.log
touch /nginx/logs/error.log
useradd -r nginx
rm -Rf /etc/init.d/nginx
cd /etc/init.d/; wget https://raw.githubusercontent.com/systemroot/my-nginx/master/nginx-as-firewall/static/nginx
chmod +x /etc/init.d/nginx
cd /nginx/; mkdir conf.d; rm -Rf nginx.conf*; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nginx.conf
mkdir -p /nginx/live/
cd /nginx/live/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/vhost/default
mkdir -p /hostdata/default
mkdir -p /hostdata/default/public_html
mkdir -p /hostdata/default/logs
mkdir -p /hostdata/default/cache
mkdir -p /nginx/modsecurity/
cd /hostdata/default/public_html/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/html/index.html
sudo update-rc.d nginx defaults
cd /nginx/; mkdir db/; cd db/; wget https://github.com/theraw/The-World-Is-Yours/raw/master/static/GeoLite2-Country.mmdb
cd /nginx/; rm -Rf *.default
cp /opt/nginx/modules/naxsi/naxsi_config/naxsi_core.rules /nginx/naxsi_core.rules
cp /opt/ModSecurity/modsecurity.conf-recommended /nginx/modsecurity/modsecurity.conf
cd /opt/; git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
cp -a /opt/owasp-modsecurity-crs/rules/ /nginx/modsecurity/
cp -a /opt/owasp-modsecurity-crs/crs-setup.conf.example /nginx/modsecurity/crs-setup.conf
clear
cd /etc/systemd/system/; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/UBUNTU16/nginx.service
sudo systemctl start nginx.service && sudo systemctl enable nginx.service
systemctl daemon-reload
clear
service nginx stop
service nginx start
clear
nginx -t
echo "Installation script on ubuntu 18 maybe can fail is not well tested if so please report any problem on github!"
;;
centos)
yum -y update; yum -y upgrade
yum install epel-release wget curl git zip unzip -y
yum remove httpd -y
yum remove apache2 -y
yum remove nginx -y
;;
esac
-5
View File
@@ -1,5 +0,0 @@
[Definition]
failregex = ^.*client: <HOST>.* 444.*$
ignoreregex =
-27
View File
@@ -1,27 +0,0 @@
#!/bin/bash
apt-get update; apt-get upgrade -y; apt-get dist-upgrade -y; apt-get autoremove -y
sudo apt-get install iptables-persistent
sudo invoke-rc.d iptables-persistent save
clear
# ========================================================================
mkdir -p /firewall/iptables/bin
echo '#!/bin/bash' > /firewall/iptables/bin/fire.sh
echo 'sudo service fail2ban stop' >> /firewall/iptables/bin/fire.sh
echo 'nano /etc/iptables/rules.v4' >> /firewall/iptables/bin/fire.sh
echo 'iptables-restore < /etc/iptables/rules.v4' >> /firewall/iptables/bin/fire.sh
echo 'iptables-save > /etc/iptables/rules.v4' >> /firewall/iptables/bin/fire.sh
echo 'sudo service fail2ban start' >> /firewall/iptables/bin/fire.sh
ln -sf /firewall/iptables/bin/fire.sh /bin/fire
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/iptables/rules > /etc/iptables/rules.v4
chmod +x /bin/fire
# ========================================================================
sudo apt-get install fail2ban -y
sudo service fail2ban stop
curl -s https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/iptables/jail.local > /etc/fail2ban/jail.local
touch /nginx/logs/error.log
sudo service fail2ban start
clear
-471
View File
@@ -1,471 +0,0 @@
[DEFAULT]
ignoreip = 127.0.0.1/8
# "bantime" is the number of seconds that a host is banned.
bantime = 1200
# A host is banned if it has generated "maxretry" during the last "findtime"
# seconds.
findtime = 600
maxretry = 3
# "backend" specifies the backend used to get files modification.
# Available options are "pyinotify", "gamin", "polling" and "auto".
# This option can be overridden in each jail as well.
#
# pyinotify: requires pyinotify (a file alteration monitor) to be installed.
# If pyinotify is not installed, Fail2ban will use auto.
# gamin: requires Gamin (a file alteration monitor) to be installed.
# If Gamin is not installed, Fail2ban will use auto.
# polling: uses a polling algorithm which does not require external libraries.
# auto: will try to use the following backends, in order:
# pyinotify, gamin, polling.
backend = auto
# "usedns" specifies if jails should trust hostnames in logs,
# warn when reverse DNS lookups are performed, or ignore all hostnames in logs
#
# yes: if a hostname is encountered, a reverse DNS lookup will be performed.
# warn: if a hostname is encountered, a reverse DNS lookup will be performed,
# but it will be logged as a warning.
# no: if a hostname is encountered, will not be used for banning,
# but it will be logged as info.
usedns = warn
# Destination email address used solely for the interpolations in
# jail.{conf,local} configuration files.
destemail = root@localhost
# Name of the sender for mta actions
sendername = Fail2Ban
# ACTIONS
# Default banning action (e.g. iptables, iptables-new,
# iptables-multiport, shorewall, etc) It is used to define
# action_* variables. Can be overridden globally or per
# section within jail.local file
banaction = iptables-multiport
# email action. Since 0.8.1 upstream fail2ban uses sendmail
# MTA for the mailing. Change mta configuration parameter to mail
# if you want to revert to conventional 'mail'.
mta = sendmail
# Default protocol
protocol = tcp
# Specify chain where jumps would need to be added in iptables-* actions
chain = INPUT
#
# Action shortcuts. To be used to define action parameter
# The simplest action to take: ban only
action_ = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
# ban & send an e-mail with whois report to the destemail.
action_mw = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
%(mta)s-whois[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s", sendername="%(sendername)s"]
# ban & send an e-mail with whois report and relevant log lines
# to the destemail.
action_mwl = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
%(mta)s-whois-lines[name=%(__name__)s, dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s", sendername="%(sendername)s"]
# Choose default action. To change, just override value of 'action' with the
# interpolation to the chosen action shortcut (e.g. action_mw, action_mwl, etc) in jail.local
# globally (section [DEFAULT]) or per specific section
action = %(action_)s
#
# JAILS
#
# Next jails corresponds to the standard configuration in Fail2ban 0.6 which
# was shipped in Debian. Enable any defined here jail by including
#
# [SECTION_NAME]
# enabled = true
#
# in /etc/fail2ban/jail.local.
#
# Optionally you may override any other parameter (e.g. banaction,
# action, port, logpath, etc) in that section within jail.local
[ssh]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 6
[nginx-limits]
enabled = true
port = http,https
filter = nginx-limits
logpath = /hostdata/*/logs/error.log
maxretry = 6
[nginx-ban]
enabled = true
port = http,https
filter = nginx-ban
logpath = /hostdata/*/logs/access.log
maxretry = 1
[dropbear]
enabled = false
port = ssh
filter = dropbear
logpath = /var/log/auth.log
maxretry = 6
# Generic filter for pam. Has to be used with action which bans all ports
# such as iptables-allports, shorewall
[pam-generic]
enabled = false
# pam-generic filter can be customized to monitor specific subset of 'tty's
filter = pam-generic
# port actually must be irrelevant but lets leave it all for some possible uses
port = all
banaction = iptables-allports
port = anyport
logpath = /var/log/auth.log
maxretry = 6
[xinetd-fail]
enabled = false
filter = xinetd-fail
port = all
banaction = iptables-multiport-log
logpath = /var/log/daemon.log
maxretry = 2
[ssh-ddos]
enabled = false
port = ssh
filter = sshd-ddos
logpath = /var/log/auth.log
maxretry = 6
# Here we use blackhole routes for not requiring any additional kernel support
# to store large volumes of banned IPs
[ssh-route]
enabled = false
filter = sshd
action = route
logpath = /var/log/sshd.log
maxretry = 6
# Here we use a combination of Netfilter/Iptables and IPsets
# for storing large volumes of banned IPs
#
# IPset comes in two versions. See ipset -V for which one to use
# requires the ipset package and kernel support.
[ssh-iptables-ipset4]
enabled = false
port = ssh
filter = sshd
banaction = iptables-ipset-proto4
logpath = /var/log/sshd.log
maxretry = 6
[ssh-iptables-ipset6]
enabled = false
port = ssh
filter = sshd
banaction = iptables-ipset-proto6
logpath = /var/log/sshd.log
maxretry = 6
#
# HTTP servers
#
[apache]
enabled = false
port = http,https
filter = apache-auth
logpath = /var/log/apache*/*error.log
maxretry = 6
# default action is now multiport, so apache-multiport jail was left
# for compatibility with previous (<0.7.6-2) releases
[apache-multiport]
enabled = false
port = http,https
filter = apache-auth
logpath = /var/log/apache*/*error.log
maxretry = 6
[apache-noscript]
enabled = false
port = http,https
filter = apache-noscript
logpath = /var/log/apache*/*error.log
maxretry = 6
[apache-overflows]
enabled = false
port = http,https
filter = apache-overflows
logpath = /var/log/apache*/*error.log
maxretry = 2
# Ban attackers that try to use PHP's URL-fopen() functionality
# through GET/POST variables. - Experimental, with more than a year
# of usage in production environments.
[php-url-fopen]
enabled = false
port = http,https
filter = php-url-fopen
logpath = /var/www/*/logs/access_log
# A simple PHP-fastcgi jail which works with lighttpd.
# If you run a lighttpd server, then you probably will
# find these kinds of messages in your error_log:
# ALERT tried to register forbidden variable GLOBALS
# through GET variables (attacker '1.2.3.4', file '/var/www/default/htdocs/index.php')
[lighttpd-fastcgi]
enabled = false
port = http,https
filter = lighttpd-fastcgi
logpath = /var/log/lighttpd/error.log
# Same as above for mod_auth
# It catches wrong authentifications
[lighttpd-auth]
enabled = false
port = http,https
filter = suhosin
logpath = /var/log/lighttpd/error.log
[nginx-http-auth]
enabled = true
filter = nginx-http-auth
port = http,https
logpath = /var/log/nginx/error.log
# Monitor roundcube server
[roundcube-auth]
enabled = false
filter = roundcube-auth
port = http,https
logpath = /var/log/roundcube/userlogins
[sogo-auth]
enabled = false
filter = sogo-auth
port = http, https
# without proxy this would be:
# port = 20000
logpath = /var/log/sogo/sogo.log
# FTP servers
[vsftpd]
enabled = false
port = ftp,ftp-data,ftps,ftps-data
filter = vsftpd
logpath = /var/log/vsftpd.log
# or overwrite it in jails.local to be
# logpath = /var/log/auth.log
# if you want to rely on PAM failed login attempts
# vsftpd's failregex should match both of those formats
maxretry = 6
[proftpd]
enabled = false
port = ftp,ftp-data,ftps,ftps-data
filter = proftpd
logpath = /var/log/proftpd/proftpd.log
maxretry = 6
[pure-ftpd]
enabled = false
port = ftp,ftp-data,ftps,ftps-data
filter = pure-ftpd
logpath = /var/log/syslog
maxretry = 6
[wuftpd]
enabled = false
port = ftp,ftp-data,ftps,ftps-data
filter = wuftpd
logpath = /var/log/syslog
maxretry = 6
# Mail servers
[postfix]
enabled = false
port = smtp,ssmtp,submission
filter = postfix
logpath = /var/log/mail.log
[couriersmtp]
enabled = false
port = smtp,ssmtp,submission
filter = couriersmtp
logpath = /var/log/mail.log
#
# Mail servers authenticators: might be used for smtp,ftp,imap servers, so
# all relevant ports get banned
#
[courierauth]
enabled = false
port = smtp,ssmtp,submission,imap2,imap3,imaps,pop3,pop3s
filter = courierlogin
logpath = /var/log/mail.log
[sasl]
enabled = false
port = smtp,ssmtp,submission,imap2,imap3,imaps,pop3,pop3s
filter = postfix-sasl
# You might consider monitoring /var/log/mail.warn instead if you are
# running postfix since it would provide the same log lines at the
# "warn" level but overall at the smaller filesize.
logpath = /var/log/mail.log
[dovecot]
enabled = false
port = smtp,ssmtp,submission,imap2,imap3,imaps,pop3,pop3s
filter = dovecot
logpath = /var/log/mail.log
# To log wrong MySQL access attempts add to /etc/my.cnf:
# log-error=/var/log/mysqld.log
# log-warning = 2
[mysqld-auth]
enabled = false
filter = mysqld-auth
port = 3306
logpath = /var/log/mysqld.log
# DNS Servers
# These jails block attacks against named (bind9). By default, logging is off
# with bind9 installation. You will need something like this:
#
# logging {
# channel security_file {
# file "/var/log/named/security.log" versions 3 size 30m;
# severity dynamic;
# print-time yes;
# };
# category security {
# security_file;
# };
# };
#
# in your named.conf to provide proper logging
# !!! WARNING !!!
# Since UDP is connection-less protocol, spoofing of IP and imitation
# of illegal actions is way too simple. Thus enabling of this filter
# might provide an easy way for implementing a DoS against a chosen
# victim. See
# http://nion.modprobe.de/blog/archives/690-fail2ban-+-dns-fail.html
# Please DO NOT USE this jail unless you know what you are doing.
#[named-refused-udp]
#
#enabled = false
#port = domain,953
#protocol = udp
#filter = named-refused
#logpath = /var/log/named/security.log
[named-refused-tcp]
enabled = false
port = domain,953
protocol = tcp
filter = named-refused
logpath = /var/log/named/security.log
# Multiple jails, 1 per protocol, are necessary ATM:
# see https://github.com/fail2ban/fail2ban/issues/37
[asterisk-tcp]
enabled = false
filter = asterisk
port = 5060,5061
protocol = tcp
logpath = /var/log/asterisk/messages
[asterisk-udp]
enabled = false
filter = asterisk
port = 5060,5061
protocol = udp
logpath = /var/log/asterisk/messages
# Jail for more extended banning of persistent abusers
# !!! WARNING !!!
# Make sure that your loglevel specified in fail2ban.conf/.local
# is not at DEBUG level -- which might then cause fail2ban to fall into
# an infinite loop constantly feeding itself with non-informative lines
[recidive]
enabled = false
filter = recidive
logpath = /var/log/fail2ban.log
action = iptables-allports[name=recidive]
sendmail-whois-lines[name=recidive, logpath=/var/log/fail2ban.log]
bantime = 604800 ; 1 week
findtime = 86400 ; 1 day
maxretry = 5
-29
View File
@@ -1,29 +0,0 @@
# Generated by iptables-save v1.4.21 on Fri Feb 23 11:18:23 2018
*nat
:PREROUTING ACCEPT [2:100]
:INPUT ACCEPT [1:40]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Fri Feb 23 11:18:23 2018
# Generated by iptables-save v1.4.21 on Fri Feb 23 11:18:23 2018
*mangle
:PREROUTING ACCEPT [65:7186]
:INPUT ACCEPT [44:4420]
:FORWARD ACCEPT [22:2966]
:OUTPUT ACCEPT [36:8424]
:POSTROUTING ACCEPT [58:11390]
COMMIT
# Completed on Fri Feb 23 11:18:23 2018
# Generated by iptables-save v1.4.21 on Fri Feb 23 11:18:23 2018
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [36:8424]
-A INPUT -i lo -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
COMMIT
# Completed on Fri Feb 23 11:18:23 2018
+61
View File
@@ -0,0 +1,61 @@
version: '3.7'
services:
nginx:
container_name: nginx
ports:
- "0.0.0.0:80-9000:80-9000"
image: ""
shm_size: '512MB'
privileged: true
restart: unless-stopped
networks:
nginx_net:
ipv4_address: 172.22.0.22
dns:
- "8.8.8.8"
- "8.8.4.4"
ulimits:
nproc: 65535
cap_add:
- "ALL"
volumes:
- /dopesrv/nginx:/nginx
- /dopesrv/etc:/etc
- /dopesrv/opt:/opt
- /dopesrv/home:/home
- /dopesrv/root:/root
- /dopesrv/var:/var
db:
container_name: db
image: 'mariadb:latest'
shm_size: '512MB'
privileged: true
restart: unless-stopped
ports:
- '3306:3306'
networks:
nginx_net:
ipv4_address: 172.22.0.33
dns:
- "8.8.8.8"
- "8.8.4.4"
ulimits:
nproc: 65535
cap_add:
- "ALL"
environment:
MYSQL_ROOT_PASSWORD: '67WxFgoz1M'
MYSQL_DATABASE: 'nginx'
MYSQL_USER: 'dopeuser'
MYSQL_PASSWORD: '67WxFgoz1M'
volumes:
- /dopesrv/var/lib/mysql:/var/lib/mysql
networks:
nginx_net:
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "false"
ipam:
driver: default
config:
- subnet: 172.22.0.0/16
+23 -34
View File
@@ -1,35 +1,24 @@
vm.nr_hugepages = 128
net.ipv4.ip_forward = 0
vm.nr_hugepages = 0
vm.vfs_cache_pressure = 100
fs.file-max = 1000000
net.core.wmem_max = 16777216
net.core.rmem_max = 16777216
kernel.randomize_va_space = 2
net.ipv4.ip_forward = 1
net.ipv4.tcp_syncookies = 1
#net.ipv4.icmp_echo_ignore_broadcasts = 1
#net.ipv4.icmp_ignore_bogus_error_responses = 1
#net.ipv4.conf.all.log_martians = 1
#net.ipv4.conf.default.log_martians = 1
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv4.conf.default.accept_source_route = 0
#net.ipv4.conf.all.rp_filter = 1
#net.ipv4.conf.default.rp_filter = 1
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv4.conf.default.accept_redirects = 0
#net.ipv4.conf.all.secure_redirects = 0
#net.ipv4.conf.default.secure_redirects = 0
#net.ipv4.conf.all.send_redirects = 0
#net.ipv4.conf.default.send_redirects = 0
#kernel.randomize_va_space = 1
#net.ipv6.conf.default.router_solicitations = 0
#net.ipv6.conf.default.accept_ra_rtr_pref = 0
#net.ipv6.conf.default.accept_ra_pinfo = 0
#net.ipv6.conf.default.accept_ra_defrtr = 0
#net.ipv6.conf.default.autoconf = 0
#net.ipv6.conf.default.dad_transmits = 0
#net.ipv6.conf.default.max_addresses = 1
#fs.file-max = 65535
#kernel.pid_max = 65536
#net.ipv4.ip_local_port_range = 2000 65000
#net.ipv4.tcp_rmem = 4096 87380 8388608
#net.ipv4.tcp_wmem = 4096 87380 8388608
#net.core.rmem_max = 8388608
#net.core.wmem_max = 8388608
#net.core.netdev_max_backlog = 5000
#net.ipv4.tcp_window_scaling = 1
net.ipv4.ip_local_port_range = 1024 64999
net.ipv4.tcp_wmem = 4096 65536 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_window_scaling = 1
net.core.somaxconn = 32768
net.core.netdev_max_backlog = 30000
net.ipv4.tcp_max_syn_backlog = 2048
net.ipv4.tcp_fin_timeout = 90
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
kernel.sched_autogroup_enabled = 0
net.ipv4.tcp_max_orphans = 32768