Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Pyramid
<p align="center">
<img width="250" alt="immagine" src="https://github.com/naksyn/Pyramid/assets/59816245/c4f25419-b350-42d3-86ad-136f3873edb8">
<img width="250" alt="immagine" src="https://github.com/naksyn/Pyramid/assets/59816245/b4e1e468-d7e9-4580-b6bc-8b589fda3dd7"
">
</p>

# What is it
Expand Down
Binary file modified Server/Dependencies/bloodhound/ldap3.zip
Binary file not shown.
Binary file added Server/Dependencies/bloodhound/winkerberos.zip
Binary file not shown.
42 changes: 19 additions & 23 deletions Server/Modules/DonPAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def __init__(self, repoName):
self.repoName = repoName
self._source_cache = {}

def _get_info(self, repoName, fullname):
def _get_info(self, fullname):
"""Search for the respective package or module in the zipfile object"""
parts = fullname.split('.')
submodule = parts[-1]
Expand All @@ -235,26 +235,26 @@ def _get_info(self, repoName, fullname):
for suffix, is_package in _search_order:
relpath = modulepath + suffix
try:
moduleRepo[repoName].getinfo(relpath)
moduleRepo[self.repoName].getinfo(relpath)
except KeyError:
pass
else:
return submodule, is_package, relpath

#Error out if we can find the module/package
msg = ('Unable to locate module %s in the %s repo' % (submodule, repoName))
msg = ('Unable to locate module %s in the %s repo' % (submodule, self.repoName))
raise ZipImportError(msg)

def _get_source(self, repoName, fullname):
def _get_source(self, fullname):
"""Get the source code for the requested module"""
submodule, is_package, relpath = self._get_info(repoName, fullname)
fullpath = '%s/%s' % (repoName, relpath)
submodule, is_package, relpath = self._get_info(fullname)
fullpath = '%s/%s' % (self.repoName, relpath)
if relpath in self._source_cache:
source = self._source_cache[relpath]
return submodule, is_package, fullpath, source
try:
### added .decode
source = moduleRepo[repoName].read(relpath).decode()
source = moduleRepo[self.repoName].read(relpath).decode()
#print(source)
source = source.replace('\r\n', '\n')
source = source.replace('\r', '\n')
Expand All @@ -263,27 +263,23 @@ def _get_source(self, repoName, fullname):
except:
raise ZipImportError("Unable to obtain source for module %s" % (fullpath))

def find_module(self, fullname, path=None):

def find_spec(self, fullname, path=None, target=None):
try:
submodule, is_package, relpath = self._get_info(self.repoName, fullname)
submodule, is_package, relpath = self._get_info(fullname)
except ImportError:
return None
else:
return self
return importlib.util.spec_from_loader(fullname, self)

def create_module(self, spec):
return None

def load_module(self, fullname):
submodule, is_package, fullpath, source = self._get_source(self.repoName, fullname)
def exec_module(self, module):
submodule, is_package, fullpath, source = self._get_source(module.__name__)
code = compile(source, fullpath, 'exec')
spec = importlib.util.spec_from_loader(fullname, loader=None)
mod = sys.modules.setdefault(fullname, importlib.util.module_from_spec(spec))
mod.__loader__ = self
mod.__file__ = fullpath
mod.__name__ = fullname
if is_package:
mod.__path__ = [os.path.dirname(mod.__file__)]
exec(code,mod.__dict__)
return mod
module.__path__ = [os.path.dirname(fullpath)]
exec(code, module.__dict__)

def get_data(self, fullpath):

Expand All @@ -298,11 +294,11 @@ def get_data(self, fullpath):

def is_package(self, fullname):
"""Return if the module is a package"""
submodule, is_package, relpath = self._get_info(self.repoName, fullname)
submodule, is_package, relpath = self._get_info(fullname)
return is_package

def get_code(self, fullname):
submodule, is_package, fullpath, source = self._get_source(self.repoName, fullname)
submodule, is_package, fullpath, source = self._get_source(fullname)
return compile(source, fullpath, 'exec')

