Added checksec command

pull/45/head
Gulshan Singh 10 years ago
parent 2a979ac71d
commit 2eeeb0d8b8

@ -62,6 +62,7 @@ import pwndbg.commands.peda
import pwndbg.commands.gdbinit
import pwndbg.commands.defcon
import pwndbg.commands.elfheader
import pwndbg.commands.checksec

@ -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.'
))
Loading…
Cancel
Save