GithubHelp home page GithubHelp logo

niv256 / simple_rootkit Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 4.0 210.55 MB

A simple LKM kernel space rootkit for v5.x linux with multiple functions.

License: GNU General Public License v3.0

Makefile 1.93% C 98.07%
rootkit kernel linux

simple_rootkit's Introduction

simple_rootkit

A simple LKM kernel space rootkit for < v5.7 linux with multiple functions.

Warning: due to the unexport of kallsyms_lookup functions from the kernel introduced in v5.7, this rootkit will NOT work on this version onwards.

How to build and run the LKM

  1. Clone the repository to a local folder.
  2. cd into src/
  3. Run make in order to build the module.
  4. Watch the kernel logging with dmesg -w in order to see printk messages in real time.
  5. Insert the module with sudo insmod rootkit.ko and specify parameters:
    pid - process id to hide.
    file_name - file name to hide.
  6. Remove the module with sudo rmmod rootkit.

How to hide a chosen pid:

  1. When inserting the module, pass the chosen pid as a parameter to the insmod function, like this:
    sudo insmod rookit.ko pid=6375, to hide pid 6375.

How to hide a chosen file name:

  1. When inserting the module, pass the chosen file name as a parameter to the insmod function, like this:
    sudo insmod rookit.ko file_name=foobar, to hide files with the name "foobar".

How to read the user's keystrokes:

  1. Read from /dev/rootkit file, for example, with cat /dev/rootkit.

How to spawn a root shell as a normal user once the rootkit has loaded:

  1. Execute the get_root program (in get_root folder) or anything similar which write "please_give_me_root" to /dev/rootkit and spawns a shell.
  2. Execute the id program to make sure you are root.
  3. Enjoy unlimited capabilities!

Currently planned features:

  • keylogging.
  • providing root access from inside the machine.
  • process hiding from ps
  • file hiding from ls.

Minor TODO list:

  • Automate the mknod process.

Built and tested on a 18.04 ubuntu machine (kernel version 5.4.0).

simple_rootkit's People

Contributors

niv256 avatar

Stargazers

 avatar  avatar  avatar  avatar Appsec.IO avatar Tomer Eyzenberg avatar Omer Katz avatar  avatar Fai Yew avatar Ofir avatar

Watchers

 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.