-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
58 lines (47 loc) · 1.88 KB
/
.htaccess
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
DirectoryIndex /index.php
ErrorDocument 400 /?status=400
ErrorDocument 401 /?status=401
ErrorDocument 403 /?status=403
ErrorDocument 404 /?status=404
ErrorDocument 405 /?status=405
ErrorDocument 429 /?status=429
ErrorDocument 503 /?status=503
RewriteEngine on
RewriteBase /
# Reescrita interna da URL "assets"
RewriteRule ^assets/img(.*)$ /app/view/assets/img$1 [L]
RewriteRule ^assets/fonts/fontawesome(.*)$ /app/view/assets/fonts/fontawesome/webfonts$1 [L]
RewriteRule ^assets/fonts(.*)$ /app/view/assets/fonts$1 [L]
# Reescrita interna da URL "code" para enviar tudo para o gz.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^code?$ gz.php [L,QSA]
## Bloquear acesso a dados específicos
RewriteRule ^(.git|.env|_web_server|db|testes|README.md) - [R=404,L]
## Bloqueio por User-Agent
SetEnvIfNoCase User-Agent "Wfuzz" bad_user_agent
SetEnvIfNoCase User-Agent "gobuster" bad_user_agent
SetEnvIfNoCase User-Agent "Nikto" bad_user_agent
SetEnvIfNoCase User-Agent "Nmap" bad_user_agent
SetEnvIfNoCase User-Agent "WhatWeb" bad_user_agent
SetEnvIfNoCase User-Agent "sqlmap" bad_user_agent
SetEnvIfNoCase User-Agent "WPScan" bad_user_agent
SetEnvIfNoCase User-Agent "nessus" bad_user_agent
SetEnvIfNoCase User-Agent "openvas" bad_user_agent
SetEnvIfNoCase User-Agent "DirBuster" bad_user_agent
SetEnvIfNoCase User-Agent "fuzz" bad_user_agent
SetEnvIfNoCase User-Agent "feroxbuster" bad_user_agent
SetEnvIfNoCase User-Agent "commix" bad_user_agent
SetEnvIfNoCase User-Agent "curl" bad_user_agent
SetEnvIfNoCase User-Agent "python" bad_user_agent
Order allow,deny
Deny from env=bad_user_agent
Allow from all
## Redirecionar tudo para 'rotas.php'
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
## Configurações específicas para ambiente Docker
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors on