Version Description
- Google Authenticator-Two Factor Authentication (2FA) : Security : Limiting Firewall, Malware, backup and login security for users not needing it.
Download this release
Release Info
Developer | cyberlord92 |
Plugin | Google Authenticator – WordPress Two Factor Authentication (2FA) |
Version | 5.3.11 |
Comparing to | |
See all releases |
Code changes from version 5.3.8 to 5.3.11
- controllers/backup_ajax.php +4 -2
- controllers/dashboard_ajax.php +231 -0
- controllers/navbar.php +45 -1
- database/database_functions.php +36 -1
- handler/ajax.php +14 -8
- handler/backup.php +30 -23
- handler/malware_scanner.php +18 -4
- handler/two_fa_pass2login.php +1 -2
- helper/constants.php +4 -0
- helper/curl.php +2 -2
- helper/dashboard_security_notification.php +67 -3
- helper/messages.php +19 -0
- includes/css/style_settings.css +48 -9
- includes/images/{normal1.png → normal1.PNG} +0 -0
- includes/images/restrict_content_pro.png +0 -0
- miniorange_2_factor_settings.php +5 -3
- readme.txt +21 -1
- uninstall.php +8 -0
- views/backup.php +3 -3
- views/dashboard.php +161 -23
- views/navbar.php +29 -15
controllers/backup_ajax.php
CHANGED
@@ -12,8 +12,9 @@ class wpns_backup_ajax
|
|
12 |
}
|
13 |
|
14 |
function mo_wpns_backup_ajax(){
|
15 |
-
|
16 |
-
|
|
|
17 |
case 'wpns_filebackup_form':
|
18 |
$this->handle_save_backup_config($_POST); break;
|
19 |
case 'wpns_instant_backup':
|
@@ -62,6 +63,7 @@ class wpns_backup_ajax
|
|
62 |
}
|
63 |
}else{
|
64 |
$handler_obj->file_cron_backup();
|
|
|
65 |
wp_send_json('manual_backup');
|
66 |
return;
|
67 |
}
|
12 |
}
|
13 |
|
14 |
function mo_wpns_backup_ajax(){
|
15 |
+
|
16 |
+
switch ($_POST['mo_wpns_backup_ajax_forms'])
|
17 |
+
{
|
18 |
case 'wpns_filebackup_form':
|
19 |
$this->handle_save_backup_config($_POST); break;
|
20 |
case 'wpns_instant_backup':
|
63 |
}
|
64 |
}else{
|
65 |
$handler_obj->file_cron_backup();
|
66 |
+
|
67 |
wp_send_json('manual_backup');
|
68 |
return;
|
69 |
}
|
controllers/dashboard_ajax.php
ADDED
@@ -0,0 +1,231 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Mo2f_ajax_dashboard
|
3 |
+
{
|
4 |
+
function __construct(){
|
5 |
+
add_action( 'admin_init' , array( $this, 'mo2f_switch_functions' ) );
|
6 |
+
}
|
7 |
+
|
8 |
+
public function mo2f_switch_functions(){
|
9 |
+
if(isset($_POST) && isset($_POST['option'])){
|
10 |
+
$tab_count= get_site_option('mo2f_tab_count', 0);
|
11 |
+
if($tab_count == 7)
|
12 |
+
update_site_option('mo_2f_switch_all', 1);
|
13 |
+
else if($tab_count == 0)
|
14 |
+
update_site_option('mo_2f_switch_all', 0);
|
15 |
+
switch($_POST['option'])
|
16 |
+
{
|
17 |
+
case "tab_all_switch":
|
18 |
+
$this->mo2f_handle_all_enable(isset($_POST['switch_val']));
|
19 |
+
break;
|
20 |
+
case "tab_2fa_switch":
|
21 |
+
$this->mo2f_handle_2fa_enable(isset($_POST['switch_val']));
|
22 |
+
break;
|
23 |
+
case "tab_waf_switch":
|
24 |
+
$this->mo2f_handle_waf_enable(isset($_POST['switch_val']));
|
25 |
+
break;
|
26 |
+
case "tab_login_switch":
|
27 |
+
$this->mo2f_handle_login_enable(isset($_POST['switch_val']));
|
28 |
+
break;
|
29 |
+
case "tab_backup_switch":
|
30 |
+
$this->mo2f_handle_backup_enable(isset($_POST['switch_val']));
|
31 |
+
break;
|
32 |
+
case "tab_malware_switch":
|
33 |
+
$this->mo2f_handle_malware_enable(isset($_POST['switch_val']));
|
34 |
+
break;
|
35 |
+
case "tab_block_switch":
|
36 |
+
$this->mo2f_handle_block_enable(isset($_POST['switch_val']));
|
37 |
+
break;
|
38 |
+
case "tab_report_switch":
|
39 |
+
$this->mo2f_handle_report_enable(isset($_POST['switch_val']));
|
40 |
+
break;
|
41 |
+
case "tab_notif_switch":
|
42 |
+
$this->mo2f_handle_notif_enable(isset($_POST['switch_val']));
|
43 |
+
break;
|
44 |
+
}
|
45 |
+
}
|
46 |
+
}
|
47 |
+
|
48 |
+
public function mo2f_handle_all_enable($POSTED){
|
49 |
+
$this->mo2f_handle_waf_enable($POSTED);
|
50 |
+
$this->mo2f_handle_login_enable($POSTED);
|
51 |
+
$this->mo2f_handle_backup_enable($POSTED);
|
52 |
+
$this->mo2f_handle_malware_enable($POSTED);
|
53 |
+
$this->mo2f_handle_block_enable($POSTED);
|
54 |
+
$this->mo2f_handle_report_enable($POSTED);
|
55 |
+
$this->mo2f_handle_notif_enable($POSTED);
|
56 |
+
if($POSTED){
|
57 |
+
update_option('mo_2f_switch_all',1);
|
58 |
+
update_site_option('mo2f_tab_count', 7);
|
59 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('ALL_ENABLED'),'SUCCESS');
|
60 |
+
}
|
61 |
+
else{
|
62 |
+
update_option('mo_2f_switch_all', 0);
|
63 |
+
update_site_option('mo2f_tab_count', 0);
|
64 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('ALL_DISABLED'),'ERROR');
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
public function mo2f_handle_2fa_enable($POSTED){
|
69 |
+
global $Mo2fdbQueries;
|
70 |
+
$user= wp_get_current_user();
|
71 |
+
$user_id= $user->user_ID;
|
72 |
+
if($POSTED){
|
73 |
+
$Mo2fdbQueries->update_user_deails($user_id, array('mo_2factor_user_registration_status', 'MO_2_FACTOR_PLUGIN_SETTINGS'));
|
74 |
+
if($_POST['tab_2fa_switch'])
|
75 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('TWO_FACTOR_ENABLE'),'SUCCESS');
|
76 |
+
}
|
77 |
+
else{
|
78 |
+
$Mo2fdbQueries->update_user_deails($user_id, array('mo_2factor_user_registration_status', 0));
|
79 |
+
if($_POST['tab_2fa_switch'])
|
80 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('TWO_FACTOR_DISABLE'),'ERROR');
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
public function mo2f_handle_waf_enable($POSTED){
|
85 |
+
if($POSTED){
|
86 |
+
update_site_option('mo_2f_switch_waf', 1);
|
87 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
88 |
+
if($_POST['option'] == 'tab_waf_switch')
|
89 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('WAF_ENABLE'),'SUCCESS');
|
90 |
+
}
|
91 |
+
else{
|
92 |
+
update_site_option('mo_2f_switch_waf', 0);
|
93 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')-1);
|
94 |
+
update_site_option('WAFEnabled', 0);
|
95 |
+
update_site_option('WAF','wafDisable');
|
96 |
+
update_site_option('Rate_limiting', 0);
|
97 |
+
$dir_name = dirname(dirname(dirname(dirname(dirname(__FILE__)))));
|
98 |
+
$dir_name1 = $dir_name.DIRECTORY_SEPARATOR.'.htaccess';
|
99 |
+
$filePath = $dir_name.DIRECTORY_SEPARATOR.'mo-check.php';
|
100 |
+
$filePath = str_replace('\\', '/', $filePath);
|
101 |
+
$file = file_get_contents($dir_name1);
|
102 |
+
$cont = PHP_EOL.'# BEGIN miniOrange WAF'.PHP_EOL;
|
103 |
+
$cont .= 'php_value auto_prepend_file '.$filePath.PHP_EOL;
|
104 |
+
$cont .= '# END miniOrange WAF'.PHP_EOL;
|
105 |
+
$file =str_replace($cont,'',$file);
|
106 |
+
file_put_contents($dir_name1, $file);
|
107 |
+
if($_POST['option'] == 'tab_waf_switch')
|
108 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('WAF_DISABLE'),'ERROR');
|
109 |
+
}
|
110 |
+
}
|
111 |
+
|
112 |
+
public function mo2f_handle_login_enable($POSTED){
|
113 |
+
if($POSTED){
|
114 |
+
update_site_option('mo_2f_switch_loginspam', 1);
|
115 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
116 |
+
if($_POST['option'] == 'tab_login_switch')
|
117 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('LOGIN_ENABLE'),'SUCCESS');
|
118 |
+
}
|
119 |
+
else{
|
120 |
+
update_site_option('mo_2f_switch_loginspam', 0);
|
121 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')-1);
|
122 |
+
update_site_option('mo2f_enable_brute_force', false);
|
123 |
+
update_site_option('mo_wpns_activate_recaptcha', false);
|
124 |
+
update_site_option('mo_wpns_activate_recaptcha_for_login', false);
|
125 |
+
update_site_option('mo_wpns_activate_recaptcha_for_woocommerce_login', false);
|
126 |
+
update_site_option('mo_wpns_activate_recaptcha_for_registration', false);
|
127 |
+
update_site_option('mo_wpns_activate_recaptcha_for_woocommerce_registration', false);
|
128 |
+
update_site_option('mo2f_enforce_strong_passswords', 0);
|
129 |
+
update_site_option('mo_wpns_enable_fake_domain_blocking', false);
|
130 |
+
update_site_option('mo_wpns_enable_advanced_user_verification', false);
|
131 |
+
update_site_option('mo_wpns_enable_social_integration', false);
|
132 |
+
update_site_option('mo2f_protect_wp_config', 0);
|
133 |
+
update_site_option('mo2f_prevent_directory_browsing', 0);
|
134 |
+
update_site_option('mo2f_disable_file_editing', 0);
|
135 |
+
update_site_option('mo_wpns_enable_comment_spam_blocking', false);
|
136 |
+
update_site_option('mo_wpns_enable_comment_recaptcha', false);
|
137 |
+
update_site_option('mo2f_htaccess_file', 0);
|
138 |
+
if($_POST['option'] == 'tab_login_switch')
|
139 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('LOGIN_DISABLE'),'ERROR');
|
140 |
+
}
|
141 |
+
}
|
142 |
+
|
143 |
+
public function mo2f_handle_backup_enable($POSTED){
|
144 |
+
if($POSTED){
|
145 |
+
update_site_option('mo_2f_switch_backup', 1);
|
146 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
147 |
+
if($_POST['option'] == 'tab_backup_switch')
|
148 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('BACKUP_ENABLE'),'SUCCESS');
|
149 |
+
}
|
150 |
+
else{
|
151 |
+
update_site_option('mo_2f_switch_backup', 0);
|
152 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')-1);
|
153 |
+
$handler_obj = new site_backup;
|
154 |
+
$handler_obj->bl_deactivate();
|
155 |
+
update_site_option('mo2f_enable_cron_backup', 0);
|
156 |
+
$handler_obj->file_backup_deactivate();
|
157 |
+
update_site_option('mo2f_enable_cron_file_backup', 0);
|
158 |
+
if($_POST['option'] == 'tab_backup_switch')
|
159 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('BACKUP_DISABLE'),'ERROR');
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
public function mo2f_handle_malware_enable($POSTED){
|
164 |
+
if($POSTED){
|
165 |
+
update_site_option('mo_2f_switch_malware', 1);
|
166 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
167 |
+
if($_POST['option'] == 'tab_malware_switch')
|
168 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('MALWARE_ENABLE'),'SUCCESS');
|
169 |
+
}else{
|
170 |
+
update_site_option('mo_2f_switch_malware', 0);
|
171 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')-1);
|
172 |
+
if($_POST['option'] == 'tab_malware_switch')
|
173 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('MALWARE_DISABLE'),'ERROR');
|
174 |
+
}
|
175 |
+
}
|
176 |
+
|
177 |
+
public function mo2f_handle_block_enable($POSTED){
|
178 |
+
if($POSTED){
|
179 |
+
update_site_option('mo_2f_switch_adv_block', 1);
|
180 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
181 |
+
if($_POST['option'] == 'tab_block_switch')
|
182 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('ADV_BLOCK_ENABLE'),'SUCCESS');
|
183 |
+
}
|
184 |
+
else{
|
185 |
+
update_site_option('mo_2f_switch_adv_block', 0);
|
186 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')-1);
|
187 |
+
update_site_option('mo_wpns_iprange_count', 0);
|
188 |
+
update_site_option('mo_wpns_enable_htaccess_blocking', 0);
|
189 |
+
update_site_option('mo_wpns_enable_user_agent_blocking', 0);
|
190 |
+
update_site_option('mo_wpns_referrers', false);
|
191 |
+
update_site_option('mo_wpns_countrycodes', false);
|
192 |
+
if($_POST['option'] == 'tab_block_switch')
|
193 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('ADV_BLOCK_DISABLE'),'ERROR');
|
194 |
+
}
|
195 |
+
}
|
196 |
+
|
197 |
+
public function mo2f_handle_report_enable($POSTED){
|
198 |
+
if($POSTED){
|
199 |
+
update_site_option('mo_2f_switch_reports', 1);
|
200 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
201 |
+
if($_POST['option'] == 'tab_report_switch')
|
202 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('REPORT_ENABLE'),'SUCCESS');
|
203 |
+
}
|
204 |
+
else{
|
205 |
+
update_site_option('mo_2f_switch_reports', 0);
|
206 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')-1);
|
207 |
+
if($_POST['option'] == 'tab_report_switch')
|
208 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('REPORT_DISABLE'),'ERROR');
|
209 |
+
}
|
210 |
+
}
|
211 |
+
|
212 |
+
public function mo2f_handle_notif_enable($POSTED){
|
213 |
+
if($POSTED){
|
214 |
+
update_site_option('mo_2f_switch_notif', 1);
|
215 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
216 |
+
if($_POST['option'] == 'tab_notif_switch')
|
217 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('NOTIF_ENABLE'),'SUCCESS');
|
218 |
+
}
|
219 |
+
else{
|
220 |
+
update_site_option('mo_2f_switch_notif', 0);
|
221 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')-1);
|
222 |
+
update_site_option('mo_wpns_enable_ip_blocked_email_to_admin', false);
|
223 |
+
update_site_option('mo_wpns_enable_unusual_activity_email_to_user', false);
|
224 |
+
if($_POST['option'] == 'tab_notif_switch')
|
225 |
+
do_action('wpns_show_message',MoWpnsMessages::showMessage('NOTIF_DISABLE'),'ERROR');
|
226 |
+
}
|
227 |
+
}
|
228 |
+
|
229 |
+
}
|
230 |
+
new Mo2f_ajax_dashboard();
|
231 |
+
?>
|
controllers/navbar.php
CHANGED
@@ -2,7 +2,51 @@
|
|
2 |
|
3 |
global $moWpnsUtility,$dirName;
|
4 |
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
$profile_url = add_query_arg( array('page' => 'mo_2fa_account' ), $_SERVER['REQUEST_URI'] );
|
7 |
$login_security = add_query_arg( array('page' => 'default' ), $_SERVER['REQUEST_URI'] );
|
8 |
$waf = add_query_arg( array('page' => 'mo_2fa_waf' ), $_SERVER['REQUEST_URI'] );
|
2 |
|
3 |
global $moWpnsUtility,$dirName;
|
4 |
|
5 |
+
if( isset( $_GET[ 'page' ])){
|
6 |
+
$tab_count= get_site_option('mo2f_tab_count', 0);
|
7 |
+
if($tab_count == 7)
|
8 |
+
update_site_option('mo_2f_switch_all', 1);
|
9 |
+
else
|
10 |
+
update_site_option('mo_2f_switch_all', 0);
|
11 |
+
switch($_GET['page'])
|
12 |
+
{
|
13 |
+
case 'mo_2fa_login_and_spam':
|
14 |
+
update_option('mo_2f_switch_loginspam', 1);
|
15 |
+
if($tab_count < 7)
|
16 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
17 |
+
break;
|
18 |
+
case 'mo_2fa_backup':
|
19 |
+
update_option('mo_2f_switch_backup', 1);
|
20 |
+
if($tab_count < 7)
|
21 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
22 |
+
break;
|
23 |
+
case 'mo_2fa_waf':
|
24 |
+
update_option('mo_2f_switch_waf', 1);
|
25 |
+
if($tab_count < 7)
|
26 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
27 |
+
break;
|
28 |
+
case 'mo_2fa_advancedblocking':
|
29 |
+
update_option('mo_2f_switch_adv_block', 1);
|
30 |
+
if($tab_count < 7)
|
31 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
32 |
+
break;
|
33 |
+
case 'mo_2fa_notifications':
|
34 |
+
update_option('mo_2f_switch_notif', 1);
|
35 |
+
if($tab_count < 7)
|
36 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
37 |
+
break;
|
38 |
+
case 'mo_2fa_reports':
|
39 |
+
update_option('mo_2f_switch_reports', 1);
|
40 |
+
if($tab_count < 7)
|
41 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
42 |
+
break;
|
43 |
+
case 'mo_2fa_malwarescan':
|
44 |
+
update_option('mo_2f_switch_malware', 1);
|
45 |
+
if($tab_count < 7)
|
46 |
+
update_site_option('mo2f_tab_count', get_site_option('mo2f_tab_count')+1);
|
47 |
+
break;
|
48 |
+
}
|
49 |
+
}
|
50 |
$profile_url = add_query_arg( array('page' => 'mo_2fa_account' ), $_SERVER['REQUEST_URI'] );
|
51 |
$login_security = add_query_arg( array('page' => 'default' ), $_SERVER['REQUEST_URI'] );
|
52 |
$waf = add_query_arg( array('page' => 'mo_2fa_waf' ), $_SERVER['REQUEST_URI'] );
|
database/database_functions.php
CHANGED
@@ -27,13 +27,14 @@
|
|
27 |
$this->scanreportdetails = $wpdb->base_prefix.'wpns_malware_scan_report_details';
|
28 |
$this->skipfiles = $wpdb->base_prefix.'wpns_malware_skip_files';
|
29 |
$this->hashfile = $wpdb->base_prefix.'wpns_malware_hash_file';
|
|
|
30 |
|
31 |
}
|
32 |
|
33 |
function mo_plugin_activate()
|
34 |
{
|
35 |
global $wpdb;
|
36 |
-
if(!get_option('mo_wpns_dbversion')||get_option('mo_wpns_dbversion')<
|
37 |
{
|
38 |
update_option('mo_wpns_dbversion', MoWpnsConstants::DB_VERSION );
|
39 |
$this->generate_tables();
|
@@ -77,6 +78,13 @@
|
|
77 |
dbDelta($sql);
|
78 |
}
|
79 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
$tableName = $this->emailAuditTable;
|
82 |
if($wpdb->get_var("show tables like '$tableName'") != $tableName)
|
@@ -253,6 +261,33 @@
|
|
253 |
);
|
254 |
}
|
255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
function get_number_of_whitelisted_ips(){
|
257 |
global $wpdb;
|
258 |
return $wpdb->get_var("SELECT COUNT(*) FROM ".$this->whitelistIPsTable."");
|
27 |
$this->scanreportdetails = $wpdb->base_prefix.'wpns_malware_scan_report_details';
|
28 |
$this->skipfiles = $wpdb->base_prefix.'wpns_malware_skip_files';
|
29 |
$this->hashfile = $wpdb->base_prefix.'wpns_malware_hash_file';
|
30 |
+
$this->backupdetails = $wpdb->base_prefix.'wpns_backup_report';
|
31 |
|
32 |
}
|
33 |
|
34 |
function mo_plugin_activate()
|
35 |
{
|
36 |
global $wpdb;
|
37 |
+
if(!get_option('mo_wpns_dbversion')||get_option('mo_wpns_dbversion')<144)
|
38 |
{
|
39 |
update_option('mo_wpns_dbversion', MoWpnsConstants::DB_VERSION );
|
40 |
$this->generate_tables();
|
78 |
dbDelta($sql);
|
79 |
}
|
80 |
|
81 |
+
$tableName = $this->backupdetails;
|
82 |
+
if($wpdb->get_var("show tables like '$tableName'") != $tableName)
|
83 |
+
{
|
84 |
+
$sql = "CREATE TABLE " . $tableName . " (`id` int NOT NULL AUTO_INCREMENT,
|
85 |
+
`backup_id` mediumtext NOT NULL, `file_name` mediumtext NOT NULL , `created_timestamp` bigint,UNIQUE KEY id (id) );";
|
86 |
+
dbDelta($sql);
|
87 |
+
}
|
88 |
|
89 |
$tableName = $this->emailAuditTable;
|
90 |
if($wpdb->get_var("show tables like '$tableName'") != $tableName)
|
261 |
);
|
262 |
}
|
263 |
|
264 |
+
function insert_backup_detail($backup_id,$file_name,$backup_created_timestamp){
|
265 |
+
|
266 |
+
global $wpdb;
|
267 |
+
$wpdb->insert(
|
268 |
+
$this->backupdetails,
|
269 |
+
array(
|
270 |
+
'backup_id' =>$backup_id,
|
271 |
+
'file_name' =>$file_name,
|
272 |
+
'created_timestamp'=> $backup_created_timestamp
|
273 |
+
)
|
274 |
+
);
|
275 |
+
}
|
276 |
+
|
277 |
+
function get_number_of_plugin_backup(){
|
278 |
+
global $wpdb;
|
279 |
+
|
280 |
+
|
281 |
+
$plugin_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$this->backupdetails." WHERE backup_id = 'plugin'");
|
282 |
+
$themes_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$this->backupdetails." WHERE backup_id = 'themes'");
|
283 |
+
$wp_files_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$this->backupdetails." WHERE backup_id = 'wpfiles'");
|
284 |
+
$db_count = $wpdb->get_var("SELECT COUNT(*) FROM ".$this->backupdetails." WHERE backup_id = 'db'");
|
285 |
+
$total_backup = $wpdb->get_var("SELECT COUNT(*) FROM ".$this->backupdetails);
|
286 |
+
$array = array('plugin_count'=>$plugin_count,'themes_count'=>$themes_count,'wp_files_count'=>$wp_files_count,'db_count'=>$db_count,'total_backup'=>$total_backup);
|
287 |
+
|
288 |
+
return $array;
|
289 |
+
}
|
290 |
+
|
291 |
function get_number_of_whitelisted_ips(){
|
292 |
global $wpdb;
|
293 |
return $wpdb->get_var("SELECT COUNT(*) FROM ".$this->whitelistIPsTable."");
|
handler/ajax.php
CHANGED
@@ -141,22 +141,28 @@ class AjaxHandler
|
|
141 |
|
142 |
|
143 |
private function create_db_backup_file($data)
|
144 |
-
{
|
|
|
|
|
|
|
145 |
$basepath = get_home_path();
|
146 |
-
if(!file_exists($basepath."
|
147 |
-
mkdir($basepath."
|
148 |
}
|
149 |
-
|
150 |
$handler_obj = new site_backup;
|
151 |
$handler_obj->create_index_file($basepath);
|
152 |
-
if(!file_exists($basepath
|
153 |
-
mkdir($basepath
|
154 |
}
|
|
|
155 |
|
156 |
-
$filename = 'db-backup-'
|
157 |
-
$handle = fopen(get_home_path()."db-backups
|
158 |
fwrite($handle,$data);
|
159 |
fclose($handle);
|
|
|
|
|
160 |
return $filename;
|
161 |
}
|
162 |
|
141 |
|
142 |
|
143 |
private function create_db_backup_file($data)
|
144 |
+
{
|
145 |
+
global $wpnsDbQueries;
|
146 |
+
$time = time();
|
147 |
+
$folderName = date("Ymd");
|
148 |
$basepath = get_home_path();
|
149 |
+
if(!file_exists($basepath."miniorangebackup")){
|
150 |
+
mkdir($basepath."miniorangebackup");
|
151 |
}
|
152 |
+
$basepath = get_home_path().'miniorangebackup/';
|
153 |
$handler_obj = new site_backup;
|
154 |
$handler_obj->create_index_file($basepath);
|
155 |
+
if(!file_exists($basepath.'miniorange-db-backups')){
|
156 |
+
mkdir($basepath.'miniorange-db-backups');
|
157 |
}
|
158 |
+
|
159 |
|
160 |
+
$filename = 'miniorange-db-backup-'.$time.'.sql';
|
161 |
+
$handle = fopen(get_home_path()."miniorangebackup".DIRECTORY_SEPARATOR.'miniorange-db-backups'.DIRECTORY_SEPARATOR.$filename,'w+');
|
162 |
fwrite($handle,$data);
|
163 |
fclose($handle);
|
164 |
+
$wpnsDbQueries->insert_backup_detail(MoWpnsConstants::DATABASE,$filename,$time);
|
165 |
+
update_option('backup_created_time',$time);
|
166 |
return $filename;
|
167 |
}
|
168 |
|
handler/backup.php
CHANGED
@@ -35,22 +35,29 @@ class site_backup
|
|
35 |
}
|
36 |
|
37 |
function file_cron_backup(){
|
38 |
-
|
|
|
|
|
39 |
if(get_option('mo_file_backup_plugins') =='1'){
|
40 |
-
$
|
41 |
$real_path=get_home_path().'wp-content/plugins';
|
42 |
-
$filename = 'plugins-backup-'
|
43 |
-
$this->file_backup($real_path,$filename
|
|
|
|
|
44 |
}if(get_option('mo_file_backup_themes')=='1'){
|
45 |
-
$
|
46 |
$real_path=get_home_path().'wp-content/themes';
|
47 |
-
$filename = 'themes-backup-'
|
48 |
-
$this->file_backup($real_path,$filename,
|
|
|
|
|
49 |
}if(get_option('mo_file_backup_wp_files') == '1'){
|
50 |
-
|
51 |
$real_path=get_home_path();
|
52 |
-
$filename = '
|
53 |
-
$this->file_backup($real_path,$filename
|
|
|
54 |
}
|
55 |
|
56 |
}
|
@@ -71,24 +78,24 @@ class site_backup
|
|
71 |
}
|
72 |
|
73 |
function mkdirectory($foldername){
|
74 |
-
|
75 |
$basepath = get_home_path();
|
76 |
-
if(!file_exists($basepath."
|
77 |
-
mkdir($basepath."
|
78 |
}
|
79 |
|
80 |
-
$basepath = get_home_path().'
|
81 |
$this-> create_index_file($basepath);
|
82 |
|
83 |
-
if(!file_exists($basepath
|
84 |
-
mkdir($basepath
|
85 |
}
|
86 |
|
87 |
-
$basepath = get_home_path().'file-backups
|
88 |
-
if(!file_exists($basepath.$
|
89 |
-
mkdir($basepath.$
|
90 |
}
|
91 |
-
|
92 |
}
|
93 |
|
94 |
function create_index_file($folder_path){
|
@@ -146,12 +153,12 @@ class site_backup
|
|
146 |
|
147 |
|
148 |
|
149 |
-
function file_backup($real_path, $filename
|
150 |
|
151 |
$basepath=get_home_path();
|
152 |
$rootPath = realpath($real_path);
|
153 |
$zip = new ZipArchive();
|
154 |
-
$res = $zip->open($basepath.'file-backups'.'/'.$foldername.'/'.$
|
155 |
|
156 |
$files = new RecursiveIteratorIterator(
|
157 |
new RecursiveDirectoryIterator($rootPath),
|
@@ -165,7 +172,7 @@ class site_backup
|
|
165 |
// Get real and relative path for current file
|
166 |
$filePath = $file->getRealPath();
|
167 |
$relativePath = substr($filePath, strlen($rootPath) + 1);
|
168 |
-
if(strpos($relativePath, '
|
169 |
{ }
|
170 |
else{
|
171 |
$zip->addFile($filePath, $relativePath);
|
35 |
}
|
36 |
|
37 |
function file_cron_backup(){
|
38 |
+
global $wpnsDbQueries;
|
39 |
+
$time = time();
|
40 |
+
update_option('backup_created_time',$time);
|
41 |
if(get_option('mo_file_backup_plugins') =='1'){
|
42 |
+
$this->mkdirectory('plugins');
|
43 |
$real_path=get_home_path().'wp-content/plugins';
|
44 |
+
$filename = 'miniorange-plugins-backup-'.$time.'.zip';
|
45 |
+
$this->file_backup($real_path,$filename,'plugins');
|
46 |
+
$wpnsDbQueries->insert_backup_detail(MoWpnsConstants::PLUGIN,$filename,$time);
|
47 |
+
|
48 |
}if(get_option('mo_file_backup_themes')=='1'){
|
49 |
+
$this->mkdirectory('themes');
|
50 |
$real_path=get_home_path().'wp-content/themes';
|
51 |
+
$filename = 'miniorange-themes-backup-'.$time.'.zip';
|
52 |
+
$this->file_backup($real_path,$filename,'themes');
|
53 |
+
|
54 |
+
$wpnsDbQueries->insert_backup_detail(MoWpnsConstants::THEMES,$filename,$time);
|
55 |
}if(get_option('mo_file_backup_wp_files') == '1'){
|
56 |
+
$this->mkdirectory('wp_files');
|
57 |
$real_path=get_home_path();
|
58 |
+
$filename = 'miniorange-wpfiles-backup-'.$time.'.zip';
|
59 |
+
$this->file_backup($real_path,$filename,'wp_files');
|
60 |
+
$wpnsDbQueries->insert_backup_detail(MoWpnsConstants::WPFILES,$filename,$time);
|
61 |
}
|
62 |
|
63 |
}
|
78 |
}
|
79 |
|
80 |
function mkdirectory($foldername){
|
81 |
+
|
82 |
$basepath = get_home_path();
|
83 |
+
if(!file_exists($basepath."miniorangebackup")){
|
84 |
+
mkdir($basepath."miniorangebackup");
|
85 |
}
|
86 |
|
87 |
+
$basepath = get_home_path().'miniorangebackup/';
|
88 |
$this-> create_index_file($basepath);
|
89 |
|
90 |
+
if(!file_exists($basepath.'miniorange-file-backups')){
|
91 |
+
mkdir($basepath.'miniorange-file-backups');
|
92 |
}
|
93 |
|
94 |
+
$basepath = get_home_path().'miniorangebackup/miniorange-file-backups/';
|
95 |
+
if(!file_exists($basepath.$foldername)){
|
96 |
+
mkdir($basepath.$foldername);
|
97 |
}
|
98 |
+
|
99 |
}
|
100 |
|
101 |
function create_index_file($folder_path){
|
153 |
|
154 |
|
155 |
|
156 |
+
function file_backup($real_path, $filename, $foldername){
|
157 |
|
158 |
$basepath=get_home_path();
|
159 |
$rootPath = realpath($real_path);
|
160 |
$zip = new ZipArchive();
|
161 |
+
$res = $zip->open($basepath.'miniorangebackup/miniorange-file-backups'.'/'.$foldername.'/'.$filename, ZipArchive::CREATE | ZipArchive::OVERWRITE);
|
162 |
|
163 |
$files = new RecursiveIteratorIterator(
|
164 |
new RecursiveDirectoryIterator($rootPath),
|
172 |
// Get real and relative path for current file
|
173 |
$filePath = $file->getRealPath();
|
174 |
$relativePath = substr($filePath, strlen($rootPath) + 1);
|
175 |
+
if(strpos($relativePath, 'miniorangebackup')!== false)
|
176 |
{ }
|
177 |
else{
|
178 |
$zip->addFile($filePath, $relativePath);
|
handler/malware_scanner.php
CHANGED
@@ -264,7 +264,11 @@ class Mo_wpns_Scan_Handler{
|
|
264 |
array_push($theme_repo_files, $iterator->getSubPathName());
|
265 |
$repo_file_path=$repo_path . DIRECTORY_SEPARATOR . 'themes';
|
266 |
}
|
267 |
-
|
|
|
|
|
|
|
|
|
268 |
$issues = $this->check_with_repo_files($file_content, $repo_file_path.DIRECTORY_SEPARATOR.$iterator->getSubPathName());
|
269 |
if(!empty($issues)){
|
270 |
$scanresult['repo']=$issues;
|
@@ -281,7 +285,7 @@ class Mo_wpns_Scan_Handler{
|
|
281 |
|
282 |
$ext['0']=$getext;
|
283 |
|
284 |
-
if(in_array($extensions,$ext) && $ext
|
285 |
|
286 |
|
287 |
if(($scan_config['check_vulnerable'] == 1) || ($scan_config['check_sql'] == 1)){
|
@@ -394,8 +398,18 @@ class Mo_wpns_Scan_Handler{
|
|
394 |
$url = trim($url,"'");
|
395 |
$url = trim($url,'"');
|
396 |
$components = parse_url($url);
|
397 |
-
|
398 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
399 |
}
|
400 |
return false;
|
401 |
}
|
264 |
array_push($theme_repo_files, $iterator->getSubPathName());
|
265 |
$repo_file_path=$repo_path . DIRECTORY_SEPARATOR . 'themes';
|
266 |
}
|
267 |
+
$getext=pathinfo($source_file_path, PATHINFO_EXTENSION);
|
268 |
+
|
269 |
+
$ext['0']=$getext;
|
270 |
+
|
271 |
+
if(! in_array($ext, array('zip')) && ! strpos($source_file_path, 'uploads')&& ! strpos($source_file_path, 'miniorangebackup')){
|
272 |
$issues = $this->check_with_repo_files($file_content, $repo_file_path.DIRECTORY_SEPARATOR.$iterator->getSubPathName());
|
273 |
if(!empty($issues)){
|
274 |
$scanresult['repo']=$issues;
|
285 |
|
286 |
$ext['0']=$getext;
|
287 |
|
288 |
+
if(in_array($extensions,$ext) && ! in_array($ext, array('zip'))){
|
289 |
|
290 |
|
291 |
if(($scan_config['check_vulnerable'] == 1) || ($scan_config['check_sql'] == 1)){
|
398 |
$url = trim($url,"'");
|
399 |
$url = trim($url,'"');
|
400 |
$components = parse_url($url);
|
401 |
+
|
402 |
+
if(isset($components['host'])){
|
403 |
+
$check_string = strpos($components['host'], 'wordpress.org');
|
404 |
+
if(isset($check_string) and is_int($check_string))
|
405 |
+
{
|
406 |
+
$check_string = 1;
|
407 |
+
}
|
408 |
+
if(!$check_string){
|
409 |
+
if(!empty($components['host']) && strpos(strtolower($components['host']),strtolower($_SERVER['HTTP_HOST'])) === false){
|
410 |
+
return true;
|
411 |
+
}
|
412 |
+
}
|
413 |
}
|
414 |
return false;
|
415 |
}
|
handler/two_fa_pass2login.php
CHANGED
@@ -31,7 +31,6 @@ class Miniorange_Password_2Factor_Login {
|
|
31 |
private $mo2f_transactionid;
|
32 |
|
33 |
public function miniorange_pass2login_redirect() {
|
34 |
-
|
35 |
do_action('mo2f_network_init');
|
36 |
global $Mo2fdbQueries;
|
37 |
|
@@ -1107,7 +1106,7 @@ class Miniorange_Password_2Factor_Login {
|
|
1107 |
}
|
1108 |
|
1109 |
$key = get_option('mo2f_customer_token');
|
1110 |
-
|
1111 |
$error=$this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to, $otp_token, $session_id );
|
1112 |
|
1113 |
|
31 |
private $mo2f_transactionid;
|
32 |
|
33 |
public function miniorange_pass2login_redirect() {
|
|
|
34 |
do_action('mo2f_network_init');
|
35 |
global $Mo2fdbQueries;
|
36 |
|
1106 |
}
|
1107 |
|
1108 |
$key = get_option('mo2f_customer_token');
|
1109 |
+
|
1110 |
$error=$this->miniorange_initiate_2nd_factor( $currentuser, $attributes, $redirect_to, $otp_token, $session_id );
|
1111 |
|
1112 |
|
helper/constants.php
CHANGED
@@ -37,6 +37,10 @@
|
|
37 |
const IP_RANGE_BLOCKING = "IP Range Blocking";
|
38 |
const FAILED_LOGIN_ATTEMPTS_FROM_NEW_IP = "Failed login attempts from new IP.";
|
39 |
const LOGGED_IN_FROM_NEW_IP = "Logged in from new IP.";
|
|
|
|
|
|
|
|
|
40 |
|
41 |
function __construct()
|
42 |
{
|
37 |
const IP_RANGE_BLOCKING = "IP Range Blocking";
|
38 |
const FAILED_LOGIN_ATTEMPTS_FROM_NEW_IP = "Failed login attempts from new IP.";
|
39 |
const LOGGED_IN_FROM_NEW_IP = "Logged in from new IP.";
|
40 |
+
const PLUGIN = 'plugin';
|
41 |
+
const THEMES = 'themes';
|
42 |
+
const WPFILES = 'wpfiles';
|
43 |
+
const DATABASE = 'db';
|
44 |
|
45 |
function __construct()
|
46 |
{
|
helper/curl.php
CHANGED
@@ -56,7 +56,7 @@ class MocURL
|
|
56 |
'lastName' => $current_user->user_lastname,
|
57 |
'company' => $_SERVER['SERVER_NAME'],
|
58 |
'email' => $q_email,
|
59 |
-
'ccEmail'
|
60 |
'phone' => $q_phone,
|
61 |
'query' => $query
|
62 |
);
|
@@ -148,7 +148,7 @@ class MocURL
|
|
148 |
$fromEmail = 'no-reply@xecurify.com';
|
149 |
if ($feedback_option == 'mo_wpns_skip_feedback')
|
150 |
{
|
151 |
-
$subject = "Deactivate [Feedback Skipped]: WordPress miniOrange 2-Factor Plugin
|
152 |
}
|
153 |
elseif ($feedback_option == 'mo_wpns_feedback')
|
154 |
{
|
56 |
'lastName' => $current_user->user_lastname,
|
57 |
'company' => $_SERVER['SERVER_NAME'],
|
58 |
'email' => $q_email,
|
59 |
+
'ccEmail' => '2fasupport@xecurify.com',
|
60 |
'phone' => $q_phone,
|
61 |
'query' => $query
|
62 |
);
|
148 |
$fromEmail = 'no-reply@xecurify.com';
|
149 |
if ($feedback_option == 'mo_wpns_skip_feedback')
|
150 |
{
|
151 |
+
$subject = "Deactivate [Feedback Skipped]: WordPress miniOrange 2-Factor Plugin";
|
152 |
}
|
153 |
elseif ($feedback_option == 'mo_wpns_feedback')
|
154 |
{
|
helper/dashboard_security_notification.php
CHANGED
@@ -10,7 +10,7 @@ class miniorange_security_notification{
|
|
10 |
}
|
11 |
|
12 |
function custom_dashboard_help() {
|
13 |
-
global $wpdb,$type_of_scan,$total_scanned_files;
|
14 |
|
15 |
$array = $wpdb->get_results("SELECT MAX(id) as id FROM ".$wpdb->base_prefix.'wpns_malware_scan_report');
|
16 |
|
@@ -32,6 +32,25 @@ class miniorange_security_notification{
|
|
32 |
|
33 |
if($total_scanned_files === null)
|
34 |
$total_scanned_files = '0';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
echo "<html>
|
37 |
<head>
|
@@ -69,7 +88,7 @@ class miniorange_security_notification{
|
|
69 |
|
70 |
</tr>
|
71 |
|
72 |
-
<tr><td> </td><td></td></tr>
|
73 |
<tr>
|
74 |
<td style='font-size:18px;color:#ffffff;text-align:center'><strong style='font-weight:300;'>Current Infected Files </strong></td>
|
75 |
<td style='font-size:18px;color:#ffffff;text-align:center'><strong style='font-weight:300;'>Total Infected Files Found</strong></td>
|
@@ -87,7 +106,52 @@ class miniorange_security_notification{
|
|
87 |
|
88 |
";
|
89 |
|
90 |
-
echo '<br><a class="button button-primary" style="background-color:#555f5f" href="admin.php?page=mo_2fa_malwarescan&tab=default&view='.$latest_id.'">View Details</a>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
|
93 |
|
10 |
}
|
11 |
|
12 |
function custom_dashboard_help() {
|
13 |
+
global $wpdb,$type_of_scan,$total_scanned_files,$wpnsDbQueries;
|
14 |
|
15 |
$array = $wpdb->get_results("SELECT MAX(id) as id FROM ".$wpdb->base_prefix.'wpns_malware_scan_report');
|
16 |
|
32 |
|
33 |
if($total_scanned_files === null)
|
34 |
$total_scanned_files = '0';
|
35 |
+
// -------------------------------------------------------------------------------------------------------->
|
36 |
+
$array = $wpnsDbQueries->get_number_of_plugin_backup();
|
37 |
+
$last_backup_create_time = get_option('backup_created_time');
|
38 |
+
$last_backup = 'No Backup Util';
|
39 |
+
if($array['total_backup'] !=0){
|
40 |
+
$timestamp = time()-$last_backup_create_time;
|
41 |
+
$days = $timestamp/(60*60*24);
|
42 |
+
$day = (int)$days;
|
43 |
+
if($day == 0){
|
44 |
+
$last_backup ='Last Backup Create Today';
|
45 |
+
}else{
|
46 |
+
$last_backup= 'Last backup'.' '.$day.' '.'day ago';
|
47 |
+
}
|
48 |
+
}else{
|
49 |
+
$last_backup = 'No Backup Until Now';
|
50 |
+
}
|
51 |
+
|
52 |
+
|
53 |
+
|
54 |
|
55 |
echo "<html>
|
56 |
<head>
|
88 |
|
89 |
</tr>
|
90 |
|
91 |
+
<tr><td> </td><td></td></tr>
|
92 |
<tr>
|
93 |
<td style='font-size:18px;color:#ffffff;text-align:center'><strong style='font-weight:300;'>Current Infected Files </strong></td>
|
94 |
<td style='font-size:18px;color:#ffffff;text-align:center'><strong style='font-weight:300;'>Total Infected Files Found</strong></td>
|
106 |
|
107 |
";
|
108 |
|
109 |
+
echo '<br><a class="button button-primary" style="background-color:#555f5f" href="admin.php?page=mo_2fa_malwarescan&tab=default&view='.$latest_id.'">View Details</a>';
|
110 |
+
echo '<br><br>';
|
111 |
+
|
112 |
+
echo "<div style='width:100%;background-color:#555f5f;padding-top:10px;'>
|
113 |
+
<div style='font-size:20px;color:white;text-align:center'>
|
114 |
+
<strong style='font-weight:300;'>Backup <span style='color:orange;'>[".$last_backup." ]</span></strong>
|
115 |
+
</div>
|
116 |
+
<hr>
|
117 |
+
<div>
|
118 |
+
<table>
|
119 |
+
<tbody>
|
120 |
+
|
121 |
+
<tr>
|
122 |
+
<td style='border-collapse:collapse!important;color:#0a0a0a;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;word-wrap:normal'>
|
123 |
+
<table dir='ltr' style='table-layout:fixed;margin:10px 0 20px 0;padding:0;vertical-align:top;width:100%'>
|
124 |
+
<tbody>
|
125 |
+
<tr>
|
126 |
+
<td style='text-align:center;font-size:36px;color:#ffffff;font-weight:400' ><strong>".$array['plugin_count']."</strong></td>
|
127 |
+
<td style='text-align:center;font-size:36px;color:#ffffff;font-weight:400'><strong>".$array['themes_count']."</strong></td>
|
128 |
+
<td style='text-align:center;font-size:36px;color:#ffffff;font-weight:400'><strong>".$array['wp_files_count']."</strong></td>
|
129 |
+
<td style='text-align:center;font-size:36px;color:#ffffff;font-weight:400'><strong>".$array['db_count']."</strong></td>
|
130 |
+
|
131 |
+
</tr>
|
132 |
+
|
133 |
+
<tr>
|
134 |
+
<td>
|
135 |
+
</td>
|
136 |
+
<td>
|
137 |
+
</td>
|
138 |
+
</tr>
|
139 |
+
<tr>
|
140 |
+
<td style='font-size:18px;color:#ffffff;text-align:center'><strong style='font-weight:300;'>Plugin Backup</strong></td>
|
141 |
+
<td style='font-size:18px;color:#ffffff;text-align:center'><strong style='font-weight:300;'>Themes Backup</strong></td>
|
142 |
+
<td style='font-size:18px;color:#ffffff;text-align:center'><strong style='font-weight:300;'>WP File Backup</strong></td>
|
143 |
+
<td style='font-size:18px;color:#ffffff;text-align:center'><strong style='font-weight:300;'>Database Backup</strong></td>
|
144 |
+
|
145 |
+
</tr>
|
146 |
+
</tbody>
|
147 |
+
</table>
|
148 |
+
|
149 |
+
</tr>
|
150 |
+
</tbody>
|
151 |
+
</table>
|
152 |
+
</div>
|
153 |
+
<a class='button button-primary' style='background-color:#f0a702;width:100%;text-align:center' href='admin.php?page=mo_2fa_backup'><h3 style='background-color:#f0a702'>Take Backup</h3></a>
|
154 |
+
</div>";
|
155 |
|
156 |
|
157 |
|
helper/messages.php
CHANGED
@@ -91,6 +91,25 @@
|
|
91 |
const INVALID_EMAIL = 'Please enter valid Email ID';
|
92 |
const EMAIL_SAVED = 'Email ID saved successfully';
|
93 |
const INVALID_HOURS = 'For scheduled backup, please enter number of hours greater than 1.';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
|
96 |
public static function showMessage($message , $data=array())
|
91 |
const INVALID_EMAIL = 'Please enter valid Email ID';
|
92 |
const EMAIL_SAVED = 'Email ID saved successfully';
|
93 |
const INVALID_HOURS = 'For scheduled backup, please enter number of hours greater than 1.';
|
94 |
+
const ALL_ENABLED = "All Website security features are available.";
|
95 |
+
const ALL_DISABLED = 'All Website security features are disabled.';
|
96 |
+
const TWO_FACTOR_ENABLE = 'Two-factor is enabled. Configure it in the Two-Factor tab.';
|
97 |
+
const TWO_FACTOR_DISABLE = 'Two-factor is disabled.';
|
98 |
+
const WAF_ENABLE = 'WAF features are now available. Configure it in the Firewall tab.';
|
99 |
+
const WAF_DISABLE = 'WAF is disabled.';
|
100 |
+
const LOGIN_ENABLE = 'Login security and spam protection features are available. Configure it in the Login and Spam tab.';
|
101 |
+
const LOGIN_DISABLE = 'Login security and spam protection features are disabled.';
|
102 |
+
const BACKUP_ENABLE = 'Encrypted backup features are available. Configure it in the Encrypted Backup tab.';
|
103 |
+
const BACKUP_DISABLE = 'Encrypted Backup features are disabled.';
|
104 |
+
const MALWARE_ENABLE = 'Malware scan features and modes are available. Configure it in the Malware Scan tab.';
|
105 |
+
const MALWARE_DISABLE = 'Malware scan features are disabled.';
|
106 |
+
const ADV_BLOCK_ENABLE = 'Advanced blocking features are available. Configure it in the Advanced blocking tab.';
|
107 |
+
const ADV_BLOCK_DISABLE = 'Advanced blocking features are disabled.';
|
108 |
+
const REPORT_ENABLE = 'Login and error reports are available in the Reports tab.';
|
109 |
+
const REPORT_DISABLE = 'Login and error reports are disabled.';
|
110 |
+
const NOTIF_ENABLE = 'Notification options are available. Configure it in the Notification tab.';
|
111 |
+
const NOTIF_DISABLE = 'Notifications are disabled.';
|
112 |
+
|
113 |
|
114 |
|
115 |
public static function showMessage($message , $data=array())
|
includes/css/style_settings.css
CHANGED
@@ -158,7 +158,7 @@
|
|
158 |
float: left;
|
159 |
width: 42%;
|
160 |
margin-left: 1%;
|
161 |
-
min-height:
|
162 |
overflow: hidden;
|
163 |
text-align: center;
|
164 |
border-top: 6px solid lightseagreen;
|
@@ -1048,7 +1048,7 @@ h2.mo_wpns_nav-tab-wrapper
|
|
1048 |
box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.19);
|
1049 |
}
|
1050 |
|
1051 |
-
h1 .nav-tab,
|
1052 |
font-size : auto;
|
1053 |
background-color: none; /* Green
|
1054 |
/*background-color: #4CAFA4;*/
|
@@ -1066,7 +1066,7 @@ h2.mo_wpns_nav-tab-wrapper
|
|
1066 |
border: 1px solid gray;
|
1067 |
/*width: 100px;*/
|
1068 |
}
|
1069 |
-
h1 .nav-tab-active,
|
1070 |
{
|
1071 |
|
1072 |
/*background-color: #4CAF50;*/
|
@@ -1076,13 +1076,13 @@ h2.mo_wpns_nav-tab-wrapper
|
|
1076 |
color: white;
|
1077 |
|
1078 |
}
|
1079 |
-
h1 .nav-tab:hover ,
|
1080 |
{
|
1081 |
background-color: #20b2aa;
|
1082 |
color: white;
|
1083 |
/*border-bottom: none;*/
|
1084 |
}
|
1085 |
-
h1 .nav-tab-active:hover ,
|
1086 |
{
|
1087 |
background-color: white;
|
1088 |
color:#20b2aa;
|
@@ -1296,7 +1296,7 @@ h2.mo_wpns_nav-tab-wrapper
|
|
1296 |
width:33%;
|
1297 |
float: left;
|
1298 |
}
|
1299 |
-
h1 .nav-tab,
|
1300 |
{
|
1301 |
font-size : 14px !important;
|
1302 |
/*background-color: none; /* Green */
|
@@ -1318,7 +1318,7 @@ h1 .nav-tab, h2 .nav-tab
|
|
1318 |
border: 1px solid #20b2aa;
|
1319 |
/*width: 100px;*/
|
1320 |
}
|
1321 |
-
h1 .nav-tab-active,
|
1322 |
{
|
1323 |
|
1324 |
/*background-color: #4CAF50;*/
|
@@ -1328,13 +1328,13 @@ h1 .nav-tab, h2 .nav-tab
|
|
1328 |
color: white;
|
1329 |
|
1330 |
}
|
1331 |
-
h1 .nav-tab:hover ,
|
1332 |
{
|
1333 |
background-color: #20b2aa;
|
1334 |
color: white;
|
1335 |
/*border-bottom: none;*/
|
1336 |
}
|
1337 |
-
h1 .nav-tab-active:hover ,
|
1338 |
{
|
1339 |
background-color: white;
|
1340 |
color:#20b2aa;
|
@@ -2434,6 +2434,45 @@ a.mo2f_thumbnail:hover, a.mo2f_thumbnail:focus, a.mo2f_thumbnail.active {
|
|
2434 |
.mo2f_display_none_forms {
|
2435 |
display: none
|
2436 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2437 |
|
2438 |
/*2FA css*/
|
2439 |
|
158 |
float: left;
|
159 |
width: 42%;
|
160 |
margin-left: 1%;
|
161 |
+
min-height: 165px;
|
162 |
overflow: hidden;
|
163 |
text-align: center;
|
164 |
border-top: 6px solid lightseagreen;
|
1048 |
box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.19);
|
1049 |
}
|
1050 |
|
1051 |
+
h1 .nav-tab, a .nav-tab{
|
1052 |
font-size : auto;
|
1053 |
background-color: none; /* Green
|
1054 |
/*background-color: #4CAFA4;*/
|
1066 |
border: 1px solid gray;
|
1067 |
/*width: 100px;*/
|
1068 |
}
|
1069 |
+
h1 .nav-tab-active, a .nav-tab-active
|
1070 |
{
|
1071 |
|
1072 |
/*background-color: #4CAF50;*/
|
1076 |
color: white;
|
1077 |
|
1078 |
}
|
1079 |
+
h1 .nav-tab:hover , a .nav-tab:hover
|
1080 |
{
|
1081 |
background-color: #20b2aa;
|
1082 |
color: white;
|
1083 |
/*border-bottom: none;*/
|
1084 |
}
|
1085 |
+
h1 .nav-tab-active:hover , a .nav-tab-active:hover
|
1086 |
{
|
1087 |
background-color: white;
|
1088 |
color:#20b2aa;
|
1296 |
width:33%;
|
1297 |
float: left;
|
1298 |
}
|
1299 |
+
h1 .nav-tab, div .nav-tab
|
1300 |
{
|
1301 |
font-size : 14px !important;
|
1302 |
/*background-color: none; /* Green */
|
1318 |
border: 1px solid #20b2aa;
|
1319 |
/*width: 100px;*/
|
1320 |
}
|
1321 |
+
h1 .nav-tab-active, div .nav-tab-active
|
1322 |
{
|
1323 |
|
1324 |
/*background-color: #4CAF50;*/
|
1328 |
color: white;
|
1329 |
|
1330 |
}
|
1331 |
+
h1 .nav-tab:hover , div .nav-tab:hover
|
1332 |
{
|
1333 |
background-color: #20b2aa;
|
1334 |
color: white;
|
1335 |
/*border-bottom: none;*/
|
1336 |
}
|
1337 |
+
h1 .nav-tab-active:hover , div .nav-tab-active:hover
|
1338 |
{
|
1339 |
background-color: white;
|
1340 |
color:#20b2aa;
|
2434 |
.mo2f_display_none_forms {
|
2435 |
display: none
|
2436 |
}
|
2437 |
+
.mo_flex-container {
|
2438 |
+
display: flex;
|
2439 |
+
flex-wrap: nowrap;
|
2440 |
+
width: 97%;
|
2441 |
+
}
|
2442 |
+
.mo_flex-container > a {
|
2443 |
+
|
2444 |
+
font-size : auto;
|
2445 |
+
background-color: none;
|
2446 |
+
border: 1px;
|
2447 |
+
text-align: center;
|
2448 |
+
text-decoration: none;
|
2449 |
+
display: inline-table;
|
2450 |
+
font-size: 20px;
|
2451 |
+
margin: 0px 0px;
|
2452 |
+
cursor: pointer;
|
2453 |
+
width: 1200px;
|
2454 |
+
border: 1px solid #20b2aa;
|
2455 |
+
|
2456 |
+
}
|
2457 |
+
.mo_subtab_flex-container{
|
2458 |
+
display: flex;
|
2459 |
+
flex-wrap: nowrap;
|
2460 |
+
width: 976px;
|
2461 |
+
}
|
2462 |
+
|
2463 |
+
.mo_subtab_flex-container > button {
|
2464 |
+
font-size : auto;
|
2465 |
+
background-color: none;
|
2466 |
+
border: 1px;
|
2467 |
+
text-align: center;
|
2468 |
+
text-decoration: none;
|
2469 |
+
display: inline-table;
|
2470 |
+
font-size: 17px;
|
2471 |
+
margin: 0px 0px;
|
2472 |
+
cursor: pointer;
|
2473 |
+
width: 1200px;
|
2474 |
+
border: 1px solid #20b2aa;
|
2475 |
+
}
|
2476 |
|
2477 |
/*2FA css*/
|
2478 |
|
includes/images/{normal1.png → normal1.PNG}
RENAMED
File without changes
|
includes/images/restrict_content_pro.png
ADDED
Binary file
|
miniorange_2_factor_settings.php
CHANGED
@@ -3,14 +3,14 @@
|
|
3 |
* Plugin Name: miniOrange 2 Factor Authentication
|
4 |
* Plugin URI: https://miniorange.com
|
5 |
* Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
|
6 |
-
* Version: 5.3.
|
7 |
* Author: miniOrange
|
8 |
* Author URI: https://miniorange.com
|
9 |
* License: GPL2
|
10 |
*/
|
11 |
define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
|
12 |
-
define( 'MO2F_VERSION', '5.3.
|
13 |
-
define( 'MO2F_TEST_MODE',
|
14 |
class Miniorange_twoFactor{
|
15 |
|
16 |
function __construct()
|
@@ -217,6 +217,8 @@
|
|
217 |
require('controllers/wpns-loginsecurity-ajax.php');
|
218 |
require('controllers/malware_scan_ajax.php');
|
219 |
require('controllers/backup_ajax.php');
|
|
|
|
|
220 |
}
|
221 |
|
222 |
}
|
3 |
* Plugin Name: miniOrange 2 Factor Authentication
|
4 |
* Plugin URI: https://miniorange.com
|
5 |
* Description: This plugin provides various two-factor authentication methods as an additional layer of security after the default wordpress login. We Support Google/Authy/LastPass Authenticator, QR Code, Push Notification, Soft Token and Security Questions(KBA) for 1 User in the free version of the plugin.
|
6 |
+
* Version: 5.3.11
|
7 |
* Author: miniOrange
|
8 |
* Author URI: https://miniorange.com
|
9 |
* License: GPL2
|
10 |
*/
|
11 |
define( 'MO_HOST_NAME', 'https://login.xecurify.com' );
|
12 |
+
define( 'MO2F_VERSION', '5.3.11' );
|
13 |
+
define( 'MO2F_TEST_MODE', false );
|
14 |
class Miniorange_twoFactor{
|
15 |
|
16 |
function __construct()
|
217 |
require('controllers/wpns-loginsecurity-ajax.php');
|
218 |
require('controllers/malware_scan_ajax.php');
|
219 |
require('controllers/backup_ajax.php');
|
220 |
+
require('controllers/dashboard_ajax.php');
|
221 |
+
|
222 |
}
|
223 |
|
224 |
}
|
readme.txt
CHANGED
@@ -6,7 +6,7 @@ Donate link: https://miniorange.com/
|
|
6 |
Requires at least: 3.0.1
|
7 |
Tested up to: 5.3
|
8 |
Requires PHP: 5.3.0
|
9 |
-
Stable tag: 5.3.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -272,6 +272,16 @@ miniOrange authentication service has 15+ authentication methods.One time passco
|
|
272 |
|
273 |
== Changelog ==
|
274 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
= 5.3.8 =
|
276 |
* Google Authenticator-Two Factor Authentication (2FA) : Security : Malware Scanner Fix.
|
277 |
|
@@ -687,6 +697,16 @@ More descriptive setup messages and UI changes.
|
|
687 |
|
688 |
== Upgrade Notice ==
|
689 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
690 |
= 5.3.8 =
|
691 |
* Google Authenticator-Two Factor Authentication (2FA) : Security : Malware Scanner Fix.
|
692 |
|
6 |
Requires at least: 3.0.1
|
7 |
Tested up to: 5.3
|
8 |
Requires PHP: 5.3.0
|
9 |
+
Stable tag: 5.3.11
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
272 |
|
273 |
== Changelog ==
|
274 |
|
275 |
+
= 5.3.11 =
|
276 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Security : Limiting Firewall, Malware, backup and login security for users not needing it.
|
277 |
+
|
278 |
+
= 5.3.10 =
|
279 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Security : Moved to Old WAF version minor issues.
|
280 |
+
|
281 |
+
= 5.3.9 =
|
282 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Security : Web application Firewall Sql Injections report and monitoring.
|
283 |
+
|
284 |
+
|
285 |
= 5.3.8 =
|
286 |
* Google Authenticator-Two Factor Authentication (2FA) : Security : Malware Scanner Fix.
|
287 |
|
697 |
|
698 |
== Upgrade Notice ==
|
699 |
|
700 |
+
= 5.3.11 =
|
701 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Security : Limiting Firewall, Malware, backup and login security for users not needing it.
|
702 |
+
|
703 |
+
= 5.3.10 =
|
704 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Security : Moved to Old WAF version minor issues..
|
705 |
+
|
706 |
+
= 5.3.9 =
|
707 |
+
* Google Authenticator-Two Factor Authentication (2FA) : Security : Web application Firewall Sql Injections report and monitoring.
|
708 |
+
|
709 |
+
|
710 |
= 5.3.8 =
|
711 |
* Google Authenticator-Two Factor Authentication (2FA) : Security : Malware Scanner Fix.
|
712 |
|
uninstall.php
CHANGED
@@ -327,4 +327,12 @@
|
|
327 |
delete_option( 'mo2f_enable_2fa' );
|
328 |
delete_option( 'kba_questions' );
|
329 |
delete_option( 'mo2f_customerKey' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
?>
|
327 |
delete_option( 'mo2f_enable_2fa' );
|
328 |
delete_option( 'kba_questions' );
|
329 |
delete_option( 'mo2f_customerKey' );
|
330 |
+
|
331 |
+
delete_option( 'mo_2f_switch_waf');
|
332 |
+
delete_option( 'mo_2f_switch_loginspam');
|
333 |
+
delete_option( 'mo_2f_switch_backup');
|
334 |
+
delete_option( 'mo_2f_switch_malware');
|
335 |
+
delete_option( 'mo_2f_switch_adv_block');
|
336 |
+
delete_option( 'mo_2f_switch_reports');
|
337 |
+
delete_option( 'mo_2f_switch_notif');
|
338 |
?>
|
views/backup.php
CHANGED
@@ -11,7 +11,7 @@ echo'
|
|
11 |
echo' <h3>Manual Database Backup</h3>
|
12 |
<form id="mo_wpns_db_backup" method="post" action="">
|
13 |
<input type="hidden" name="option" value="mo_wpns_db_backup" />
|
14 |
-
<p>Backup your WordPress database easily with a single click. Your backup will be saved in <b>'.site_url().'/
|
15 |
<input type="submit" name="submit" value="Backup Now" class="mo_wpns_button mo_wpns_button1" />
|
16 |
</form>
|
17 |
<div class="db_backup_desc" hidden></div>
|
@@ -72,7 +72,7 @@ echo' <h3>Manual Database Backup</h3>
|
|
72 |
<input type="hidden" name="option" value="mo2f_cron_backup_configuration">
|
73 |
<table class="mo2f_ns_settings_table" style="width:100%;">
|
74 |
<tr>
|
75 |
-
<td>Backup is created in the folder <b>"<?php echo site_url().'/
|
76 |
?>"</b></td>
|
77 |
</tr>
|
78 |
<tr>
|
@@ -124,7 +124,7 @@ echo '</div>
|
|
124 |
|
125 |
<?php } ?>
|
126 |
<tr>
|
127 |
-
<td>Backup created in your computer under <b>"/wordpress/
|
128 |
</tr>
|
129 |
|
130 |
</table>
|
11 |
echo' <h3>Manual Database Backup</h3>
|
12 |
<form id="mo_wpns_db_backup" method="post" action="">
|
13 |
<input type="hidden" name="option" value="mo_wpns_db_backup" />
|
14 |
+
<p>Backup your WordPress database easily with a single click. Your backup will be saved in <b>'.site_url().'/miniorange</b> .</p>
|
15 |
<input type="submit" name="submit" value="Backup Now" class="mo_wpns_button mo_wpns_button1" />
|
16 |
</form>
|
17 |
<div class="db_backup_desc" hidden></div>
|
72 |
<input type="hidden" name="option" value="mo2f_cron_backup_configuration">
|
73 |
<table class="mo2f_ns_settings_table" style="width:100%;">
|
74 |
<tr>
|
75 |
+
<td>Backup is created in the folder <b>"<?php echo site_url().'/miniorange';
|
76 |
?>"</b></td>
|
77 |
</tr>
|
78 |
<tr>
|
124 |
|
125 |
<?php } ?>
|
126 |
<tr>
|
127 |
+
<td>Backup created in your computer under <b>"/wordpress/miniorange".</b></td>
|
128 |
</tr>
|
129 |
|
130 |
</table>
|
views/dashboard.php
CHANGED
@@ -1,7 +1,21 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
4 |
<div class="mo_wpns_divided_layout">
|
|
|
5 |
<div class="mo_wpns_dashboard_layout">
|
6 |
<center>
|
7 |
<div class ="mo_wpns_inside_dashboard_layout ">Failed Login<hr class="line"><p class ="wpns_font_size mo_wpns_dashboard_text" >'.$wpns_attacks_blocked.'</p></div>
|
@@ -13,56 +27,180 @@ echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximu
|
|
13 |
|
14 |
</center>
|
15 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
<div class="mo_wpns_small_layout">
|
18 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
Two Factor Authentication adds an extra security layer for verification that involve <b>google authenticator, other application based authentication, Soft Token, Push Notification, USB based Hardware token, Security Questions, One time passcodes (OTP) over SMS, OTP over Email </b> etc.
|
20 |
|
21 |
-
<ul><li><a class="mo_wpns_button mo_wpns_button1" href="'.$two_fa.'">Settings</a></li></ul>
|
22 |
</div>
|
23 |
<div class="mo_wpns_small_layout">
|
24 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
Web Application Firewall protects your website from several website attacks such as <b>SQL Injection(SQLI), Cross Site Scripting(XSS), Remote File Inclusion</b> and many more cyber attacks.It also protects your website from <b>critical attacks</b> such as <b>Dos and DDos attacks.</b><br>
|
26 |
-
<ul><li><a class="mo_wpns_button mo_wpns_button1" href="'.$waf.'">Settings</a></li></ul>
|
27 |
</div>
|
28 |
<div class="mo_wpns_small_layout">
|
29 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
Firewall protects the whole website.
|
31 |
If you just want to prevent your login page from <b> password guessing attacks</b> by humans or by bots.
|
32 |
We have features such as <b> Brute Force,Enforcing Strong Password,Custom Login Page URL,Recaptcha </b> etc. <br>
|
33 |
-
<ul><li><a class="mo_wpns_button mo_wpns_button1" href="'.$login_and_spam.'">Settings</a></li></ul>
|
34 |
</div>
|
35 |
<div class="mo_wpns_small_layout">
|
36 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
Creating regular backups for your website is essential. By Creating backup you can <b>restore your website back to normal</b> within a few minutes. miniOrange creates <b>database and file Backup</b> which is stored locally in your system.
|
38 |
-
<ul><li><a class="mo_wpns_button mo_wpns_button1" href="'.$backup.'">Settings</a></li></ul>
|
39 |
</div>
|
40 |
<div class="mo_wpns_small_layout">
|
41 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
A malware scanner / detector or virus scanner is a <b>software that detects the malware</b> into the system. It detects different kinds of malware and categories based on the <b>strength of vulnerability or harmfulness.</b> <br>
|
43 |
-
<ul><li><a class="mo_wpns_button mo_wpns_button1" href="'.$scan_url.'">Settings</a></li></ul>
|
44 |
</div>
|
45 |
<div class="mo_wpns_small_layout">
|
46 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
In Advanced blocking we have features like <b> Country Blocking, IP range Blocking , Browser blocking </b> and other options you can set up specifically according to your needs
|
48 |
-
<ul><li><a class="mo_wpns_button mo_wpns_button1" href="'.$advance_block.'">Settings</a></li></ul>
|
49 |
</div>
|
50 |
<div class="mo_wpns_small_layout">
|
51 |
-
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
</div>
|
55 |
|
56 |
<div class="mo_wpns_small_layout">
|
57 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
Get <b>Notified realtime</b> about any <b>IP getting Blocked.</b> With that, also get informed about any <b>unusual activities</b> detected by miniOrange.
|
59 |
-
<ul><li><a class="mo_wpns_button mo_wpns_button1" href="'.$notif_url.'">Settings</a></li></ul>
|
60 |
</div>
|
61 |
|
62 |
-
</div>
|
63 |
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
|
68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
+
global $moWpnsUtility,$dirName;
|
3 |
+
include_once $dirName . 'views'.DIRECTORY_SEPARATOR.'navbar.php';
|
4 |
+
add_action('admin_footer','mo_2fa_dashboard_switch');
|
5 |
+
$two_fa_toggle = get_site_option("mo2f_toggle");
|
6 |
+
$two_fa_on= get_site_option("mo_2f_switch_2fa")?"checked":"";
|
7 |
+
$all_on= get_site_option("mo_2f_switch_all")?"checked":"";
|
8 |
+
$waf_on= get_site_option("mo_2f_switch_waf")?"checked":"";
|
9 |
+
$login_spam_on= get_site_option("mo_2f_switch_loginspam")?"checked":"";
|
10 |
+
$backup_on= get_site_option("mo_2f_switch_backup")?"checked":"";
|
11 |
+
$malware_on= get_site_option("mo_2f_switch_malware")?"checked":"";
|
12 |
+
$adv_block_on= get_site_option("mo_2f_switch_adv_block")?"checked":"";
|
13 |
+
$report_on= get_site_option("mo_2f_switch_reports")?"checked":"";
|
14 |
+
$notif_on= get_site_option("mo_2f_switch_notif")?"checked":"";
|
15 |
+
echo '<div id="mo_switch_message" style=" padding:8px"></div>';
|
16 |
echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
17 |
<div class="mo_wpns_divided_layout">
|
18 |
+
|
19 |
<div class="mo_wpns_dashboard_layout">
|
20 |
<center>
|
21 |
<div class ="mo_wpns_inside_dashboard_layout ">Failed Login<hr class="line"><p class ="wpns_font_size mo_wpns_dashboard_text" >'.$wpns_attacks_blocked.'</p></div>
|
27 |
|
28 |
</center>
|
29 |
</div>
|
30 |
+
|
31 |
+
|
32 |
+
<div style="padding: 0px 0px 0px 5px; width:30%; margin-left:634px; margin-right:25px; float:right;" >
|
33 |
+
<form name="tab_all" id="tab_all" method="post">
|
34 |
+
<h3>Enable/Disable all features
|
35 |
+
<label class="mo_wpns_switch">
|
36 |
+
<input type="hidden" name="option" value="tab_all_switch"/>
|
37 |
+
<input type=checkbox id="switch_all" name="switch_val" value="1" '.$all_on.' />
|
38 |
+
<span class="mo_wpns_slider mo_wpns_round"></span>
|
39 |
+
</label>
|
40 |
+
</h3>
|
41 |
+
</form>
|
42 |
+
</div>
|
43 |
|
44 |
<div class="mo_wpns_small_layout">
|
45 |
+
<form name="tab_2fa" id="tab_2fa" method="post">
|
46 |
+
<h3>Two Factor Authentication ';
|
47 |
+
if($two_fa_toggle){
|
48 |
+
echo ' <label class="mo_wpns_switch" style="float: right">
|
49 |
+
<input type="hidden" name="option" value="tab_2fa_switch"/>
|
50 |
+
<input type=checkbox id="switch_2fa" name="switch_val" value="1" '.$two_fa_on.' />
|
51 |
+
<span class="mo_wpns_slider mo_wpns_round"></span>
|
52 |
+
</label>';
|
53 |
+
}else{
|
54 |
+
echo ' <b style="color:green;">(Enabled)</b>';
|
55 |
+
}
|
56 |
+
echo ' </h3>
|
57 |
+
</form>
|
58 |
+
<br>
|
59 |
Two Factor Authentication adds an extra security layer for verification that involve <b>google authenticator, other application based authentication, Soft Token, Push Notification, USB based Hardware token, Security Questions, One time passcodes (OTP) over SMS, OTP over Email </b> etc.
|
60 |
|
|
|
61 |
</div>
|
62 |
<div class="mo_wpns_small_layout">
|
63 |
+
<form name="tab_waf" id="tab_waf" method="post">
|
64 |
+
<h3 align="center">Web Application Firewall (WAF)
|
65 |
+
<label class="mo_wpns_switch" style="float: right">
|
66 |
+
<input type="hidden" name="option" value="tab_waf_switch"/>
|
67 |
+
<input type=checkbox id="switch_WAF" name="switch_val" value="1" '.$waf_on.' />
|
68 |
+
<span class="mo_wpns_slider mo_wpns_round"></span>
|
69 |
+
</label>
|
70 |
+
</h3>
|
71 |
+
</form>
|
72 |
+
<br>
|
73 |
Web Application Firewall protects your website from several website attacks such as <b>SQL Injection(SQLI), Cross Site Scripting(XSS), Remote File Inclusion</b> and many more cyber attacks.It also protects your website from <b>critical attacks</b> such as <b>Dos and DDos attacks.</b><br>
|
|
|
74 |
</div>
|
75 |
<div class="mo_wpns_small_layout">
|
76 |
+
<form name="tab_login" id="tab_login" method="post">
|
77 |
+
<h3 align="center">Login and Spam
|
78 |
+
<label class="mo_wpns_switch" style="float: right">
|
79 |
+
<input type="hidden" name="option" value="tab_login_switch"/>
|
80 |
+
<input type=checkbox id="switch_login_spam" name="switch_val" value="1" ' .$login_spam_on. ' />
|
81 |
+
<span class="mo_wpns_slider mo_wpns_round"></span>
|
82 |
+
</label>
|
83 |
+
</h3>
|
84 |
+
</form>
|
85 |
+
<br>
|
86 |
Firewall protects the whole website.
|
87 |
If you just want to prevent your login page from <b> password guessing attacks</b> by humans or by bots.
|
88 |
We have features such as <b> Brute Force,Enforcing Strong Password,Custom Login Page URL,Recaptcha </b> etc. <br>
|
|
|
89 |
</div>
|
90 |
<div class="mo_wpns_small_layout">
|
91 |
+
<form name="tab_backup" id="tab_backup" method="post">
|
92 |
+
<h3>Encrypted Backup
|
93 |
+
<label class="mo_wpns_switch" style="float: right">
|
94 |
+
<input type="hidden" name="option" value="tab_backup_switch"/>
|
95 |
+
<input type=checkbox id="switch_backup" name="switch_val" value="1" ' .$backup_on. '/>
|
96 |
+
<span class="mo_wpns_slider mo_wpns_round"></span>
|
97 |
+
</label>
|
98 |
+
</h3>
|
99 |
+
</form>
|
100 |
+
<br>
|
101 |
Creating regular backups for your website is essential. By Creating backup you can <b>restore your website back to normal</b> within a few minutes. miniOrange creates <b>database and file Backup</b> which is stored locally in your system.
|
|
|
102 |
</div>
|
103 |
<div class="mo_wpns_small_layout">
|
104 |
+
<form name="tab_malware" id="tab_malware" method="post">
|
105 |
+
<h3>Malware Scan
|
106 |
+
<label class="mo_wpns_switch" style="float: right">
|
107 |
+
<input type="hidden" name="option" value="tab_malware_switch"/>
|
108 |
+
<input type=checkbox id="switch_malware" name="switch_val" value="1" ' .$malware_on. ' />
|
109 |
+
<span class="mo_wpns_slider mo_wpns_round"></span>
|
110 |
+
</label>
|
111 |
+
</h3>
|
112 |
+
</form>
|
113 |
+
<br>
|
114 |
A malware scanner / detector or virus scanner is a <b>software that detects the malware</b> into the system. It detects different kinds of malware and categories based on the <b>strength of vulnerability or harmfulness.</b> <br>
|
|
|
115 |
</div>
|
116 |
<div class="mo_wpns_small_layout">
|
117 |
+
<form name="tab_adv_block" id="tab_adv_block" method="post">
|
118 |
+
<h3>Advanced Blocking
|
119 |
+
<label class="mo_wpns_switch" style="float: right">
|
120 |
+
<input type="hidden" name="option" value="tab_block_switch"/>
|
121 |
+
<input type=checkbox id="switch_adv_block" name="switch_val" value="1" ' .$adv_block_on. '/>
|
122 |
+
<span class="mo_wpns_slider mo_wpns_round"></span>
|
123 |
+
</label>
|
124 |
+
</h3>
|
125 |
+
</form>
|
126 |
+
<br>
|
127 |
In Advanced blocking we have features like <b> Country Blocking, IP range Blocking , Browser blocking </b> and other options you can set up specifically according to your needs
|
|
|
128 |
</div>
|
129 |
<div class="mo_wpns_small_layout">
|
130 |
+
<form name="tab_report" id="tab_report" method="post">
|
131 |
+
<h3>Reports
|
132 |
+
<label class="mo_wpns_switch" style="float: right">
|
133 |
+
<input type="hidden" name="option" value="tab_report_switch"/>
|
134 |
+
<input type=checkbox id="switch_reports" name="switch_val" value="1" ' .$report_on. '/>
|
135 |
+
<span class="mo_wpns_slider mo_wpns_round"></span>
|
136 |
+
</label>
|
137 |
+
</h3>
|
138 |
+
</form>
|
139 |
+
<br>
|
140 |
+
Track users <b>login activity</b> on your website. You can also <b>track 404 error</b> so that if anyone tries to access it too many times you can take action.
|
141 |
</div>
|
142 |
|
143 |
<div class="mo_wpns_small_layout">
|
144 |
+
<form name="tab_notif" id="tab_notif" method="post">
|
145 |
+
<h3>Notification
|
146 |
+
<label class="mo_wpns_switch" style="float: right">
|
147 |
+
<input type="hidden" name="option" value="tab_notif_switch"/>
|
148 |
+
<input type=checkbox id="switch_notification" name="switch_val" value="1" ' .$notif_on. '/>
|
149 |
+
<span class="mo_wpns_slider mo_wpns_round"></span>
|
150 |
+
</label>
|
151 |
+
</h3>
|
152 |
+
</form>
|
153 |
+
<br>
|
154 |
Get <b>Notified realtime</b> about any <b>IP getting Blocked.</b> With that, also get informed about any <b>unusual activities</b> detected by miniOrange.
|
|
|
155 |
</div>
|
156 |
|
157 |
+
</div> ';
|
158 |
|
159 |
+
function mo_2fa_dashboard_switch(){
|
160 |
+
if ( ('admin.php' != basename( $_SERVER['PHP_SELF'] )) || ($_GET['page'] != 'mo_2fa_dashboard') ) {
|
161 |
+
return;
|
162 |
+
}
|
163 |
+
?>
|
164 |
+
<script>
|
165 |
+
jQuery(document).ready(function(){
|
166 |
+
jQuery("#switch_2fa").click(function(){
|
167 |
+
jQuery("#tab_2fa").submit();
|
168 |
+
});
|
169 |
+
|
170 |
+
jQuery("#switch_all").click(function(){
|
171 |
+
jQuery("#tab_all").submit();
|
172 |
+
});
|
173 |
|
174 |
+
jQuery("#switch_WAF").click(function(){
|
175 |
+
jQuery("#tab_waf").submit();
|
176 |
+
});
|
177 |
+
|
178 |
+
jQuery("#switch_login_spam").click(function(){
|
179 |
+
jQuery("#tab_login").submit();
|
180 |
+
});
|
181 |
+
|
182 |
+
jQuery("#switch_backup").click(function(){
|
183 |
+
jQuery("#tab_backup").submit();
|
184 |
+
});
|
185 |
+
|
186 |
+
jQuery("#switch_malware").click(function(){
|
187 |
+
jQuery("#tab_malware").submit();
|
188 |
+
});
|
189 |
+
|
190 |
+
jQuery("#switch_adv_block").click(function(){
|
191 |
+
jQuery("#tab_adv_block").submit();
|
192 |
+
});
|
193 |
+
|
194 |
+
jQuery("#switch_reports").click(function(){
|
195 |
+
jQuery("#tab_report").submit();
|
196 |
+
});
|
197 |
+
|
198 |
+
jQuery("#switch_notification").click(function(){
|
199 |
+
jQuery("#tab_notif").submit();
|
200 |
+
});
|
201 |
+
|
202 |
+
});
|
203 |
+
</script>
|
204 |
+
<?php
|
205 |
+
}
|
206 |
+
?>
|
views/navbar.php
CHANGED
@@ -16,20 +16,34 @@
|
|
16 |
</h1>
|
17 |
</div>';
|
18 |
//check_is_curl_installed();
|
|
|
19 |
|
20 |
-
echo'<div id="tab">
|
21 |
-
<h2 class="nav-tab-wrapper mo_wpns_nav-tab-wrapper">';
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
</
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
</h1>
|
17 |
</div>';
|
18 |
//check_is_curl_installed();
|
19 |
+
?>
|
20 |
|
|
|
|
|
21 |
|
22 |
+
<br>
|
23 |
+
<div class="mo_flex-container">
|
24 |
+
<?php echo '<a class="nav-tab '.($active_tab == 'mo_2fa_dashboard' ? 'nav-tab-active' : '').'" href="'.$dashboard_url .'">Dashboard</a>';
|
25 |
+
echo '<a class="nav-tab '.($active_tab == 'mo_2fa_two_fa' ? 'nav-tab-active' : '').'" href="'.$two_fa .'">Two Factor</a>';
|
26 |
+
if(get_site_option('mo_2f_switch_waf')){
|
27 |
+
echo '<a id="mo_2fa_waf" class="nav-tab '.($active_tab == 'mo_2fa_waf' ? 'nav-tab-active' : '').'" href="'.$waf .'">Firewall</a>';
|
28 |
+
}
|
29 |
+
if(get_site_option('mo_2f_switch_loginspam')){
|
30 |
+
echo '<a id="login_spam_tab" class="nav-tab '.($active_tab == 'mo_2fa_login_and_spam' ? 'nav-tab-active' : '').'" href="'.$login_and_spam .'">Login and Spam</a>';
|
31 |
+
}
|
32 |
+
if(get_site_option('mo_2f_switch_backup')){
|
33 |
+
echo '<a id="backup_tab" class="nav-tab '.($active_tab == 'mo_2fa_backup' ? 'nav-tab-active' : '').'" href="'.$backup .'">Encrypted Backup</a>';
|
34 |
+
}
|
35 |
+
if(get_site_option('mo_2f_switch_malware')){
|
36 |
+
echo '<a id="malware_tab" class="nav-tab '.($active_tab == 'mo_2fa_malwarescan' ? 'nav-tab-active' : '').'" href="'.$scan_url .'">Malware Scan</a>';
|
37 |
+
}
|
38 |
+
if(get_site_option('mo_2f_switch_adv_block')){
|
39 |
+
echo '<a id="adv_block_tab" class="nav-tab '.($active_tab == 'mo_2fa_advancedblocking'? 'nav-tab-active' : '').'" href="'.$advance_block .'">Advanced Blocking</a>';
|
40 |
+
}
|
41 |
+
if(get_site_option('mo_2f_switch_notif')){
|
42 |
+
echo '<a id="notif_tab" class="nav-tab '.($active_tab == 'mo_2fa_notifications' ? 'nav-tab-active' : '').'" href="'.$notif_url .'">Notifications</a>';
|
43 |
+
}
|
44 |
+
if(get_site_option('mo_2f_switch_reports')){
|
45 |
+
echo '<a id="report_tab" class="nav-tab '.($active_tab == 'mo_2fa_reports' ? 'nav-tab-active' : '').'" href="'.$reports_url .'">Reports</a>';
|
46 |
+
}
|
47 |
+
echo '<a class="nav-tab '.($active_tab == 'mo_2fa_upgrade' ? 'nav-tab-active' : '').'" href="'.$upgrade_url .'">Upgrade</a>';
|
48 |
+
?>
|
49 |
+
</div>
|