winexe error when executed from webserver with php

244 Views Asked by At

i have installed winexe from the package 'winexe_4.13.0.1-1_amd64.deb' (that i get from https://software.opensuse.org/download/package?package=winexe&project=home%3Auibmz%3Aopsi%3A4.1%3Aexperimental)

so, my winexe is:

$ winexe -V
winexe version 4.13

winexe executes well when invoked from command line, for example:

/usr/bin/winexe -U Administrador%xxxx //192.168.2.99 systeminfo

i would like to execute winexe command from a php script served by apache, so i have php8.0.10 and apache 2.4.1 linked by libapache2-mod-php8.0

for this reason, i have a php script that execute the command from above with system() and/or exec() and/or shell_exec() functions and i get the error but when i run the same command above (with -d 5 --interactive=0 options added) from a php script (with system(), exec(), shell_exec()) from a webpage (ie, i connect to 'https://...) i get the errors:

...
...
Bind RPC Pipe: host 192.168.2.99 auth_type 0, auth_level 1
rpc_api_pipe: host 192.168.2.99
rpc_read_send: data_to_read: 52
check_bind_response: accepted!
rpc_api_pipe: host 192.168.2.99
rpc_read_send: data_to_read: 32
rpc_api_pipe: host 192.168.2.99
rpc_read_send: data_to_read: 32
rpc_api_pipe: host 192.168.2.99
rpc_read_send: data_to_read: 40
rpc_api_pipe: host 192.168.2.99
rpc_read_send: data_to_read: 32
rpc_api_pipe: host 192.168.2.99
rpc_read_send: data_to_read: 32
samba_tevent: EPOLL_CTL_ADD failed (Operation not permitted) replay[0] - calling panic_fallback
main: cli_ctrl failed: NT_STATUS_CONNECTION_DISCONNECTED

note. i have tried prepening 'cat < /dev/null | /usr/bin/winexe ...' and the error persist

any help will be welcome, thankyou in advance,

g

1

There are 1 best solutions below

1
On

finally, i have given up with winexe and, instead, i use atexec.py from impacket package and it works like a charm