Hi Guys,
We use winexe in Open-AudIT, so big thanks for your efforts. Trying out Open-AudIT against Windows 2012R2 and I seem to have run up against the SMB1/2/3 issue. I found Wil's bug report here, http://sourceforge.net/p/winexe/bugs/30/ so I thought I'd try building and running 1.1.
TL/DR - 1.1 is failing to run against a target Windows 2012R2 machine.
I built it using the commands below.
mkdir /build
cd /build
apt-get install gcc-mingw-w64 comerr-dev libpopt-dev libbsd-dev zlib1g-dev libc6-dev python-dev libacl1-dev libldap2-dev
git clone git://git.code.sf.net/p/winexe/winexe-waf winexe-winexe-waf
git clone git://git.samba.org/samba.git samba
cd winexe-winexe-waf/source
./waf --samba-dir=../../samba configure build
That produced the binary - build/winexe-static
There are some seemingly non-existing files searched for when the config / build is run, but I'm unsure if these are essential to actually having winexe-static work (build log attached).
If I try running it against a Win2008 machine like below, it works fine.
./winexe-static -U open-audit/administrator%MYPASSWORD //192.168.0.16 "ipconfig"
<usual ipconfig="" windows="" output=""></usual>
If I try running it against a Win2012r2 machine like below, it fails.
./winexe-static -U open-audit/administrator%Mu@Op007It //192.168.0.53 "ipconfig"
ERROR: Failed to open connection - NT_STATUS_OBJECT_NAME_NOT_FOUND
If I run the above using -d11, the result is below.
If I try the stdin redirect trick (cat /dev/null | ./winexe-static .... ), there is no difference in output or result (not that I thought there would be, just trying anything).
Any help much appreciated.
./winexe-static -U open-audit/administrator%MYPASSWORD -d11 //192.168.0.53 "ipconfig"
INFO: Current debug levels:
all: 11
tdb: 11
printdrivers: 11
lanman: 11
smb: 11
rpc_parse: 11
rpc_srv: 11
rpc_cli: 11
passdb: 11
sam: 11
auth: 11
winbind: 11
vfs: 11
idmap: 11
quota: 11
acls: 11
locking: 11
msdfs: 11
dmapi: 11
registry: 11
scavenger: 11
dns: 11
ldb: 11
winexe version 1.1
This program may be freely redistributed under the terms of the GNU GPLv3
added interface eth0 ip=192.168.0.84 bcast=192.168.0.255 netmask=255.255.255.0
not adding non-broadcast interface tun0
added interface eth0 ip=192.168.0.84 bcast=192.168.0.255 netmask=255.255.255.0
not adding non-broadcast interface tun0
Socket options:
SO_KEEPALIVE = 0
SO_REUSEADDR = 0
SO_BROADCAST = 0
TCP_NODELAY = 1
TCP_KEEPCNT = 9
TCP_KEEPIDLE = 7200
TCP_KEEPINTVL = 75
IPTOS_LOWDELAY = 0
IPTOS_THROUGHPUT = 0
SO_SNDBUF = 16384
SO_RCVBUF = 87380
SO_SNDLOWAT = 1
SO_RCVLOWAT = 1
SO_SNDTIMEO = 0
SO_RCVTIMEO = 0
TCP_QUICKACK = 1
TCP_DEFER_ACCEPT = 0
ERROR: Failed to open connection - NT_STATUS_OBJECT_NAME_NOT_FOUND
Sigh - please ignore the above results. The damn Windows firewall turned itself on when I joined the domain. It does indeed work now.
Interestingly it failed on the first two attempts at running winexe-static (yes, after I disabled the firewall), but now runs fine.
Apologies for the inaccurate ticket - damn n00b users :-)
Thanks again for all your efforts on winexe.
Cheers