Code Monkey home page Code Monkey logo

nssctf-round_v7-shadowflag's Introduction

都rm -f执行过了,flag还能找到吗

题目考点

  • /proc/<pid>/fd文件系统
  • 新版本Flask Debug PIN计算
  • Flask Debug界面调取变量数据

解题流程

视频讲解 - Bilibili

请参阅项目目录:./document/poc.py。 在脚本中,备注部分给出了一份无空格Python反弹shell的指令(注意修改为自己的监听地址),并且此脚本为高版本Flask计算Debug PIN的脚本。步骤如下:

  1. 访问靶机,可以看到app.py源码,其中可以看到整体的路由和逻辑
  2. 访问ip:port/shell,用过POST方法发送上文的无空格反弹shell,即可得到shell
  3. 参考赵总的这篇文章2020 年 V&N 内部考核赛 WriteUp - Glzjin,访问到前半部分flag
  4. 阅读poc.py中的注释说明,通过shell读取到相应的环境数据,计算出Debug PIN
  5. 访问ip:port/shell,用过POST方式,随便POST数据(只要不包含act这个变量),或者直接访问ip:port/console,即可触发错误,进而进入Flask Debug界面
  6. 利用上文计算得到的Debug PIN,进入Debug控制台,执行flag2或者dump(),即可读取到变量数据,进而得到flag2
  7. 两段flag拼接,即可解出

参考资料

环境部署

项目已给出Dockerfile,直接执行docker build即可构建镜像。

本项目支持动态flag($FLAG传入),部署容器可使用CTFd,或参考./docker/docker-compose.yml

nssctf-round_v7-shadowflag's People

Contributors

randark-jmt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

shenghuo2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.