Winexe is a GNU/Linux based application that allows users to execute commands remotely on WindowsNT/2000/XP/2003/Vista/7/8 systems. It installs a service on the remote system, executes the command and uninstalls the service. Winexe allows execution of most of the windows shell commands. How to install: You can download the source package from Current version is winexe-1.00.tar.gz. tar -xvf winexe-1.00.tar.gz. cd winexe-1.00/source4/./autogen.sh./configure. make basics bin/winexe.
Tennessee serial killer 1902. Philadelphia citypaper.
make “CPP=gcc -E -ffreestanding” basics bin/winexe (For X64 bit) this will create a winexe binary file in the bin folder. You can use that binary to execute the windows commands from Linux.
![]()
Or else there are some compiled version of binary itself available for download. You can download and use it from. How to use it:./winexe -U Domain/User%Password //host command Examples:./winexe -U HOME/Administrator%Pass123 //192.168.0.1 “netstat -a”./winexe -U HOME/Administrator%Pass123 //192.168.0.1 “ipconfig -all”.
/winexe -U HOME/Administrator%Pass123 //192.168.0.1 “ping localhost” To launch a windows shell from inside your Linux box. Using this below command, /winexe -U HOME/Administrator%Pass123 //192.168.0.1 “cmd.exe” Winexe Binarycd winexe-1.00/source4/. Nice Tutorial! Can you please let me know how would I execute a cd command on windows machine from a linux server using winexe?
![]()
I tried this from a linux machine./winexe -U ablocaluser%abcd321 //mycomputer “cd c: tmp” I’m getting the following error: Error: error Creating process(cd c: tmp) 2./winexe -U ablocaluser%abcd321 //mycomputer “pushd c: tmp” I’m getting the following error: Error: error Creating process(pushd c: tmp) 2 Also I have a tar command to untar a file and when I provide it via winexe command it untar the file in C: Windows System32 folder. I would like the contents of the tar file to be untared in a different location. I even tried it explicitly specifying./winexe -U ablocaluser%abcd321 //mycomputer “tar -xvf sample.tar – C c: tmp” but for some reason it is trying to cd to c: Windows System32 c: tmp Appreciate your help in resolving this issue!
We are trying to execute.exe with parameter remotely from CentOS 7 using Winexe. Following are the commands we used but none of them worked.
sudo winexe hostname -u abcd CI.Admin -p Password@123 -h cmd /c C: test GetProcessInstance.exe. sudo winexe -user abcd CI.Admin -password Password@123 //hostname C: test GetProcessInstance.exe.
sudo winexe -U abcd/CI.Admin%Password@123 //hostname 'C: test GetProcessInstance.exe ' Showing following error for all.
We use winexe 1.0 in our products and were able to download, compile statically, and run winexe 1.0 on our CentOS 6.3 appliances. Now however, we are unable to figure out how to convert the instructions for ubuntu and winexe waf 1.1 such that we can again compile statically and run on CentOS 6.3. Is there a set of instructions somewhere for compiling on CentOS? Is there a plan to release 1.1 and also will it include new CentOS packages? Is there perhaps one already that I did not find?
The best we've been able to do always crashes when it runs with segfaults. Samba is currently being repackaged for Debian and Ubuntu. After this process is complete, winexe will be updated to ensure that it builds against the new packages, and released. The new Debian Samba packages will be a model for other distributions to follow. If other distributions package Samba similarly to Debian then that will make it easier to build winexe on other distributions as well.
Even without Samba packages it is possible to build winexe statically relative to the current Samba source tree. Required for the build are (equivalents of) gcc-mingw-w64, comerr-dev, libpopt-dev, libbsd-dev, zlib1g-dev, and libc6-dev. No instructions have yet been written for compiling winexe on CentOS. We basically followed your directions replacing apt-get with yum, figuring out the various library equivalent names, got an RPM of the appropriate mingw (apparently centos.org does not have the same mingw having only i686-pc-mingw32-gcc), downloaded samba 4 and followed the static directions to configure and run waf. All this on CentOS 6.3. We have another developer who did all that and was not able to get a runnable program.
I (a Windows developer) tried to do it with CentOS 6.4 but haven't even been able to get winexe to compile. Samba compiles though. The winexe binary that I built 'statically' on Ubuntu 13.04 is statically linked with a host of Samba and other libraries but it still gets dynamically linked with linux-vdso, libdl, libpthread, ld-linux and libc (as reported by ldd).
I tried running this Ubuntu-built binary on a RHEL 6.2 machine I have, but the latter's glibc is too old: RHEL 6 has glibc 2.12 whereas Ubuntu 13.04 has glibc 2.17. I looked into building winexe statically on Ubuntu 10.04 which has glibc 2.11, but Ubuntu 10.04 lacks MinGW packages. I looked into building winexe statically on RHEL 6.2.
MinGW packages are available on the Internet for CentOS 6 and these install on RHEL 6.2, but this isn't enough: also needed are statically built libraries bsd, z, rt, and resolv. These are not available for RHEL 6 and packages for other distros won't install because of tight version dependency constraints. William's colleague apparently succeeded with CentOS 6 but didn't get a working binary, which could indicate that one or more of the packages used is no good. It looks as if it would be possible to build on Fedora 17 However, this won't help William because the resulting binary won't run on CentOS 6. For that it may be necessary to package some of winexe's dependencies. If you like we can provide you access to an instance of our appliance with no dev tools, but with yum enabled so everything can be installed.
We can make one publicly available for 7 days. After that we'd have to start over and create a new instance.
Install Winexe Centos 7
That instance would have our product on it which includes the statically built winexe 1.0 we currently ship. On a side note, could we build the various required mingw gcc to get them? Could the dynamically linked libraries you mentioned be statically compiled in as well?
Install Winexe Centos 7
William wrote: we can provide you access Thanks for the offer. First we should establish that the static build works on some 32-bit system. Bug #21 suggests that it may be broken everywhere.
If the static build works at all on some 32-bit systems then it should be possible to get it working on 32-bit CentOS 6.3 provided the dependencies are available. But as you and I both wrote earlier, getting all the dependencies is difficult. Could we build the various required mingw gcc to get them? You could build the necessary dependency packages, yes. Could the dynamically linked libraries you mentioned be statically compiled in as well? I was able to build winexe statically on 64-bit CentOS 6.4 with two additional repos: the well known EPEL and lfarkas's MinGW repo mentioned by Andrzej earlier (I had to apply the following patch to get winexe-static to link.
wscriptbuildORIG 2013-09-02 22:31797 +0200 wscriptbuild 2013-09-02 22:35164 +0200 @@ -41,6 +41,6 @@ cflags='-pthread', linkflags='-pthread', stlibpath=bld.srcnode.abspath + '/smbstatic/build', - stlib='smbstatic bsd z resolv rt', - lib='dl' + stlib='smbstatic', + lib='dl bsd z resolv rt' ) Last edit: Thomas Hood 2013-09-02. William: Do you now have enough information to build winexe on a 32-bit CentOS 6 machine? You need to - get the latest winexe code; - patch the wscript file as I showed yesterday; - activate the EPEL and lfarkas repos; - build winexe statically. If you are building an appliance then you presumably do not rely upon binaries built elsewhere, but I'll still mention that I have no idea who is behind the lfarkas repo—I don't know whether or not it is a reliable source.
If you give me access to one of your appliances as you proposed earlier then I can attempt the build on that machine. Last edit: Thomas Hood 2013-09-03.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |