if (!WFWAF_SUBDIRECTORY_INSTALL && $waf = wfWAF::getInstance()) {
- Download the official Wordfence security plugin from: https://en-ca.wordpress.org/plugins/wordfence/
- Upload the plugin to your wordpress but don't activate it
- Next, in your wordpress main dashboard head to Plugins -> Plugin Editor
- In the "Select plugin to edit" bar choose Wordfence Security and press Select
- Under the "lib file section" select the wordfenceClass.php file
- Press ctrl+f and paste this:
You should see:
$updateCountries = false;
if (!WFWAF_SUBDIRECTORY_INSTALL && $waf = wfWAF::getInstance()) {
$homeurl = wfUtils::wpHomeURL();
$siteurl = wfUtils::wpSiteURL();
Now right under it paste this in:
wfConfig::set('isPaid', 1);
wfConfig::set('keyType', wfAPI::KEY_TYPE_PAID_CURRENT);
wfConfig::set('premiumNextRenew', time()+31536000);
So the code should look like this:
$updateCountries = false;
if (!WFWAF_SUBDIRECTORY_INSTALL && $waf = wfWAF::getInstance()) {
$homeurl = wfUtils::wpHomeURL();
$siteurl = wfUtils::wpSiteURL();
wfConfig::set('isPaid', 1);
wfConfig::set('keyType', wfAPI::KEY_TYPE_PAID_CURRENT);
wfConfig::set('premiumNextRenew', time()+31536000);
7. Save the file, then activate WordFence plugin, you should have unlimited premium license! It says "renew in 365 days" but you will notice that this number doesn't go down
If you can't find the code, you can export the file, edit using notepad++ and then reupload or do something similar. You can also use FTP application to do this method.
Like for more "exploits" like this!
Thanks a lot for this, @eliteshades, you rock!
- Download the official Wordfence security plugin from: https://en-ca.wordpress.org/plugins/wordfence/
- Upload the plugin to your wordpress but don't activate it
- ...
<?php
add_action('plugins_loaded', function(){
if( !class_exists('wfConfig') ) return;
wfConfig::set('isPaid', 1);
wfConfig::set('keyType', wfAPI::KEY_TYPE_PAID_CURRENT);
wfConfig::set('premiumNextRenew', time()+31536000);
}, 99);
missing information.Thanks a lot for this, @eliteshades, you rock!
We don't need to modify the plugin code. Use the following as a Must Use plugin (drop the php file inside wp-content/mu-plugins) and forget about it
Code:<?php add_action('plugins_loaded', function(){ if( !class_exists('wfConfig') ) return; wfConfig::set('isPaid', 1); wfConfig::set('keyType', wfAPI::KEY_TYPE_PAID_CURRENT); wfConfig::set('premiumNextRenew', time()+31536000); }, 99);
Thanks a lot for this, @eliteshades, you rock!
We don't need to modify the plugin code. Use the following as a Must Use plugin (drop the php file inside wp-content/mu-plugins) and forget about it
Code:<?php add_action('plugins_loaded', function(){ if( !class_exists('wfConfig') ) return; wfConfig::set('isPaid', 1); wfConfig::set('keyType', wfAPI::KEY_TYPE_PAID_CURRENT); wfConfig::set('premiumNextRenew', time()+31536000); }, 99);
add_action('plugins_loaded', function(){
if( !class_exists('wfConfig') ) return;
wfConfig::set('isPaid', 1);
wfConfig::set('keyType', wfAPI::KEY_TYPE_PAID_CURRENT);
wfConfig::set('premiumNextRenew', time()+31536000);
}, 99);
Just tried on the newest version and it works perfectly.Let me know if this exploit still works on newest version of wordfence, mine still says renew in 364 days
How can we tell how old WAF rules and Malware signatures are? This needs to be investigated. Please share your findings.Just so you know, setting the values in the code does nothing but let you “think” you have premium. A valid premium key is required in order to get the updated WAF (Web Application Firewall) rules and Malware signatures. If one is not provided, you still only get the free even though the dashboard says you’re getting premium.
From CJ Chamberland over at GPLDL - WORDFENCE (not sure if I may link to his posting over there so I won't):
How can we tell how old WAF rules and malware signatures are? This needs to be investigated. Please share your findings.
wp-content/wflogs/rules.php
. My rules file's time stamp is from today, and it is a pretty lengthy file.As per this Wordfence support thread, rules are stored inwp-content/wflogs/rules.php
. My rules file's time stamp is from today, and it is a pretty lengthy file.