├── pwnlib ├── internal │ └── __init__.py ├── constants │ ├── cgc │ │ ├── __init__.py │ │ ├── alpha.py │ │ ├── amd64.py │ │ ├── arm.py │ │ ├── i386.py │ │ ├── ia64.py │ │ ├── mips.py │ │ ├── s390.py │ │ ├── s390x.py │ │ ├── sparc.py │ │ ├── aarch64.py │ │ ├── powerpc.py │ │ ├── powerpc64.py │ │ └── sparc64.py │ ├── linux │ │ └── __init__.py │ ├── LICENSE.txt │ └── constant.py ├── data │ └── includes │ │ ├── android │ │ ├── cgc │ │ ├── alpha.h │ │ ├── amd64.h │ │ ├── i386.h │ │ ├── ia64.h │ │ ├── mips.h │ │ ├── s390.h │ │ ├── s390x.h │ │ ├── sparc.h │ │ ├── thumb.h │ │ ├── aarch64.h │ │ ├── powerpc.h │ │ ├── powerpc64.h │ │ └── sparc64.h │ │ ├── freebsd │ │ ├── alpha.h │ │ ├── amd64.h │ │ ├── arm.h │ │ ├── i386.h │ │ ├── ia64.h │ │ ├── mips.h │ │ ├── s390.h │ │ ├── s390x.h │ │ ├── sparc.h │ │ ├── thumb.h │ │ ├── aarch64.h │ │ ├── powerpc.h │ │ ├── powerpc64.h │ │ └── sparc64.h │ │ └── generator │ │ ├── freebsd │ │ ├── vm │ │ │ └── vm.h │ │ ├── sys │ │ │ ├── _iovec.h │ │ │ ├── _sigset.h │ │ │ ├── _types.h │ │ │ ├── cdefs.h │ │ │ ├── time.h │ │ │ ├── _timespec.h │ │ │ └── _sockaddr_storage.h │ │ └── machine │ │ │ ├── _align.h │ │ │ ├── _limits.h │ │ │ └── signal.h │ │ └── linux │ │ ├── alpha.h │ │ ├── ia64.h │ │ ├── mips.h │ │ ├── s390.h │ │ ├── s390x.h │ │ ├── sparc.h │ │ ├── sparc64.h │ │ ├── thumb.h │ │ ├── aarch64.h │ │ ├── amd64.h │ │ └── arm.h ├── commandline │ └── __init__.py ├── shellcraft │ └── templates │ │ ├── aarch64 │ │ ├── __doc__ │ │ ├── linux │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── pause.asm │ │ │ ├── sync.asm │ │ │ ├── vfork.asm │ │ │ ├── getgid.asm │ │ │ ├── getpid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── dup.asm │ │ │ ├── munlockall.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fchdir.asm │ │ │ ├── fsync.asm │ │ │ ├── nice.asm │ │ │ ├── sched_yield.asm │ │ │ ├── acct.asm │ │ │ ├── chdir.asm │ │ │ ├── iopl.asm │ │ │ └── rmdir.asm │ │ ├── android │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── pause.asm │ │ │ ├── vfork.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getgid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getpid.asm │ │ │ ├── getppid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── vhangup.asm │ │ │ ├── dup.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── acct.asm │ │ │ ├── fchdir.asm │ │ │ └── sched_yield.asm │ │ └── infloop.asm │ │ ├── powerpc │ │ ├── __doc__ │ │ ├── linux │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── pause.asm │ │ │ ├── sync.asm │ │ │ ├── vfork.asm │ │ │ ├── getgid.asm │ │ │ ├── getpid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── dup.asm │ │ │ ├── munlockall.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fchdir.asm │ │ │ ├── fsync.asm │ │ │ ├── nice.asm │ │ │ └── sched_yield.asm │ │ └── android │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── pause.asm │ │ │ ├── vfork.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getgid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getpid.asm │ │ │ ├── getppid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── vhangup.asm │ │ │ ├── dup.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ └── nice.asm │ │ ├── i386 │ │ ├── cgc │ │ │ └── __doc__ │ │ ├── android │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── getgid.asm │ │ │ ├── getpid.asm │ │ │ ├── getuid.asm │ │ │ ├── pause.asm │ │ │ ├── setsid.asm │ │ │ ├── vfork.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── dup.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── sched_yield.asm │ │ │ ├── acct.asm │ │ │ ├── fchdir.asm │ │ │ └── iopl.asm │ │ ├── trap.asm │ │ ├── __doc__ │ │ ├── infloop.asm │ │ ├── linux │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── pause.asm │ │ │ ├── vfork.asm │ │ │ ├── getgid.asm │ │ │ ├── getpid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── close.asm │ │ │ ├── dup.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── acct.asm │ │ │ ├── brk.asm │ │ │ ├── fchdir.asm │ │ │ ├── sched_yield.asm │ │ │ ├── chdir.asm │ │ │ ├── getsid.asm │ │ │ ├── iopl.asm │ │ │ ├── rmdir.asm │ │ │ ├── setgid.asm │ │ │ └── setuid.asm │ │ ├── nop.asm │ │ ├── freebsd │ │ │ └── __doc__ │ │ ├── breakpoint.asm │ │ ├── prolog.asm │ │ ├── epilog.asm │ │ └── crash.asm │ │ ├── arm │ │ ├── android │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── pause.asm │ │ │ ├── vfork.asm │ │ │ ├── getgid.asm │ │ │ ├── getpid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── dup.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── acct.asm │ │ │ ├── brk.asm │ │ │ ├── fchdir.asm │ │ │ ├── sched_yield.asm │ │ │ ├── chdir.asm │ │ │ ├── getsid.asm │ │ │ ├── iopl.asm │ │ │ ├── rmdir.asm │ │ │ ├── setgid.asm │ │ │ └── setuid.asm │ │ ├── linux │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── pause.asm │ │ │ ├── vfork.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getgid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getpid.asm │ │ │ ├── getppid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── vhangup.asm │ │ │ ├── dup.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── acct.asm │ │ │ ├── fchdir.asm │ │ │ ├── sched_yield.asm │ │ │ ├── chdir.asm │ │ │ ├── exit.asm │ │ │ ├── getsid.asm │ │ │ ├── iopl.asm │ │ │ ├── rmdir.asm │ │ │ ├── setgid.asm │ │ │ ├── setuid.asm │ │ │ ├── stime.asm │ │ │ ├── time.asm │ │ │ ├── umask.asm │ │ │ └── uname.asm │ │ ├── __doc__ │ │ ├── nop.asm │ │ ├── trap.asm │ │ ├── infloop.asm │ │ └── crash.asm │ │ ├── amd64 │ │ ├── android │ │ │ ├── __doc__ │ │ │ ├── getpid.asm │ │ │ ├── kill.asm │ │ │ ├── sigreturn.asm │ │ │ ├── readptr.asm │ │ │ ├── echo.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── migrate_stack.asm │ │ │ ├── pause.asm │ │ │ ├── read_upto.asm │ │ │ ├── vfork.asm │ │ │ ├── getgid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── acct.asm │ │ │ ├── fchdir.asm │ │ │ ├── sched_yield.asm │ │ │ ├── chdir.asm │ │ │ ├── getsid.asm │ │ │ ├── iopl.asm │ │ │ ├── rmdir.asm │ │ │ ├── setgid.asm │ │ │ ├── setuid.asm │ │ │ ├── stime.asm │ │ │ ├── time.asm │ │ │ └── umask.asm │ │ ├── __doc__ │ │ ├── trap.asm │ │ ├── nop.asm │ │ ├── infloop.asm │ │ └── linux │ │ │ ├── __doc__ │ │ │ ├── getpid.asm │ │ │ ├── kill.asm │ │ │ ├── sigreturn.asm │ │ │ ├── readptr.asm │ │ │ ├── echo.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── getgid.asm │ │ │ ├── getuid.asm │ │ │ ├── migrate_stack.asm │ │ │ ├── pause.asm │ │ │ ├── read_upto.asm │ │ │ ├── setsid.asm │ │ │ ├── vfork.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── sched_yield.asm │ │ │ ├── acct.asm │ │ │ ├── fchdir.asm │ │ │ ├── iopl.asm │ │ │ ├── chdir.asm │ │ │ ├── chroot.asm │ │ │ ├── getsid.asm │ │ │ ├── rmdir.asm │ │ │ ├── setgid.asm │ │ │ ├── setuid.asm │ │ │ ├── stime.asm │ │ │ └── time.asm │ │ ├── mips │ │ ├── android │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── echo.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── getgid.asm │ │ │ ├── getpid.asm │ │ │ ├── getuid.asm │ │ │ ├── pause.asm │ │ │ ├── setsid.asm │ │ │ ├── vfork.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── dup.asm │ │ │ ├── sh.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── sched_yield.asm │ │ │ ├── acct.asm │ │ │ ├── fchdir.asm │ │ │ └── iopl.asm │ │ ├── __doc__ │ │ ├── linux │ │ │ ├── __doc__ │ │ │ ├── sh.asm │ │ │ ├── sigreturn.asm │ │ │ ├── echo.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── pause.asm │ │ │ ├── vfork.asm │ │ │ ├── getgid.asm │ │ │ ├── getpid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── dup.asm │ │ │ ├── dupsh.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── acct.asm │ │ │ ├── brk.asm │ │ │ ├── fchdir.asm │ │ │ ├── sched_yield.asm │ │ │ ├── chdir.asm │ │ │ ├── getsid.asm │ │ │ ├── iopl.asm │ │ │ ├── rmdir.asm │ │ │ ├── setgid.asm │ │ │ └── setuid.asm │ │ ├── trap.asm │ │ └── nop.asm │ │ ├── thumb │ │ ├── android │ │ │ ├── __doc__ │ │ │ ├── sh.asm │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── pause.asm │ │ │ ├── vfork.asm │ │ │ ├── getgid.asm │ │ │ ├── getpid.asm │ │ │ ├── getuid.asm │ │ │ ├── setsid.asm │ │ │ ├── dupsh.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── acct.asm │ │ │ ├── fchdir.asm │ │ │ └── sched_yield.asm │ │ ├── linux │ │ │ ├── __doc__ │ │ │ ├── sigreturn.asm │ │ │ ├── fork.asm │ │ │ ├── sync.asm │ │ │ ├── getgid.asm │ │ │ ├── getpid.asm │ │ │ ├── getuid.asm │ │ │ ├── pause.asm │ │ │ ├── setsid.asm │ │ │ ├── vfork.asm │ │ │ ├── dupsh.asm │ │ │ ├── getegid.asm │ │ │ ├── geteuid.asm │ │ │ ├── getpgrp.asm │ │ │ ├── getppid.asm │ │ │ ├── vhangup.asm │ │ │ ├── brk.asm │ │ │ ├── close.asm │ │ │ ├── fsync.asm │ │ │ ├── munlockall.asm │ │ │ ├── nice.asm │ │ │ ├── sched_yield.asm │ │ │ ├── acct.asm │ │ │ ├── fchdir.asm │ │ │ └── iopl.asm │ │ ├── nop.asm │ │ ├── trap.asm │ │ ├── __doc__ │ │ ├── infloop.asm │ │ ├── popad.asm │ │ ├── pushad.asm │ │ └── crash.asm │ │ └── common │ │ └── __doc__ ├── version.py ├── rop │ └── __init__.py ├── encoders │ ├── amd64 │ │ └── __init__.py │ ├── mips │ │ └── __init__.py │ ├── i386 │ │ └── __init__.py │ └── arm │ │ └── __init__.py └── elf │ └── __init__.py ├── MANIFEST.in ├── docs ├── .gitignore ├── source │ ├── logo.png │ ├── gdb.rst │ ├── term.rst │ ├── atexit.rst │ ├── ui.rst │ ├── exception.rst │ ├── util │ │ ├── hashes.rst │ │ ├── crc.rst │ │ ├── lists.rst │ │ ├── net.rst │ │ ├── fiddling.rst │ │ ├── cyclic.rst │ │ ├── proc.rst │ │ ├── safeeval.rst │ │ ├── web.rst │ │ └── misc.rst │ ├── dynelf.rst │ ├── atexception.rst │ ├── replacements.rst │ ├── runner.rst │ ├── shellcraft │ │ ├── common.rst │ │ └── regsort.rst │ ├── rop │ │ ├── rop.rst │ │ └── srop.rst │ ├── rop.rst │ ├── elf.rst │ ├── fmtstr.rst │ ├── testexample.rst │ ├── useragents.rst │ ├── memleak.rst │ ├── timeout.rst │ ├── constants.rst │ └── tubes │ │ ├── serial.rst │ │ └── processes.rst └── requirements.txt ├── .gitattributes ├── .isort.cfg ├── extra └── textmate │ └── screenshot.png ├── tox.ini ├── examples ├── yesno.py ├── options.py ├── splash.py ├── remote.py ├── attach.py └── asm.py ├── .gitignore ├── .sublime-settings ├── pwn └── __init__.py └── requirements.txt /pwnlib/internal/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include *.txt 2 | -------------------------------------------------------------------------------- /pwnlib/constants/cgc/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/android: -------------------------------------------------------------------------------- 1 | linux -------------------------------------------------------------------------------- /pwnlib/constants/cgc/alpha.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/amd64.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/arm.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/i386.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/ia64.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/mips.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/s390.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/s390x.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/sparc.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/linux/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/alpha.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/amd64.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/i386.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/ia64.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/mips.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/s390.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/s390x.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/sparc.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/thumb.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | robots.txt 3 | -------------------------------------------------------------------------------- /pwnlib/commandline/__init__.py: -------------------------------------------------------------------------------- 1 | # empty 2 | -------------------------------------------------------------------------------- /pwnlib/constants/cgc/aarch64.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/powerpc.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/powerpc64.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/constants/cgc/sparc64.py: -------------------------------------------------------------------------------- 1 | thumb.py -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/aarch64.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/powerpc.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/powerpc64.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/data/includes/cgc/sparc64.h: -------------------------------------------------------------------------------- 1 | arm.h -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/__doc__: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/__doc__: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/version.py: -------------------------------------------------------------------------------- 1 | __version__ = '2.2.1' 2 | -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/alpha.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/amd64.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/arm.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/i386.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/ia64.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/mips.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/s390.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/s390x.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/sparc.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/thumb.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/vm/vm.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/rop/__init__.py: -------------------------------------------------------------------------------- 1 | from .rop import ROP 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/cgc/__doc__: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | pwnlib/data/* linguist-vendored 2 | -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/aarch64.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/powerpc.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/powerpc64.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/freebsd/sparc64.h: -------------------------------------------------------------------------------- 1 | ../freebsd.h -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/sys/_iovec.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/sys/_sigset.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/sys/_types.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/sys/cdefs.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/sys/time.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/encoders/amd64/__init__.py: -------------------------------------------------------------------------------- 1 | from . import delta -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/__doc__: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/__doc__: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/machine/_align.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/machine/_limits.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/machine/signal.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/sys/_timespec.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/encoders/mips/__init__.py: -------------------------------------------------------------------------------- 1 | from . import xor 2 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/freebsd/sys/_sockaddr_storage.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/__doc__: -------------------------------------------------------------------------------- 1 | ../linux/__doc__ -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/__doc__: -------------------------------------------------------------------------------- 1 | ../linux/__doc__ -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/__doc__: -------------------------------------------------------------------------------- 1 | ../linux/__doc__ -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/__doc__: -------------------------------------------------------------------------------- 1 | ../linux/__doc__ -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/__doc__: -------------------------------------------------------------------------------- 1 | ../linux/__doc__ -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/__doc__: -------------------------------------------------------------------------------- 1 | ../linux/__doc__ -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/__doc__: -------------------------------------------------------------------------------- 1 | ../linux/__doc__ -------------------------------------------------------------------------------- /pwnlib/encoders/i386/__init__.py: -------------------------------------------------------------------------------- 1 | from . import delta 2 | from . import xor 3 | -------------------------------------------------------------------------------- /pwnlib/encoders/arm/__init__.py: -------------------------------------------------------------------------------- 1 | from . import alphanumeric 2 | from . import xor 3 | -------------------------------------------------------------------------------- /.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | indent=' ' 3 | not_skip = __init__.py 4 | force_single_line = 1 -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing generic MIPS shellcodes. 2 | -------------------------------------------------------------------------------- /docs/source/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arthaud/python3-pwntools/HEAD/docs/source/logo.png -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/trap.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A trap instruction. 2 | int3 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing generic Intel x86_64 shellcodes. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/trap.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A trap instruction. 2 | int3 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing ARM shellcodes for Linux. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing generic Intel i386 shellcodes. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing MIPS shellcodes for Linux. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing THUMB shellcodes for Linux. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/nop.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A nop instruction. 2 | mov r6, r6 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/trap.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A trap instruction. 2 | BKPT 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/nop.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A single-byte nop instruction. 2 | nop 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing generic ARM little endian shellcodes. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/nop.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A nop instruction. 2 | orr r1, r1, r1 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/common/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing shellcode common to all platforms. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/infloop.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A two-byte infinite loop. 2 | jmp $ 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing Intel i386 shellcodes for Linux. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/nop.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A single-byte nop instruction. 2 | nop 3 | -------------------------------------------------------------------------------- /extra/textmate/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/arthaud/python3-pwntools/HEAD/extra/textmate/screenshot.png -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/infloop.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A two-byte infinite loop. 2 | jmp $ 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing Intel x86_64 shellcodes for Linux. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/freebsd/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing Intel i386 shellcodes for FreeBSD. 2 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/trap.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A trap instruction. 2 | teq $zero, $zero 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/__doc__: -------------------------------------------------------------------------------- 1 | Shellcraft module containing generic thumb little endian shellcodes. 2 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/alpha.h: -------------------------------------------------------------------------------- 1 | #define __alpha__ 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/ia64.h: -------------------------------------------------------------------------------- 1 | #define __ia64__ 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/mips.h: -------------------------------------------------------------------------------- 1 | #define __mips__ 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/s390.h: -------------------------------------------------------------------------------- 1 | #define __s390__ 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/s390x.h: -------------------------------------------------------------------------------- 1 | #define __s390x__ 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/sparc.h: -------------------------------------------------------------------------------- 1 | #define __sparc__ 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/sparc64.h: -------------------------------------------------------------------------------- 1 | #define __sparc64__ 2 | #include 3 | #include 4 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/breakpoint.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A single-byte breakpoint instruction. 2 | int3 3 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/nop.asm: -------------------------------------------------------------------------------- 1 | <%docstring>MIPS nop instruction. 2 | add $t9, $t9, $zero /* nop */ 3 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/thumb.h: -------------------------------------------------------------------------------- 1 | #define __arm__ 2 | #define __thumb__ 3 | #include 4 | #include 5 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/aarch64.h: -------------------------------------------------------------------------------- 1 | #define __arm__ 2 | #define __aarch64__ 3 | #include 4 | #include 5 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/prolog.asm: -------------------------------------------------------------------------------- 1 | <%docstring> 2 | Function prologue. 3 | 4 | 5 | push ebp 6 | mov ebp, esp 7 | -------------------------------------------------------------------------------- /docs/source/gdb.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.gdb` --- Working with GDB 2 | ====================================== 3 | 4 | .. automodule:: pwnlib.gdb 5 | :members: 6 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/amd64.h: -------------------------------------------------------------------------------- 1 | #define __x86_64__ 2 | #include 3 | #include 4 | #include 5 | -------------------------------------------------------------------------------- /docs/source/term.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.term` --- Terminal handling 2 | ======================================== 3 | 4 | .. automodule:: pwnlib.term 5 | :members: 6 | -------------------------------------------------------------------------------- /pwnlib/data/includes/generator/linux/arm.h: -------------------------------------------------------------------------------- 1 | #define __arm__ 2 | #define __ARM_EABI__ 1 3 | #define __KERNEL__ 1 4 | #include 5 | #include 6 | -------------------------------------------------------------------------------- /docs/source/atexit.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.atexit` --- Replacement for atexit 2 | =============================================== 3 | 4 | .. automodule:: pwnlib.atexit 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/source/ui.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.ui` --- Functions for user interaction 2 | =================================================== 3 | 4 | .. automodule:: pwnlib.ui 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/source/exception.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.exception` --- Pwnlib exceptions 2 | ==================================================== 3 | 4 | .. automodule:: pwnlib.exception 5 | :members: 6 | -------------------------------------------------------------------------------- /docs/source/util/hashes.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.util.hashes` --- Hashing functions 2 | =============================================== 3 | 4 | .. automodule:: pwnlib.util.hashes 5 | :members: 6 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/getpid.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%docstring>Retrieve the current PID 3 | 4 | ${amd64.linux.syscall('SYS_getpid')} 5 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/getpid.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%docstring>Retrieve the current PID 3 | 4 | ${amd64.linux.syscall('SYS_getpid')} 5 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/trap.asm: -------------------------------------------------------------------------------- 1 | <%docstring>A trap instruction. 2 | nop 3 | nop 4 | nop 5 | mov r0, 12 6 | mov r1, sp 7 | BKPT 0xab 8 | B . 9 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py33, py34 3 | [testenv] 4 | deps=-r{toxinidir}/requirements.txt 5 | -r{toxinidir}/docs/requirements.txt 6 | commands=make PWNLIB_NOTERM=1 -C docs clean doctest 7 | -------------------------------------------------------------------------------- /examples/yesno.py: -------------------------------------------------------------------------------- 1 | """ 2 | Example showing `pwnlib.ui.yesno()` 3 | """ 4 | 5 | from pwn import * 6 | 7 | if ui.yesno('Do you like Pwntools?'): 8 | print(':D') 9 | else: 10 | print(':(') 11 | -------------------------------------------------------------------------------- /docs/source/dynelf.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.dynelf` --- Resolving remote functions using leaks 2 | =============================================================== 3 | 4 | .. automodule:: pwnlib.dynelf 5 | :members: 6 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/infloop.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import common %> 2 | <%docstring>An infinite loop. 3 | <% infloop = common.label("infloop") %> 4 | ${infloop}: 5 | b ${infloop} 6 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/sh.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import thumb %> 2 | <%docstring> 3 | Execute a different process. 4 | 5 | ${thumb.linux.execve('/system/bin//sh', ['sh'], 0)} 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.hi 3 | *.pyc 4 | __pycache__ 5 | *~ 6 | *.swp 7 | .ropeproject 8 | *.pdf 9 | */auto/* 10 | */bin/* 11 | docs/build 12 | build 13 | MANIFEST 14 | dist 15 | pwntools.egg-info 16 | *.core 17 | -------------------------------------------------------------------------------- /docs/source/atexception.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.atexception` --- Callbacks on unhandled exception 2 | ============================================================== 3 | 4 | .. automodule:: pwnlib.atexception 5 | :members: 6 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/infloop.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import common %> 2 | <%docstring>An infinite loop. 3 | <% infloop = common.label("infloop") %> 4 | ${infloop}: 5 | b ${infloop} 6 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/infloop.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import common %> 2 | <%docstring>An infinite loop. 3 | <% infloop = common.label("infloop") %> 4 | ${infloop}: 5 | b ${infloop} 6 | -------------------------------------------------------------------------------- /.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "default_encoding": "UTF-8", 3 | "ensure_newline_at_eof_on_save": true, 4 | "tab_size": 4, 5 | "translate_tabs_to_spaces": true, 6 | "trim_trailing_white_space_on_save": true 7 | } 8 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/sh.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import mips %> 2 | <%docstring>Execute /bin/sh 3 | 4 | ${mips.pushstr('//bin/sh')} 5 | 6 | ${mips.syscall('SYS_execve', '$sp', 0, 0)} 7 | -------------------------------------------------------------------------------- /docs/source/replacements.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.replacements` --- Replacements for various functions 2 | ================================================================= 3 | 4 | .. automodule:: pwnlib.replacements 5 | :members: 6 | -------------------------------------------------------------------------------- /examples/options.py: -------------------------------------------------------------------------------- 1 | """ 2 | Example showing `pwnlib.ui.options()` 3 | """ 4 | 5 | from pwn import * 6 | 7 | opts = [string.ascii_letters[x] for x in range(10)] 8 | print('You choose "%s"' % opts[options('Pick one:', opts)]) 9 | -------------------------------------------------------------------------------- /examples/splash.py: -------------------------------------------------------------------------------- 1 | """ 2 | "Easteregg" 3 | """ 4 | 5 | from pwn import * 6 | 7 | splash() 8 | 9 | h = log.waitfor("You wrote", status="--") 10 | 11 | while True: 12 | l = input('> ') 13 | h.status(l.upper()) 14 | -------------------------------------------------------------------------------- /pwnlib/elf/__init__.py: -------------------------------------------------------------------------------- 1 | from .elf import load, ELF 2 | from .corefile import Core 3 | from .datatypes import * 4 | 5 | __all__ = ['load', 'ELF', 'Core'] + sorted(filter(lambda x: not x.startswith('_'), datatypes.__dict__.keys())) 6 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/popad.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%docstring> 3 | Pop all of the registers onto the stack which i386 popad does, 4 | in the same order. 5 | 6 | pop {r0-r12} 7 | -------------------------------------------------------------------------------- /docs/source/runner.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwn import * 4 | 5 | :mod:`pwnlib.runner` --- Running Shellcode 6 | =========================================== 7 | 8 | .. automodule:: pwnlib.runner 9 | :members: 10 | -------------------------------------------------------------------------------- /examples/remote.py: -------------------------------------------------------------------------------- 1 | """ 2 | Example showing how to use the remote class. 3 | """ 4 | 5 | from pwn import * 6 | 7 | sock = remote('127.0.0.1', 9001) 8 | 9 | print(sock.recvline()) 10 | sock.send('foo') 11 | sock.interactive() 12 | -------------------------------------------------------------------------------- /pwn/__init__.py: -------------------------------------------------------------------------------- 1 | # Promote useful stuff to toplevel 2 | from .toplevel import * 3 | 4 | pwnlib.args.initialize() 5 | pwnlib.log.install_default_handler() 6 | 7 | log = pwnlib.log.getLogger('pwnlib.exploit') 8 | args = pwnlib.args.args 9 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/pushad.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%docstring> 3 | Push all of the registers onto the stack which i386 pushad does, 4 | in the same order. 5 | 6 | push {r0-r12} 7 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # This requirements.txt file simply hits the setup.py file and 2 | # installs the 'install_requires' python modules, the magic command 3 | # to do that is simply '-e .': so here it is 4 | 5 | # Amazing command 6 | -e . 7 | -------------------------------------------------------------------------------- /examples/attach.py: -------------------------------------------------------------------------------- 1 | """ 2 | Example showing `pwnlib.gdb.attach()` 3 | """ 4 | 5 | from pwn import * 6 | 7 | bash = process('/bin/bash') 8 | gdb.attach(bash, execute = ''' 9 | p "hello from pwnlib" 10 | c 11 | ''') 12 | bash.interactive() 13 | -------------------------------------------------------------------------------- /docs/source/shellcraft/common.rst: -------------------------------------------------------------------------------- 1 | :mod:`pwnlib.shellcraft.common` --- Shellcode common to all architecture 2 | ======================================================================== 3 | 4 | .. automodule:: pwnlib.shellcraft.common 5 | :members: 6 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/kill.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="pid, signal='SIGKILL'"/> 3 | <%docstring>Writes a string to a file descriptor 4 | 5 | ${amd64.linux.syscall('SYS_kill', pid, signal)} 6 | -------------------------------------------------------------------------------- /docs/source/rop/rop.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwn import * 4 | 5 | :mod:`pwnlib.rop.rop` --- Return Oriented Programming 6 | ========================================================== 7 | 8 | .. automodule:: pwnlib.rop.rop 9 | :members: 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/kill.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="pid, signal='SIGKILL'"/> 3 | <%docstring>Writes a string to a file descriptor 4 | 5 | ${amd64.linux.syscall('SYS_kill', pid, signal)} 6 | -------------------------------------------------------------------------------- /docs/source/rop/srop.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwn import * 4 | 5 | :mod:`pwnlib.rop.srop` --- Sigreturn Oriented Programming 6 | ========================================================== 7 | 8 | .. automodule:: pwnlib.rop.srop 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/util/crc.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.util.crc import * 4 | 5 | 6 | :mod:`pwnlib.util.crc` --- Calculating CRC-sums 7 | =============================================== 8 | 9 | .. automodule:: pwnlib.util.crc 10 | :members: 11 | -------------------------------------------------------------------------------- /docs/source/util/lists.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.util.lists import * 4 | 5 | :mod:`pwnlib.util.lists` --- Operations on lists 6 | ================================================ 7 | 8 | .. automodule:: pwnlib.util.lists 9 | :members: 10 | -------------------------------------------------------------------------------- /docs/source/util/net.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.util.net import * 4 | 5 | 6 | :mod:`pwnlib.util.net` --- Networking interfaces 7 | =================================================== 8 | 9 | .. automodule:: pwnlib.util.net 10 | :members: 11 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%docstring> 5 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 6 | 7 | 8 | ${syscall('SYS_sigreturn')} 9 | -------------------------------------------------------------------------------- /docs/source/shellcraft/regsort.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.regsort import * 4 | 5 | :mod:`pwnlib.regsort` --- Register sorting 6 | =========================================================== 7 | 8 | .. automodule:: pwnlib.regsort 9 | :members: 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%docstring> 5 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 6 | 7 | 8 | ${syscall('SYS_sigreturn')} 9 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%docstring> 5 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 6 | 7 | 8 | ${syscall('SYS_sigreturn')} 9 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%docstring> 5 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 6 | 7 | 8 | ${syscall('SYS_sigreturn')} 9 | -------------------------------------------------------------------------------- /docs/source/rop.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwn import * 4 | 5 | :mod:`pwnlib.rop` --- Return Oriented Programming 6 | ================================================= 7 | 8 | Submodules 9 | ---------- 10 | 11 | .. toctree:: 12 | :glob: 13 | 14 | rop/* 15 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%docstring> 5 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 6 | 7 | 8 | ${syscall('SYS_rt_sigreturn')} 9 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%docstring> 5 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 6 | 7 | 8 | ${syscall('SYS_rt_sigreturn')} 9 | -------------------------------------------------------------------------------- /docs/source/elf.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.elf import * 4 | from pwnlib.util.misc import which 5 | 6 | :mod:`pwnlib.elf` --- Working with ELF binaries 7 | =============================================== 8 | 9 | .. automodule:: pwnlib.elf 10 | :members: 11 | -------------------------------------------------------------------------------- /docs/source/fmtstr.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwn import * 4 | import tempfile 5 | 6 | :mod:`pwnlib.fmtstr` --- Format string bug exploitation tools 7 | ============================================================= 8 | 9 | .. automodule:: pwnlib.fmtstr 10 | :members: 11 | -------------------------------------------------------------------------------- /docs/source/testexample.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | import os 4 | from pwnlib.testexample import add 5 | 6 | :mod:`pwnlib.testexample` --- Example Test Module 7 | ================================================== 8 | 9 | .. automodule:: pwnlib.testexample 10 | :members: 11 | -------------------------------------------------------------------------------- /docs/source/useragents.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.useragents import * 4 | 5 | :mod:`pwnlib.useragents` --- A database of useragent strings 6 | ============================================================ 7 | 8 | .. automodule:: pwnlib.useragents 9 | :members: 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%docstring> 5 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 6 | 7 | 8 | 9 | ${syscall('SYS_sigreturn', )} 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%docstring> 5 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 6 | 7 | 8 | 9 | ${syscall('SYS_sigreturn', )} 10 | -------------------------------------------------------------------------------- /docs/source/util/fiddling.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.util.fiddling import * 4 | 5 | 6 | :mod:`pwnlib.util.fiddling` --- Utilities bit fiddling 7 | ====================================================== 8 | 9 | .. automodule:: pwnlib.util.fiddling 10 | :members: 11 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/readptr.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="fd=0, target_reg='rdx'"/> 3 | <%docstring>Reads 8 bytes into the specified register 4 | 5 | push 1 6 | ${amd64.linux.read(fd, 'rsp', 8)} 7 | pop ${target_reg} 8 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/readptr.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="fd=0, target_reg='rdx'"/> 3 | <%docstring>Reads 8 bytes into the specified register 4 | 5 | push 1 6 | ${amd64.linux.read(fd, 'rsp', 8)} 7 | pop ${target_reg} 8 | -------------------------------------------------------------------------------- /docs/source/util/cyclic.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.util.cyclic import * 4 | 5 | 6 | :mod:`pwnlib.util.cyclic` --- Generation of unique sequences 7 | ============================================================ 8 | 9 | .. automodule:: pwnlib.util.cyclic 10 | :members: 11 | -------------------------------------------------------------------------------- /docs/source/util/proc.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.util.proc import * 4 | import os, sys 5 | 6 | 7 | :mod:`pwnlib.util.proc` --- Working with ``/proc/`` 8 | =================================================== 9 | 10 | .. automodule:: pwnlib.util.proc 11 | :members: 12 | -------------------------------------------------------------------------------- /pwnlib/constants/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The file __init__.py is covered by the same license as the majority of this 2 | project, that is an MIT license. 3 | 4 | The remaining files of this directory and all subdirectories are covered 5 | by the terms decribed in the file: 6 | 7 | pwnlib/data/includes/LICENSE.txt 8 | -------------------------------------------------------------------------------- /docs/source/memleak.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.memleak import * 4 | 5 | :mod:`pwnlib.memleak` --- Helper class for leaking memory 6 | ========================================================= 7 | 8 | .. module:: pwnlib.memleak 9 | 10 | .. autoclass:: MemLeak 11 | :members: 12 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/echo.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import mips %> 2 | <%page args="string, sock=1"/> 3 | <%docstring>Writes a string to a file descriptor 4 | 5 | ${mips.pushstr(string, append_null=False)} 6 | ${mips.linux.syscall('SYS_write', sock, '$sp', len(string))} 7 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/echo.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import mips %> 2 | <%page args="string, sock=1"/> 3 | <%docstring>Writes a string to a file descriptor 4 | 5 | ${mips.pushstr(string, append_null=False)} 6 | ${mips.linux.syscall('SYS_write', sock, '$sp', len(string))} 7 | -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | sphinxcontrib-napoleon 2 | sphinxcontrib-autoprogram 3 | isort 4 | paramiko>=1.15.2 5 | mako>=1.0.0 6 | pyelftools>=0.2.3 7 | capstone 8 | ropgadget>=5.3 9 | pyserial>=2.7 10 | requests>=2.5.1 11 | pip>=6.0.8 12 | tox>=1.8.1 13 | pygments>=2.0 14 | sphinx_rtd_theme 15 | doc2dash 16 | -------------------------------------------------------------------------------- /docs/source/util/safeeval.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.util.safeeval import * 4 | 5 | 6 | :mod:`pwnlib.util.safeeval` --- Safe evaluation of python code 7 | ============================================================== 8 | 9 | .. automodule:: pwnlib.util.safeeval 10 | :members: 11 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/echo.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="string, sock='1'"/> 3 | <%docstring>Writes a string to a file descriptor 4 | 5 | ${amd64.pushstr(string, append_null=False)} 6 | ${amd64.linux.syscall('SYS_write', sock, 'rsp', len(string))} 7 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/echo.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="string, sock='1'"/> 3 | <%docstring>Writes a string to a file descriptor 4 | 5 | ${amd64.pushstr(string, append_null=False)} 6 | ${amd64.linux.syscall('SYS_write', sock, 'rsp', len(string))} 7 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/crash.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft.arm import mov %> 2 | <%docstring> 3 | Crash. 4 | 5 | Example: 6 | 7 | >>> run_assembly(shellcraft.crash()).poll(True) 8 | -11 9 | 10 | 11 | pop {r0-r12,lr} 12 | ${mov('sp', 0)} 13 | add pc, sp, #0 14 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/epilog.asm: -------------------------------------------------------------------------------- 1 | <%page args="nargs=0"/> 2 | <%docstring> 3 | Function epilogue. 4 | 5 | Arguments: 6 | nargs(int): Number of arguments to pop off the stack. 7 | 8 | 9 | leave 10 | %if nargs: 11 | ret ${nargs}*4 12 | %else: 13 | ret 14 | %endif 15 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="scp"/> 5 | <%docstring> 6 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 7 | 8 | 9 | ${syscall('SYS_sigreturn')} 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/crash.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft.thumb import mov %> 2 | <%docstring> 3 | Crash. 4 | 5 | Example: 6 | 7 | >>> run_assembly(shellcraft.crash()).poll(True) < 0 8 | True 9 | 10 | 11 | pop {r0-r12,lr} 12 | ldr sp, [sp, 64] 13 | bx r1 14 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="scp"/> 5 | <%docstring> 6 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 7 | 8 | 9 | ${syscall('SYS_sigreturn')} 10 | -------------------------------------------------------------------------------- /docs/source/timeout.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.context import context 4 | from pwnlib.timeout import Timeout 5 | import time 6 | 7 | :mod:`pwnlib.timeout` --- Timeout handling 8 | ============================================ 9 | 10 | .. automodule:: pwnlib.timeout 11 | :members: 12 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="scp"/> 5 | <%docstring> 6 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 7 | 8 | 9 | ${syscall('SYS_sigreturn')} 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="scp"/> 5 | <%docstring> 6 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 7 | 8 | 9 | ${syscall('SYS_sigreturn')} 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/crash.asm: -------------------------------------------------------------------------------- 1 | <%docstring> 2 | Crash. 3 | 4 | Example: 5 | 6 | >>> run_assembly(shellcraft.crash()).poll(True) 7 | -11 8 | 9 | popad /* fill all registers with shit */ 10 | xor esp, esp /* especially esp */ 11 | jmp esp /* boom */ 12 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="scp"/> 5 | <%docstring> 6 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 7 | 8 | 9 | ${syscall('SYS_sigreturn')} 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/sigreturn.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="scp"/> 5 | <%docstring> 6 | Invokes the syscall sigreturn. See 'man 2 sigreturn' for more information. 7 | 8 | 9 | ${syscall('SYS_sigreturn')} 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /docs/source/constants.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib import constants 4 | from pwnlib.context import context 5 | 6 | :mod:`pwnlib.constants` --- Easy access to header file constants 7 | ================================================================ 8 | 9 | .. automodule:: pwnlib.constants 10 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/migrate_stack.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="size=0x100000, fd=0"/> 3 | <%docstring>Migrates to a new stack. 4 | 5 | ${amd64.linux.mmap_rwx(size)} 6 | ${amd64.mov('rsp', 'rax')} 7 | 8 | add rsp, ${hex((size * 3 // 4) & ~7)} 9 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/read_upto.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="fd=0, buffer='rsp', sizereg='rdx'"/> 3 | <%docstring>Reads up to N bytes 8 bytes into the specified register 4 | 5 | ${amd64.linux.readptr(sizereg)} 6 | ${amd64.linux.read(fd, buffer, sizereg)} 7 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/migrate_stack.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="size=0x100000, fd=0"/> 3 | <%docstring>Migrates to a new stack. 4 | 5 | ${amd64.linux.mmap_rwx(size)} 6 | ${amd64.mov('rsp', 'rax')} 7 | 8 | add rsp, ${hex((size * 3 // 4) & ~7)} 9 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/read_upto.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import amd64 %> 2 | <%page args="fd=0, buffer='rsp', sizereg='rdx'"/> 3 | <%docstring>Reads up to N bytes 8 bytes into the specified register 4 | 5 | ${amd64.linux.readptr(sizereg)} 6 | ${amd64.linux.read(fd, buffer, sizereg)} 7 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/fork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall fork. See 'man 2 fork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_fork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/sync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sync. See 'man 2 sync' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sync')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/pause.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall pause. See 'man 2 pause' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_pause')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/vfork.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vfork. See 'man 2 vfork' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vfork')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/dupsh.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft.thumb import linux %> 2 | <%page args="sock='r6'"/> 3 | <%docstring> 4 | Args: [sock (imm/reg) = ebp] 5 | Duplicates sock to stdin, stdout and stderr and spawns a shell. 6 | 7 | 8 | ${linux.dup(sock)} 9 | 10 | ${linux.sh()} 11 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /docs/source/util/web.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.context import context 4 | from pwnlib.util.web import * 5 | 6 | :mod:`pwnlib.util.web` --- Utilities for working with the WWW 7 | ============================================================= 8 | 9 | .. automodule:: pwnlib.util.web 10 | :members: 11 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/sh.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft import mips %> 2 | <%docstring>Execute /bin/sh 3 | 4 | ${mips.push(0)} 5 | ${mips.pushstr('sh')} 6 | ${mips.mov('$a1', '$sp')}} 7 | 8 | ${mips.pushstr('/system/bin//sh')} 9 | 10 | ${mips.syscall('SYS_execve', '$sp', '$a1', 0)} 11 | 12 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/dupsh.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft.mips import linux %> 2 | <%page args="sock='$s0'"/> 3 | <%docstring> 4 | Args: [sock (imm/reg) = s0] 5 | Duplicates sock to stdin, stdout and stderr and spawns a shell. 6 | 7 | 8 | 9 | ${linux.dup(sock)} 10 | 11 | ${linux.sh()} 12 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/getgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getgid. See 'man 2 getgid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getgid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/getpid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpid. See 'man 2 getpid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/getuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getuid. See 'man 2 getuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/setsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall setsid. See 'man 2 setsid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_setsid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/dupsh.asm: -------------------------------------------------------------------------------- 1 | <% from pwnlib.shellcraft.thumb import linux %> 2 | <%page args="sock='r6'"/> 3 | <%docstring> 4 | Args: [sock (imm/reg) = ebp] 5 | Duplicates sock to stdin, stdout and stderr and spawns a shell. 6 | 7 | 8 | ${linux.dup(sock)} 9 | 10 | ${linux.sh()} 11 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/getegid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getegid. See 'man 2 getegid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getegid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/geteuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall geteuid. See 'man 2 geteuid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_geteuid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/getpgrp.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getpgrp. See 'man 2 getpgrp' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getpgrp')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/getppid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall getppid. See 'man 2 getppid' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_getppid')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/vhangup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall vhangup. See 'man 2 vhangup' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_vhangup')} 13 | -------------------------------------------------------------------------------- /docs/source/tubes/serial.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwn import * 4 | 5 | :mod:`pwnlib.tubes.serialtube` --- Serial Ports 6 | =========================================================== 7 | 8 | .. automodule:: pwnlib.tubes.serialtube 9 | 10 | .. autoclass:: pwnlib.tubes.serialtube.serialtube 11 | :members: 12 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="fd, fd2"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="fd, fd2"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/dup.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall dup. See 'man 2 dup' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_dup', fd)} 13 | -------------------------------------------------------------------------------- /examples/asm.py: -------------------------------------------------------------------------------- 1 | """ 2 | Example showing the interface to `pwnlib.asm.asm` and `pwnlib.shellcraft`. 3 | """ 4 | 5 | from pwn import * 6 | 7 | context(arch='i386', os='linux') 8 | 9 | shellcode = shellcraft.i386_to_amd64() 10 | shellcode_asm = asm(shellcode) 11 | 12 | print(enhex(shellcode_asm)) 13 | print(disasm(shellcode_asm)) 14 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /docs/source/util/misc.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwnlib.util.misc import * 4 | import os, subprocess 5 | os.chdir("..") 6 | 7 | :mod:`pwnlib.util.misc` --- We could not fit it any other place 8 | =============================================================== 9 | 10 | .. automodule:: pwnlib.util.misc 11 | :members: 12 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/chdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall chdir. See 'man 2 chdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_chdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/getsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="pid"/> 5 | <%docstring> 6 | Invokes the syscall getsid. See 'man 2 getsid' for more information. 7 | 8 | Arguments: 9 | pid(pid_t): pid 10 | 11 | 12 | ${syscall('SYS_getsid', pid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/rmdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall rmdir. See 'man 2 rmdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_rmdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/setgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="gid"/> 5 | <%docstring> 6 | Invokes the syscall setgid. See 'man 2 setgid' for more information. 7 | 8 | Arguments: 9 | gid(gid_t): gid 10 | 11 | 12 | ${syscall('SYS_setgid', gid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/android/setuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="uid"/> 5 | <%docstring> 6 | Invokes the syscall setuid. See 'man 2 setuid' for more information. 7 | 8 | Arguments: 9 | uid(uid_t): uid 10 | 11 | 12 | ${syscall('SYS_setuid', uid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/chdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall chdir. See 'man 2 chdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_chdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/exit.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="status"/> 5 | <%docstring> 6 | Invokes the syscall exit. See 'man 2 exit' for more information. 7 | 8 | Arguments: 9 | status(int): status 10 | 11 | 12 | ${syscall('SYS_exit', status)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/getsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="pid"/> 5 | <%docstring> 6 | Invokes the syscall getsid. See 'man 2 getsid' for more information. 7 | 8 | Arguments: 9 | pid(pid_t): pid 10 | 11 | 12 | ${syscall('SYS_getsid', pid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/rmdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall rmdir. See 'man 2 rmdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_rmdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/setgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="gid"/> 5 | <%docstring> 6 | Invokes the syscall setgid. See 'man 2 setgid' for more information. 7 | 8 | Arguments: 9 | gid(gid_t): gid 10 | 11 | 12 | ${syscall('SYS_setgid', gid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/setuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="uid"/> 5 | <%docstring> 6 | Invokes the syscall setuid. See 'man 2 setuid' for more information. 7 | 8 | Arguments: 9 | uid(uid_t): uid 10 | 11 | 12 | ${syscall('SYS_setuid', uid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/stime.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="when"/> 5 | <%docstring> 6 | Invokes the syscall stime. See 'man 2 stime' for more information. 7 | 8 | Arguments: 9 | when(time_t): when 10 | 11 | 12 | ${syscall('SYS_stime', when)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/time.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="timer"/> 5 | <%docstring> 6 | Invokes the syscall time. See 'man 2 time' for more information. 7 | 8 | Arguments: 9 | timer(time_t): timer 10 | 11 | 12 | ${syscall('SYS_time', timer)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/umask.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="mask"/> 5 | <%docstring> 6 | Invokes the syscall umask. See 'man 2 umask' for more information. 7 | 8 | Arguments: 9 | mask(mode_t): mask 10 | 11 | 12 | ${syscall('SYS_umask', mask)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/arm/linux/uname.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.arm.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall uname. See 'man 2 uname' for more information. 7 | 8 | Arguments: 9 | name(utsname): name 10 | 11 | 12 | ${syscall('SYS_uname', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/android/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/chdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall chdir. See 'man 2 chdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_chdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/getsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="pid"/> 5 | <%docstring> 6 | Invokes the syscall getsid. See 'man 2 getsid' for more information. 7 | 8 | Arguments: 9 | pid(pid_t): pid 10 | 11 | 12 | ${syscall('SYS_getsid', pid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/rmdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall rmdir. See 'man 2 rmdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_rmdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/setgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="gid"/> 5 | <%docstring> 6 | Invokes the syscall setgid. See 'man 2 setgid' for more information. 7 | 8 | Arguments: 9 | gid(gid_t): gid 10 | 11 | 12 | ${syscall('SYS_setgid', gid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/i386/linux/setuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.i386.linux import syscall 3 | %> 4 | <%page args="uid"/> 5 | <%docstring> 6 | Invokes the syscall setuid. See 'man 2 setuid' for more information. 7 | 8 | Arguments: 9 | uid(uid_t): uid 10 | 11 | 12 | ${syscall('SYS_setuid', uid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/android/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/chdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall chdir. See 'man 2 chdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_chdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/getsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="pid"/> 5 | <%docstring> 6 | Invokes the syscall getsid. See 'man 2 getsid' for more information. 7 | 8 | Arguments: 9 | pid(pid_t): pid 10 | 11 | 12 | ${syscall('SYS_getsid', pid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/rmdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall rmdir. See 'man 2 rmdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_rmdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/setgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="gid"/> 5 | <%docstring> 6 | Invokes the syscall setgid. See 'man 2 setgid' for more information. 7 | 8 | Arguments: 9 | gid(gid_t): gid 10 | 11 | 12 | ${syscall('SYS_setgid', gid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/mips/linux/setuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.mips.linux import syscall 3 | %> 4 | <%page args="uid"/> 5 | <%docstring> 6 | Invokes the syscall setuid. See 'man 2 setuid' for more information. 7 | 8 | Arguments: 9 | uid(uid_t): uid 10 | 11 | 12 | ${syscall('SYS_setuid', uid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/munlockall.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall munlockall. See 'man 2 munlockall' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_munlockall')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/android/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/brk.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="addr"/> 5 | <%docstring> 6 | Invokes the syscall brk. See 'man 2 brk' for more information. 7 | 8 | Arguments: 9 | addr(void): addr 10 | 11 | 12 | ${syscall('SYS_brk', addr)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/close.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall close. See 'man 2 close' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_close', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/fsync.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fsync. See 'man 2 fsync' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fsync', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/nice.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args="inc"/> 5 | <%docstring> 6 | Invokes the syscall nice. See 'man 2 nice' for more information. 7 | 8 | Arguments: 9 | inc(int): inc 10 | 11 | 12 | ${syscall('SYS_nice', inc)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/powerpc/linux/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.powerpc.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/android/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/thumb/linux/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.thumb.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /docs/source/tubes/processes.rst: -------------------------------------------------------------------------------- 1 | .. testsetup:: * 2 | 3 | from pwn import * 4 | 5 | :mod:`pwnlib.tubes.process` --- Processes 6 | =========================================================== 7 | 8 | .. automodule:: pwnlib.tubes.process 9 | 10 | .. autoclass:: pwnlib.tubes.process.process 11 | :members: 12 | :show-inheritance: 13 | -------------------------------------------------------------------------------- /pwnlib/constants/constant.py: -------------------------------------------------------------------------------- 1 | class Constant(int): 2 | 3 | def __new__(cls, s, i): 4 | obj = super(Constant, cls).__new__(cls, i) 5 | obj.s = s 6 | return obj 7 | 8 | def __str__(self): 9 | return self.s 10 | 11 | def __repr__(self): 12 | return 'Constant(%r, %#x)' % (self.s, int(self)) 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/fchdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="fd"/> 5 | <%docstring> 6 | Invokes the syscall fchdir. See 'man 2 fchdir' for more information. 7 | 8 | Arguments: 9 | fd(int): fd 10 | 11 | 12 | ${syscall('SYS_fchdir', fd)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/android/sched_yield.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args=""/> 5 | <%docstring> 6 | Invokes the syscall sched_yield. See 'man 2 sched_yield' for more information. 7 | 8 | Arguments: 9 | 10 | 11 | 12 | ${syscall('SYS_sched_yield')} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/acct.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="name"/> 5 | <%docstring> 6 | Invokes the syscall acct. See 'man 2 acct' for more information. 7 | 8 | Arguments: 9 | name(char): name 10 | 11 | 12 | ${syscall('SYS_acct', name)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/chdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall chdir. See 'man 2 chdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_chdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/aarch64/linux/rmdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.aarch64.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall rmdir. See 'man 2 rmdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_rmdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/chdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall chdir. See 'man 2 chdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_chdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/getsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="pid"/> 5 | <%docstring> 6 | Invokes the syscall getsid. See 'man 2 getsid' for more information. 7 | 8 | Arguments: 9 | pid(pid_t): pid 10 | 11 | 12 | ${syscall('SYS_getsid', pid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/iopl.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="level"/> 5 | <%docstring> 6 | Invokes the syscall iopl. See 'man 2 iopl' for more information. 7 | 8 | Arguments: 9 | level(int): level 10 | 11 | 12 | ${syscall('SYS_iopl', level)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/rmdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall rmdir. See 'man 2 rmdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_rmdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/setgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="gid"/> 5 | <%docstring> 6 | Invokes the syscall setgid. See 'man 2 setgid' for more information. 7 | 8 | Arguments: 9 | gid(gid_t): gid 10 | 11 | 12 | ${syscall('SYS_setgid', gid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/setuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="uid"/> 5 | <%docstring> 6 | Invokes the syscall setuid. See 'man 2 setuid' for more information. 7 | 8 | Arguments: 9 | uid(uid_t): uid 10 | 11 | 12 | ${syscall('SYS_setuid', uid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/stime.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="when"/> 5 | <%docstring> 6 | Invokes the syscall stime. See 'man 2 stime' for more information. 7 | 8 | Arguments: 9 | when(time_t): when 10 | 11 | 12 | ${syscall('SYS_stime', when)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/time.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="timer"/> 5 | <%docstring> 6 | Invokes the syscall time. See 'man 2 time' for more information. 7 | 8 | Arguments: 9 | timer(time_t): timer 10 | 11 | 12 | ${syscall('SYS_time', timer)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/android/umask.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="mask"/> 5 | <%docstring> 6 | Invokes the syscall umask. See 'man 2 umask' for more information. 7 | 8 | Arguments: 9 | mask(mode_t): mask 10 | 11 | 12 | ${syscall('SYS_umask', mask)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/chdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall chdir. See 'man 2 chdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_chdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/chroot.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall chroot. See 'man 2 chroot' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_chroot', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/getsid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="pid"/> 5 | <%docstring> 6 | Invokes the syscall getsid. See 'man 2 getsid' for more information. 7 | 8 | Arguments: 9 | pid(pid_t): pid 10 | 11 | 12 | ${syscall('SYS_getsid', pid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/rmdir.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="path"/> 5 | <%docstring> 6 | Invokes the syscall rmdir. See 'man 2 rmdir' for more information. 7 | 8 | Arguments: 9 | path(char): path 10 | 11 | 12 | ${syscall('SYS_rmdir', path)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/setgid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="gid"/> 5 | <%docstring> 6 | Invokes the syscall setgid. See 'man 2 setgid' for more information. 7 | 8 | Arguments: 9 | gid(gid_t): gid 10 | 11 | 12 | ${syscall('SYS_setgid', gid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/setuid.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="uid"/> 5 | <%docstring> 6 | Invokes the syscall setuid. See 'man 2 setuid' for more information. 7 | 8 | Arguments: 9 | uid(uid_t): uid 10 | 11 | 12 | ${syscall('SYS_setuid', uid)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/stime.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="when"/> 5 | <%docstring> 6 | Invokes the syscall stime. See 'man 2 stime' for more information. 7 | 8 | Arguments: 9 | when(time_t): when 10 | 11 | 12 | ${syscall('SYS_stime', when)} 13 | -------------------------------------------------------------------------------- /pwnlib/shellcraft/templates/amd64/linux/time.asm: -------------------------------------------------------------------------------- 1 | <% 2 | from pwnlib.shellcraft.amd64.linux import syscall 3 | %> 4 | <%page args="timer"/> 5 | <%docstring> 6 | Invokes the syscall time. See 'man 2 time' for more information. 7 | 8 | Arguments: 9 | timer(time_t): timer 10 | 11 | 12 | ${syscall('SYS_time', timer)} 13 | --------------------------------------------------------------------------------