Changeset 2615297
- Timestamp:
- 10/17/2021 08:44:25 AM (4 years ago)
- Location:
- code9/trunk
- Files:
-
- 5 edited
-
code9.php (modified) (3 diffs)
-
function/code9_security.php (modified) (4 diffs)
-
plugin/security/spa/security.js (modified) (3 diffs)
-
plugin/security/spa/security.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
code9/trunk/code9.php
r2612798 r2615297 4 4 Plugin URI: https://wordpress.org/plugins/code9/ 5 5 Description: Utility tool for wordpress. 2-step verificatoin code user login. 6 Version: 1.0. 06 Version: 1.0.1 7 7 Author: Code9Fair 8 8 Author URI: https://paypal.me/code9fair/ … … 31 31 $GLOBALS['CODE9_PLUGIN_DIR'] = plugin_dir_path( __FILE__ ); 32 32 $GLOBALS['CODE9_PLUGIN_URL'] = plugin_dir_url( __FILE__ ); 33 34 require($GLOBALS['CODE9_PLUGIN_DIR'] . 'function/code9_anti_brute_foce.php'); 33 35 34 36 if(wp_get_current_user()->ID !== 0) { … … 39 41 require($GLOBALS['CODE9_PLUGIN_DIR'] . 'function/code9_security.php'); 40 42 require($GLOBALS['CODE9_PLUGIN_DIR'] . 'plugin/security/spa.php'); 41 require($GLOBALS['CODE9_PLUGIN_DIR'] . 'plugin/security/api/security_2_step_get.php');42 43 require($GLOBALS['CODE9_PLUGIN_DIR'] . 'plugin/security/api/security_2_step_key_iv_reset.php'); 43 44 require($GLOBALS['CODE9_PLUGIN_DIR'] . 'plugin/security/api/security_2_step_update.php'); 45 require($GLOBALS['CODE9_PLUGIN_DIR'] . 'plugin/security/api/security_anti_brute_force_update.php'); 46 47 44 48 } 45 49 -
code9/trunk/function/code9_security.php
r2613018 r2615297 92 92 if ($error->getMessage() === '2step-code9') { 93 93 94 if (isset($_SESSION['code9_security_auth_' . $admin_id . '_block_time']) === true && $_SESSION['code9_security_auth_' . $admin_id . '_block_time'] > time()) {94 if (isset($_SESSION['code9_security_auth_' . $admin_id . '_block_time']) === true && $_SESSION['code9_security_auth_' . $admin_id . '_block_time'] !== null && $_SESSION['code9_security_auth_' . $admin_id . '_block_time'] > time()) { 95 95 96 96 wp_die('<h1>' . __('Account locked', 'c9') . '</h1><p><span id="c9-countdown-container">Wait</span> until account unlock.</p><script type="text/javascript"> … … 108 108 })(); 109 109 110 </script><p><a href="' . wp_logout_url('') . '">' . __('Sign out', 'c9') . '</a></p>', "Account has been block- Code9");110 </script><p><a href="' . wp_logout_url('') . '">' . __('Sign out', 'c9') . '</a></p>', __("Account has been block", "c9") . " - Code9"); 111 111 112 112 } … … 136 136 $_SESSION['code9_security_auth_' . $admin_id] = $_COOKIE['code9_security_public']; 137 137 138 $_SESSION['code9_security_auth_' . $admin_id . '_attemp'] = 0; 138 $_SESSION['code9_security_auth_' . $admin_id . '_attemp'] = null; 139 $_SESSION['code9_security_auth_' . $admin_id . '_block_time'] = null; 139 140 } else { 140 if (isset($_SESSION['code9_security_auth_' . $admin_id . '_attemp']) !== true ) {141 if (isset($_SESSION['code9_security_auth_' . $admin_id . '_attemp']) !== true || $_SESSION['code9_security_auth_' . $admin_id . '_attemp'] === null) { 141 142 $_SESSION['code9_security_auth_' . $admin_id . '_attemp'] = 0; 142 143 } … … 518 519 add_action('edit_user_profile_update', 'code9_security_2_step_code_edit_update'); 519 520 } 521 -
code9/trunk/plugin/security/spa/security.js
r2612798 r2615297 1 1 (async function () { 2 var _response = await C9_API("security_2_step_get");3 2 4 jQuery("#c9-security_2_step-checkbox").prop('checked', _response.data === '1' ? true: false);5 3 6 4 jQuery("#c9-security_2_step-checkbox").on("change", function () { … … 12 10 13 11 jQuery('#c9-security_2_step-logout-all-user-button').unbind('click').bind('click', async function() { 14 var _button_html = C9_ BUTTON_LOADING(jQuery(this)[0]);12 var _button_html = C9_DOM_LOADING(jQuery(this)[0]); 15 13 16 14 var _response = await C9_API("security_2_step_key_iv_reset"); 17 15 18 C9_ BUTTON_LOADING(jQuery(this)[0], _button_html);16 C9_DOM_LOADING(jQuery(this)[0], _button_html); 19 17 20 18 if(_response.result === true) { … … 23 21 C9_NOTI(_response.response_text); 24 22 } 25 }); 23 }); 24 25 jQuery("#c9-security_security_anti_brute_force-checkbox").on("change", function () { 26 console.log(jQuery("#c9-security_security_anti_brute_force-checkbox").prop("checked")) 27 C9_API("security_anti_brute_force_update", { 28 security_anti_brute_force: 29 jQuery("#c9-security_security_anti_brute_force-checkbox").prop("checked") === true ? "1" : "0", 30 }); 31 }); 32 26 33 })(); -
code9/trunk/plugin/security/spa/security.php
r2612798 r2615297 9 9 </label> 10 10 </div> 11 <div >11 <div class="c9-margin-bottom-small"> 12 12 <button class="button" id="c9-security_2_step-logout-all-user-button"><?php echo __('log out 2 step sign in for all user'); ?></button> 13 13 </div> 14 <div class="c9-margin-bottom-small"> 15 <label> 16 <input type="checkbox" value="1" id="c9-security_security_anti_brute_force-checkbox" <?php echo get_option('code9_security_anti_brute_force', '0') === '1' ? 'checked="checked"' : '' ?> /> 17 <?php echo __('Use anti brute force attack', 'c9'); ?> 18 </label> 19 </div> 14 20 </div> -
code9/trunk/readme.txt
r2612798 r2615297 2 2 Contributors: Code9fair 3 3 Donate link: https://paypal.me/code9fair 4 Tags: 2-step login, verification password, anti brute force login 4 Tags: 2-step login, verification password, anti brute force login, xmlrpc.php 5 5 Requires at least: 5.8 6 6 Tested up to: 5.8 … … 14 14 == Description == 15 15 16 == 2-Step Verification Code == 17 16 18 Code9 2-step verification code will add more protection to site admin area. 17 19 … … 23 25 * Admin can active and deactive 2-step verification code anytime. 24 26 27 == Anti Brute Force == 28 29 Prevent attacker from continuous login. (Including xmlrpc.php) 30 * If plugin detects that there is a continuous login. Plugin will redirect user to Recapcha page before allow user to continue login. 25 31 26 32 == Installation == … … 42 48 8. User can try 2-step verification again when locked time is up. 43 49 9. Install and activate Code9 plugin. 50 10. Prevent user to continuous login if user has repeatedly entering wrong username or password. 51 52 == Changelog == 53 54 = 1.0.1 = 55 * Add function anti brute force attack.
Note: See TracChangeset
for help on using the changeset viewer.