GithubHelp home page GithubHelp logo

mushfiqur47 / rootkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from klecko/rootkit

0.0 0.0 0.0 106 KB

Let's try to create a rootkit!

License: MIT License

Shell 6.91% Python 10.42% C 81.13% Makefile 1.54%

rootkit's Introduction

Rootkit

Let's try to create a rootkit!

Features

  • Hide files by name
  • Hide files whose name contains a magic string
  • Hide processes by PID
  • Hide the rootkit itself
  • See hidden files and PIDs
  • Backdoor thread to provide reverse shell as root

Tested on

  • Ubuntu 18.04.3: 5.4.8-050408-generic, 5.0.0-37-generic, 4.17.0-041700-generic, 4.15.0-72-generic

Details

The rootkit hooks system calls overwriting the syscall table. This allows changing their behavior, causing getdents not to list a hidden file or a hidden entry in /proc, or causing kill to return 'process not found' when it's called on a hidden process, among others. In order to get as much consistency as possible, every syscall with a pid_t argument is hooked (if any is missing, will be added soon).

To communicate with the rootkit from userland, it creates a virtual proc file where it reads requests. A simple client is provided in client.c

There's a config file where you can enable or disable the backdoor thread, hooks, set the magic string and the proc filename, etc.

Also, a sample backdoor script and web server are included. The web server is made with Flask, it lists every active rootkit and provides a button to ask for a reverse shell. Just run nc -lvp PORT, click the button, and enjoy! The backdoor thread of the rootkit runs the backdoor script every few seconds, which updates the web server and grants a reverse shell if requested.

web

Sample usage

  • Set the IPs and ports in the server and in the backdoor script.
  • Build and install in the victim: ./build.sh. This will copy the backdoor script to /tmp, build the client and the rootkit and run insmod on it.
  • Hide files and PIDs with ./client.
  • Run the web server: python3 server.py. You may need to install Flask before: pip install flask.
  • The web server should now have an entry with the data of the victim.
  • Run nc -lvp PORT, with PORT being the SHELL_PORT variable set in the server.
  • Click the "Get Shell" button, wait a few secs.
  • Enjoy the shell!

rootkit's People

Contributors

dmateos-ugr avatar klecko 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.