Git Product home page Git Product logo

spoofing-office-macro's Introduction

This repository contains an example of a VBA macro spawning a process with a spoofed parent and command line. Companion blog post: Building an Office macro to spoof parent processes and command line arguments

Demo

Click for full size.

Demo

Notes

  • The 32-bit initial PoC was written and tested by myself, on Windows 10 with Office Professional Plus 2016, version 1902.

  • The 64-bit version is a contribution brought by @py7hagoras.

  • The size of the original command line stored in originalCli needs to be greater than the size of the real one stored in cmdStr

Acknowledgments & inspiration

Disclaimer

You are solely responsible for the use you make of this PoC. I assume no liability for any misuse or damage caused by this program.

spoofing-office-macro's People

Contributors

christophetd avatar cnotin avatar py7hagoras avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spoofing-office-macro's Issues

PoC no longer works

Is this dead project? When I run macro on Windows 10, it will not work...

64 bit compatibility

Hey I am trying to use the VB macro on 64-bit machine O365 but looks like it's not compatible. It gave some ptrsafe errors. I fixed them by adding ptrsafe to the declare statements but then I got some ByRef errors. I also tried converting long to longptr as suggested in some articles for converting 32 nit vb to 64 bit. Is there any chance that you can provide 64 bit version or any tips to fix the errors?

Convert VBA code to vbs code or js code?

hi bro ,I really appreciate your writing this code。
but,Can you convert VBA code to vbs code or js code ? Vbs code or js codes is very userful
I will be very grateful if you can

Same issue as the others

I have the same issue as the others.
A buffer overflow at

result = NtQueryInformationProcess(newProcessHandle, 0, pbi, Len(pbi), size)

Cant work

Hi

I fix the issues and tried in 32bit and 64bit office at Windows10 Environment

But I found result = NtQueryInformationProcess(newProcessHandle, 0, pbi, Len(pbi), size) doesn't work. the result is FALSE

And the new Process still be a childProcess of WINWORD.EXE.
Can you help me

By the way, the function to getPid is not work.
I used WMI to get Pid

Function getProcessId(ByVal name As String)
    Dim objServices As Object, objProcessSet As Object, Process As Object
    Dim tmp As Integer
    Set objServices = GetObject("winmgmts:\\.\root\CIMV2")
    Set objProcessSet = objServices.ExecQuery("SELECT ProcessID, name FROM Win32_Process WHERE name = " & Chr(&H22) & name & Chr(&H22), , 48)
    For Each Process In objProcessSet
        tmp = Process.ProcessID
    Next
    getProcessId = tmp
End Function

Thanks

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.