def install_hook(repoName):
Expand Down
42 changes: 19 additions & 23 deletions Server/Modules/LaZagne.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def __init__(self, repoName):
self.repoName = repoName
self._source_cache = {}

def _get_info(self, repoName, fullname):
def _get_info(self, fullname):
"""Search for the respective package or module in the zipfile object"""
parts = fullname.split('.')
submodule = parts[-1]
Expand All @@ -240,26 +240,26 @@ def _get_info(self, repoName, fullname):
for suffix, is_package in _search_order:
relpath = modulepath + suffix
try:
moduleRepo[repoName].getinfo(relpath)
moduleRepo[self.repoName].getinfo(relpath)
except KeyError:
pass
else:
return submodule, is_package, relpath

#Error out if we can find the module/package
msg = ('Unable to locate module %s in the %s repo' % (submodule, repoName))
msg = ('Unable to locate module %s in the %s repo' % (submodule, self.repoName))
raise ZipImportError(msg)

def _get_source(self, repoName, fullname):
def _get_source(self, fullname):
"""Get the source code for the requested module"""
submodule, is_package, relpath = self._get_info(repoName, fullname)
fullpath = '%s/%s' % (repoName, relpath)
submodule, is_package, relpath = self._get_info(fullname)
fullpath = '%s/%s' % (self.repoName, relpath)
if relpath in self._source_cache:
source = self._source_cache[relpath]
return submodule, is_package, fullpath, source
try:
### added .decode
source = moduleRepo[repoName].read(relpath).decode()
source = moduleRepo[self.repoName].read(relpath).decode()
#print(source)
source = source.replace('\r\n', '\n')
source = source.replace('\r', '\n')
Expand All @@ -268,27 +268,23 @@ def _get_source(self, repoName, fullname):
except:
raise ZipImportError("Unable to obtain source for module %s" % (fullpath))

def find_module(self, fullname, path=None):

def find_spec(self, fullname, path=None, target=None):
try:
submodule, is_package, relpath = self._get_info(self.repoName, fullname)
submodule, is_package, relpath = self._get_info(fullname)
except ImportError:
return None
else:
return self
return importlib.util.spec_from_loader(fullname, self)

def create_module(self, spec):
return None

def load_module(self, fullname):
submodule, is_package, fullpath, source = self._get_source(self.repoName, fullname)
def exec_module(self, module):
submodule, is_package, fullpath, source = self._get_source(module.__name__)
code = compile(source, fullpath, 'exec')
spec = importlib.util.spec_from_loader(fullname, loader=None)
mod = sys.modules.setdefault(fullname, importlib.util.module_from_spec(spec))
mod.__loader__ = self
mod.__file__ = fullpath
mod.__name__ = fullname
if is_package:
mod.__path__ = [os.path.dirname(mod.__file__)]
exec(code,mod.__dict__)
return mod
module.__path__ = [os.path.dirname(fullpath)]
exec(code, module.__dict__)

def get_data(self, fullpath):

Expand All @@ -303,11 +299,11 @@ def get_data(self, fullpath):

def is_package(self, fullname):
"""Return if the module is a package"""
submodule, is_package, relpath = self._get_info(self.repoName, fullname)
submodule, is_package, relpath = self._get_info(fullname)
return is_package

def get_code(self, fullname):
submodule, is_package, fullpath, source = self._get_source(self.repoName, fullname)
submodule, is_package, fullpath, source = self._get_source(fullname)
return compile(source, fullpath, 'exec')

def install_hook(repoName):
Expand Down
44 changes: 20 additions & 24 deletions Server/Modules/bh.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def __init__(self, repoName):
self.repoName = repoName
self._source_cache = {}

