Skip to content

ctfhub-team/base_web_nodejs_koa_xssbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

基础镜像 WEB NodeJs Koa XSSBot

  • L: Linux Alpine
  • N: NodeJs
  • K: Koa
  • P: PM2
  • R: Redis

Example

TODO:

Usage

Conf

ENV

  • DOMAIN_NAME=xxxx.sandbox.ctfhub.com Auto Set
  • FLAG=ctfhub{base_web_nodejs_koa_xssbot}

You should rewrite flag.sh when you use this image. The $FLAG is not mandatory, but i hope you use it!

Files

  • src 项目源码
    • bot - Bot XSSBot源码
      • main.js - Bot 入口 : 一般无需改动
      • bot.js - Bot 自定义行为
    • web - Web 网站源码
      • app.js - Web 入口
      • ...etc
  • Dockerfile
  • docker-compose.yml
  • meta.yml

Dockerfile

FROM ctfhub/base_web_nodejs_koa_xssbot

COPY src /home/bot/web

RUN cd /home && yarn add xxx; yarn cache clean;

bot/bot.js

If you want to do more, plz overwrite bot/main.js

// Use basic variables in config, it read from process.env
const config = require('../config');

const custom = async function (page) {

    // Example
    // Set Custom Cookie as Flag
    await page.setCookie({
        name: config.FLAG_KEY,
        value: config.FLAG,
        domain: config.DOMAIN,
        path: "/",
        httpOnly: false,
        secure: false,
        sameSite: "Lax"
    });

    // Add your custom page actions
}

module.exports = custom

web/app.js

examples/app.js