21
Jan 11
Jan 11
P3wn Windows from Ubuntu
I don't run windows, still there are cases that I need to remotely run a windows tool in an automated fashion, up till now I didn't find a working solution,
psexec is the tool of choice on the windows platform, googeling will lead you to this forum post that mentions winexe.
Finding how to use the tool and installing the latest version (0.9.1) on Ubuntu 10.10 took me some time that I hope this post will spare.
Most sites offer to compile winexe right from zenoss repo going this route will lead you to 0.8 version running which didn't work with a remote win7,
another (less mentioned) option is on sourceforge, the project page offers 0.91 source tar, lets head on to business:
$ wget http://tinyurl.com/4t8vjwl && tar -xvzf 4t8vjwl
$ cd winexe-0.91/source4
$ ./autogen.sh
$ ./configure
$ make
$ bin/winexe
winexe version 0.91
This program may be freely redistributed under the terms of the GNU GPLv3
...
Using the tool is as follows:
$ bin/winexe -U windows-domain/user%pass //machine-name "cmd" C:\ we are in windows landNote that the machine name is that under the windows domain and not dns name, the user must have admin remote priviliges in the domain (not just on the machine) in order to bypass that you can regedit your way out, I wish you all a windows-less future :)

Follow me online