volatility3.framework.constants.linux package
Volatility 3 Linux Constants.
Linux-specific values that aren’t found in debug symbols
- ATTRIBUTE_NAME_MAX_SIZE = 255
In 5.9-rc1+, the Linux kernel limits the READ size of a section bin_attribute name to MODULE_SECT_READ_SIZE:
https://elixir.bootlin.com/linux/v6.15-rc4/source/kernel/module/sysfs.c#L106
https://github.com/torvalds/linux/commit/11990a5bd7e558e9203c1070fc52fb6f0488e75b
However, the raw section name loaded from the .ko ELF can in theory be thousands of characters, and unless we do a NULL terminated search we can’t set a perfect value.
- class ELF_CLASS(value)[source]
Bases:
IntEnumELF header class types
- ELFCLASS32 = 1
- ELFCLASS64 = 2
- ELFCLASSNONE = 0
- as_integer_ratio()
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()
Returns self, the complex conjugate of any int.
- denominator
the denominator of a rational number in lowest terms
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- imag
the imaginary part of a complex number
- numerator
the numerator of a rational number in lowest terms
- real
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class ELF_IDENT(value)[source]
Bases:
IntEnumELF header e_ident indexes
- EI_CLASS = 4
- EI_DATA = 5
- EI_MAG0 = 0
- EI_MAG1 = 1
- EI_MAG2 = 2
- EI_MAG3 = 3
- EI_OSABI = 7
- EI_PAD = 8
- EI_VERSION = 6
- as_integer_ratio()
Return integer ratio.
Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.
>>> (10).as_integer_ratio() (10, 1) >>> (-10).as_integer_ratio() (-10, 1) >>> (0).as_integer_ratio() (0, 1)
- bit_count()
Number of ones in the binary representation of the absolute value of self.
Also known as the population count.
>>> bin(13) '0b1101' >>> (13).bit_count() 3
- bit_length()
Number of bits necessary to represent self in binary.
>>> bin(37) '0b100101' >>> (37).bit_length() 6
- conjugate()
Returns self, the complex conjugate of any int.
- denominator
the denominator of a rational number in lowest terms
- classmethod from_bytes(bytes, byteorder='big', *, signed=False)
Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Indicates whether two’s complement is used to represent the integer.
- imag
the imaginary part of a complex number
- numerator
the numerator of a rational number in lowest terms
- real
the real part of a complex number
- to_bytes(length=1, byteorder='big', *, signed=False)
Return an array of bytes representing an integer.
- length
Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.
- signed
Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.
- class IF_OPER_STATES(value)[source]
Bases:
EnumRFC 2863 - Network interface operational status
- DORMANT = 5
- DOWN = 2
- LOWERLAYERDOWN = 3
- NOTPRESENT = 1
- TESTING = 4
- UNKNOWN = 0
- UP = 6
- KERNEL_NAME = '__kernel__'
The value hard coded from the Linux Kernel (hence not extracted from the layer itself)
- class PT_FLAGS(value)[source]
Bases:
FlagPTrace flags
- PT_EXITKILL = 8388608
- PT_PTRACED = 1
- PT_SEIZED = 65536
- PT_SUSPEND_SECCOMP = 16777216
- PT_TRACESYSGOOD = 8
- PT_TRACE_CLONE = 64
- PT_TRACE_EXEC = 128
- PT_TRACE_EXIT = 512
- PT_TRACE_FORK = 16
- PT_TRACE_SECCOMP = 1024
- PT_TRACE_VFORK = 32
- PT_TRACE_VFORK_DONE = 256
- TAINT_FLAGS = {'A': TaintFlag(shift=256, desc='OVERRIDDEN_ACPI_TABLE', when_present=True, module=False), 'B': TaintFlag(shift=32, desc='BAD_PAGE', when_present=True, module=False), 'C': TaintFlag(shift=1024, desc='CRAP', when_present=True, module=True), 'D': TaintFlag(shift=128, desc='DIE', when_present=True, module=False), 'E': TaintFlag(shift=8192, desc='UNSIGNED_MODULE', when_present=True, module=True), 'F': TaintFlag(shift=2, desc='FORCED_MODULE', when_present=True, module=False), 'G': TaintFlag(shift=1, desc='PROPRIETARY_MODULE', when_present=False, module=True), 'I': TaintFlag(shift=2048, desc='FIRMWARE_WORKAROUND', when_present=True, module=False), 'K': TaintFlag(shift=32768, desc='LIVEPATCH', when_present=True, module=True), 'L': TaintFlag(shift=16384, desc='SOFTLOCKUP', when_present=True, module=False), 'M': TaintFlag(shift=16, desc='MACHINE_CHECK', when_present=True, module=False), 'N': TaintFlag(shift=262144, desc='TEST', when_present=True, module=True), 'O': TaintFlag(shift=4096, desc='OOT_MODULE', when_present=True, module=True), 'P': TaintFlag(shift=1, desc='PROPRIETARY_MODULE', when_present=True, module=True), 'R': TaintFlag(shift=8, desc='FORCED_RMMOD', when_present=True, module=False), 'S': TaintFlag(shift=4, desc='CPU_OUT_OF_SPEC', when_present=True, module=False), 'T': TaintFlag(shift=131072, desc='RANDSTRUCT', when_present=True, module=True), 'U': TaintFlag(shift=64, desc='USER', when_present=True, module=False), 'W': TaintFlag(shift=512, desc='WARN', when_present=True, module=False), 'X': TaintFlag(shift=65536, desc='AUX', when_present=True, module=True)}
Flags used to taint kernel and modules, for debugging purposes.
Map based on 6.12-rc5.
- Documentation :
taint_flag kernel struct
taint_flags kernel constant