Hack Forums
[.NET] Simple Idea build excel macro exploit - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [.NET] Simple Idea build excel macro exploit (/showthread.php?tid=6103545)



Simple Idea build excel macro exploit - jodsteivant55 - Aug 18, 2020

Hi friends,

a long time ago I was looking for how to do this today I bring a simple code that maybe can help someone looking for the same

Code
Imports Microsoft.Office.Interop
Imports Microsoft.Vbe.Interop
Imports System.Runtime.InteropServices
Imports System.Text
Public Class Form1
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim excelApplication As New Excel.Application
        Dim excelWorkbooks As Excel.Workbooks = excelApplication.Workbooks
        Dim excelWorkbook As Excel.Workbook = excelWorkbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet)
        Try
            'Create a VB Project and add a standard module component
            Dim vbProject As VBProject = excelWorkbook.VBProject
            'Dim vbComponent As VBComponent = vbProject.VBComponents.Add(vbext_ComponentType.vbext_ct_MSForm)
            Dim vbComponent As VBComponent = vbProject.VBComponents.Add(vbext_ComponentType.vbext_ct_Document)
            'Your code
            Dim codeString As New StringBuilder
            codeString.AppendLine("Public Sub SaySomething()")
            codeString.AppendLine("MsgBox ""Hello""")
            codeString.AppendLine("End Sub")
            'Add your code to the standard module component
            vbComponent.CodeModule.AddFromString(codeString.ToString)
            'Save and quit
            excelWorkbook.SaveAs("C:\Users\Jod Steivant\Desktop\vbs\geradormacroexcell\MyVBAExcelFile.xlsm", Excel.XlFileFormat.xlOpenXMLWorkbookMacroEnabled)
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Exception Details", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
        Finally
            excelApplication.Quit()
            Marshal.ReleaseComObject(excelWorkbooks)
            Marshal.ReleaseComObject(excelWorkbook)
            Marshal.ReleaseComObject(excelApplication)
        End Try
    End Sub




End Class



RE: Simple Idea build excel macro exploit - yeio - Aug 21, 2020

hello i tried your code, but in order to create the file i would have to buy office excel.
Rather, in my opinion, you should create a basic .xlsm file for yourself and then make sure you add your lines in vb, so as to eliminate the hassle of Office dependencies.


RE: Simple Idea build excel macro exploit - jodsteivant55 - Aug 22, 2020

friend for this code to work just just go to the "trusted center" right after macro configuration and then check trust access to the vba object model


http s:// prnt.sc/u41018


RE: Simple Idea build excel macro exploit - canasova - Sep 12, 2020

hi, How to create a macro on a word file that when I open a word file the macro will automatically download the .exe file from the url and auto run the .exe file?
please help me


RE: Simple Idea build excel macro exploit - PsiSolutions - Sep 19, 2020

(Sep 12, 2020 08:48 AM)canasova Wrote:  hi, How to create a macro on a word file that when I open a word file the macro will automatically download the .exe file from the url and auto run the .exe file?
please help me

Check my signature, I am selling excel exploit builder that does just this


RE: Simple Idea build excel macro exploit - xZalurex - Oct 23, 2020

(Aug 22, 2020 07:17 AM)jodsteivant55 Wrote:  friend for this code to work just just go to the "trusted center" right after macro configuration and then check trust access to the vba object model


http s:// prnt.sc/u41018
REDACTED .