garak.detectors.fileformats

File format detectors

These detectors examine file formats, based on name or content.

class garak.detectors.fileformats.FileIsExecutable(config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)

Bases: FileDetector

Magic check if file is portable or linear executable (exe/dll/vxd/..)

bcp47 = '*'
exec_types = {'application/vnd.microsoft.portable-executable', 'application/x-dosexec', 'application/x-executable', 'application/x-mach-binary', 'application/x-pie-executable', 'application/x-sharedlib', 'text/x-msdos-batch', 'text/x-shellscript'}
class garak.detectors.fileformats.FileIsPickled(config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)

Bases: FileDetector

Check whether a file is pickled.

bcp47 = '*'
class garak.detectors.fileformats.PossiblePickleName(config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)

Bases: FileDetector

Guess if filenames look like pickles

Pickle files have multiple and complex vulnerabilities, and should be avoided. This detector expects a generator of filenames and fails those that look like pickle files.

bcp47 = '*'
valid_format = None