Winexe – Run Windows commands in Linux to admin


winexe remotely executes commands on Windows NT/2000/XP/2003 systems from GNU/Linux .



$ sudo aptitude install build-essential autoconf checkinstall \
 python python-all python-dev python-all-dev python-setuptools libdcerpc-dev

Installation of winexe

$ cd ~/src/
$ wget
$ tar xzvf winexe-1.00.tar.gz
$ cd winexe-1.00/source4/
$ ./
$ ./configure
$ make basics bin/winexe
$ ./bin/winexe -V
Version 4.0.0alpha11-GIT-UNKNOWN



Usage: winexe //host command


Common options

Uninstall winexe service after remote execution
Reinstall winexe service before remote execution
Use SYSTEM account
Run as user (BEWARE: password is sent in cleartext over net)
Run as user options defined in a file
Desktop interaction: 0 – disallow, 1 – allow. If you allow use also –system switch (Win requirement). Vista do not support this option.
OS type: 0 – 32bit, 1 – 64bit, 2 – winexe will decide. Determines which version (32bit/64bit) of service will be installed.

Help and version options

-?, –help
Show this help message
Display brief usage message
-V, –version
Print version

Common samba options

-d, –debuglevel=DEBUGLEVEL
Set debug level
Send debug output to STDERR
-s, –configfile=CONFIGFILE
Use alternative configuration file
Set smb.conf option from command line
-l, –log-basename=LOGFILEBASE
Basename for log/debug files
enable talloc leak reporting on exit
enable full talloc leak reporting on exit

Connection options

-R, –name-resolve=NAME-RESOLVE-ORDER
Use these name resolution services only
-O, –socket-options=SOCKETOPTIONS
socket options to use
-n, –netbiosname=NETBIOSNAME
Primary netbios name
-S, –signing=on|off|required
Set the client signing state
-W, –workgroup=WORKGROUP
Set the workgroup name
Set the realm name
-i, –scope=SCOPE
Use this Netbios scope
-m, –maxprotocol=MAXPROTOCOL
Set max protocol level

Authentication options

Set the network username
-N, –no-pass
Don’t ask for a password
-A, –authentication-file=FILE
Get the credentials from a file
-P, –machine-pass
Use stored machine account password (implies -k)
DN to use for a simple bind
-k, –kerberos=STRING
Use Kerberos

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s