!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/wincloud_gateway/checking/   drwxr-xr-x
Free 13.02 GB of 57.97 GB (22.46%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     rateLimit.js (2.28 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
'use strict';

// const redis = require("redis");
var { client } = require('./redisClient');
// const bluebird = require("bluebird");

// bluebird.promisifyAll(redis.RedisClient.prototype);
// bluebird.promisifyAll(redis.Multi.prototype);
///balance check start

module.exports = {

getLimit:async function (user_id,rate_limit) {
    // Rate limit start  
let st_time = new Date().toISOString(); //interval start time
// console.log(st_time);
let e_dt= new Date();
e_dt.setMinutes( e_dt.getMinutes() + 1 ); 
var end_date=e_dt.toISOString(); //interval end time

        return new Promise((resolve, reject) => {

          return  client.exists(user_id, function(err, reply) {
      if (reply === 1) {

          client.hgetall(user_id, function(err, object) {

            let p_hits=parseInt(object.hits, 10);
            let e_date=object.end_time; //interval end time
            // console.log(e_date);
            var new_t=object.start_time;
            var c_date= new Date (); 

                // console.log(check_e_date);
                if(Date.parse(e_date)>Date.parse(c_date) && p_hits===parseInt(rate_limit, 10) )
                // when limit exceed for given interval
                {
                  console.log("cross");
                  resolve("exceed");
                }
                else
                {
                  
                    if( Date.parse(c_date) >Date.parse(e_date))
                    // first hit in a given interval
                    {                  
                       client.hmset(user_id, { start_time: c_date, end_time: end_date,hits:1 });
                      resolve(user_id);
                    }
                    else
                  // when limit not exceed for given interval
                    {
                      var hits= parseInt(p_hits, 10);
                      client.hmset(user_id, {hits:hits+1 });
                      resolve(user_id);
                    }
                        
                }
            });
      } else {      
        // first hit if user not exist
        // console.log("first");
           client.hmset(user_id, { start_time: st_time, end_time: end_date,hits:1 });
 
          resolve(user_id);
      }
  });
});
}

// end rate limit 
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.033 ]--