vanhauser-thc / thc-hydra

hydra
GNU Affero General Public License v3.0
9.54k stars 1.99k forks source link

Compilation failures with recent freerdp-3 #935

Open hlein opened 7 months ago

hlein commented 7 months ago

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

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):

Additional context Add any other context about the problem here.

vanhauser-thc commented 6 months ago

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

hlein commented 6 months ago

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).