Giter Site home page Giter Site logo

iq-scm / pyshell Goto Github PK

View Code? Open in Web Editor NEW

This project forked from praetorian-inc/pyshell

0.0 0.0 0.0 2.42 MB

PyShell makes interacting with web-based command injection less painful, emulating the feel of an interactive shell as much as possible.

Python 100.00%

pyshell's Introduction

PyShell - Shellify Your HTTP Command Injection!

Firewall got you down? Are your reverse-shell connection attempts being filtered? Are you stuck working solely over HTTP / HTTPS? Then this just might be just the thing for you.

PyShell exists to make interacting with web-based command injection less painful. The goal is to make it feel as much like an interactive shell as possible. Commands are base-64 encoded to help deal with WAFs, and are submitted as POST requests to be less visible in request logs.

Usage is python3 pyshell.py URL where URL points to a script which performs the command injection, something like this:

<?php $r=base64_decode($_POST['cmd']).' '.base64_decode($_POST['opts']); echo `$r` ?>

The server-side script should accept the following parameters:

  • cmd: the command to be run, base64 encoded
  • opts: the options to provide to cmd, also base64 encoded
  • [timeout]: optional, denotes the number of seconds to wait for a command

USAGE DEMO:

Screencast

COOL FEATURES:

  • Basic command history (up arrow / down arrow to navigate).
  • Navigate directory tree with cd [target] pseudo-command.
  • Exfiltrate files or folders via get [target] pseudo-command.
  • Tab completion. (whoa!)

KNOWN ISSUES:

  • Trying to cd into a non-existent directory is not prevented

MISC NOTES:

Note that you only get output when the command you run exits. Interactive commands are also unsupported, for reasons that should be obvious -- although if you ever forget why while using PyShell, we'll consider that a success!

To change the timeout parameter passed with each command, run settimeout n. It defaults to 20. Unless you handle the timeout parameter server side, it does exactly nothing.

Your command-history is located in ~/.pyshellhistory.

When exfiltrating data, a tgz file will be created in the downloads subdirectory (which will be created as needed). If you do not have permission to read a file, the file will simply be omitted in the downloaded archive.

pyshell's People

Contributors

ojensen5115 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.