dissect.target.plugins.filesystem.walkfs¶
Module Contents¶
Classes¶
Filesystem agnostic walkfs plugin. |
Functions¶
Generate a |
Attributes¶
- dissect.target.plugins.filesystem.walkfs.FilesystemRecord¶
- class dissect.target.plugins.filesystem.walkfs.WalkFsPlugin(target: dissect.target.target.Target)¶
Bases:
dissect.target.plugin.PluginFilesystem agnostic walkfs plugin.
- check_compatible() None¶
Perform a compatibility check with the target.
This function should return
Noneif the plugin is compatible with the current target (self.target). For example, check if a certain file exists. Otherwise it should raise anUnsupportedPluginError.- Raises:
UnsupportedPluginError – If the plugin could not be loaded.
- walkfs(walkfs_path: str = '/', capability: bool = False) collections.abc.Iterator[FilesystemRecord]¶
Walk a target’s filesystem and return all filesystem entries.
References
https://steflan-security.com/linux-privilege-escalation-suid-binaries
https://github.com/torvalds/linux/blob/master/include/uapi/linux/capability.h
Yields FilesystemRecords for every filesystem entry and CapabilityRecords if
xattrsecurity attributes were found in the filesystem entry and the--capabilityflag is set.hostname (string): The target hostname. domain (string): The target domain. mtime (datetime): modified timestamp indicates the last time the contents of a file were modified. atime (datetime): access timestamp indicates the last time a file was accessed. ctime (datetime): changed timestamp indicates the last time metadata of a file was modified. btime (datetime): birth timestamp indicates the time when a file was created. ino (varint): number of the corresponding underlying filesystem inode. path (path): path location of the entry. size (filesize): size of the file in bytes on the filesystem. mode (uint32): contains the file type and mode. uid (uint32): the user id of the owner of the entry. gid (uint32): the group id of the owner of the entry. is_suid (boolean): denotes if the entry has the set-user-id bit set. attr (string[]): list of key-value pair attributes separated by '='. fs_types (string[]): list of filesystem type(s) of the entry.
- dissect.target.plugins.filesystem.walkfs.generate_record(target: dissect.target.target.Target, entry: dissect.target.filesystem.FilesystemEntry, capability: bool) collections.abc.Iterator[FilesystemRecord]¶
Generate a
WalkFsRecordfrom the givenFilesystemEntry.- Parameters:
target –
Targetinstanceentry –
FilesystemEntryinstance
- Returns:
Generator of
FilesystemRecordfor the givenFilesystemEntry.