As promised in the previous post, I will show you how to embed the “lonely potato” in InstallUtil.exe.

Why do we need that? Because, as explained here , with Installutil we can call our C# assembly with whatever extension we like, for example “.txt”.

Cool way to bypass some Application and File restriction policies….

Quick and dirty:

  • First of all add a reference to “System.Configuration.Install” in our project

pota2

  • Add your custom “Uninstall” Method in Program.cs:

pota3

That’s all!  We need to recompile the entire project and create a single executable with ILMerge.exe.

Now let’s rename  the assembly in lonelypotato.txt and launch it  from from our shell impersonating  “iis apppool\defaultapppool” user with  Installutil.exe:

c:\andrea\installutil /logfile= /LogToConsole=false 
   /ScriptName=c:\andrea\rev.bat /u c:\andrea\lonelypotato.txt

pota4

Boom again! it works! 🙂

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s