OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python27
/
lib
/
python2.7
/
site-packages
/
postomaat
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
01/08/2025 10:42:48 AM
rwxr-xr-x
📄
__init__.py
712 bytes
03/16/2023 02:20:00 PM
rw-r--r--
📄
__init__.pyc
309 bytes
12/18/2024 09:49:00 AM
rw-r--r--
📄
addrcheck.py
4.1 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
addrcheck.pyc
5.29 KB
12/18/2024 09:49:00 AM
rw-r--r--
📁
bin
-
12/18/2024 09:49:00 AM
rwxr-xr-x
📄
checkLogfileConfig.py
4.76 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
checkLogfileConfig.pyc
3.28 KB
12/18/2024 09:49:00 AM
rw-r--r--
📁
conf
-
12/18/2024 09:49:00 AM
rwxr-xr-x
📄
core.py
27.75 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
core.pyc
23.77 KB
12/18/2024 09:49:00 AM
rw-r--r--
📄
daemon.py
5.05 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
daemon.pyc
4.73 KB
12/18/2024 09:49:00 AM
rw-r--r--
📁
extensions
-
12/18/2024 09:49:00 AM
rwxr-xr-x
📄
funkyconsole.py
2.24 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
funkyconsole.pyc
2.12 KB
12/18/2024 09:49:00 AM
rw-r--r--
📄
logtools.py
12.22 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
logtools.pyc
11.35 KB
12/18/2024 09:49:00 AM
rw-r--r--
📁
plugins
-
12/18/2024 09:49:00 AM
rwxr-xr-x
📄
procpool.py
10.58 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
procpool.pyc
9.79 KB
12/18/2024 09:49:00 AM
rw-r--r--
📄
scansession.py
11.69 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
scansession.pyc
12.12 KB
12/18/2024 09:49:00 AM
rw-r--r--
📄
service.py
14.48 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
service.pyc
11.49 KB
12/18/2024 09:49:00 AM
rw-r--r--
📄
shared.py
21.93 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
shared.pyc
24.04 KB
12/18/2024 09:49:00 AM
rw-r--r--
📄
stats.py
7.29 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
stats.pyc
7.55 KB
12/18/2024 09:49:00 AM
rw-r--r--
📄
stringencode.py
13.49 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
stringencode.pyc
10.66 KB
12/18/2024 09:49:00 AM
rw-r--r--
📄
threadpool.py
8.92 KB
03/16/2023 02:20:00 PM
rw-r--r--
📄
threadpool.pyc
8.19 KB
12/18/2024 09:49:00 AM
rw-r--r--
📁
utils
-
12/18/2024 09:49:00 AM
rwxr-xr-x
📄
workaround.py
935 bytes
03/16/2023 02:20:00 PM
rw-r--r--
📄
workaround.pyc
667 bytes
12/18/2024 09:49:00 AM
rw-r--r--
Editing: checkLogfileConfig.py
Close
# -*- coding: utf-8 -*- # Copyright 2012-2018 Oli Schacher # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # import optparse import sys try: import ConfigParser except ImportError: import configparser as ConfigParser import os def checkLogfileConfig(configfile): """ Checks Logfile configuration in file as used by logging.config.fileConfig Using the fileConfig options produces error messages which can not be seen if a service is started. However in test mode the loggers are not active. configfile name and path of logging configuration file return true for no error """ if not os.path.exists(configfile): print("Config file not found!") print("Filename: "+str(configfile)) print("") parser.print_help() return False logconfig=ConfigParser.ConfigParser() logconfig.readfp(open(configfile)) # get list of sections sectionList = logconfig.sections() if logconfig.has_section("handler_logfile"): if logconfig.has_option('handler_logfile', 'class'): logfileClass=logconfig.get('handler_logfile','class') if logfileClass=="handlers.TimedRotatingFileHandler": if logconfig.has_option('handler_logfile', 'args'): logfileArgs=logconfig.get('handler_logfile','args') logfileArgs= logfileArgs.replace("(","").replace(")","") logfileArgs= logfileArgs.replace("'","").replace('"',"") logfileArgsList = logfileArgs.split(",") if (len(logfileArgsList) > 0 ): firstArg = logfileArgsList[0] else: firstArg = logfileArgs if firstArg.strip(): try: firstArgDir = os.path.dirname(firstArg) if not os.path.isdir(firstArgDir): print("ERROR: Logfile handler output path as defined in ") print(" the config file does not exist. Please create") print(" the target directory containing the log file manually") print(" or change the configuration.") print("") print(" Config file : \""+str(configfile)+"\"") print(" Log file given : \""+str(firstArg)+"\"") print(" Log file dir extracted and tested: \""+str(firstArgDir)+"\"") return False except: # pass since it is possible to define a function # handling the output filename print("Could extracting directory from "+str(firstArg)) pass else: print("INFO: Logfile handler has no key 'args' which is used") print(" to define a log filename. Skipping test for the") print(" existence of the logfile directory...") else: print("INFO: Logfile has section 'handler_logfile' but ") print(" class differs from haindlers.TimedRotatingFileHandler.") print(" Skipping directory existence test fore logfile handler...") else: print("INFO: Logfile has section 'handler_logfile' but no") print(" class keyword defined.") print(" Skipping directory existence test fore logfile handler...") # no error return True #--------# #- test -# #--------# if __name__ == "__main__": parser = optparse.OptionParser() parser.add_option("-c", "--config", action="store", dest="configfile", default=None, help="configuration file") (opts, args) = parser.parse_args() if len(args) > 0: print("Unknown option(s): %s" % args) print("") parser.print_help() sys.exit(1) if not opts.configfile: print("Config file missing as an argument!") print("") parser.print_help() sys.exit(1) configfile = opts.configfile if not checkLogfileConfig(configfile): sys.exit(1)