summaryrefslogtreecommitdiff
path: root/examples/winexe
Commit message (Collapse)AuthorAgeFilesLines
* winexe: add configure option to control whether to build it (default: auto)Günther Deschner2020-03-091-1/+2
| | | | | | | | | | Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Mar 9 16:27:21 UTC 2020 on sn-devel-184
* librpc: fix IDL for svcctl_ChangeServiceConfigWGünther Deschner2020-03-091-0/+2
| | | | | | | | | | | Found while trying to run winexe against Windows Server 2019. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14313 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* winexe: Add support for connecting to a host on an alternate portKarl Lenz2019-07-051-3/+23
| | | | | | | | | | | | | | | | | | This commit allows an optional port number to be specified after the hostname on the winexe command line. If no port is given, it defaults to port 445, just like it used before. Although this is probably a pretty uncommon use-case, it allows port-forwarding the service through a firewall to an alternate port, which can occassionally be helpful. $ ./bin/winexe -U karl%password1 //127.0.0.1:5445 cmd.exe Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Windows\system32> Signed-off-by: Karl Lenz <xorangekiller@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* winexe: Fix translation of the winexesvc binaries to CKarl Lenz2019-07-051-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two small Windows binaries that winexe uses to execute commands on a remote system, winexesvc32.exe and winexesvc64.exe, are compiled then translated into a C byte array as hex so that they can be embedded into the winexe binary. Although the winexesvc binaries were built properly, the Python method that does the translation to C tried to open them in text mode, which would have worked in Python 2 before the concept of bytearrays was introduced, but instead raises an exception in Python 3. The exception was unfortunately suppressed, so the build didn't stop, and the winexe binary that was produced was effectively useless because it didn't contain either winexesvc binary as expected. After winexe successfully authenticated with a Windows host, it showed the error message below rather than executing the given command on the remote system. $ ./bin/winexe -U karl%password1 -d 2 //192.168.56.3 cmd winexe_svc_install: dcerpc_svcctl_StartServiceW failed: WERR_BAD_EXE_FORMAT main: winexe_svc_install failed: NT_STATUS_BAD_INITIAL_PC This commit fixes that problem by opening the winexesvc binaries in binary mode rather than text mode when the winexe build script reads them to translate them to C. Furthermore it adds an additional sanity check that will cause the winexesvc binary generator commands to fail if the winexesvc binaries cannot be opened or read correctly to guarantee that the build does not silently "succeed" if something like this ever happens again. Signed-off-by: Karl Lenz <xorangekiller@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* winexe: Use C99 initializer for poptOption in winexe.cStefan Metzmacher2019-05-281-34/+115
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:libsmb: pass impersonation_level to cli_ntcreate_send()Stefan Metzmacher2018-12-131-0/+3
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Tim Beale <timbeale@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PY3: fix "TabError: inconsistent use of tabs and spaces"Noel Power2018-09-271-10/+10
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* examples: Fix mingw64 detectionVolker Lendecke2018-09-051-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* examples: Add winexe re-implemented on current Samba libsVolker Lendecke2018-08-286-0/+2788
winexe from https://sourceforge.net/projects/winexe/ is a project based on Samba libraries from 2012. According to the winexe git repository the last Samba commit winexe was updated to is 47bbf9886f0c from November 6, 2012. As winexe uses unpublished Samba internal libraries, it broke over time. This is a port of the winexe functionality to more modern Samba versions. It still uses internal APIs, but it being part of the tree means that it is much easier to keep up to date. The Windows service files were taken literally from the original winexe from the sourceforge git. Andrzej Hajda chose GPLv3 only and not GPLv3+. As GPL evolves very slowly, this should not be a practical problem for quite some time. To build it under Linux, you need mingw binaries on your build system. Under Debian stretch, the package names are gcc-mingw-w64 and friends. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Aug 28 02:03:07 CEST 2018 on sn-devel-144