Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Simple Idea build excel macro exploit

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


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by Dio BrandoMar 10, 2022 09:55 AM 4 467 Mar 10, 2022 09:55 AM
Last Post: benio2
[.NET] by QU35TApr 1, 2020 01:47 AM 4 182 Apr 1, 2020 01:47 AM
Last Post: QU35T
[C#] by MrHudson185Jul 17, 2019 05:03 PM 0 195 Jul 17, 2019 05:03 PM
Last Post: MrHudson185