6.4.5 操纵应用行为

有些应用可能有开发人员用于执行测试的特殊指令。最突出的指令之一是debug=1。将这条指令附加在GET或POST请求上可能返回关于变量、系统或者后端数据库连接的更多信息。成功的攻击可能要求debug、dbg和true、T或者1的组合。一些平台可能允许在URL上设置内部变量。其他攻击针对Web服务器。对于JRun 3.0和3.1以及Tomcat 3.2.3,插入%3f.jsp将返回目录列表。

搜索引擎

强大的百分号(%)常常在SQL或者搜索引擎中代表一个通配符。在搜索域中提交百分号可能返回整个数据库内容,或者生成一个带有信息的错误,如下例:

http://victim.com/users/search?FreeText=on&kw=on&ss=%

Exception in com.motive.web411.Search.processQuery(Compiled Code):

java.lang.StringIndexOutOfBoundsException:String index out of range:

3 at java.lang.String.substring(Compiled Code)at

javax.servlet.http.HttpUtils.parseName(Compiled Code)at

javax.servlet.http.HttpUtils.parseQueryString(Compiled Code)at

com.motive.mrun.MotiveServletRequest.parseParameters(Compiled Code)

at com.motive.mrun.MotiveServletRequest.getParameterValues(Compiled

Code)at com.motive.web411.MotiveServlet.getParamValue(Compiled Code)

at com.motive.web411.Search.processQuery(Compiled Code)at

com.motive.web411.Search.doGet(Compiled Code)at

javax.servlet.http.HttpServlet.service(Compiled Code)at

javax.servlet.http.HttpServlet.service(Compiled Code)at

com.motive.mrun.ServletRunner.RunServlet(Compiled Code)

SQL也使用下划线(_)表示单个字符通配符。采用LDAP后端的Web应用可能也暴露在基于星号的相似攻击之下,在LDAP协议中星号代表通配符。