scripts: add PE Canary check to security-check

This commit is contained in:
fanquake
2023-01-06 10:21:17 +00:00
parent 911a40ead2
commit 6ba17d4955
2 changed files with 15 additions and 8 deletions

View File

@@ -146,6 +146,12 @@ def check_PE_control_flow(binary) -> bool:
return True
return False
def check_PE_Canary(binary) -> bool:
'''
Check for use of stack canary
'''
return binary.has_symbol('__stack_chk_fail')
def check_MACHO_NOUNDEFS(binary) -> bool:
'''
Check for no undefined references.
@@ -203,6 +209,7 @@ BASE_PE = [
('NX', check_NX),
('RELOC_SECTION', check_PE_RELOC_SECTION),
('CONTROL_FLOW', check_PE_control_flow),
('Canary', check_PE_Canary),
]
BASE_MACHO = [