pwninit template
This commit is contained in:
parent
14a0e719c8
commit
1f3dc557b4
|
|
@ -80,6 +80,7 @@ alias clipboard-image='xclip -o -sel clip | nsxiv-pipe'
|
||||||
alias path='sed "s/:/\n/g" <<< $PATH'
|
alias path='sed "s/:/\n/g" <<< $PATH'
|
||||||
alias utc='date -u +"%Y-%m-%d %H:%M:%S UTC"'
|
alias utc='date -u +"%Y-%m-%d %H:%M:%S UTC"'
|
||||||
alias odd='objdump -d'
|
alias odd='objdump -d'
|
||||||
|
alias pwninit='pwninit --template-path ~/.config/pwninit/template.py --template-bin-name e'
|
||||||
alias fonts='fc-list | awk -F: "{ print \$2 }" | sort | uniq | fzf'
|
alias fonts='fc-list | awk -F: "{ print \$2 }" | sort | uniq | fzf'
|
||||||
alias hz='xrandr --output DisplayPort-1 --mode 1920x1080 --rate'
|
alias hz='xrandr --output DisplayPort-1 --mode 1920x1080 --rate'
|
||||||
alias ns='nix-shell'
|
alias ns='nix-shell'
|
||||||
|
|
|
||||||
32
user/config/pwninit/template.py
Normal file
32
user/config/pwninit/template.py
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
from pwn import *
|
||||||
|
import argparse
|
||||||
|
import sys
|
||||||
|
|
||||||
|
{bindings}
|
||||||
|
context.binary = {bin_name}
|
||||||
|
context.terminal = ['tmux', 'splitw', '-h']
|
||||||
|
gdbscript = ''
|
||||||
|
|
||||||
|
def main(args):
|
||||||
|
p = conn(args)
|
||||||
|
|
||||||
|
p.interactive()
|
||||||
|
|
||||||
|
def conn(args):
|
||||||
|
if args.remote:
|
||||||
|
p = remote(*args.remote)
|
||||||
|
else:
|
||||||
|
p = process({proc_args})
|
||||||
|
if args.gdb:
|
||||||
|
gdb.attach(p, gdbscript=gdbscript)
|
||||||
|
return p
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
g = parser.add_mutually_exclusive_group()
|
||||||
|
g.add_argument('-r', '--remote', nargs=2, metavar=('HOST', 'PORT'))
|
||||||
|
g.add_argument('-g', '--gdb', action='store_true')
|
||||||
|
argv = ['-r' if x == 'nc' else x for x in sys.argv[1:]]
|
||||||
|
args = parser.parse_args(argv)
|
||||||
|
main(args)
|
||||||
|
|
@ -16,6 +16,7 @@ in {
|
||||||
xdg.configFile.git.source = config/git;
|
xdg.configFile.git.source = config/git;
|
||||||
xdg.configFile.lsd.source = config/lsd;
|
xdg.configFile.lsd.source = config/lsd;
|
||||||
xdg.configFile.picom.source = config/picom;
|
xdg.configFile.picom.source = config/picom;
|
||||||
|
xdg.configFile.pwninit.source = config/pwninit;
|
||||||
xdg.configFile.python.source = config/python;
|
xdg.configFile.python.source = config/python;
|
||||||
xdg.configFile.qt5ct.source = config/qt5ct;
|
xdg.configFile.qt5ct.source = config/qt5ct;
|
||||||
xdg.configFile.readline.source = config/readline;
|
xdg.configFile.readline.source = config/readline;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue