Introducing the powerful waf (web application firewall) 6G firewall, which you can simply write into htaccess.


What is 6G Firewall?

A firewall is a security setting or application on the server side that prevents attacks on the site, much like a firewall on a server.

The 6G firewall is a set of settings that have been created based on research into hacker attack patterns, mainly on WordPress, to make it harder for hackers to penetrate your site by simply writing into the HTACCESS.

You can check the contents at the following site, and you can easily copy and paste them into the HTACCESS file in your WordPress installation folder using FTP software.

https://perishablepress.com/6g/#6g-firewall

6G Firewall Description

Let’s look at the specific code.

In the configuration section below, a setting is written to block when a site is sent invalid values (including malware-like code) that are not originally included in the submitted data (queries).

RewriteCond %{QUERY_STRING} (eval\() [NC,OR] ← block if string "eval" is included in query
RewriteCond %{QUERY_STRING} (127\.0\.0\.1) [NC,OR]←Block if string 127.0.0.1 is included in query
RewriteCond %{QUERY_STRING} ([a-z0-9]{2000,}) [NC,OR]←Block if the query contains a string of more than 2000 consecutive English characters
... Configuration continues

The following configuration section blocks requests to servers such as track trace, which are not commonly used. (only post and get are used in the display of wordpress sites)

RewriteCond %{REQUEST_METHOD} ^(connect|debug|move|put|trace|track) [NC].

The following configuration part blocks invalid values for the value of the source (referrer) visiting your company’s site. This value can be used to exploit vulnerabilities or when your site becomes a stepping stone for XSS.

RewriteCond %{HTTP_REFERER} ([a-z0-9]{2000,}) [NC,OR].
RewriteCond %{HTTP_REFERER} (semalt.com|todaperfeita) [NC].

The following configuration blocks the use of hacking software (or software used for hacking) based on the user agent (name of the currently connected software) sent by the software.

SetEnvIfNoCase User-Agent ([a-z0-9]{2000,}) bad_bot
SetEnvIfNoCase User-Agent (archive.org|binlar|casper|checkpriv|choppy|clshttp|cmsworld|diavol|dotbot|extract|feedfinder|flicky|g00g1 e|harvest|heritrix|httrack|kmccrew|loader|miner|nikto|nutch|planetwork|postrank|purebot|pycurl|python|seekerspider|siclab|skygrid| sqlmap|sucker|turnit|vikspider|winhttp|xxxyy|youda|zmeu|zune) bad_bot
...

This will not prevent all hacking, but it will certainly make it much harder to hack.

Free WordPress:Malware Scanning & Security Plugin [Malware and Virus Detection and Removal] allows you to deploy a more extended and powerful WAF setup similar to the 6G Firewall with a single click.