def _get_info(self, repoName, fullname):
def _get_info(self, fullname):
"""Search for the respective package or module in the zipfile object"""
parts = fullname.split('.')
submodule = parts[-1]
Expand All @@ -229,26 +229,26 @@ def _get_info(self, repoName, fullname):
for suffix, is_package in _search_order:
relpath = modulepath + suffix
try:
moduleRepo[repoName].getinfo(relpath)
moduleRepo[self.repoName].getinfo(relpath)
except KeyError:
pass
else:
return submodule, is_package, relpath

#Error out if we can find the module/package
msg = ('Unable to locate module %s in the %s repo' % (submodule, repoName))
msg = ('Unable to locate module %s in the %s repo' % (submodule, self.repoName))
raise ZipImportError(msg)

def _get_source(self, repoName, fullname):
def _get_source(self, fullname):
"""Get the source code for the requested module"""
submodule, is_package, relpath = self._get_info(repoName, fullname)
fullpath = '%s/%s' % (repoName, relpath)
submodule, is_package, relpath = self._get_info(fullname)
fullpath = '%s/%s' % (self.repoName, relpath)
if relpath in self._source_cache:
source = self._source_cache[relpath]
return submodule, is_package, fullpath, source
try:
### added .decode
source = moduleRepo[repoName].read(relpath).decode()
source = moduleRepo[self.repoName].read(relpath).decode()
#print(source)
source = source.replace('\r\n', '\n')
source = source.replace('\r', '\n')
Expand All @@ -257,27 +257,23 @@ def _get_source(self, repoName, fullname):
except:
raise ZipImportError("Unable to obtain source for module %s" % (fullpath))

def find_module(self, fullname, path=None):

def find_spec(self, fullname, path=None, target=None):
try:
submodule, is_package, relpath = self._get_info(self.repoName, fullname)
submodule, is_package, relpath = self._get_info(fullname)
except ImportError:
return None
else:
return self
return importlib.util.spec_from_loader(fullname, self)

def create_module(self, spec):
return None

def load_module(self, fullname):
submodule, is_package, fullpath, source = self._get_source(self.repoName, fullname)
def exec_module(self, module):
submodule, is_package, fullpath, source = self._get_source(module.__name__)
code = compile(source, fullpath, 'exec')
spec = importlib.util.spec_from_loader(fullname, loader=None)
mod = sys.modules.setdefault(fullname, importlib.util.module_from_spec(spec))
mod.__loader__ = self
mod.__file__ = fullpath
mod.__name__ = fullname
if is_package:
mod.__path__ = [os.path.dirname(mod.__file__)]
exec(code,mod.__dict__)
return mod
module.__path__ = [os.path.dirname(fullpath)]
exec(code, module.__dict__)

def get_data(self, fullpath):

Expand All @@ -292,11 +288,11 @@ def get_data(self, fullpath):

def is_package(self, fullname):
"""Return if the module is a package"""
submodule, is_package, relpath = self._get_info(self.repoName, fullname)
submodule, is_package, relpath = self._get_info(fullname)
return is_package

def get_code(self, fullname):
submodule, is_package, fullpath, source = self._get_source(self.repoName, fullname)
submodule, is_package, fullpath, source = self._get_source(fullname)
return compile(source, fullpath, 'exec')

def install_hook(repoName):
Expand All @@ -320,7 +316,7 @@ def hook_routine(fileName,zip_web):
zip_list=['bloodhound---setuptools', 'bloodhound---pkg_resources', 'bloodhound---jaraco', 'bloodhound---_distutils_hack', 'bloodhound---bloodhound', 'bloodhound---distutils',\
'bloodhound---configparser', 'bloodhound---future', 'bloodhound---chardet', 'bloodhound---flask', 'bloodhound---ldap3', 'bloodhound---ldapdomaindump', \
'bloodhound---pyasn1', 'bloodhound---OpenSSL','bloodhound---pyreadline', 'bloodhound---six','bloodhound---markupsafe', 'bloodhound---werkzeug','bloodhound---jinja2',\
'bloodhound---click', 'bloodhound---itsdangerous', 'bloodhound---dns', 'bloodhound---cryptography', 'bloodhound---json', 'bloodhound---impacket' ]
'bloodhound---click', 'bloodhound---itsdangerous', 'bloodhound---dns', 'bloodhound---cryptography', 'bloodhound---json', 'bloodhound---impacket', 'bloodhound---winkerberos' ]

