Coder Social home page Coder Social logo

5up3rc / maliciousmacromsbuild Goto Github PK

View Code? Open in Web Editor NEW

This project forked from infosecn1nja/maliciousmacromsbuild

0.0 1.0 0.0 6 KB

Generates Malicious Macro and Execute Powershell or Shellcode via MSBuild Application Whitelisting Bypass.

Python 100.00%

maliciousmacromsbuild's Introduction

Malicious Macro MSBuild Generator

Description

Generates Malicious Macro and Execute Powershell or Shellcode via MSBuild Application Whitelisting Bypass.

What is MSBuild

MSBuild.exe (Microsoft Build Engine) is a software build platform used by Visual Studio. It takes XML formatted project files that define requirements for building various platforms and configurations.

Adversaries can use MSBuild to proxy execution of code through a trusted Windows utility. The inline task capability of MSBuild that was introduced in .NET version 4 allows for C# code to be inserted into the XML project file.

MSBuild will compile and execute the inline task. MSBuild.exe is a signed Microsoft binary, so when it is used this way it can execute arbitrary code and bypass application whitelisting defenses that are configured to allow MSBuild.exe execution.

Usage

usage: M3G.py [-h] -i INPUTFILE -p PAYLOAD -o OUTPUT

M3G - Malicious Macro MSBuild Generator v1.0
Author : Rahmat Nurfauzi (@infosecn1nja)

optional arguments:
  -h, --help            show this help message and exit
  -i INPUTFILE, --inputfile INPUTFILE
                        Input file you want to embed into the macro
  -p PAYLOAD, --payload PAYLOAD
                        Choose a payload for powershell or raw shellcode
  -o OUTPUT, --output OUTPUT
                        Output filename for the macro

Example

  • Choose a payload you want to test like shellcode or powershell
  • Generate a raw shellcode in whatever framework you want (Cobalt Strike, Metasploit Framework)

$ msfvenom -p windows/exec cmd="calc.exe" -f raw > payload.bin
$ python M3G.py -p shellcode -i /path/payload.bin -o macro.vba
$ python M3G.py -p powershell -i /path/payload.ps1 -o macro.vba

Links

Credit

Rahmat Nurfauzi (@infosecn1nja)

maliciousmacromsbuild's People

Watchers

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