Giter Club home page Giter Club logo

escalator's Introduction

Escalator

A library for privelege-escalation written in Zig.

Requirements

  • zig compiler (0.12.0 or newer)

Install

First, add the dependency to your build.zig.zon using zig fetch:

zig fetch --save git+https://github.com/weskoerber/escalator#main

Then, import escalator into your build.zig:

const std = @import("std");

pub fn build(b: *std.Build) void {
    const target = b.standardTargetOptions(.{});
    const optimize = b.standardOptimizeOption(.{});

    const escalator = b.dependency("escalator", .{
            .target = target,
            .optimize = optimize,
    }).module("escalator");

    const my_exe = b.addExecutable(.{
        .name = "my_exe",
        .root_source_file = b.path("src/main.zig"),
        .target = target,
        .optimize = optimize,
    });

    my_exe.root_module.addImport(escalator);
}

Usage

Documentation can be found at https://weskoerber.github.io/escalator. The docs are generated by Zig's autodoc feature and deployed via Github Actions.

Also see the examples directory for example usage. Example executables can be built by setting the examples option to true:

    const mac_address = b.dependency("escalator", .{
            .target = target,
            .optimize = optimize,
            .examples = true,
    }).module("escalator");

Acknowlegments

escalator's People

Contributors

weskoerber avatar

Stargazers

 avatar

Watchers

 avatar

escalator's Issues

Determine if Windows support is feasible

Windows has ShellExecuteExA which takes a pointer to a SHELLEXECUTEINFOA structure. This structure contains a field called lpVerb. lpVerb can take the value runAs which launches a program as Administrator:

runas: Launches an application as Administrator. User Account Control (UAC) will prompt the user for consent to run the application elevated or enter the credentials of an administrator account used to run the application.

It seems that we may be able to make the escalate function use this to restart the program as admin (or, depending on the comptime OS tag, use Linux syscalls).

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.