for zip_name in zip_list:
try:
Expand Down
41 changes: 19 additions & 22 deletions Server/Modules/clr.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def __init__(self, repoName):
self.repoName = repoName
self._source_cache = {}

def _get_info(self, repoName, fullname):
def _get_info(self, fullname):
"""Search for the respective package or module in the zipfile object"""
parts = fullname.split('.')
submodule = parts[-1]
Expand All @@ -232,26 +232,26 @@ def _get_info(self, repoName, fullname):
for suffix, is_package in _search_order:
relpath = modulepath + suffix
try:
moduleRepo[repoName].getinfo(relpath)
moduleRepo[self.repoName].getinfo(relpath)
except KeyError:
pass
else:
return submodule, is_package, relpath

#Error out if we can find the module/package
msg = ('Unable to locate module %s in the %s repo' % (submodule, repoName))
msg = ('Unable to locate module %s in the %s repo' % (submodule, self.repoName))
raise ZipImportError(msg)

def _get_source(self, repoName, fullname):
def _get_source(self, fullname):
"""Get the source code for the requested module"""
submodule, is_package, relpath = self._get_info(repoName, fullname)
fullpath = '%s/%s' % (repoName, relpath)
submodule, is_package, relpath = self._get_info(fullname)
fullpath = '%s/%s' % (self.repoName, relpath)
if relpath in self._source_cache:
source = self._source_cache[relpath]
return submodule, is_package, fullpath, source
try:
### added .decode
source = moduleRepo[repoName].read(relpath).decode()
source = moduleRepo[self.repoName].read(relpath).decode()
#print(source)
source = source.replace('\r\n', '\n')
source = source.replace('\r', '\n')
Expand All @@ -260,26 +260,23 @@ def _get_source(self, repoName, fullname):
except:
raise ZipImportError("Unable to obtain source for module %s" % (fullpath))

def find_module(self, fullname, path=None):
def find_spec(self, fullname, path=None, target=None):
try:
submodule, is_package, relpath = self._get_info(self.repoName, fullname)
submodule, is_package, relpath = self._get_info(fullname)
except ImportError:
return None
else:
return self
return importlib.util.spec_from_loader(fullname, self)

def load_module(self, fullname):
submodule, is_package, fullpath, source = self._get_source(self.repoName, fullname)
def create_module(self, spec):
return None

def exec_module(self, module):
submodule, is_package, fullpath, source = self._get_source(module.__name__)
code = compile(source, fullpath, 'exec')
spec = importlib.util.spec_from_loader(fullname, loader=None)
mod = sys.modules.setdefault(fullname, importlib.util.module_from_spec(spec))
mod.__loader__ = self
mod.__file__ = fullpath
mod.__name__ = fullname
if is_package:
mod.__path__ = [os.path.dirname(mod.__file__)]
exec(code,mod.__dict__)
return mod
module.__path__ = [os.path.dirname(fullpath)]
exec(code, module.__dict__)

def get_data(self, fullpath):
prefix = os.path.join(self.repoName, '')
Expand All @@ -293,11 +290,11 @@ def get_data(self, fullpath):

def is_package(self, fullname):
"""Return if the module is a package"""
submodule, is_package, relpath = self._get_info(self.repoName, fullname)
submodule, is_package, relpath = self._get_info(fullname)
return is_package

def get_code(self, fullname):
submodule, is_package, fullpath, source = self._get_source(self.repoName, fullname)
submodule, is_package, fullpath, source = self._get_source(fullname)
return compile(source, fullpath, 'exec')

def install_hook(repoName):
Expand Down
Loading