outflanknl/C2-Tool-Collection

askcreds - fails to compile

jabra- opened this issue · 14 comments

Askcreds.c: In function ‘AskCreds’:
Askcreds.c:111:9: error: ‘CREDUIWIN_GENERIC’ undeclared (first use in this function); did you mean ‘CRED_TYPE_GENERIC’?
         CREDUIWIN_GENERIC | CREDUIWIN_CHECKBOX
         ^~~~~~~~~~~~~~~~~
         CRED_TYPE_GENERIC
Askcreds.c:111:9: note: each undeclared identifier is reported only once for each function it appears in
Askcreds.c:111:29: error: ‘CREDUIWIN_CHECKBOX’ undeclared (first use in this function); did you mean ‘CREDUI_INFO’?
         CREDUIWIN_GENERIC | CREDUIWIN_CHECKBOX
                             ^~~~~~~~~~~~~~~~~~
                             CREDUI_INFO

How do you compile? Tools should compile successfully on latest version of Kali/Mac OSX with latest version of Mingw-w64 compiler.

OS: debian buster.
used make to compile.
All of the other BOFs compiled just fine.

+#define CREDUIWIN_GENERIC 0x1
+#define CREDUIWIN_CHECKBOX 0x2

fixes it.
ref: https://github.com/kinke/mingw-w64-crt/blob/master/mingw-w64-headers/include/wincred.h#L327

Same issue here with Ubuntu 20.04.3 LTS

Tools have been tested (and compiled) successfully on Kali (latest) and mac OSX with Mingw-w64 installed (see support note in readme). I hope the above #define change fixes the issue on Debian/Ubuntu otherwise I recommend compiling the tools on a Kali VM.

@Cn33liz indeed, the target is to build on Kali but I was using Ubuntu 20.04 for dev and noticed the issue. I thought it would be interesting to add a reference here if others have the same issue 😉
The #define change fixes the issue

Good point, i'll add this to the readme, thank you :)

Added the proposed solution to an issue section within the readme file. If this is okay with you both then i'll close the issue?

Why not just add these to your .h header?

Here is a reference from microsoft:
https://docs.microsoft.com/en-us/windows/win32/api/wincred/nf-wincred-creduipromptforwindowscredentialsa

FYI I've tried with Kali 2022.1 from a few months old (missing lot of updates) and it was giving the same error as above.
After upgrading the system, the error was no longer showing up.

I added the #defines to the header file. Can you verify if everything is working as expected now?

Looks like it's working now, on Ubuntu 20.04 as well, thanks! 😄

great! compiles perfectly now. good to close.

Great thanks for the feedback!