Skip to content

Commit 89a87fc

Browse files
committed
Fixed the wrong checksec output 'RELRO: Full' when there is BIND_NOW but not the GNU_RELRO
Signed-off-by: degrigis <fbi.gritti@gmail.com>
1 parent 69068b0 commit 89a87fc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

peda.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2528,9 +2528,12 @@ def checksec(self, filename=None):
25282528

25292529
for line in out.splitlines():
25302530
if "GNU_RELRO" in line:
2531-
result["RELRO"] = 2 # Partial
2531+
result["RELRO"] = 2 # Partial | NO BIND_NOW + GNU_RELRO
25322532
if "BIND_NOW" in line:
2533-
result["RELRO"] = 3 # Full
2533+
if result["RELRO"] == 2:
2534+
result["RELRO"] = 3 # Full | BIND_NOW + GNU_RELRO
2535+
else:
2536+
result["RELRO"] = 0 # ? | BIND_NOW + NO GNU_RELRO = NO PROTECTION
25342537
if "__stack_chk_fail" in line:
25352538
result["CANARY"] = 1
25362539
if "GNU_STACK" in line and "RWE" in line:

0 commit comments

Comments
 (0)