Plugin Directory

Changeset 1815669


Ignore:
Timestamp:
02/05/2018 02:30:52 PM (8 years ago)
Author:
osexcel
Message:

Centrora Joomla 7.2.1

Location:
ose-firewall/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • ose-firewall/trunk/assets/views/calltoaction.php

    r1814810 r1815669  
    11<div>
    22    <!--    <div class="panel panel-danger plain toggle" id="jst_4">-->
    3         <!-- Start .panel -->
    4         <div class="panel-body">
    5             <div class="row">
    6                 <div class="subscribe-layer">
    7                     <h2 class="text-center">
    8                         <?php oLang::_('CALL_TO_ACTION_P'); ?><br>
    9                     </h2>
     3    <!-- Start .panel -->
     4    <div class="panel-body" style="padding:0px !important;">
     5        <div class="row">
     6            <div class="subscribe-layer" style="background-image: url('https://cdn.centrora.com/images/2018/01/28/slide122.jpg'); margin-top: -30px !important;padding: 100px 0px 60px 0px;" >
     7                <h2 class="text-center">
     8                    <?php oLang::_('CALL_TO_ACTION_P'); ?><br>
     9                </h2>
     10                <p class="text-center">
     11                    <?php oLang::_('CALL_TO_ACTION_P2'); ?>
     12                </p>
    1013
    11                     <h2 class="text-center">
    12                         <img style="min-width: 300px;"
    13                              src="  <?php echo OSE_FWURL ?>/public/images/premium/subscribe-icons.png">
    14                     </h2>
    15                     <p class="text-center">
    16                         <?php oLang::_('CALL_TO_ACTION_P2'); ?>
    17                     </p>
     14                <h2 class="text-center">
     15                    <button id="subscribe-btn" type="button"
     16                            onClick="location.href='https://www.centrora.com/services'">
     17                        <i class="im-cart6 mr5"></i> <?php oLang::_('SUBSCRIBE_NOW'); ?>
     18                    </button>
     19                </h2>
    1820
    19                     <h2 class="text-center">
    20                         <button id="subscribe-btn" type="button"
    21                                 onClick="location.href='<?php oLang::_('OSE_OEM_URL_SUBSCRIBE'); ?>'">
    22                             <i class="im-cart6 mr5"></i> <?php oLang::_('SUBSCRIBE_NOW'); ?>
    23                         </button>
    24                     </h2>
    25 
    26                     <br>
     21                <br>
     22            </div>
     23            <div id="img-layer">
     24                <div style="margin-top:-18px; margin-left: 18px;">
     25                    <h2><?php echo $this->model->showSubTitle(); ?></h2>
     26                    <p>Detect hacking attacks towards the website, block out suspicious activities and protect the website from malware codes.</p>
    2727                </div>
    28                 <div id="img-layer">
    29                     <div style="margin-top:-18px; margin-left: 18px;">
    30                         <h2><?php echo $this->model->showSubTitle(); ?></h2>
    31                         <p><?php echo $this->model->showSubDesc(); ?></p>
    32                     </div>
    33                     <img style="margin-top: -1px; min-width: 900px;" src="<?php echo $this->model->showSubPic(); ?>"
    34                          alt="Centrora Logo"/>
    35                 </div>
    36                 <div id="content-layer">
    37                     <div>
    38                         <h2 class="text-danger"
    39                             style="text-align: center; font-weight:700; "><?php oLang::_('CALL_TO_ACTION_TITLE2'); ?></h2>
    40                         <?php oLang::_('CALL_TO_ACTION_UL'); ?>
    41                     </div>
    42                 </div>
     28                <img style="margin-top: -1px; min-width: 900px;" src="<?php echo OSE_FWPUBLICURL . "/images/premium/coredic.png"; ?>"
     29                     alt="Centrora Logo"/>
    4330            </div>
    44             <!--            <div class="row">-->
    45             <!--                <p class="text-left">-->
    46             <!--                <h2 class="text-danger">--><?php //oLang::_('CALL_TO_ACTION_TITLE3'); ?><!--</h2>-->
    47             <!--                --><?php //oLang::_('CALL_TO_ACTION_DECS3'); ?><!--<a-->
    48             <!--                    href="--><?php //echo OSE_OEM_URL_PREMIUM_TUT; ?><!--"-->
    49             <!--                    target="_blank">--><?php //oLang::_('O_OUR_TUTORIAL'); ?><!--</a>-->
    50             <!--                --><?php //oLang::_('O_SUBSCRIBE_PLAN'); ?><!--.-->
    51             <!--                </p>-->
    52             <!--            </div>-->
    53             <div class="subcribe-footer">
     31            <div id="content-layer">
    5432                <div>
    55                     <img style="min-width: 150px;"
    56                          src="  <?php echo OSE_FWURL ?>/public/images/premium/logo_footer.png">
    57 
    58                     <div id="border-right"></div>
    59                     <p> <?php oLang::_('CALL_TO_ACTION_DESC2'); ?> </p>
     33                    <h2 class="text-danger"
     34                        style="text-align: center; font-weight:700; "><?php oLang::_('CALL_TO_ACTION_TITLE2'); ?></h2>
     35                    <?php oLang::_('CALL_TO_ACTION_UL'); ?>
    6036                </div>
    6137            </div>
    6238        </div>
     39        <!--            <div class="row">-->
     40        <!--                <p class="text-left">-->
     41        <!--                <h2 class="text-danger">--><?php //oLang::_('CALL_TO_ACTION_TITLE3'); ?><!--</h2>-->
     42        <!--                --><?php //oLang::_('CALL_TO_ACTION_DECS3'); ?><!--<a-->
     43        <!--                    href="--><?php //echo OSE_OEM_URL_PREMIUM_TUT; ?><!--"-->
     44        <!--                    target="_blank">--><?php //oLang::_('O_OUR_TUTORIAL'); ?><!--</a>-->
     45        <!--                --><?php //oLang::_('O_SUBSCRIBE_PLAN'); ?><!--.-->
     46        <!--                </p>-->
     47        <!--            </div>-->
     48        <div class="subcribe-footer">
     49            <div>
     50                <img style="min-width: 150px;"
     51                     src="  <?php echo OSE_FWURL ?>/public/images/premium/logo_footer.png">
     52
     53                <div id="border-right"></div>
     54                <p> <?php oLang::_('CALL_TO_ACTION_DESC2'); ?> </p>
     55            </div>
     56        </div>
     57    </div>
    6358    <!--    </div>-->
    6459</div>
  • ose-firewall/trunk/assets/views/cronjobs.php

    r1814810 r1815669  
    6161                             </div>
    6262                         </div>
    63                         -->
     63                            -->
    6464                          </div>
    6565                     </div>
  • ose-firewall/trunk/assets/views/login.php

    r1814810 r1815669  
    210210                                <div class="panel-heading">
    211211                                    <p>
    212                                         If you don't have an account yet, please use the following form to create an account.
     212                                        If you don't have an account yet, please contact us to open an account.
    213213                                    </p>
    214214                                </div>
    215215                                <div class="panel-body">
    216                                
     216                                    <div class="form-group">
     217                                        <a class="at-banner__button" style="margin-left: 150px;" target="_blank" href="https://www.centrora.com/support">Contact us to open an account</a>
     218                                    </div>
     219                                <!--
    217220                                <form id = 'new-account-form' class="form-horizontal group-border stripped" role="form">
    218221                                    <div class="form-group">
     
    259262                                    </div>
    260263                                </form>
     264                                    -->
    261265                                </div>
    262266                              </div>
     267
    263268                            </div>
    264269
  • ose-firewall/trunk/classes/App/Base.php

    r1814810 r1815669  
    7676    }
    7777    protected function isPremiumViews($view){
    78         $premiumViews = array('vsscan','cfscan','vsreport','cronjobs','bsconfigv7','ipmanagement','bsconfigv7stats','emailnotificationv7');
    79         if(in_array(strtolower($view),$premiumViews)){
    80             return true;
     78        $premiumViews = array('vsscan','cfscan','vsreport','cronjobs','bsconfigv7','ipmanagement','bsconfigv7stats','emailnotificationv7');
     79        if(in_array(strtolower($view),$premiumViews)){
     80            return true;
    8181        }
    8282        return false;
  • ose-firewall/trunk/classes/App/Model/VsscanModel.php

    r1814810 r1815669  
    3939        if ($status == true) {
    4040            oseFirewall::loadJSFile('CentroraManageJQPlot', 'plugins/pie-chart/jquery.flot.custom.js', false);
    41             oseFirewall::loadJSFile ('CentroraManageJQPieChart', 'plugins/pie-chart/jquery.easy-pie-chart.js', false);
    42             oseFirewall::loadJSFile ('CentroraManageIPs', 'vsscan.js', false);
    43         }
     41            oseFirewall::loadJSFile ('CentroraManageJQPieChart', 'plugins/pie-chart/jquery.easy-pie-chart.js', false);
     42            oseFirewall::loadJSFile ('CentroraManageIPs', 'vsscan.js', false);
     43        }
    4444    }
    4545    private function getAVScanScript () {
  • ose-firewall/trunk/classes/Library/fwscannerv7/fwscannerv7.php

    r1814810 r1815669  
    282282            foreach($array as $key=>$value)
    283283            {
    284                if(in_array($key,$acceptedKeys)) {
    285                    //toogle fws v6
    286                    if($key == 1 && $value == 1) { //turn off v6 if v7 is turned on
    287                        oseFirewall::callLibClass('fwscanner', 'fwscanner');
    288                        $fs = new oseFirewallScanner();
    289                        $result_temp = $fs->toggleFirewallScanerV6(1);
    290                        if ($result_temp['status'] == 0) {
    291                            return $result_temp;
    292                        }
    293                        $this->toggleManageWebLogCronJobs(1);
    294                    }
    295                    if($key == 1 && $value == 0)
    296                    {
    297                        $this->toggleManageWebLogCronJobs(0);
    298                    }
    299                        if ($key == 27) {
    300                            if(isset($array[15]) && $array[15] ==0)
    301                            {
    302                                $value = 0;
    303                            }
    304                            if (!oseFirewallBase::isSuite()) {
    305                            if (OSE_CMS == 'joomla') {
    306                                $temp = $this->updateGoogleAuthLoginJoomla($value);
    307                                if ($temp == 0) {
    308                                    $return = $this->prepareErrorMessage("There was some problem in updating the Login Google Authentication in the Joomla Plgin Table");
    309                                    return $return;
    310                                }
    311                            }
    312                            if (OSE_CMS == 'wordpress') {
    313                                $temp = $this->toggleGoogleAuthLoginFromProfile($value);
    314                                if ($temp == 0) {
    315                                    $return = $this->prepareErrorMessage("There was some problem in updating the Login Google Authentication in the Wordpress usermeta Table");
    316                                    return $return;
    317                                }
    318                            }
    319                            $fwscannerv7 = new oseFirewallScannerV7();
    320                            $oldSettings = $fwscannerv7->getFirewallSettingsfromDb();
    321                            $sendemail = false;
    322                            if ($oldSettings['status'] == 1 && $oldSettings['info'][27] == 0) {
    323                                $sendemail = true;
    324                            }
    325                            if ($value == 1 && $sendemail) {
    326                                $this->sendEmailNotification('googleauth', null, false);
    327                            }
    328                        }else{
    329                                //disbale bf google auth for the suite users
    330                                $value=0;
    331                            }
    332                    }
    333                    if(($key == 28 || $key ==29) && oseFirewallBase::isSuite())
    334                    {
    335                        //disable the 2 step authentication for ban page for the suite users
    336                        $value = 0;
    337                    }
     284                if(in_array($key,$acceptedKeys)) {
     285                    //toogle fws v6
     286                    if($key == 1 && $value == 1) { //turn off v6 if v7 is turned on
     287                        oseFirewall::callLibClass('fwscanner', 'fwscanner');
     288                        $fs = new oseFirewallScanner();
     289                        $result_temp = $fs->toggleFirewallScanerV6(1);
     290                        if ($result_temp['status'] == 0) {
     291                            return $result_temp;
     292                        }
     293                        $this->toggleManageWebLogCronJobs(1);
     294                    }
     295                    if($key == 1 && $value == 0)
     296                    {
     297                        $this->toggleManageWebLogCronJobs(0);
     298                    }
     299                    if ($key == 27) {
     300                        if(isset($array[15]) && $array[15] ==0)
     301                        {
     302                            $value = 0;
     303                        }
     304                        if (!oseFirewallBase::isSuite()) {
     305                            if (OSE_CMS == 'joomla') {
     306                                $temp = $this->updateGoogleAuthLoginJoomla($value);
     307                                if ($temp == 0) {
     308                                    $return = $this->prepareErrorMessage("There was some problem in updating the Login Google Authentication in the Joomla Plgin Table");
     309                                    return $return;
     310                                }
     311                            }
     312                            if (OSE_CMS == 'wordpress') {
     313                                $temp = $this->toggleGoogleAuthLoginFromProfile($value);
     314                                if ($temp == 0) {
     315                                    $return = $this->prepareErrorMessage("There was some problem in updating the Login Google Authentication in the Wordpress usermeta Table");
     316                                    return $return;
     317                                }
     318                            }
     319                            $fwscannerv7 = new oseFirewallScannerV7();
     320                            $oldSettings = $fwscannerv7->getFirewallSettingsfromDb();
     321                            $sendemail = false;
     322                            if ($oldSettings['status'] == 1 && $oldSettings['info'][27] == 0) {
     323                                $sendemail = true;
     324                            }
     325                            if ($value == 1 && $sendemail) {
     326                                $this->sendEmailNotification('googleauth', null, false);
     327                            }
     328                        }else{
     329                            //disbale bf google auth for the suite users
     330                            $value=0;
     331                        }
     332                    }
     333                    if(($key == 28 || $key ==29) && oseFirewallBase::isSuite())
     334                    {
     335                        //disable the 2 step authentication for ban page for the suite users
     336                        $value = 0;
     337                    }
    338338                    if($key == 29)
    339339                    {
    340340                        die($value);
    341341                    }
    342                    $result = $this->updateSettings($key, $value);
    343                    if ($result == 0) {
    344                        $return = $this->prepareErrorMessage("There was some problem in updating the id:" . $key . " with value" . $value);
    345                        return $return;
    346                    }
    347                }
     342                    $result = $this->updateSettings($key, $value);
     343                    if ($result == 0) {
     344                        $return = $this->prepareErrorMessage("There was some problem in updating the id:" . $key . " with value" . $value);
     345                        return $return;
     346                    }
     347                }
    348348            }
    349349            if($result == 0)
     
    365365                {
    366366                    //error in updating the local files
    367                  return $resullt_updatefile;
     367                    return $resullt_updatefile;
    368368                }
    369369            }
     
    539539            }
    540540        }
     541        $vararray = array(
     542            'value' => $value,
     543        );
     544        $result = $this->db->addData('update', '#__osefirewall_fwscannerv7Config', 'id', $id, $vararray);
     545        $this->db->closeDBO();
     546        return $result;
     547    }
     548
     549    public function insertSettings($id,$value)
     550    {
     551        if(OSE_CMS == "joomla") {
    541552            $vararray = array(
     553                'id' => $id,
     554                "key" => "secureKey",
    542555                'value' => $value,
     556                "type" => "bruteforce"
    543557            );
    544             $result = $this->db->addData('update', '#__osefirewall_fwscannerv7Config', 'id', $id, $vararray);
     558            $result = $this->db->addData('insert', '#__osefirewall_fwscannerv7Config', '', '', $vararray);
    545559            $this->db->closeDBO();
    546560            return $result;
    547     }
    548 
    549     public function insertSettings($id,$value)
    550     {
    551          if(OSE_CMS == "joomla") {
    552              $vararray = array(
    553                  'id' => $id,
    554                  "key" => "secureKey",
    555                  'value' => $value,
    556                  "type" => "bruteforce"
    557              );
    558              $result = $this->db->addData('insert', '#__osefirewall_fwscannerv7Config', '', '', $vararray);
    559              $this->db->closeDBO();
    560              return $result;
    561          }else{
    562              return true;
    563          }
     561        }else{
     562            return true;
     563        }
    564564    }
    565565
     
    822822            if(array_key_exists('accountpath',$flatarray))
    823823            {
    824              $request_stringsfiltered = true;
     824                $request_stringsfiltered = true;
    825825            }
    826826            if(!$request_stringsfiltered)
    827827            {
    828                //does not have any white list string
    829                unset($request_variablesfiltered);
    830                $request_variablesfiltered = $flatarray;
    831                if(!empty($request_variablesfiltered))
    832                {
    833                    //scan the variables
    834                    $result = array();
    835                    $request_variablesfiltered_decoded = $this->codeArray($request_variablesfiltered,'decode');
    836                    foreach($request_variablesfiltered_decoded as $key=> $rec)
    837                    {
    838 
    839                        $record[$key] = $rec;
    840                        $result = $this->scanRequests($record,$request_variablesfiltered_decoded,$settings);  //$request_stringsfiltered
    841                        unset($record);
    842                        if($result['status'] == 6)
    843                        {
    844                            //if the ip has been blocked
    845                            if($subscription_status == true) {
    846                                $this->showBanPage();
    847                            }
     828                //does not have any white list string
     829                unset($request_variablesfiltered);
     830                $request_variablesfiltered = $flatarray;
     831                if(!empty($request_variablesfiltered))
     832                {
     833                    //scan the variables
     834                    $result = array();
     835                    $request_variablesfiltered_decoded = $this->codeArray($request_variablesfiltered,'decode');
     836                    foreach($request_variablesfiltered_decoded as $key=> $rec)
     837                    {
     838
     839                        $record[$key] = $rec;
     840                        $result = $this->scanRequests($record,$request_variablesfiltered_decoded,$settings);  //$request_stringsfiltered
     841                        unset($record);
     842                        if($result['status'] == 6)
     843                        {
     844                            //if the ip has been blocked
     845                            if($subscription_status == true) {
     846                                $this->showBanPage();
     847                            }
    848848//                           return true;
    849                        }elseif($result['status'] == 4)
    850                        {
    851                            //pattern file not found
    852                            //do not scan the request
    853                            $this->errorLog('scannning request',$result['info']);
    854                            return true;
    855                        }
    856                        else
    857                        {
    858                            //error or non malicious request
    859                            if($result['status'] == 0)
    860                            {
    861                                $this->errorLog('scanning request',$result['info']);
    862                            }
    863                            $subscription_status = oseFirewall::checkSubscriptionStatus(false);
    864                            if($subscription_status == false)
    865                            {
    866                                //free users
     849                        }elseif($result['status'] == 4)
     850                        {
     851                            //pattern file not found
     852                            //do not scan the request
     853                            $this->errorLog('scannning request',$result['info']);
     854                            return true;
     855                        }
     856                        else
     857                        {
     858                            //error or non malicious request
     859                            if($result['status'] == 0)
     860                            {
     861                                $this->errorLog('scanning request',$result['info']);
     862                            }
     863                            $subscription_status = oseFirewall::checkSubscriptionStatus(false);
     864                            if($subscription_status == false)
     865                            {
     866                                //free users
    867867//                               $temp  = $this->getCompleteRequest();
    868868//                               $completereq = $this->getTheOriginalArrayStrucutre($request_variablesfiltered);
    869                                if($this->detected_pentest== false)
    870                                {
    871                                    $temp_completereq = $this->getTheOriginalArrayStrucutre($request_variablesfiltered);
    872                                    $completereq = $this->addWhiteListedVarsBack($temp_completereq);
    873                                    $this->setRequestVariables($completereq,$type);
    874                                }
    875                                else {
    876                                    $temp_completereq = $this->getTheOriginalArrayStrucutre($request_variablesfiltered_decoded);
    877                                    $completereq = $this->addWhiteListedVarsBack($temp_completereq);
    878                                    $this->setRequestVariables($completereq,$type);
    879                                }
    880 
    881                            }
    882                            else
    883                            {
    884                                //PREMIUM USERS
    885                                $temp  = $this->getCompleteRequest();
    886                                if($this->detected_pentest == false)
    887                                {
    888                                    $temp_completereq = $this->getTheOriginalArrayStrucutre($request_variablesfiltered);
    889                                    $completereq = $this->addWhiteListedVarsBack($temp_completereq);
    890                                    $this->setRequestVariables($completereq,$type);
    891                                }else {
    892                                    $temp_completereq = $this->getTheOriginalArrayStrucutre($temp);
    893                                    $completereq = $this->addWhiteListedVarsBack($temp_completereq);
    894                                    $this->setRequestVariables($completereq,$type);
    895                                }
    896                            }
    897 
    898                        }
    899                    }
    900                    unset($this->completerequest);
    901                    unset($this->detected_whitelistedVars);
     869                                if($this->detected_pentest== false)
     870                                {
     871                                    $temp_completereq = $this->getTheOriginalArrayStrucutre($request_variablesfiltered);
     872                                    $completereq = $this->addWhiteListedVarsBack($temp_completereq);
     873                                    $this->setRequestVariables($completereq,$type);
     874                                }
     875                                else {
     876                                    $temp_completereq = $this->getTheOriginalArrayStrucutre($request_variablesfiltered_decoded);
     877                                    $completereq = $this->addWhiteListedVarsBack($temp_completereq);
     878                                    $this->setRequestVariables($completereq,$type);
     879                                }
     880
     881                            }
     882                            else
     883                            {
     884                                //PREMIUM USERS
     885                                $temp  = $this->getCompleteRequest();
     886                                if($this->detected_pentest == false)
     887                                {
     888//                                   $temp_completereq = $this->getTheOriginalArrayStrucutre($request_variablesfiltered);
     889//                                   $completereq = $this->addWhiteListedVarsBack($temp_completereq);
     890                                    $this->setRequestVariables($this->orignal_request_backup,$type);
     891                                }else {
     892                                    $temp_completereq = $this->getTheOriginalArrayStrucutre($temp);
     893                                    $completereq = $this->addWhiteListedVarsBack($temp_completereq);
     894                                    $this->setRequestVariables($completereq,$type);
     895                                }
     896                            }
     897
     898                        }
     899                    }
     900                    unset($this->completerequest);
     901                    unset($this->detected_whitelistedVars);
    902902//                   return $result;
    903                    return false;
    904                }
    905                else
    906                {
    907                  //EMPTY  =>>> the request is empty
    908                  ////continue
    909                  //return true //safe to use
    910                    unset($this->detected_whitelistedVars);
    911                    return true;
    912                }
    913            }
    914            else{
    915                //white list string was detected
    916                unset($this->detected_whitelistedVars);
    917                return true;
    918            }
     903                    return false;
     904                }
     905                else
     906                {
     907                    //EMPTY  =>>> the request is empty
     908                    ////continue
     909                    //return true //safe to use
     910                    unset($this->detected_whitelistedVars);
     911                    return true;
     912                }
     913            }
     914            else{
     915                //white list string was detected
     916                unset($this->detected_whitelistedVars);
     917                return true;
     918            }
    919919        }
    920920        else
     
    10331033                    //no match == clean variables
    10341034                    //continue
    1035                    $result = $this->preapreCustomMessage(5,"No malicious contents were detected in the request ");
     1035                    $result = $this->preapreCustomMessage(5,"No malicious contents were detected in the request ");
    10361036                    $this->setCompleteRequest($key,$record);
    10371037                }
     
    11051105                if(!$result_file)
    11061106                {
    1107                    //error in logging the attack for free users
     1107                    //error in logging the attack for free users
    11081108                    $result['status'] = 0;
    11091109                    $temp[$key] = $cleanrequest;
     
    11271127
    11281128        }else {
    1129                 //IP IS BLANK
    1130                 $result['status'] = 0;
    1131                 $temp[$key] = $cleanrequest;
    1132                 //return the cleaned request
    1133                 $result['request'] = $temp;
    1134                 $result['info'] = 'The Ip is blank';
    1135                 return $result;
    1136             }
     1129            //IP IS BLANK
     1130            $result['status'] = 0;
     1131            $temp[$key] = $cleanrequest;
     1132            //return the cleaned request
     1133            $result['request'] = $temp;
     1134            $result['info'] = 'The Ip is blank';
     1135            return $result;
     1136        }
    11371137
    11381138    }
     
    11881188                    }
    11891189                }
    1190          }
     1190            }
    11911191        }
    11921192        return $return[$par];
     
    14201420        $filepath = OSE_WEBLOGFOLDER.ODS.$ip.ODS.'blocked.php';
    14211421        if(file_exists($filepath))
    1422          {
     1422        {
    14231423            $content = $this->getAttackFilecontent($ip);
    1424              $temp_attempst_latestrecord =end($content);
     1424            $temp_attempst_latestrecord =end($content);
    14251425            return $temp_attempst_latestrecord['attempt'];
    1426          }else {
     1426        }else {
    14271427            return 0;
    14281428        }
     
    22142214                        }
    22152215                    }
    2216                         //update the blocked record in ip management table as well
     2216                    //update the blocked record in ip management table as well
    22172217                    $subscription_status = oseFirewall::checkSubscriptionStatus(false);
    22182218                    if($subscription_status)
     
    23462346    public function bruteForceProtection($authUser)
    23472347    {
    2348             //get brute force configurations
    2349             $settings = $this->getCompleteFirewallSettingsFromDb();
    2350             $maxfail = $settings['info'][25];
    2351             $timeFrame = $settings['info'][26];
    2352             $userip = $this->ip;
    2353             //check for the user
    2354             $timestamp = $this->getCurrentTimeStamp();
    2355             $this->recordLoginAttempts($userip,$authUser,$timestamp,$maxfail,$timeFrame);
     2348        //get brute force configurations
     2349        $settings = $this->getCompleteFirewallSettingsFromDb();
     2350        $maxfail = $settings['info'][25];
     2351        $timeFrame = $settings['info'][26];
     2352        $userip = $this->ip;
     2353        //check for the user
     2354        $timestamp = $this->getCurrentTimeStamp();
     2355        $this->recordLoginAttempts($userip,$authUser,$timestamp,$maxfail,$timeFrame);
    23562356    }
    23572357
     
    23832383    {
    23842384        $date = new DateTime();
    2385         $current_timestamp = $date->getTimestamp();
     2385        $current_timestamp = $date->getTimestamp();
    23862386        foreach($contents as $content)
    23872387        {
     
    25912591            //not in the time frame the, count of attempts does not matter
    25922592            // so reset the count of attacks
    2593          return false;
     2593            return false;
    25942594        }
    25952595    }
     
    26202620    }
    26212621
    2622         ///FILE UPLOAD
     2622    ///FILE UPLOAD
    26232623    public function scanUploadFiles()
    26242624    {
     
    28012801                else {
    28022802                    $this->errorLog("Inconsistent File Type", 'The tmp_name variable is empty');
    2803                         return true;
     2803                    return true;
    28042804                }
    28052805            }
     
    30703070    {
    30713071        $pattern = array();
    3072             if(!empty($settings[22]) && $settings[22] == 1)
    3073             {
    3074                 array_push($pattern,'googlebot');
    3075             }
    3076             if(!empty($settings[23]) && $settings[23] == 1)
    3077             {
    3078                 array_push($pattern,'yahoobot');
    3079             }
    3080             if(!empty($settings[24]) && $settings[24] == 1)
    3081             {
    3082                 array_push($pattern,'msnbot');
    3083             }
     3072        if(!empty($settings[22]) && $settings[22] == 1)
     3073        {
     3074            array_push($pattern,'googlebot');
     3075        }
     3076        if(!empty($settings[23]) && $settings[23] == 1)
     3077        {
     3078            array_push($pattern,'yahoobot');
     3079        }
     3080        if(!empty($settings[24]) && $settings[24] == 1)
     3081        {
     3082            array_push($pattern,'msnbot');
     3083        }
    30843084        if(!empty($pattern))
    30853085        {
     
    31043104            if(preg_match($pattern,$element,$matches))
    31053105            {
    3106                $allowedbots[$i] = $matches[0];
     3106                $allowedbots[$i] = $matches[0];
    31073107                $i ++;
    31083108            }
     
    31673167            }
    31683168            $result = $this->isAllowedBot($allowedbotPattern);
    3169         if($result['status'] == 1)
    3170         {
    3171             //bot was detecetd
    3172             return true;
    3173         }
    3174         else
    3175         {
    3176             //bot is not selected
    3177             return false;
    3178         }
     3169            if($result['status'] == 1)
     3170            {
     3171                //bot was detecetd
     3172                return true;
     3173            }
     3174            else
     3175            {
     3176                //bot is not selected
     3177                return false;
     3178            }
    31793179        }
    31803180    }
     
    32383238    {
    32393239        $temp = array(
     3240            'ip' => $this->ip,
     3241            'methodname' =>$methodname,
     3242            'message' => $message,
     3243            'datetime' => date('Y-m-d h:i:s'),
     3244        );
     3245        return $temp;
     3246    }
     3247    public function formatContentErrorLog($methodname, $message)
     3248    {
     3249        $temp = array(
     3250            array(
    32403251                'ip' => $this->ip,
    32413252                'methodname' =>$methodname,
    32423253                'message' => $message,
    32433254                'datetime' => date('Y-m-d h:i:s'),
     3255            ),
    32443256        );
    3245         return $temp;
    3246     }
    3247     public function formatContentErrorLog($methodname, $message)
    3248     {
    3249         $temp = array(
    3250             array(
    3251             'ip' => $this->ip,
    3252             'methodname' =>$methodname,
    3253             'message' => $message,
    3254             'datetime' => date('Y-m-d h:i:s'),
    3255         ),
    3256     );
    32573257        return $temp;
    32583258    }
     
    32943294        $this->loadLibrary();
    32953295        //check the country status
    3296          $countryblock_reesult= $this->checkCountryStatus_v7();
     3296        $countryblock_reesult= $this->checkCountryStatus_v7();
    32973297        if($countryblock_reesult == true)
    32983298        {
     
    34713471        if(empty($temp_domain))
    34723472        {
    3473          $domain =OSE_BANPAGE_ADMIN;
     3473            $domain =OSE_BANPAGE_ADMIN;
    34743474        }else{
    34753475            $http = ($temp_domain['protocol']==1)?"https":"http";
     
    37233723    public function saveBanPageSettings($data)
    37243724    {
    3725       $validate =  $this->validateBanPageInput($data[32],$data[31]);
    3726       if($validate['status'] == 1)
    3727       {
    3728          if($data[30] ==1 )
    3729          {
    3730              $result1 = $this->updateSettings(30,$data[30]);
    3731              if($result1 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 30");
    3732              $result2 = $this->updateSettings(31,$data[31]);
    3733              if($result2 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 31");
    3734              $result3 =$this->updateSettings(32,$data[32]);
    3735              if($result3 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 32");
    3736 
    3737          }else {
    3738              $result1 = $this->updateSettings(30,$data[30]);
    3739              if($result1 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 30");
    3740          }
    3741              $result4 = $this->updateSettings(28, $data[28]);
    3742              if ($result4 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 28");
    3743              $result5 = $this->updateSettings(29, $data[29]);
    3744              if ($result5 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 29");
     3725        $validate =  $this->validateBanPageInput($data[32],$data[31]);
     3726        if($validate['status'] == 1)
     3727        {
     3728            if($data[30] ==1 )
     3729            {
     3730                $result1 = $this->updateSettings(30,$data[30]);
     3731                if($result1 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 30");
     3732                $result2 = $this->updateSettings(31,$data[31]);
     3733                if($result2 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 31");
     3734                $result3 =$this->updateSettings(32,$data[32]);
     3735                if($result3 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 32");
     3736
     3737            }else {
     3738                $result1 = $this->updateSettings(30,$data[30]);
     3739                if($result1 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 30");
     3740            }
     3741            $result4 = $this->updateSettings(28, $data[28]);
     3742            if ($result4 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 28");
     3743            $result5 = $this->updateSettings(29, $data[29]);
     3744            if ($result5 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 29");
    37453745            if(OSE_CMS == "joomla" && (!oseFirewallBase::isSuite()))
    37463746            {
    37473747                $validateSecureKey = $this->validateSecureKey($data[34]);
    37483748                if($validateSecureKey['status']==0)
    3749                  {
    3750                      return $validateSecureKey;
    3751                  }else{
     3749                {
     3750                    return $validateSecureKey;
     3751                }else{
    37523752                    if(!$this->secureKeyRecordExists())
    37533753                    {
    3754                        $result6 = $this->insertSettings(34,$data[34]);
     3754                        $result6 = $this->insertSettings(34,$data[34]);
    37553755                    }else{
    37563756                        $result6 = $this->updateSettings(34, $data[34]);
    37573757
    37583758                    }
    3759                      if ($result6 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 33");
    3760                  }
     3759                    if ($result6 == 0) return $this->prepareErrorMessage("There was a problem in updating the ban page settings for id 33");
     3760                }
    37613761            }else{
    3762                  $this->updateSettings(34,0);
    3763             }
    3764           return $this->prepareSuccessMessage("The settings have been saved successfully");
    3765      }else {
    3766          return $validate;
    3767      }
     3762                $this->updateSettings(34,0);
     3763            }
     3764            return $this->prepareSuccessMessage("The settings have been saved successfully");
     3765        }else {
     3766            return $validate;
     3767        }
    37683768    }
    37693769
     
    37843784    {
    37853785        if(!empty($secureKey)){
    3786         $pattern = "/^[a-zA-Z\d]+$/";
    3787         if (!preg_match($pattern, $secureKey)) {
    3788             return oseFirewallBase::prepareErrorMessage('Backend Access Secure Key can only contain numbers, letters');
    3789         } else{
    3790             return oseFirewallBase::prepareSuccessMessage("Valida Access Secure Key");
    3791         }
     3786            $pattern = "/^[a-zA-Z\d]+$/";
     3787            if (!preg_match($pattern, $secureKey)) {
     3788                return oseFirewallBase::prepareErrorMessage('Backend Access Secure Key can only contain numbers, letters');
     3789            } else{
     3790                return oseFirewallBase::prepareSuccessMessage("Valida Access Secure Key");
     3791            }
    37923792        }else{
    37933793            return oseFirewallBase::prepareSuccessMessage("Valida Access Secure Key");
     
    39713971            }
    39723972        }else if(OSE_CMS == 'joomla')
    3973          {
     3973        {
    39743974            $query = "SELECT `enabled` FROM `#__extensions` WHERE `name` = 'plg_twofactorauth_totp' AND `folder` = 'twofactorauth'";
    39753975            $this->db->setQuery($query);
     
    40074007            if($result == 0)
    40084008            {
    4009              return $this->prepareErrorMessage('There was some problem in turning the Firewall Scanner V7 ON');
     4009                return $this->prepareErrorMessage('There was some problem in turning the Firewall Scanner V7 ON');
    40104010            }else {
    40114011                return $this->prepareSuccessMessage('The Firewall Scanner V7 has been Turned ON');
    40124012            }
    40134013        }else {
    4014            $result =  $this->updateSettings(1,0);
     4014            $result =  $this->updateSettings(1,0);
    40154015            if($result == 0)
    40164016            {
     
    40294029        if($value == 1)
    40304030        {
    4031          $fs7 = $this->toggleFirewallScannerV7(1);
    4032          if($fs7['status'] == 1)
    4033          {
    4034            $fs6 = $fs->toggleFirewallScanerV6(1);
    4035              if($fs6['status'] == 1)
    4036              {
    4037                  $result = $this->prepareSuccessMessage('Firewall Scanner V7 has been activated Successfully');
    4038                  if(OSE_CMS =='wordpress')
    4039                  {
    4040                      $result['url'] = '?page=ose_fw_bsconfigv7';
    4041                  }else {
    4042                      $result['url'] = '?option=com_ose_firewall&view=bsconfigv7';
    4043                  }
    4044                  return $result;
    4045              }
    4046          }else {
    4047              //error in turning on the firewall scanner v7
    4048              return $fs7;
    4049          }
     4031            $fs7 = $this->toggleFirewallScannerV7(1);
     4032            if($fs7['status'] == 1)
     4033            {
     4034                $fs6 = $fs->toggleFirewallScanerV6(1);
     4035                if($fs6['status'] == 1)
     4036                {
     4037                    $result = $this->prepareSuccessMessage('Firewall Scanner V7 has been activated Successfully');
     4038                    if(OSE_CMS =='wordpress')
     4039                    {
     4040                        $result['url'] = '?page=ose_fw_bsconfigv7';
     4041                    }else {
     4042                        $result['url'] = '?option=com_ose_firewall&view=bsconfigv7';
     4043                    }
     4044                    return $result;
     4045                }
     4046            }else {
     4047                //error in turning on the firewall scanner v7
     4048                return $fs7;
     4049            }
    40504050
    40514051        }else {
  • ose-firewall/trunk/classes/Library/oseFirewallJoomla.php

    r1814810 r1815669  
    122122        $menu .= '><a href="index.php?option=' . $extension . '&view=cfscan">' . oLang::_get('CORE_SCAN') . '</a></li>';
    123123
     124        /*
    124125        $menu .= '<li ';
    125126        $menu .= ($view == 'mfscan') ? 'class="active"' : '';
    126127        $menu .= '><a href="index.php?option=' . $extension . '&view=mfscan">' . oLang::_get('MF_SCAN') . '</a></li>';
     128        */
    127129
    128130        $menu .= '<li ';
     
    142144        $menu .= '</li>';
    143145
     146        //Modified File Scanner
     147        $menu .= '<li ';
     148        $menu .= (in_array($view, array('mfscan'))) ? 'class="active dropdown"' : 'class="dropdown"';
     149        $menu .= '><a href="index.php?option=' . $extension . '&view=mfscan" class="dropdown-toggle">';
     150        $menu .= '<img src=' . OSE_FWPUBLICURL . '/images/topbar/icon_t.png>';
     151        $menu .= oLang::_get('MF_SCAN') . '</a>';
     152        // SubMenu Anti-Hacking Starts;
     153        $menu .= '<ul class="dropdown-menu">';
     154        $menu .= '<li ';
     155        $menu .= ($view == 'mfscan') ? 'class="active"' : '';
     156        $menu .= '><a href="index.php?option=' . $extension . '&view=mfscan">' . oLang::_get('MF_SCAN') . '</a></li>';
     157        $menu .= '</ul>';
     158        $menu .= '</li>';
     159
    144160        //Backup menu starts
     161        /*
    145162        $menu .= '<li ';
    146163        $menu .= (in_array($view, array('backup', 'advancedbackup', 'authentication', 'gitbackup'))) ? 'class="dropdown"' : 'class="dropdown"';
     
    165182        // SubMenu Anti-Hacking Ends;
    166183        $menu .= '</li>';
    167 
     184*/
    168185        if(oseFirewallBase::isSuite()) {
    169186            if (oseFirewallBase::isFirewallV7Active()) {
     
    199216        $menu .= '<li onclick="enableV7()" ';
    200217        $menu .= ($view == 'ose_fw_bsconfigv7') ? 'class=""' : '';
    201         $menu .= '><a href="index.php?option=' . $extension . '&view=bsconfigv7">' . 'Enable Firewall Scanner V7.0 <sup>(Beta)</sup>' . '</a></li>';
    202 
    203 
    204         $menu .= '<li onclick="enableV6()"';
    205         $menu .= ($view == 'ose_fw_bsconfigv7') ? 'class=""' : '';
    206         $menu .= '><a href="index.php?option=' . $extension . '&view=bsconfigv7">' . 'Enable Firewall Scanner  V6.6 <sup>(Stable)</sup>'. '</a>';
     218        $menu .= '><a href="index.php?option=' . $extension . '&view=bsconfigv7">' . 'Enable Firewall Scanner V7.0 <sup></sup>' . '</a></li>';
     219
     220
     221        //$menu .= '<li onclick="enableV6()"';
     222        //$menu .= ($view == 'ose_fw_bsconfigv7') ? 'class=""' : '';
     223        //$menu .= '><a href="index.php?option=' . $extension . '&view=bsconfigv7">' . 'Enable Firewall Scanner  V6.6 <sup>(Stable)</sup>'. '</a>';
    207224        $menu .= '</div>';
    208225
     
    212229        $menu .= '<li ';
    213230        $menu .= ($view == 'ose_fw_bsconfigv7') ? 'class=""' : '';
    214         $menu .= '><a href="index.php?option=' . $extension . '&view=bsconfigv7">'  . 'Firewall Scanner V7.0 <sup>(Beta)</sup>' . '</a></li>';
    215 
    216 
    217         $menu .= '<li id="nav-to-v6"';
    218         $menu .= ($view == 'ose_fw_bsconfigv7') ? 'class=""' : '';
    219         $menu .= '><a href="#" >' . '<b>Switch to Firewall Version 6.6 <sup>(Stable)</sup></b>'. '</a>';
     231        $menu .= '><a href="index.php?option=' . $extension . '&view=bsconfigv7">'  . 'Firewall Scanner V7.0 <sup></sup>' . '</a></li>';
     232
     233
     234        //$menu .= '<li id="nav-to-v6"';
     235        //$menu .= ($view == 'ose_fw_bsconfigv7') ? 'class=""' : '';
     236        //$menu .= '><a href="#" >' . '<b>Switch to Firewall Version 6.6 <sup>(Stable)</sup></b>'. '</a>';
    220237        $menu .= '</div>';
    221238
     
    226243        $menu .= '<li id="nav-to-v7" ';
    227244        $menu .= ($view == 'ose_fw_bsconfigv7') ? 'class=""' : '';
    228         $menu .= '><a href="#">' . '<b>Enable Firewall V7.0 <sup>(Beta)</b></sup>' . '</a></li>';
     245        $menu .= '><a href="#">' . '<b>Enable Firewall V7.0 <sup></b></sup>' . '</a></li>';
    229246
    230247        //OLD FIREWALL VIEW FOR VERSION 7
     
    447464    <div class="at-banner__text">
    448465
    449     <b>Suffering from website malware and server security issues ?</b><br>
    450     We have a complete hosting solution which includes :<br>
    451     advanced <b>Centrora Security Solutions</b>, <br>
    452     and <b>High Performance</b> hosting services at <b>Affordable Prices</b>.
     466    <b>Need Enterprise Security Services?</b>.
    453467    </div>
    454     <a class="at-banner__button" target="_blank" href="https://centrora.com/services#suite">VPS - only $28.6/m</a>
    455     <a class="at-banner__button" style="margin-left: 20px;" target="_blank" href="https://centrora.com/services/hosting-services-pricing">Dedicated Servers</a>
     468    <a class="at-banner__button" target="_blank" href="https://www.centrora.com/services">Our Service</a>
     469    <a class="at-banner__button" style="margin-left: 20px;" target="_blank" href="https://www.centrora.com/support">Contact Us Now</a>
    456470  </div>
    457471</div>';
  • ose-firewall/trunk/classes/Library/oseFirewallWordpress.php

    r1814810 r1815669  
    134134        //Modified File Scanner
    135135        $menu .= '<li ';
    136         $menu .= (in_array($view, array('mfsacn'))) ? 'class="active dropdown"' : 'class="dropdown"';
    137         $menu .= '><a href="admin.php?page=ose_fw_mfsacn" class="dropdown-toggle">';
     136        $menu .= (in_array($view, array('mfscan'))) ? 'class="active dropdown"' : 'class="dropdown"';
     137        $menu .= '><a href="admin.php?page=ose_fw_mfscan" class="dropdown-toggle">';
    138138        $menu .= '<img src=' . OSE_FWPUBLICURL . '/images/topbar/icon_t.png>';
    139139        $menu .= oLang::_get('MF_SCAN') . '</a>';
     
    141141        $menu .= '<ul class="dropdown-menu">';
    142142        $menu .= '<li ';
    143         $menu .= ($view == 'mfsacn') ? 'class="active"' : '';
    144         $menu .= '><a href="admin.php?page=ose_fw_mfsacn">' . oLang::_get('MF_SCAN') . '</a></li>';
     143        $menu .= ($view == 'mfscan') ? 'class="active"' : '';
     144        $menu .= '><a href="admin.php?page=ose_fw_mfscan">' . oLang::_get('MF_SCAN') . '</a></li>';
    145145        $menu .= '</ul>';
    146146        $menu .= '</li>';
     
    433433        add_submenu_page('ose_fw_configuration', VARIABLES, VARIABLES, $permission, 'ose_fw_variables', 'oseFirewall::variables');
    434434        add_submenu_page('ose_fw_configuration', INSTALLATION, INSTALLATION, $permission, 'ose_fw_configuration', 'oseFirewall::configuration');
    435         add_submenu_page('ose_firewall', BACKUP, BACKUP, $permission, 'ose_fw_backup', 'oseFirewall::backup');
    436         add_submenu_page('ose_firewall', GITBACKUP, GITBACKUP, $permission, 'ose_fw_gitbackup', 'oseFirewall::gitbackup');//suraj
     435        //add_submenu_page('ose_firewall', BACKUP, BACKUP, $permission, 'ose_fw_backup', 'oseFirewall::backup');
     436        //add_submenu_page('ose_firewall', GITBACKUP, GITBACKUP, $permission, 'ose_fw_gitbackup', 'oseFirewall::gitbackup');//suraj
    437437
    438438        //firewall scanner v7
     
    449449
    450450        add_submenu_page('ose_fw_configuration', AUTHENTICATION, AUTHENTICATION, $permission, 'ose_fw_authentication', 'oseFirewall::authentication');
    451         add_submenu_page('ose_fw_configuration', ADVANCEDBACKUP, ADVANCEDBACKUP, $permission, 'ose_fw_advancedbackup', 'oseFirewall::advancedbackup');
     451        //add_submenu_page('ose_fw_configuration', ADVANCEDBACKUP, ADVANCEDBACKUP, $permission, 'ose_fw_advancedbackup', 'oseFirewall::advancedbackup');
    452452        add_submenu_page('ose_firewall', PERMCONFIG, PERMCONFIG, $permission, 'ose_fw_permconfig', 'oseFirewall::permconfig');
    453453        add_submenu_page('ose_fw_configuration', ADMINEMAILS, ADMINEMAILS, $permission, 'ose_fw_adminemails', 'oseFirewall::adminemails');
  • ose-firewall/trunk/ose_firewall_badge.php

    r1814810 r1815669  
    44   Description: Plugin For Showing Centrora Security Badge
    55   Author: Centrora Security
    6    Version: 7.2.0
     6   Version: 7.2.1
    77*/
    88include(dirname(__FILE__).'/includes/oseBadgeWidget.php');
  • ose-firewall/trunk/ose_wordpress_firewall.php

    r1814810 r1815669  
    55Description: Centrora Security (previously OSE Firewall) - A WordPress Security Firewall plugin created by Centrora. Protect your WordPress site by identify any malicious codes, spam, virus, SQL injection, and security vulnerabilities.
    66Author: Centrora (Previously ProWeb)
    7 Version: 7.2.0
     7Version: 7.2.1
    88Author URI: http://www.centrora.com/
    99*/
Note: See TracChangeset for help on using the changeset viewer.