Skip to content

pag-r/simplewebshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Go-based webshell for Docker

By default http server listens port 9090.
If using GET commands have to be seperated by comma symbol i.e. ls,-al,|,grep,Dockerfile
If using POST format:

{"command" : "ls -al | grep Dockerfile"}

Build Go binary

go build -o run run.go

Image build

docker build --tag webshell .

Docker image run

docker run -it --rm -p 9090:9090 --name webshell webshell

Usage

  1. GET
  • Shell command output:
curl -XGET <localhost>:9090/cat,run.py
  • Python3 script execution
curl -XGET <localhost>:9090/python3,run.py
  • Python3 direct command execution
curl -XGET <localhost>:9090/python3,-c,\'print\(\"foo\"\)\'
  1. POST
  • Shell command output:
curl -XPOST <localhost>:9090/ -d '{"command" : "cat run.py"}'
  • Python3 script execution
curl -XPOST <localhost>:9090/ -d '{"command" : "python3 run.py"}'
  • Python3 direct command execution
curl -XPOST <localhost>:9090/ -d '{"command":"python3 -c \"print(\\\"foo\\\")\" "}'

About

Simple Docker Webshell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published