DLL hijacking vulnerabilities in Nirsoft tools
borncity.com
borncity.com
``` $ unzip -t processactivityview-x64.zip Archive: processactivityview-x64.zip testing: ProcessActivityView.exe OK testing: ProcessActivityView.chm OK testing: readme.txt OK No errors detected in compressed data of processactivityview-x64.zip. ```
Those two options result in whatever's in the zip file being dumped into the same directory as the zip file itself. If the archive contains a top level directory, a directory appears. If it's just an exe and a chm and a readme, like the Nirsoft zips, then those files appear next to the zip archive.
That must be one the most braindead defaults of the century. But I guess I'm the weird one as usual.
This is a huge issue for linux as well. Trigger a download and just wait until the OS or some file-exporer inspect the file and exploit the parser (which is typically ridden with security issues).
It's only Chrome that doesn't, right? Do other browsers have this behaviour?
Is it necessary to write things like this about an individual in a blog? I mean, the guy made these tools and gave them away for free. You're not a customer. It's up to him to reply to your emails, and it's fine if he doesn't.
If I get this right, you should have a malware running in the background, waiting for the Nirsoft tool execution, in order to have a malicious .dll be copied in the folder (the author suggests "normally" the "Downloads" one is used) from which the tool is run.
Of course possible, but shouldn't be there other tools to avoid that a malware is running?
On the other hand - personally - but not because of particular security measures, only for convenience, I tend to run those tools from within the .zip file (opened in 7-zip) i.e. in practice in a "random" directory created on the fly, i.e. something like \7zO6BD1.tmp (inside the users Temp folder).
Besides AFAIK/AFAICR all tools are available in .zip files, I don't think that the "common" user will open the .zip in the "Download" folder and routinely extract its contents in the same "Download" folder (as opposed to a path like C:\Nirsoft\<name of the tool> or similar).
https://devblogs.microsoft.com/oldnewthing/20060508-22/?p=31...
His logic is also faulty since he conflates 'End-User' permitted capabilities (what the App correctly allows the user/ request to do) with Application permissions to the OS.
Really this seems like it might be blinded by too many years of C/ C++ & immersion in stale campus group-think.
[0] https://stackoverflow.com/questions/43044855/explanation-how...
[1] https://www.ghacks.net/2017/03/09/notepad-7-3-3-update-fixes...
From the linked posts, it was rather not convenient at all.
> they could have just as easily accomplished the same thing by replacing the binary with a malicious one instead
From the linked posts, they were going via a shared downloads directory, so they could not have.
Occam's Razor implies there was actually something to the attack and it wasn't that some bored attacker took the long way around for fun.
Do you mean the Stack Overflow answer? That looks like original research to me. Yes, Windows will by default try loading DLLs from the current working directory, but:
1. it has lower priority than the program's own directory, and Notepad++ ships with a copy of SciLexer.dll, and more importantly:
2. Notepad++ specifically only looks for SciLexer.dll in the same directory as the executable itself: https://github.com/notepad-plus-plus/notepad-plus-plus/commi...
> it wasn't that some bored attacker took the long way around for fun.
There are other conceivable reasons for putting the hijack inside a DLL, e.g. because you're more likely to inspect the executable. But permissions wise, it was no easier than modifying the executable.
That’s already carte Blanche.
Whether any of that can be leveraged further by messing with the contents - DLL or otherwise - is academic.
I don't see such a scenario described in this article, so it can be that the issue here has much less potential to be misused?
There is also a system-wide solution for all programs at once: SafeDllSearchMode registry entry.
https://www.fortinet.com/blog/industry-trends/a-crash-course...
> It is sufficient for the Malware to place DLLs with the expected names in the relevant folder.
That "relevant folder" is a system directory (like c:\windows) that requires admin rights to modify.
This seems like the Windows-land equivalent of the old GNU ldd bug - it's rare that you use ldd and rarer still that a sysadmin runs it as root on a user-provided binary, but once they do, the user can immediately escalate privileges (and use whatever means they like for persistence).