diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-11-16 17:15:13 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-11-16 17:15:13 (GMT) |
commit | 187cf13a6f0b0ddbb46fd563d66bb01b0dcd18be (patch) | |
tree | d085435f4845148269240de4b188982873be42c3 /plugins/python | |
parent | e8009661bc2a647678b944a09ee3a7e218692e44 (diff) |
Updated code to the new Python API for the Elf format.
Diffstat (limited to 'plugins/python')
-rw-r--r-- | plugins/python/checksec/mitigations.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/python/checksec/mitigations.py b/plugins/python/checksec/mitigations.py index 1539fa7..f054fac 100644 --- a/plugins/python/checksec/mitigations.py +++ b/plugins/python/checksec/mitigations.py @@ -28,9 +28,9 @@ class ElfMitigations(): # -Wl,-z,execstack / -Wl,-z,noexecstack - stack = self._fmt.find_program_by_type(ElfFormat.PT_GNU_STACK) + stack = self._fmt.find_program_by_type(ElfFormat.ElfProgramHeaderType.PT_GNU_STACK) - status = stack is None or stack.p_flags & ElfFormat.PF_X + status = stack is None or stack.p_flags & ElfFormat.ElfProgramHeaderFlags.PF_X return 'No' if status else 'Yes' @@ -44,7 +44,7 @@ class ElfMitigations(): hdr = self._fmt.get_header() - status = hdr.e_type == ElfFormat.ET_DYN + status = hdr.e_type == ElfFormat.ElfHeaderType.ET_DYN return 'Yes' if status else 'No' @@ -57,9 +57,9 @@ class ElfMitigations(): # -Wl,-z,relro / -Wl,-z,now - prgm = self._fmt.find_program_by_type(ElfFormat.PT_GNU_RELRO) + prgm = self._fmt.find_program_by_type(ElfFormat.ElfProgramHeaderType.PT_GNU_RELRO) - entry = self._fmt.find_dynamic_item_by_type(ElfFormat.DT_BIND_NOW) + entry = self._fmt.find_dynamic_item_by_type(ElfFormat.ElfSectionHeaderFlags.DT_BIND_NOW) if prgm is None and entry is None: status = 'No' |