Personal tools
You are here: Home Management Gateway and Remote Control Wipe a Disk through the Gateway

Wipe a Disk through the Gateway

by jack — last modified 2007-06-05 08:05

How to initiate OS Deployment virtual boot via policy

If you want to remotely wipe a disk through the management gateway, this should do the trick. The basic method is to use the same process that allows OS Deployment to do virtual boot deployment jobs against managed clients; therefore, scope could be broadened to even do a full OS Deployment to a remote machine without VPN.

First, we create a .bat file; in this case we're going to put the evil action into the image, so the batch file is very simple:

set LDMS_CLIENT_DIR=c:\progra~1\landesk\ldclient
set CUSTJOBHOSTIP=GRANITE
set IMAGE=bootdie.img

call %LDMS_CLIENT_DIR%\sdclient.exe /f /p="http://%CUSTJOBHOSTIP%/landesk/vboot/bootfile.exe"
call %LDMS_CLIENT_DIR%\sdclient.exe /f /p="http://%CUSTJOBHOSTIP%/landesk/vboot/tlibr16.dll"
call %LDMS_CLIENT_DIR%\sdclient.exe /f /p="http://%CUSTJOBHOSTIP%/landesk/vboot/tlibr32.dll"
call %LDMS_CLIENT_DIR%\sdclient.exe /f /p="http://%CUSTJOBHOSTIP%/landesk/vboot/%IMAGE%"
call %LDMS_CLIENT_DIR%\sdclient.exe /f /p="http://%CUSTJOBHOSTIP%/landesk/vboot/lddefrag.exe"
copy /Y %LDMS_CLIENT_DIR%\sdmcache\%IMAGE% c:\

call %LDMS_CLIENT_DIR\sdmcache\lddefrag.exe c:\%IMAGE%
call %LDMS_CLIENT_DIR\sdmcache\bootfile.exe c:\%IMAGE% /keep /bootunsafe

SET ERRORLEVEL=0
The four sections of the file will set variable names, download the image file and some utilities, start the reboot, and report success to the policy agent.

Second, we modify the image. Copy ldvboot.img to bootdie.img and use WinImage to inject whatever tools you want, then call those tools from autoexec.bat. In my testing, I injected LANDesk's prtition.exe and called it to erase the partition table.
@echo off
set iar=Y
set IOBS=A
c:\net\pworkcl.exe /M 0
c:\dos\xmsdsk 3072 r: /y /t
md r:\dos
md r:\net
copy c:\dos\*.* r:\dos
copy c:\net\*.* r:\net
copy c:\*.* r:\
set path=r:\;r:\DOS;r:\NET
set COMSPEC=r:\COMMAND.COM
r:
call prtition wipe
@echo g=ffff:0000 | debug
This of course leaves the data on the disk, but protects it from casual users. On the other hand, it's very fast, and if that reboot command worked, the system would be dead before the user had really realized something was happening. Other techniques may include use of Lenovo's sdd.exe if you have access to that through the TVTs, or sending the Linux image and dd'ing some /dev/zero all over the device, or whatever floats your boat. Here's a free disk wiper, and here's some DOS encryption tools.

I'd also think about replacing the bitmap in your bootdie.img, so that the last thing it shows them isn't the nice LANDesk lady, unless you think that's funny :) Thanks to Tracy Hammond for helping test!
Server Says:
Most legends have their basis in facts.
-- Kirk, "And The Children Shall Lead", stardate 5029.5
Safety First!
203 Days without a Dumpster fire.
 

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: