Giter Club home page Giter Club logo

c-reverse-shell's Introduction

c-reverse-shell

Info

A reverse shell for Windows and Linux written in C.

Features:

  • Linux and Windows version.
  • Runs in the background (on both, Linux and Windows, no blocking terminal or black screen).
  • You can choose between waiting for the client (if it's no listening) or not.
  • Compile with just one command (see at the bottom of the README.md), there is also a Makefile.

Dependencies

For Windows you will need mingw-w64 compiler (the .exe binary is compiled in linux):

sudo apt install gcc-mingw-w64

How to use

  1. Clone repo:
git clone https://github.com/izenynn/c-reverse-shell.git
  1. Change client IP and client PORT with change_client.sh (you can change it manually inside linux.c and windows.c if you prefer):
./change_client.sh [CLIENT_IP] [CLIENT_PORT]
  1. Compile for Linux and Windows with make (equivalent to make all):
make
  1. And โœจ magic โœจ compile the program in your target, or just send the binary, and execute it, make sure your client is listening ๐Ÿ˜Š.

Additionally you can compile with WAIT_FOR_CLIENT true, this will make the program loop until the connection to the client is established, instead of returning an error in the connection:

make WAIT_FOR_CLIENT=TRUE

NOTE: this doen't work on windows, not sure why, but I'm sleepy, so maybe I fix it another day (or pull request if you fix it please ๐Ÿ˜Š).

Other Makefile rules:

  • make all
  • make linux
  • make windows
  • make re
  • make all WAIT_FOR_CLIENT=TRUE
  • make linux WAIT_FOR_CLIENT=TRUE
  • make windows WAIT_FOR_CLIENT=TRUE
  • make re WAIT_FOR_CLIENT=TRUE
  • make clean

In case you don't have the Makefile, just copy the reverse-shell.c file and compile it with the following command:

  • Linux
gcc -std=c99 linux.c -o rsh.out
gcc -std=c99 linux.c -o rsh.out -D WAIT_FOR_CLIENT
  • Windows:
i686-w64-mingw32-gcc-win32 -std=c99 windows.c -o rsh.exe -lws2_32
i686-w64-mingw32-gcc-win32 -std=c99 windows.c -o rsh.exe -lws2_32 -D WAIT_FOR_CLIENT

forthebadge forthebadge

c-reverse-shell's People

Contributors

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