Just found this project, and am hoping it will allow me to run commands on win 7 from linux.
I'm using Tinycore Linux, and have downloaded and tried the following versions of winexe
winexe-0.91.tar.gz
winexe-1.00.tar.gz
winexe-static-081123.bz2
Found simple guides to installing the software online, and installing seems to go fine on my distro. Did have to install python and python-dev.
winexe-static-081123.bz2 does not seem to need any installing/compiling or have any dependencies, it just unpacks and runs after being made executable by my user.
Regardless of WHAT version of winexe I try, I get the same error message on all of them when trying to run a simple command on a remote win 7 pro machine.
$ winexe -U Steve%password //10.1.1.5 "cmd -k ipconfig /all"
ERROR: Failed to open connection - NT_STATUS_IO_TIMEOUT
I've tried this to a win xp virtual macine as well, with the exact same error message.
Any suggestions would be very welcome.
Thanks :)
Have solved this using google.
Seems a few settings are required in Windows 7 Pro to get this to work. Reference this website : http://miskstuf.tumblr.com/post/6840077505/winexe-1-00-linux-macos-windows-7-finally-working for following solution that worked for me.
winexe 1.00, Linux/MacOS, Windows 7; finally working
For a few weeks I’ve been trying to get winexe compiled, running, connecting, and working from both Linux (Ubuntu 11.04) and MacOS X (Snow Leopard, 10.6.x), to a Windows 7 system. But could never find a complete solution, only fragments of information. This may help anyone trying to piece things together as I did.
First, on the Windows system you want to remote connect to:
If you have the firewall enabled, enable “Inbound Rules” -> “Remote Service Management (NP-In)” (I figured this out by trial and error)
Add this to the registry (see this and this)
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
Then on Linux/Mac, get and build from latest source; 1.00 as of this post.
wget http://sourceforge.net/projects/winexe/files/winexe-1.00.tar.gz/download -O winexe-1.00.tar.gz
tar xf winexe-1.00.tar.gz
On Mac, there’s a patch you have to apply (see the note under “For Mac OS X:” here; I created the tinypaste link for convenience)
wget http://tinypaste.com/70837/save.php?hash=0 -O 1.patch
patch -p0 < 1.patch
Then continue:
cd winexe-1.00/source4
./autogen.sh
./configure
make
./bin/winexe -U “<user>%<password>” //<windows system=""> cmd.exe
Notes:
On Ubuntu, some of the packages that I had to install (I don’t remember all of them) are: autoconf, python-dev.
On Mac, I’m using homebrew for missing standard *nix packages/utilities, like wget.
Some sites I’ve read mention running “make proto bin/winexe”, instead of “make”. This failed for me, so I just ran the full make.
Some sites I’ve read mention patching source4/winexe/service.c, changing the line
define NT_STATUS_SERVICE_DOES_NOT_EXIST NT_STATUS(0xc0000424)
from 0xc0000424 to 0x00000424. I tried this. winexe worked fine without changing this line, and didn’t work when I did change it.
Now that I have it working, I can’t get some basic key mappings working, like the backspace key. But that’s a separate issue.
In case the Mac patch should disappear for some reason, the single change is in source4/winexe/winexe.h. Change
struct tevent_context *ev_ctx;
to
extern struct tevent_context *ev_ctx;