forked from pwndbg/pwndbg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import gdb | ||
import pwndbg.commands | ||
|
||
import subprocess | ||
|
||
@pwndbg.commands.Command | ||
def checksec(): | ||
''' | ||
Prints out the binary security settings. Attempts to call the binjitsu | ||
checksec first, and then falls back to checksec.sh. | ||
''' | ||
#local_path = pwndbg.file.get_file(pwndbg.proc.exe) | ||
local_path = pwndbg.proc.exe | ||
try: | ||
subprocess.call(['checksec', local_path]) | ||
except: | ||
try: | ||
subprocess.call(['checksec.sh', '--file', local_path]) | ||
except: | ||
print(pwndbg.color.red( | ||
'An error occurred when calling checksec. ' \ | ||
'Make sure the checksec binary is in your PATH.' | ||
)) |