wietze / windows-dll-hijacking

Project for identifying executables and DLLs vulnerable to relative path DLL hijacking.
GNU General Public License v3.0
438 stars 73 forks source link

issue with generate_dlls.py #2

Open strangerdanger010 opened 4 years ago

strangerdanger010 commented 4 years ago

Hey there Wietze,

having some issue here with the python script used to compile the DLLs via docker. see image below... not sure as to why its doing this. any help would be greatly appreciated! Thanks

image

wietze commented 4 years ago

Hey strangerdanger010, glad to see you found this research and doing some testing yourself.

Regarding the final KeyError, it suggests you have a CSV file generated for msdrm.dll but does not appear in your entrypoints.dll. Admittedly this should probably throw a nicer error, or even skip over it. I'll add that.

For the other more generic 'Could not compile' issues, that does seem odd. I'd recommend you change line 121 (highlighted here) to the following:

    if subprocess.call(["docker", "run", "--rm", "-ti", "-v", "{}:/mnt".format(os.getcwd()), "mmozeiko/mingw-w64", "x86_64-w64-mingw32-gcc", "-shared", "-mwindows", "-o", dll_path, dll_c_path, dll_def_path]):

In other words, remove the stdout option, so anything outputted by the docker command will be printed to your terminal window. Hopefully that helps in finding out why the command failed.