How to Protect Against SQL Injection through htaccess file in WordPress

Опубликовано: 08 Июль 2022
на канале: WebTask With Hassan
944
19

In this wordpress tutorial for beginners you will learn how to protected your wordpress website again sql injections through .htaccess file and increase your website security. It’s important to note again that this is not going to keep you 100% protected forever so don’t blindly use this code and think that’s it. You need to keep on top of your security monitoring all the time. This will however at least block some of the most common attempts / attacks at SQL injection. Insert this code into your roots .htaccess file.

*check pin comment in comment section and you will find code there also because in description angle brackets not allow

Protect Against SQL Injection
IfModule mod_rewrite.c // add angle brackets
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_METHOD} ^(HEAD|TRACE|DELETE|TRACK) [NC]
RewriteRule ^(.*)$ - [F,L]
RewriteCond %{QUERY_STRING} \.\.\/ [NC,OR]
RewriteCond %{QUERY_STRING} boot\.ini [NC,OR]
RewriteCond %{QUERY_STRING} tag\= [NC,OR]
RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
RewriteCond %{QUERY_STRING} http\: [NC,OR]
RewriteCond %{QUERY_STRING} https\: [NC,OR]
RewriteCond %{QUERY_STRING} (\ #addanglebracket |%3C).*script.*(\ #addanglebracket |%3E) [NC,OR]
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|%3D) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)| #addanglebracket | #addanglebracket |ê|"|;|\?|\*|=$).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(%24&x).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(%0|%A|%B|%C|%D|%E|%F|127\.0).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(globals|encode|localhost|loopback).* [NC,OR]
RewriteCond %{QUERY_STRING} ^.*(request|select|insert|union|declare).* [NC]
RewriteCond %{HTTP_COOKIE} !^.*WordPress_logged_in_.*$
RewriteRule ^(.*)$ - [F,L]
/IfModule // add angle brackets

#sqlinjection #htaccess #wordpress #webtaskwithhassan #hassangilani


Смотрите видео How to Protect Against SQL Injection through htaccess file in WordPress онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь WebTask With Hassan 08 Июль 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 944 раз и оно понравилось 19 людям.