From 2288eb64d023f618df208764523c6c4b7a936059 Mon Sep 17 00:00:00 2001 From: Herwin Date: Tue, 1 Mar 2022 16:26:51 +0100 Subject: [PATCH] Improved PHP code, Included Quantum font, Temporarily fixed htaccess --- .dockerignore | 4 +- .gitignore | 4 +- .htaccess | 93 ++++++++++-------- 403.php | 6 +- 404.php | 6 +- about/index.php | 75 ++++++++++++--- commons/body-root.php | 7 +- commons/content.php | 13 ++- commons/langs.php | 7 +- commons/sidebar.php | 75 ++++++--------- commons/strings.json | 30 +++++- contact/index.php | 13 ++- content/index.json | 4 +- content/index.php | 128 +++++++++++++++---------- content/items/test01.json | 2 +- index.php | 21 ++-- links/index.php | 10 +- privacy/index.php | 18 ++-- readme.md | 4 - resources/Azias/css/nibblepoker.lu.css | 34 ++++++- resources/Quantum/Quantum.otf | Bin 0 -> 31656 bytes resources/Quantum/readme.md | 2 + 22 files changed, 356 insertions(+), 200 deletions(-) create mode 100644 resources/Quantum/Quantum.otf create mode 100644 resources/Quantum/readme.md diff --git a/.dockerignore b/.dockerignore index b30e85b..3d1eb70 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,5 +2,5 @@ .idea/ .dockerignore .gitignore -notes.txt -readme.md +*.txt +*.md diff --git a/.gitignore b/.gitignore index d7bb56b..b7df7a1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,7 @@ resources/ChartJs/ resources/FontAwesomePro/ resources/GoogleFonts/ resources/HalfMoon/ -resources/Icons8/ -resources/Quantum/ # Other folders (Will be removed once the content system is finished !) content/page/ -files/ +/files/ diff --git a/.htaccess b/.htaccess index 045af22..2cb4437 100644 --- a/.htaccess +++ b/.htaccess @@ -1,9 +1,24 @@ # Prevent access to .htaccess - Order allow,deny - Deny from all + ## Apache 2.2 + Order allow,deny + Deny from all + ## Apache 2.4 + # Require all denied +## Deny access to some common leftovers +# +# ## Apache 2.2 +# Order allow,deny +# Deny from all +# Satisfy All +# ## Apache 2.4 +# # Require all denied +# + +ServerSignature Off + # Redirecting HTTP traffic to HTTPS. (Keep commented on localhost !) # This is handled other services, but it should still be enabled in production just to be safe. #RewriteEngine On @@ -19,61 +34,63 @@ ErrorDocument 403 /403.php ErrorDocument 404 /404.php # Setting some headers for security. -# TODO: Implement a proper module check and redirection to clean 503 error page if module is not enabled ! Header always set X-Detected-Country "NK" Header always set X-Frame-Options "deny" +# Prevents CloudFlare from injecting some JS code through their hidden apps... Header always set Content-Security-Policy "default-src 'self'; object-src 'none'; child-src 'self'; frame-ancestors 'none'; upgrade-insecure-requests; block-all-mixed-content" Header always set X-XSS-Protection " 1; mode=block" Header always set Referrer-Policy "no-referrer" Header always set X-Content-Type-Options "nosniff" Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" Header always set Cache-Control "max-age=300, public" -# FIXME: Apparently, the 'Permissions-Policy' header is not properly formatted, IDK why... +# Remark: Apparently, the 'Permissions-Policy' header is not properly formatted, IDK why... Header always set Permissions-Policy "accelerometer=(),autoplay=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),fullscreen=(),geolocation=(),gyroscope=(),magnetometer=(),microphone=(),midi=(),payment=(),picture-in-picture=(),publickey-credentials-get=(),screen-wake-lock=(),sync-xhr=(self),usb=(),web-share=(),xr-spatial-tracking=()" Header always set Access-Control-Allow-Origin "*" Header unset X-Powered-By Header always set X-Powered-By "Amiga 1200, Kickstart 3.1" +# Removed the condition to prevent silent errors since the module is required for the website +# + # Handling all other redirections. - - # TODO: Raise error if not available - RewriteEngine On +RewriteEngine On - # Sending a 404 for git and IDEs folders just in case they ever get copied to the web server, - # or if one of the honeypot files is acessed directly. - # A 404 is preferred to prevent further scanning of this folder and from raising some flags. - # FIXME: These rules break the later honeypot rules !!! - #RedirectMatch 404 ^.*\.?(git|vs(code)|idea).* - #RedirectMatch 404 ^.*honeypot.* +# Sending a 404 for git and IDEs folders just in case they ever get copied to the web server, +# or if one of the honeypot files is acessed directly. +# A 404 is preferred to prevent further scanning of this folder and from raising some flags. +# FIXME: These rules break the later honeypot rules !!! +#RedirectMatch 404 ^.*\.?(git|vs(code)|idea).* +#RedirectMatch 404 ^.*honeypot.* - # Languages. (Does not work with a regex) - RewriteRule ^en/(.*)$ /$1 [QSA] - RewriteRule ^fr/(.*)$ /$1 [QSA] - RewriteRule ^lb/(.*)$ /$1 [QSA] +# Languages. (Does not work with a regex) +RewriteRule ^en/(.*)$ /$1 [QSA] +RewriteRule ^fr/(.*)$ /$1 [QSA] +RewriteRule ^lb/(.*)$ /$1 [QSA] - # Content categories. - Should be removed ? - #RewriteRule ^((en|fr|lb)/)?blog/article/(.*)$ /content/page/$1 [QSA] - #RewriteRule ^((en|fr|lb)/)?programming/(applications|tutorials|tools)/(.*)$ /content/page/$1 [QSA] - ##RewriteRule ^((en|fr|lb)/)?electronics/ham/(.*)$ /content/page/$1 [QSA] +# Content categories. - Should be removed ? +#RewriteRule ^((en|fr|lb)/)?blog/article/(.*)$ /content/page/$1 [QSA] +#RewriteRule ^((en|fr|lb)/)?programming/(applications|tutorials|tools)/(.*)$ /content/page/$1 [QSA] +##RewriteRule ^((en|fr|lb)/)?electronics/ham/(.*)$ /content/page/$1 [QSA] - # Content root pages. - Should be removed ? - #RewriteRule ^((en|fr|lb)/)?programming/(purebasic|python|others)/(.*)$ /content/$1 [QSA] - #RewriteRule ^((en|fr|lb)/)?electronics/(iot|experiments)/(.*)$ /content/$1 [QSA] +# Content root pages. - Should be removed ? +#RewriteRule ^((en|fr|lb)/)?programming/(purebasic|python|others)/(.*)$ /content/$1 [QSA] +#RewriteRule ^((en|fr|lb)/)?electronics/(iot|experiments)/(.*)$ /content/$1 [QSA] - # Content pages. (Old regex are taken care of by the "content/index.php" page) - RewriteRule ^((en|fr|lb)/)?(blog|programming|electronics)/(.*)$ /content/$1 [QSA] +# Content pages. (Old regex are taken care of by the "content/index.php" page) +RewriteRule ^((en|fr|lb)/)?(blog|programming|electronics)/(.*)$ /content/$1 [QSA] - # Internal redirections for scanning and exploit attempts. - # These rules are here since they're easier to implement in the .htaccess. - #RewriteRule ^.*(install|xmlrpc)\.php.*$ /honeypot/file-php.php [QSA] - #RewriteRule ^.*\.xml.*$ /honeypot/file-xml.php [QSA] - #RewriteRule ^.*wlwmanifest\.xml.*$ /honeypot/file-xml-wlwmanifest.php [QSA] - #RewriteRule ^.*\.env.*$ /honeypot/file-env.php [QSA] - #RewriteRule ^.*(ap(i|p.*)|cms|sit[eo]|shop.*|wp.*).*$ /honeypot/folder.php [QSA] +# Internal redirections for scanning and exploit attempts. +# These rules are here since they're easier to implement in the .htaccess. +#RewriteRule ^.*(install|xmlrpc)\.php.*$ /honeypot/file-php.php [QSA] +#RewriteRule ^.*\.xml.*$ /honeypot/file-xml.php [QSA] +#RewriteRule ^.*wlwmanifest\.xml.*$ /honeypot/file-xml-wlwmanifest.php [QSA] +#RewriteRule ^.*\.env.*$ /honeypot/file-env.php [QSA] +#RewriteRule ^.*(ap(i|p.*)|cms|sit[eo]|shop.*|wp.*).*$ /honeypot/folder.php [QSA] - # Cases left to handle: - # * /wp-admin/post.php?id=whatever - # * /public /vendor /storage +# Cases left to handle: +# * /wp-admin/post.php?id=whatever +# * /public /vendor /storage +# * //vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php + +# TODO: Implement bee-movie themed tarpit once I have a rate-limiting solution in place ! - # TODO: Implement bee-movie themed tarpit once I have a rate-limiting solution in place ! - diff --git a/403.php b/403.php index dd21867..2e0be75 100644 --- a/403.php +++ b/403.php @@ -1,4 +1,8 @@ - + diff --git a/404.php b/404.php index 525c0e9..75ef384 100644 --- a/404.php +++ b/404.php @@ -1,4 +1,8 @@ - + diff --git a/about/index.php b/about/index.php index 0670acf..8f659e0 100644 --- a/about/index.php +++ b/about/index.php @@ -1,4 +1,8 @@ - + @@ -16,7 +20,7 @@ data-sidebar-shortcut-enabled="true">
- +
-
+
-
+

-   Who am I ? +   

-
-

nibblepoker@gmail.com

-
-
-

TODO

+
+ +
+
+ rounded image +
+ +
+
+
+

+ Bozet Herwin +

+
+ +
+ + +
+
+ +
@@ -54,7 +80,7 @@

-   Skills +   

@@ -64,7 +90,32 @@
-
+
+

+   TODO +

+
+ +
+ +
+ +
+
+
+
+

+    +

+
+
+

@NibblePoker

+
+
+
+
+ +

  TODO

diff --git a/commons/body-root.php b/commons/body-root.php index 298797a..71e2c11 100644 --- a/commons/body-root.php +++ b/commons/body-root.php @@ -1,2 +1,7 @@ - +
diff --git a/commons/content.php b/commons/content.php index 7846614..948cba5 100644 --- a/commons/content.php +++ b/commons/content.php @@ -1,6 +1,14 @@ -