Can't Create Process in Pwntools

I am trying to use python's pwntools. I want to start a process using

from pwn import *
s = process('./step1')

When I do this I receive the following error message:

Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/pwnlib/tubes/process.py", line 267, in init stdin, stdout, stderr, master, slave = self._handles(*handles) File "/usr/local/lib/python2.7/dist-packages/pwnlib/tubes/process.py", line 603, in _handles tty.setraw(master) File "/usr/lib/python2.7/tty.py", line 28, in setraw tcsetattr(fd, when, mode) termios.error: (22, 'Invalid argument')

I am already in the directory that contains the file step1 and step1 is executable. Does anyone have an idea why I get this error. If it helps, I am using the Linux subsystem on Windows 10.

1 Answer

Check out this link. process() needs its first argument as a list of program arguments. So

$ ./step1 arg1 arg2

is equivalent to

p = process(['step1', 'arg1', 'arg2'])

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest