Skip to content
This repository has been archived by the owner on Jan 2, 2018. It is now read-only.

rothgar/scriptr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

scriptr

Scriptr is a go wrapper for running arbitrary commands. It was created out of the need to run an executable as a different user without sudo or su.

I wrote this tool to learn a little bit of go and solve a very specific problem. If you want something that probably works better you should check out how to do it in C. An example can be found here.

Usage

You can use scriptr by downloading the scriptr executable and running executables in your path.

./scriptr whoami
rothgar

If you want to run a program as a different user, you, or someone with access, can change the owner of the executable and set the sticky execution bit of scripter.

chmod +s scriptr
sudo chown root scriptr

Now scripter will fork proccesses as the owner.

./scriptr whoami
root

Scriptr will also accept flags to the called executable for options.

./scriptr id -un
root

Warning

Scriptr is incredibly dangerous. Seriously. It should not replace built in security features of your operating system.

Caveats

Scriptr will not work with shell scripts. For an example. If you have a script

#!/bin/bash
# ./whoami.sh

whoami

You can run the script with

chmod +x ./whoami.sh
./scriptr ./whoami.sh
rothgar

Building

If you want to build the source you can install go and run

go build scriptr.go

You can also set the owner with sudo -u USER go build scriptr.go if you want to save a step.

About

go wrapper for executables

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published