Documentation
¶
Index ¶
- Variables
- func ExtractArchiveToTempDir(ctx context.Context, c malcontent.Config, path string) (string, error)
- func ExtractBz2(ctx context.Context, d, f string) error
- func ExtractDeb(ctx context.Context, d, f string) error
- func ExtractGzip(ctx context.Context, d string, f string) error
- func ExtractRPM(ctx context.Context, d, f string) error
- func ExtractTar(ctx context.Context, d string, f string) error
- func ExtractUPX(ctx context.Context, d, f string) error
- func ExtractZip(ctx context.Context, d string, f string) error
- func ExtractZlib(ctx context.Context, d string, f string) error
- func ExtractZstd(ctx context.Context, d string, f string) error
- func ExtractionMethod(ext string) func(context.Context, string, string) error
- func IsValidPath(target, dir string) bool
- func OCI(ctx context.Context, path string) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var GzMIME = map[string]struct{}{
"application/gzip": {},
"application/gzip-compressed": {},
"application/gzipped": {},
"application/x-gunzip": {},
"application/x-gzip": {},
"application/x-gzip-compressed": {},
"gzip/document": {},
}
Functions ¶
func ExtractArchiveToTempDir ¶
extractArchiveToTempDir creates a temporary directory and extracts the archive file for scanning.
func ExtractBz2 ¶
Extract Bz2 extracts bzip2 files.
func ExtractDeb ¶
ExtractDeb extracts .deb packages.
func ExtractGzip ¶
extractGzip extracts .gz archives.
func ExtractRPM ¶
extractRPM extracts .rpm packages.
func ExtractTar ¶
extractTar extracts .apk and .tar* archives.
func ExtractZip ¶
ExtractZip extracts .jar and .zip archives.
func ExtractZlib ¶
extractZlib extracts extension-agnostic zlib-compressed files.
func ExtractZstd ¶ added in v1.9.0
ExtractZstd extracts .zst and .zstd archives.
func ExtractionMethod ¶
func IsValidPath ¶
isValidPath checks if the target file is within the given directory.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.