Plugin Directory

Changeset 1032393


Ignore:
Timestamp:
11/25/2014 08:23:03 AM (11 years ago)
Author:
seraum
Message:

Add an obfuscation depth parameter. Tested on Wordpress v4.0.1.

Location:
wp-obfuscator/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wp-obfuscator/trunk/README.txt

    r1028213 r1032393  
    33Tags: Security, obfuscation, wp-config.php
    44Requires at least: 3.5
    5 Tested up to: 4.0
    6 Stable tag: 0.3
     5Tested up to: 4.0.1
     6Stable tag: 0.4
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2323
    2424== Changelog ==
     25version 0.4 :
     26Add an obfuscation depth parameter. Tested on Wordpress v4.0.1
     27
    2528version 0.3 :
    2629Change Seraum_Obf lib with a free non-obfuscated lib
  • wp-obfuscator/trunk/files/class/seraum_obf.php

    r1028213 r1032393  
    1010{
    1111    var $dic = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_/ ,.:!'=+;";
    12     function doIt($c){$it = rand(2, 4);for($i = 0; $i < $it; $i++){ $c = $this->h($c);}return $c;}
     12    function doIt($c, $it){for($i = 0; $i < $it; $i++){ $c = $this->h($c);}return $c;}
    1313    function h($c)
    1414    {
  • wp-obfuscator/trunk/wpobfuscator.php

    r1028213 r1032393  
    1212{
    1313    add_option("wpo_state", "0");
     14    add_option("wpo_depth", "1");
    1415    $c = base64_encode(wpo_get_config());
    1516    add_option("wpo_config", $c);
     
    2526    $p = ABSPATH . 'wp-config.php';
    2627    $c = wpo_get_config();
     28    $it = get_option('wpo_depth');
    2729    $sobf = new Free_Obfusc();
    28     $o =  $sobf->doIt($c); 
     30    $o =  $sobf->doIt($c, $it);
    2931    file_put_contents($p, $o);
    3032    ob_clean();
     
    4345            delete_option('wpo_state');
    4446            delete_option("wpo_config");
     47            delete_option("wpo_depth");
    4548        }
    4649        ob_clean();
     
    7780    ?>
    7881    <div class="wrap">
    79      <form method="post" action="options.php">
    80             <?php settings_fields('wpo_settings'); ?>
     82     
     83           
    8184            <?php $state = get_option('wpo_state'); ?>
     85            <?php $wpo_depth = get_option('wpo_depth'); ?>
    8286            <?php
    8387                $code = file_get_contents(ABSPATH . "wp-config.php");
     
    99103            ?>
    100104            <p><b style="color:<?php echo $color; ?>;"><?php _e($msg); ?></b></p>
     105            <div style="display:inline-block"><?php _e("Obfuscation depth :"); ?></div>
     106            <form style="display:inline-block" method="post" action="options.php">
     107            <?php settings_fields('wpo_settings'); ?>
     108            <input type="hidden" name="wpo_state" value="<?php if($state) echo 0; else echo 1; ?>">
     109            <select style="display:inline-block" name="wpo_depth">
     110                <option value="1" <?php if ( $wpo_depth == 1 ) echo 'selected="selected"'; ?>>1</option>
     111                <option value="2" <?php if ( $wpo_depth == 2 ) echo 'selected="selected"'; ?>>2</option>
     112                <option value="3" <?php if ( $wpo_depth == 3 ) echo 'selected="selected"'; ?>>3</option>
     113                <option value="4" <?php if ( $wpo_depth == 4 ) echo 'selected="selected"'; ?>>4</option>
     114                <option value="5" <?php if ( $wpo_depth == 5 ) echo 'selected="selected"'; ?>>5</option>
     115            </select>
     116             <p style="display:inline-block" class="submit">
     117                <input style="display:inline-block" type="submit" class="button-primary" value="<?php _e("Save") ?>" />
     118            </p>
     119            </form>
     120           
     121            <form method="post" action="options.php">
     122            <?php settings_fields('wpo_settings'); ?>
    101123            <input type="hidden" name="wpo_state" value="<?php echo $state; ?>">
     124            <input type="hidden" name="wpo_depth" value="<?php echo $wpo_depth; ?>">
    102125            <p class="submit">
    103126                <input type="submit" class="button-primary" value="<?php _e($action) ?>" />
     
    113136function wpo_register()
    114137{
    115   register_setting( 'wpo_settings', 'wpo_state',  'wpo_clean');
     138    register_setting( 'wpo_settings', 'wpo_depth',  'wpo_cleandepth');
     139    register_setting( 'wpo_settings', 'wpo_state',  'wpo_clean');
     140 
    116141}
    117142function wpo_clean( $input )
     
    130155        }
    131156    }
     157    return $input;
     158}
     159function wpo_cleandepth( $input )
     160{
     161    if(!is_numeric($input)) $input = 1;
     162    else if($input < 0 || $input > 5) $input = 1;
    132163    return $input;
    133164}
Note: See TracChangeset for help on using the changeset viewer.