Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 940
Rincewind Avatar asked Oct 20 '25 05:10

Rincewind


1 Answers

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'])
like image 125
SamudNeb Avatar answered Oct 21 '25 17:10

SamudNeb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!