!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache/2.2.8 (Ubuntu) PHP/5.2.4-2ubuntu5.12 with Suhosin-Patch mod_ssl/2.2.8 OpenSSL/0.9.8g. PHP/5.2.4-2ubuntu5.12 

uname -a: Linux forum.circlefusion.com 2.6.24-19-server #1 SMP Wed Jun 18 15:18:00 UTC 2008 i686 

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

Safe-mode: OFF (not secure)

/usr/share/denyhosts/DenyHosts/   drwxr-xr-x
Free 11.6 GB of 97.11 GB (11.95%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     purgecounter.py (1.91 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |

from counter import Counter, CounterRecord

import constants
import os

try:
    set = set
except:
    from sets import Set
    set = Set

import logging

error = logging.getLogger("purgecounter").error
info = logging.getLogger("purgecounter").info
    
class PurgeCounter:
    def __init__(self, prefs):
        self.filename = os.path.join(prefs['WORK_DIR'],
                                     constants.PURGE_HISTORY)
        self.purge_threshold = prefs['PURGE_THRESHOLD']

        
    def get_banned_for_life(self):
        banned = set()
        if self.purge_threshold == 0:
            return banned
        
        try:
            fp = open(self.filename, "r")
        except:
            return banned

        for line in fp:
            try:
                host, count, timestamp = line.strip().split(':', 2)
            except:
                continue

            if int(count) > self.purge_threshold:
                banned.add(host)
            
        fp.close()
        return banned


    def get_data(self):        
        counter = Counter()
        try:
            fp = open(self.filename, "r")
        except:
            return counter

        for line in fp:
            try:
                host, count, timestamp = line.strip().split(':', 2)
            except:
                continue
            counter[host] = CounterRecord(int(count), timestamp)
            
        fp.close()
        return counter


    def write_data(self, data):
        try:
            fp = open(self.filename, "w")
        except Exception, e:
            error("error saving %s: %s", self.filename, str(e))

        keys = data.keys()
        keys.sort()

        for key in keys:
            fp.write("%s:%s\n" % (key, data[key]))
        fp.close()
        

    def increment(self, purged_hosts):
        data = self.get_data()
        
        for host in purged_hosts:
            data[host] += 1
        self.write_data(data)

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

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

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

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0056 ]--