Coder Social home page Coder Social logo

doit's Introduction

What? and Why?

a setuid binary that allows you to run a single command as root before it deletes itself idk why I thought'd it be funny tho. I was thinking about security and stuff and this came to mind.

Then I was wondering if there was a "disposable" sudo binary that was a one time use, or one that could give you very very limited commands that are able to run. Mainly because working around user space operations that need root are just annoying.

maybe you could make a custom binary with just and allow-list a single command, like chroot or something, let a process use it for just what it needs and then it silently deletes itself. Not practical probably but I kinda like the idea of a disposable and limited scope binary that you constantly generate and use as needed.

Im also curious if you could download a tar ball with setuid binaries in it and have root on that machine. Probably not right? but also why not?

Examples

  ./doit whoami # root
  ls            # . .. --> binary deleted itself lol

Installation

Build from source

go build
chown root:root doit
chmod u+s doit
# or
just

Features

doit as root, but only once lol

Allow listing

  • Experimental

edit the just file under allows and add commands you want to allow list like: go build -ldflags "-s -w -X main.build_allow=true -X main.allow1=env -X main.allow2=chroot" up to allow5. You obviously wouldn't want to allow env since you can run anything using that. it is "smart" to pack the binary with upx before chmod + chown-ing it.

just allows

please dont use this for anything serious, I am really just messing around here.

doit's People

Contributors

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