thc-hydra icon indicating copy to clipboard operation
thc-hydra copied to clipboard

Compilation failures with recent freerdp-3

Open hlein opened this issue 2 years ago • 2 comments

IMPORTANT This is just for reporting BUGS not help on how to hack, how to use hydra, command line options or how to get it compiled. Please search for help via search engines. Issues asking for this here will be closed.

Describe the bug

hydra-9.5 cannot compile against recent freerdp-3.x, such as freerdp-3.2.0

Since https://github.com/vanhauser-thc/thc-hydra/pull/538 claimed to add support for freerdp-3 I tried going back to 3.0.0, still fails. But the rest of the following details are against 3.2.0.

Compilation fails with many errors like:

x86_64-pc-linux-gnu-gcc -march=znver2 -O2 -pipe -msse4.1 -msse4.2 -msse4 -mavx -I. -march=znver2 -O2 -pipe -msse4.1 -msse4.2 -msse4 -mavx -fcommon -pie -fPIE -fstack-protector-all --param ssp-buffer-size=4 -Wl,-z,now -Wl,-z,relro -Wl,--allow-multiple-definition -march=znver2 -O2 -pipe -msse4.1 -msse4.2 -msse4 -mavx -D_GNU_SOURCE -c hydra-time.c -DHAVE_MYSQL_MYSQL_H -DLIBOPENSSL  -DHAVE_PCRE -DLIBMYSQLCLIENT -DLIBPOSTGRES -DLIBSVN -DHAVE_ZLIB  -DLIBMCACHED -DLIBMONGODB -DLIBBSON -DLIBFREERDP -DLIBWINPR3 -DLIBSMBCLIENT -DHAVE_MATH_H -DHAVE_SYS_PARAM_H -I/usr/include/mysql -I/usr/include -I/usr/include -I/usr/include/postgresql -I/usr/include -I/usr/include/subversion-1 -I/usr/include/apr-1 -I/usr/include/subversion-1 -I/usr/include/libmemcached -I/usr/include/libmongoc-1.0 -I/usr/include/libbson-1.0 -I/usr/include/freerdp3 -I/usr/include/winpr3 -I/usr/include/samba-4.0
hydra-rdp.c: In function ‘rdp_connect’:
hydra-rdp.c:23:11: error: ‘freerdp’ {aka ‘struct rdp_freerdp’} has no member named ‘settings’
   23 |   instance->settings->Username = login;
      |           ^~
hydra-rdp.c:24:11: error: ‘freerdp’ {aka ‘struct rdp_freerdp’} has no member named ‘settings’
   24 |   instance->settings->Password = password;
      |           ^~
hydra-rdp.c:25:11: error: ‘freerdp’ {aka ‘struct rdp_freerdp’} has no member named ‘settings’
   25 |   instance->settings->IgnoreCertificate = TRUE;
      |           ^~
hydra-rdp.c:27:13: error: ‘freerdp’ {aka ‘struct rdp_freerdp’} has no member named ‘settings’
   27 |     instance->settings->AuthenticationOnly = FALSE;
      |             ^~
hydra-rdp.c:29:13: error: ‘freerdp’ {aka ‘struct rdp_freerdp’} has no member named ‘settings’
   29 |     instance->settings->AuthenticationOnly = TRUE;
      |             ^~
hydra-rdp.c:30:11: error: ‘freerdp’ {aka ‘struct rdp_freerdp’} has no member named ‘settings’
   30 |   instance->settings->ServerHostname = server;
      |           ^~

There is a WITH_FREERDP_DEPRECATED you can define to enable some measure of backwards compatibility. Doing so handles the settings errors but then there's still more failures like:

/usr/include/winpr3/winpr/winpr.h:68:41: note: in definition of macro ‘WINPR_DEPRECATED_VAR’
   68 | #define WINPR_DEPRECATED_VAR(text, obj) obj __attribute__((deprecated(text)))
      |                                         ^~~
hydra-rdp.c:34:21: error: ‘rdpSettings’ {aka ‘struct rdp_settings’} has no member named ‘MaxTimeInCheckLoop’
   34 |   instance->settings->MaxTimeInCheckLoop = 100;
      |                     ^~

And indeed MaxTimeInCheckLoop has been removed entirely here: https://github.com/FreeRDP/FreeRDP/commit/5f81005ecbd87d043f2ce39ea11c98065b1a1923

Various other projects have simply sworn off the freerdp-3 branch until they stabilize their ABI, which seems sensible.

To Reproduce

  • Ensure that you have tested the bug to be present in the current github code. You might be using an outdated version that comes with your Linux distribution!
  • You must provide full command line options.

Steps to reproduce the behavior:

  1. install freerdp-3.0+
  2. attempt to compile hydra-9.5.0

Expected behavior Build should succeed, and the resulting hydra rdp://... should complete successfully

Screenshots If applicable, add screenshots to help explain your problem. Note that all messages must be in English, not in Chinese, Russian, etc.

Desktop (please complete the following information):

  • Gentoo Linux
  • hydra-9.5.0

Additional context Add any other context about the problem here.

hlein avatar Feb 27 '24 23:02 hlein

so what do you recommend - not support libfreerdp3 (do not look for it), or add support?

vanhauser-thc avatar Mar 06 '24 11:03 vanhauser-thc

I think just don't support it for now.

I first tried to figure out how to add support for current libfreerdp3; could not find a porting guide so I went looking at other projects to see what they did. Well... what they did was not support it :/

If someone wants to come up with patches that restore support that would be great (until/unless they change their API yet again).

hlein avatar Mar 11 '24 20:03 hlein