Extracting install files uploaded to Kace

Fri 10 February 2012

I've been working on Kace more and more recently, and I have come to realise that once you upload a binary file for a managed installation, you can't download it again... At least, not easily. The following is one possible way for you to extract your binary back out of your Kace K1000 box -- practical if you've lost or deleted your original file and do not wish to lose your work!

In order to proceed, you need to know a little about XML and how files work. You're going to be working with a hex editor; if you're not comfortable with that, you may wish to reconsider undertaking this little manipulation.

First, log into your Kace admin console over the web, then go to Settings > Security Settings. Scroll down to the Samba section and enable file sharing by ticking on the corresponding checkbox, and setting the admin password. Next, go to Settings > Resources > Export K1000 resources. Select your managed install package and under Actions, click on Export to Samba Share. This will effectively export your entire managed installation package to the \k1000clientdrop share.

Kace saves the configuration and binaries in a format that is relatively easy to read -- a compressed XML file. It is saved as a file of extension .KPKG; if you rename the file to .ZIP, you can extract the underlying XML file to a location where you can work on it.

As mentioned before, you'll need a hex editor in order to proceed. When working with Windows  I've used Olly even if it's not really intended as a hex editor. If you're a Linux buff, ghex is a great little tool, very simple and straightforward. For my experimentation, I went with HxD, which is free and is very much like ghex in terms of its simplicity.

Open up the XML and locate the beginning of your file. This is relatively simple if you're used to working with raw files; if you're not, you may find that this site might help you. I suspect that most of your binaries, like mine, will be self-extracting files -- in other words, executables -- in which case, the file header that you're looking for is '4D 5A' (that's "MZ" in ASCII). If you truncate your XML file just before that, you should be good to go!