-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating hydra support for freedrdp 3 #538
Conversation
Added support for freerdp module 3, this is the newest module from freerdp
so everyone who runs a Linux that does not have freerdp3 yet cant use rdp anymore? |
Not sure what you are getting at, just if you are running thc-hydra and pull the latest freerdp repo and build from source, you will get an issue. I did, found the issue and just posted a solution that meant adding support for the new version. |
a solution that breaks rdp for most users is not a solution but a bug :) |
Let me go do that, and re-submit a proper PR, good call absolutely right |
Adding logic to check for freerdp2 first and if not the rdp module will check for freerdp3 to support the rdp module
Did not do proper check for freerdp2 or freerdp3 modules
Fixed logic inside of configure to properly check for freedrdp2 if not found check for freerdp3, if found to skip freerdp3
hydra-rdp.c
Outdated
@@ -10,7 +10,7 @@ | |||
#include "hydra-mod.h" | |||
|
|||
extern char *HYDRA_EXIT; | |||
#ifndef LIBFREERDP2 | |||
#if !defined(LIBFREERDP2) || (LIBFREERDP3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the library versions make no different is v2 or v3 I would just name it LIBFREERDP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, just fixed this
if [ -n "$WINPR2_PATH" ]; then | ||
XLIBS="$XLIBS -lwinpr2" | ||
if [ -n "$WINPR3_PATH" ]; then | ||
XLIBS="$XLIBS -lwinpr3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you have not reestablished the previous librdp2 for XLIBS, only librdp3. same for the include paths above and defines etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just fixed the XLIBS and XDEFINES paths
Removing double entry of libfreerdp in hydra.c and hydra-rdp.c
Trying to fix defines for freerdp
@vanhauser-thc this should be it, tested this on my machine, compiles and runs as it should and fixed the ldconfig issue by adding the instructions to the makefile. Let me know your thoughts. |
@@ -78,6 +78,7 @@ install: strip | |||
-cp -f *.csv $(DESTDIR)$(PREFIX)$(DATADIR) | |||
-mkdir -p $(DESTDIR)$(PREFIX)$(MANDIR) | |||
-cp -f hydra.1 xhydra.1 pw-inspector.1 $(DESTDIR)$(PREFIX)$(MANDIR) | |||
-ldconfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why that? that would only be needed if a new shared library would be installed (which hydra does not have).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed for "libfreerdp3.so.3" which is loaded as a shared library, not sure why this is the case for v3 and not for v2. This is the error I get when ldconfig is not done:
/usr/local/bin/hydra: error while loading shared libraries: libfreerdp3.so.3: cannot open shared object file: No such file or directory
configure
Outdated
@@ -1518,9 +1601,12 @@ fi | |||
if [ -n "$MONGODB_IPATH" ]; then | |||
XIPATHS="$XIPATHS -I$MONGODB_IPATH -I$BSON_IPATH" | |||
fi | |||
if [ -n "$FREERDP2_IPATH" ]; then | |||
if [ -n "$FREERDP3_IPATH" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is wrong, you moved the check to RDP3, but then copy RDP2_IPATH. as the real RDP3 one is below this has to be $FREERDP2_IPATH :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this bug is still present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Working on this today and will update when finished
besides two minor things I just commented on it looks good. |
sorry for the long delay, I have so much to do ... there is one bug left, just commented on it. |
Updating the logic here to check for freerdpv3 first and if found do not check for freerdpv2. Also fixed paths for freerdpv2 paths. Updated bash "or" to use "||" and "and" to use "&&" conditionals with proper POSIX specifications.
@vanhauser-thc This should be it, fixed the bug you mentioned, added logic to handle version of freerdp properly and just updated bash conditionals. |
looks good, thanks! |
I had to perform a few fixes:
but now everything compiles cleanly, thanks! |
The newest version of freerdp is v.3, updating Hydra to support this new module.
Have tested this on my Ubuntu 18.04 LTS using latest build from freerdp and thc-hydra at time of writing.