Git Product home page Git Product logo

castle-shell's Introduction

castleShell - Encrypted PHP web shell

castleShell is a single-file PHP web shell, which uses encryption in order to hide your traces in web logs.

The first step is to establishing a shared key between the back and front end of the shell. This is done by using Diffie-Hellman key exchange, which makes it (practically) impossible to find out the shared key even when all of the mutual communication is logged. After the key exchange, all communication (e.g. executed commands) gets encrypted and decrypted with the shared key.

However, due to some limitations, the last used encryption key gets temporarely stored in the PHP session. You can clear it by either using the destroy command or by refreshing the webpage.

This web shell is based on p0wny@shell:~# but besides having encryption, castleShell also includes a few addional features (marked with +++)

Features

  • Command history (using arrow keys โ†‘ โ†“)
  • Auto-completion of command and file names (using Tab key)
  • Navigate on the remote file-system (using cd command)
  • Upload a file to the server (using upload <destination_file_name> command)
  • Download a file from the server (using download <file_name> command)
  • Destroy the session and delete the shell (using destroy command) +++
  • Semi-realistic bash prompt +++

Screenshot

Here is the encryped output of a command: Screenshot

TODO

  • A fully interactive PTY shell with colors and stuff. (Requires a complete rewrite.)
  • Add longer and more secure Diffie-Hellman groups.

Known bugs

  • Sometimes the key exhange fails, which results in an alert box with an error. Refresh the webpage to try again.
  • No terminal colours.
  • Failed cd command does not output an error.

Changelog

  • 2020-11-11: Initial release

castle-shell's People

Contributors

joonatanjak avatar

Stargazers

loecho avatar Karl-Gregor Keerles avatar Lyra Rebane avatar

Watchers

Karl-Gregor Keerles avatar  avatar

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.