Feb-13-2018, 06:07 PM
(Feb-13-2018, 05:18 PM)wavic Wrote: Post the command, please! What it asks for?
process = Popen(['reaver -i wlan1mon -b my:ap:ma:ca:dr:es'], stdin=PIPE, stdout=PIPE, shell=True)after this is run the console prompts: "Restore previous session for my:ap:ma:ca:dr:es? [n/Y]
(Feb-13-2018, 05:37 PM)nilamo Wrote:(Feb-11-2018, 09:49 PM)Monty Wrote: I've tried
process.communicate('Y\n') #TypeError: memoryview: a bytes-like object is required, not 'str'
A bytes-like object can be created by putting ab
in front of your string. Have you tried:process.communicate(b'Y\n')
?
I did try process.communicate(b'Y\n')
But it doesn't run it. I'm guessing it gets stuck on that line when it prompts to continue, if that is the case then the subprocess line would never get completed. Perhaps I need another script to answer to this prompt?
Perhaps I could work-around this by creating a bash script to run a python file with only that line in the background and in the next line it would communicate to that stuck line. Seems like a stupid idea though, there must be a better way.