-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3,158 changed files
with
1,067 additions
and
596 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
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 |
---|---|---|
@@ -1,83 +1,16 @@ | ||
<IfModule mod_rewrite.c> | ||
RewriteEngine On | ||
RewriteBase / | ||
## Begin - Rewrite rules to block out some common exploits. | ||
# If you experience problems on your site block out the operations listed below | ||
# This attempts to block the most common type of exploit `attempts` to Monstra | ||
# | ||
# Block out any script trying to base64_encode data within the URL. | ||
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR] | ||
# Block out any script that includes a <script> tag in URL. | ||
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR] | ||
# Block out any script trying to set a PHP GLOBALS variable via URL. | ||
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR] | ||
# Block out any script trying to modify a _REQUEST variable via URL. | ||
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) | ||
# Return 403 Forbidden header and show the content of the root homepage | ||
RewriteRule .* index.php [F,L] | ||
# | ||
RewriteCond %{REQUEST_FILENAME} !-f | ||
RewriteCond %{REQUEST_FILENAME} !-d | ||
# RewriteRule ^([^\.]+)$ $1.php [NC,L] | ||
# RewriteRule ^(.+)\.php$ /$1 [R,L] | ||
# RewriteCond %{REQUEST_FILENAME}/index.html !-f | ||
RewriteCond %{REQUEST_FILENAME}/index.php !-f | ||
# | ||
# RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L] | ||
RewriteRule ^ index.php [QSA,L] | ||
# RewriteRule . index.php [L] | ||
Redirect 301 "/home" "/" | ||
Redirect 301 "/inicio" "/" | ||
Redirect 301 "/system" "/admin" | ||
Redirect 301 "/login" "/signin" | ||
</IfModule> | ||
<IfModule mod_headers.c> | ||
# Make sure proxies don't deliver the wrong content | ||
# Header always set Content-Security-Policy: upgrade-insecure-requests | ||
# This one can be a pain in the A** to set up, which is why I commented it out. | ||
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" | ||
Header append Vary User-Agent env=!dont-vary | ||
Header always append X-Frame-Options SAMEORIGIN | ||
Header always set Content-Security-Policy "upgrade-insecure-requests;" | ||
# // This is the Xss header you are looking for | ||
Header set X-XSS-Protection "1; mode=block" | ||
Header set X-Content-Type-Options nosniff | ||
Header set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'" | ||
Header set Access-Control-Allow-Origin "*" | ||
IndexIgnore *.zip *.css *.js *.pyt | ||
Options -MultiViews -Indexes | ||
RewriteEngine On | ||
RewriteBase / | ||
|
||
RewriteCond %{THE_REQUEST} /public/([^\s?]*) [NC] | ||
RewriteRule ^ %1 [L,NE,R=302] | ||
RewriteRule ^((?!public/).*)$ public/$1 [L,NC] | ||
#RewriteRule ^(.*)$ public/index.php?$1 [L,QSA] | ||
|
||
RewriteCond %{REQUEST_FILENAME}.php -f | ||
RewriteCond %{REQUEST_FILENAME}.php -d | ||
RewriteCond %{REQUEST_URI} !/$ | ||
RewriteRule ^(.*)$ $1.php [L] | ||
|
||
</IfModule> | ||
<IfModule mod_security.c> | ||
SecFilterEngine On | ||
# ^Turn the filtering engine On or Off | ||
SecFilterScanPOST On | ||
# ^Should mod_security inspect POST payloads | ||
SecFilterSelective "HTTP_USER_AGENT|HTTP_HOST" "^$" | ||
# ^Require HTTP_USER_AGENT and HTTP_HOST in all requests | ||
SecFilter "../" | ||
# ^Prevent path traversal (..) attacks | ||
SecFilter "<[[:space:]]*script" | ||
# ^Weaker XSS protection but allows common HTML tags | ||
SecFilter "<(.|n)+>" | ||
# ^Prevent XSS atacks (HTML/Javascript injection) | ||
SecFilter "delete[[:space:]]+from" | ||
SecFilter "insert[[:space:]]+into" | ||
SecFilter "select.+from" | ||
SecFilter "drop[[:space:]]table" | ||
# ^Very crude filters to prevent SQL injection attacks | ||
SecFilterSelective ARG_PHPSESSID "!^[0-9a-z]*$" | ||
SecFilterSelective COOKIE_PHPSESSID "!^[0-9a-z]*$" | ||
# ^Protecting from XSS attacks through the PHP session cookie | ||
SecFilterDefaultAction "deny,log,status:500" | ||
# ^Action to take by default | ||
</IfModule> | ||
# Block access to backup and source files. | ||
# These files may be left by some text editors and can pose a great security | ||
# danger when anyone has access to them. | ||
|
||
<FilesMatch "(^#.*#|.(bak|config|dist|fla|inc|ini|log|psd|sh|sql|sw[op])|~)$"> | ||
Order allow,deny | ||
Deny from all | ||
Satisfy All | ||
</FilesMatch> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
|
||
class App | ||
{ | ||
private $controller = 'Home'; | ||
private $method = 'index'; | ||
|
||
private function splitURL() | ||
{ | ||
$URL = $_GET['url'] ?? 'home'; | ||
$URL = explode("/", trim($URL,"/")); | ||
return $URL; | ||
} | ||
|
||
public function loadController() | ||
{ | ||
$URL = $this->splitURL(); | ||
|
||
/** select controller **/ | ||
$filename = "../app/controllers/".ucfirst($URL[0]).".php"; | ||
if(file_exists($filename)) | ||
{ | ||
require $filename; | ||
$this->controller = ucfirst($URL[0]); | ||
unset($URL[0]); | ||
}else{ | ||
|
||
$filename = "../app/controllers/_404.php"; | ||
require $filename; | ||
$this->controller = "_404"; | ||
} | ||
|
||
$controller = new $this->controller; | ||
|
||
/** select method **/ | ||
if(!empty($URL[1])) | ||
{ | ||
if(method_exists($controller, $URL[1])) | ||
{ | ||
$this->method = $URL[1]; | ||
unset($URL[1]); | ||
} | ||
} | ||
|
||
call_user_func_array([$controller,$this->method], $URL); | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
|
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,22 @@ | ||
<?php | ||
|
||
|
||
Trait Controller | ||
{ | ||
|
||
public function view($name, $data = []) | ||
{ | ||
if(!empty($data)) | ||
extract($data); | ||
|
||
$filename = "../views/".$name.".view.php"; | ||
if(file_exists($filename)) | ||
{ | ||
require $filename; | ||
}else{ | ||
|
||
$filename = "../views/404.view.php"; | ||
require $filename; | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -7,5 +7,5 @@ | |
'pepiuox_com' => ['dataserver' => 'cms_2'], | ||
'pepiuox_org' => ['dataserver' => 'cms_3'] | ||
] | ||
] | ||
] | ||
?> |
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 |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
|
||
$url = '../index.php'; | ||
header('Location: ' . $url); | ||
exit(); | ||
?> | ||
die(); | ||
?> |
Oops, something went wrong.