Exploit databaseDownload repository ZIP
GH-db984ad2f3fbc8e39f8dce7979a818cb
yifanzhg/cve-2023-45158
Sources for CVE-2023-45158
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files51
yifanzhg/cve-2023-45158Revision 140058fb5b1f
- ↑..Parent directory
- __pycache__/
- contrib/
- packages/
- tests/
- .DS_Store
- __init__.py
- _compat.py
- admin.py
- authapi.py
- cache.py
- cfs.py
- compileapp.py
- console.py
- contenttype.py
- custom_import.py
- dal.py
- debug.py
- decoder.py
- digest.py
- fileutils.py
- form.py
- globals.py
- highlight.py
- html.py
- http.py
- import_all.py
- languages.py
- main.py
- messageboxhandler.py
- newcron.py
- recfile.py
- restricted.py
- rewrite.py
- rocket.py
- rocket.py.footer
- sanitizer.py
- scheduler.py
- serializers.py
- settings.py
- shell.py
- sql.py
- sqlhtml.py
- storage.py
- streamer.py
- template.py
- tools.py
- utf8.py
- utils.py
- validators.py
- widget.py
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
web2py/gluon/recfile.py
Python · 2,052 bytes#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <[email protected]>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Generates names for cache and session files
--------------------------------------------
"""
import os
from gluon._compat import builtin
def generate(filename, depth=2, base=512):
if os.path.sep in filename:
path, filename = os.path.split(filename)
else:
path = None
dummyhash = sum(ord(c) * 256 ** (i % 4) for i, c in enumerate(filename)) % base ** depth
folders = []
for level in range(depth - 1, -1, -1):
code, dummyhash = divmod(dummyhash, base ** level)
folders.append("%03x" % code)
folders.append(filename)
if path:
folders.insert(0, path)
return os.path.join(*folders)
def exists(filename, path=None):
if os.path.exists(filename):
return True
if path is None:
path, filename = os.path.split(filename)
fullfilename = os.path.join(path, generate(filename))
if os.path.exists(fullfilename):
return True
return False
def remove(filename, path=None):
if os.path.exists(filename):
return os.unlink(filename)
if path is None:
path, filename = os.path.split(filename)
fullfilename = os.path.join(path, generate(filename))
if os.path.exists(fullfilename):
return os.unlink(fullfilename)
raise IOError
def open(filename, mode="r", path=None):
if not path:
path, filename = os.path.split(filename)
fullfilename = None
if not mode.startswith('w'):
fullfilename = os.path.join(path, filename)
if not os.path.exists(fullfilename):
fullfilename = None
if not fullfilename:
fullfilename = os.path.join(path, generate(filename))
if mode.startswith('w') and not os.path.exists(os.path.dirname(fullfilename)):
os.makedirs(os.path.dirname(fullfilename))
return builtin.open(fullfilename, mode)