Debian/Ubuntu wmi-client package with OpenVAS libwmiclient1 patches

The other day I wanted to build some updated OpenVAS packages and realized I now needed libwmiclient1 for local Windows checks which wasn’t readily available anywhere. The old wmi-client package that used to be in debian was pulled due to the forked/branched nature of the source code as well as the idea that something better could be implemented with the upcoming Samba4 release. That didn’t seem to pan out in the end but OpenVAS still needs to use aspects of it to build libwmiclient1 for WMI support. I suppose monitoring applications like Nagios, Cacti, Zabbix, etc are all likely feeling the loss of wmic as well so I figure why not try to fill both gaps? Anyways, here are the packages we created for Orvant, OpenVAS or anybody else who wants or needs it.

Orvant Packages

Debian 6.0 (Squeeze) AMD64

Debian 6.0 (Squeeze) i386

Ubuntu 10.10 (Maverick) AMD64

Ubuntu 10.10 (Maverick) i386

Source Package

Using the WMI client package (libwmiclient1 is only useful for OpenVAS):

wmic -U <user>%<pass> //10.1.1.100 "select CommandLine,Handle,Name,ProcessId from Win32_Process"

CLASS: Win32_Process
CommandLine|Handle|Name|ProcessId
“C:\Windows\system32\cmd.exe” |3512|cmd.exe|3512
C:\Windows\Explorer.EXE|2740|explorer.exe|2740
C:\Windows\system32\lsass.exe|436|lsass.exe|436

Debian Sid/Unstable VirtualBox 3 Guest

Debian Sid/Unstable GuestAs I was poking around the VirtualBox support forums the other day I noticed there seems to be a ton of confusion surrounding linux guests. A lot of that seems like it stems from the way virtualbox has to approach additional kernel modules in guest additions. So here is the “Debian way” that both Ubuntu and Debian users can use.

Installation:

Grab a stable net install (i386 or amd64 image) from Debian’s image download. You can try testing if you want, it should be closer to the base build of debian you are going to want but half the time the installer is severely broken until close to freeze periods in the debian freeze phase.

Setup a new VirtualBox Guest to install. Here is the basic gist:

Make sure to select Linux and Debian.

Select Debian Guest

Selected the netinst ISO that you’ve just downloaded.

Select the netinst ISO as a boot image.

Make sure you enable 3D and give the GPU some memory to work with.

Enabled 3D Acceleration

Configuring a Debian Guest:

Go through the normal install process and when you get to the end where you select the task. Just select “Standard Linux System” for now. Once you are done with the install reboot and replace all instances of lenny with sid in /etc/apt/sources.list and upgrade:

sed 's/lenny/sid/g' /etc/apt/sources.list
apt-get update
apt-get -f dist-upgrade

Once you have upgraded to sid and rebooted, log back in as root and install the desktop environment by running tasksel and selecting “Desktop Environment”:

tasksel

That will install a boatload of packages so when it completes you’ll want to setup X and install the virtualbox utilities.

apt-get install virtualbox-ose-guest-dkms virtualbox-ose-guest-utils virtualbox-ose-guest-x11
Xorg -configure
mv /root/xorg.conf.root /etc/x11/xorg.conf

DKMS should build the virtualbox guest modules for your kernel on unstable or testing. For lenny or “virtualbox-ose-guest-source” you’d need to install modules-assistant and run “module-assistant” by hand to build a kernel module if it isn’t already under stable as it should be. Which is easy enough, DKMS just made that process easier/automagic.

Now you’ll want to edit /etc/X11/xorg.conf and update your mouse driver to be “vboxmouse” and your video driver to be “vboxvideo”. Then start up GDM and you should have access to direct rendering to run everything from compiz to avant.

nano /etc/X11/xorg.conf
/etc/init.d/gdm restart

Verdict:

Lets hope you made it to something like this:

Debian Sid/Unstable Guest

Debian Sid/Unstable Guest

Your Debian guest should now inegrate with your host computer. (clipboard, mouse, screen resizing, ability to mount shared folders) You’ll also be able to use direct rendering and opengl if you enabled it in virtualbox. There are still an annoying bug with direct rendering under linux guests where the screen does not refresh with something like compiz running. A way to make it less noticeable is to keep the screen ticking along with something changing. That is why I add the seconds to my clock on the guest. Also, if you are getting superblock in the future errors when restarting you will want to edit /etc/default/rcS to utc=no. Of course, that is only applicable to anybody west of prime meridian I guess.