# docker run -it openvas-smb:12 /bin/sh
# cd /usr/local/bin
# ./wmic -U USERNAME%PASSWORD //10.X.X.X "select * from Win32_ComputerSystem"
[/source/samba/librpc/rpc/dcerpc_connect.c:337:dcerpc_pipe_connect_ncacn_ip_tcp_recv()] failed NT status (c00000b5) in dcerpc_pipe_connect_ncacn_ip_tcp_recv
[/source/samba/librpc/rpc/dcerpc_connect.c:798:dcerpc_pipe_connect_b_recv()] failed NT status (c00000b5) in dcerpc_pipe_connect_b_recv
[/source/wmi/wmic.c:201:main()] ERROR: Login to remote object.
NTSTATUS: NT_STATUS_IO_TIMEOUT - NT_STATUS_IO_TIMEOUT
Hypothesis on the cause of the issue
I did some basic troubleshooting of the issue with a colleague of mine and we believe this issue is related to popt.
Debian 11 uses popt 1.18 and debian 12 uses popt 1.19. In fact, if you compile popt 1.18 manually on Debian 12 and link it statically to the code the issue goes away. I realize this is hacky, it does however indicate that the issue is somehow related to the version of popt.
If you want to test this yourself here are some instructions.
1) install dependencies
2) download and build popt 1.18 from source
wget http://ftp.rpm.org/popt/releases/popt-1.x/popt-1.18.tar.gz
tar xf popt-1.18.tar.gz
cd popt-1.18/
mkdir build
cd build
CFLAGS="-fPIC -static" ../configure --enable-shared=no
make -j6
The static library ends up in popt-1.18/build/src/.libs/libpopt.a
3) in openvas-smb/wmi/CMakeList.txt, above "add_executable(wmic wmic.c...", add:
Found an odd issue compiling the latest code on Debian 12 vs. Debian 11. This issue is specific to the
wmic
CLI applicationExpected behavior (Debian 11)
The behavior of the application will be the same between the two versions of Debian.
The environment is Docker using the dockerfile in the repo.
On Debian 11:
Build command:
docker buildx build --pull -t openvas-smb:11 -f .docker/.docker/prod-oldstable.Dockerfile .
Actual behavior (Debian 12)
On a Debian 12:
Build command:
docker buildx build --pull -t openvas-smb:12 -f .docker/.docker/prod.Dockerfile .
Hypothesis on the cause of the issue
I did some basic troubleshooting of the issue with a colleague of mine and we believe this issue is related to popt.
Debian 11 uses popt 1.18 and debian 12 uses popt 1.19. In fact, if you compile popt 1.18 manually on Debian 12 and link it statically to the code the issue goes away. I realize this is hacky, it does however indicate that the issue is somehow related to the version of popt.
If you want to test this yourself here are some instructions.
1) install dependencies 2) download and build popt 1.18 from source
The static library ends up in popt-1.18/build/src/.libs/libpopt.a
3) in openvas-smb/wmi/CMakeList.txt, above "add_executable(wmic wmic.c...", add:
4) create a build directory, "cmake .. && make -j6"
Run the test command above on the test machine.
Environment
Docker using official docker files, Though it is easy to reproduce this issue on a VM.