Coder Social home page Coder Social logo

asdlei99 / runinsandbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from forderud/runinsandbox

0.0 1.0 0.0 264 KB

Sample code for launching Windows executables & COM servers in a sandboxed environment

License: MIT License

C++ 83.68% C 0.39% Batchfile 1.57% C# 14.36%

runinsandbox's Introduction

Run in Sandbox

Work-in-progress C++ code for launching executables and out-of-process COM server in a sandboxed low-integrity or AppContainer process on the same machine. There's no need to create any additional user accounts.

Executable sandboxing

Run RunInSandbox.exe [ac|li|mi|hi] ExePath to launch the ExePath application in an AppContainer, low-integrity, medium-integrity or high-integrity process. This works for STARTUPINFOEX-based process creation.

COM sandboxing

Run RunInSandbox.exe [ac|li|mi|hi] ProgID [username] [password] to launch the ProgID COM server in an AppContainer, low-integrity, medium-integrity or high-integrity process. The process will also run through a different user if username&password are provided. Unfortunately, AppContainer isolation doesn't work yet. Also, user impersonation only works for administrator accounts.

Example usage: RunInSandbox.exe li PowerPoint.Application to start Microsoft PowerPoint in a low-integrity process connected using COM automation.

Client-side impersonation problems

This approach performs client-side user impersonation with ImpersonateLoggedOnUser for the current thread. Then the COM server is created with CLSCTX_ENABLE_CLOAKING to allow the COM server to be created with the current thread credentials.

Token impersonation problems
Low integrity โœ… (confirmed to work)
AppContainer โŒ Process is created but CoGetClassObject activation gives E_ACCESSDENIED (The machine-default permission settings do not grant Local Activation permission for the COM Server)

GrantAccess

Command-line tool to make a file or path writable by a low-integrity process. Useful for whitelisting specific folders that should not be subject to application sandboxing.

RunElevatedNet

C#/.Net sample code for launching an executable or COM class in an "elevated" process with admin privileges. The same functionality is also included in the RunInSandbox project.

External references

UAC related:

runinsandbox's People

Contributors

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