5 ms·
I mean, it's goofy, hacky, and has obvious security flaws but doesn't look malicious. Calling it a "backdoor" ascribes a certain intentionality to the vulnerab
by monocasa 8y ago
I mean, it's goofy, hacky, and has obvious security flaws but doesn't look malicious. Calling it a "backdoor" ascribes a certain intentionality to the vulnerability that's not clear is warranted. It's about the code quality I expect from the management shovelware that comes preloaded on laptops from any major brand.
Source: I've written kernel drivers and exploits.
- noir_lord 8y agoOn the other hand a reliable backdoor that also looks like sloppy code is better, as most of us are familiar with truly awful code it’s a nice layer of plausible deniability. As the full saying goes. Never attribute to malice what can be explained by stupidity...but don’t rule out malice.
- monocasa 8y agoBy that logic we should be calling all vulnerabilities "backdoors" just in case.
- peteradio 8y agoPerhaps you should because the end result is the same, shit code sinks ships. Somebody could have written it intentionally or somebody could have been a dumbshit. Doesn't matter to me because now my computer is compromised.
- monocasa 8y agoI mean, the term 'backdoor' has a connotation of intentionality. Unless you write perfect code 100% of the time, you probably rely on the difference.
- bsder 8y agoFreetype buffer overflow leads to privilege escalataion. All code is security code.
- codeinstyle 8y agoFrom Microsoft’s blog post: Inspecting MateBookService.exe!main revealed a “startup mode” that revived the service if it’s stopped – some sort of watchdog mechanism meant to keep the Huawei PC Manager main service running. I agree that it’s hard to prove malice, but why should any PC management software go out of their way to ensure that it never gets shut down?
- monocasa 8y ago...because it's the hardware management service and if it goes down you're no longer managing the hardware? Like this stuff is usually designed by EEs and they love their watchdogs at all levels. Having a watchdog is very standard for this stuff.
- codeinstyle 8y ago>...because it’s the hardware management service and if it goes down you’re no longer managing the hardware? I’m no expert on device drivers but to my knowledge, Windows already allows you to manage devices and install drivers through Device Managers. Then if drivers are already installed for the various devices and hardware components, what exactly is the hardware management service managing on top of the individual drivers? I am asking this as the only plausible reason to be doing this (at least for me) is if Windows isn’t providing enough tools for device management that needs coordination between the hardware components on the machine, so I would appreciate someone with more knowledge to shed some light on the subject.
- monocasa 8y agoDevice Manager only handles kernel drivers. Best practice is to put as much as possible into a highly privileged, but still user mode process so it can crash without bluescreening your system. If you assume that this code can crash (hence why it was delegated to user mode in the first place) it makes sense to code in a resurrection capability.
- zaphirplane 8y ago
- stefan_ 8y agoWhat is not malicious about a driver whose pure function (this thing literally has no other value or purpose) is maintaining an invincible NT_AUTHORITY process of their pre-installed management software? And achieving that by allocating a RWX page in services.exe? What are we even doing W^X for? Maybe we have different expectations of what a driver is. Take a look for yourself, even the updated PC Manager Software on their website still has the driver with the goofy shellcode in its installer (no idea if it's just not loaded now): https://consumer.huawei.com/us/support/pc/matebook-x-pro/ https://consumer.huawei.com/us/support/pc/matebook-x-pro/
- monocasa 8y ago> What is not malicious > malicious - adj. - having or showing a desire to cause harm to someone I'ts goofy, and wouldn't pass a design review that I was a part of, but it isn't "showing a desire to cause harm". It just looks like a rushed design. > about a driver whose pure function (this thing literally has no other value or purpose) I see nothing about how this driver doesn't have any other functions. > is maintaining an invincible NT_AUTHORITY process of their pre-installed management software Because you want the hardware management process to be resurrected if it fails. They're not gaining anything from an attack perspective by deferring to user mode, the process isn't hidden, and they're already running as a kernel driver so they have full control of the system as it is. In Raymond Chen's parlance, they're already on the other side of the airtight hatch. > Maybe we have different expectations of what a driver is. I mean, Minix ascribes it's uptime and reliability to a resurrection server. Is this a much crappier design? Yes. Is it such a bad design that it's malicious? No, that's absurd. > Maybe we have different expectations of what a driver is. I expect drivers to defer everything they can to user mode so they don't crash the kernel. That's one of the reasons why APCs exist in the first place. > Take a look for yourself, even the updated PC Manager Software on their website still has the driver with the goofy shellcode in its installer (no idea if it's just not loaded now): Oh no, they didn't take that out of their package, but even Microsoft says that they fixed the vulnerability, and quicker than responsible disclosure asks for.
- stefan_ 8y ago
- gridlockd 8y ago> I mean, it's goofy, hacky, and has obvious security flaws but doesn't look malicious. Plausible deniability. If you were to implement a backdoor for a company, would you write "professionally done" all over it?
- monocasa 8y agoSo now every bug on a privilege boundary is a backdoor, because of "plausible deniability"?
- gridlockd 8y agoDid I say that? The point is that it just because it looks like an "honest mistake" doesn't mean it is. If you were to create a backdoor, that's exactly how you'd want to do it. Given the circumstances, one might wish to err on the side of caution.
- novaleaf 8y agoThe microsoft article mentions that Windows Defender caught multiple machines performing kernel injections near the same time with this driver as the root cause. Meaning it was already being exploited. This doesn't mean the actual flaw was malicious, but being actively exploited, it seems intent doesn't really matter.
- monocasa 8y agoI don't see anything saying this was being actively exploited; the non malicious use case would set off their scanners on all MateBooks running this driver.
- novaleaf 8y agofrom the article: > While monitoring alerts related to kernel-mode attacks, one alert drew our attention: >The alert process tree showed an abnormal memory allocation and execution in the context of services.exe by a kernel code. Investigating further, we found that an identical alert was fired on another machine around the same time. This shows code injection taking place, via the exploited code. You are right that they don't mention what code was injected (probably they don't know)
- monocasa 8y ago> via the exploited code Their scanner doesn't show any exploitation happening, and they don't say that it does.
- empath75 8y agoHave you heard of plausible deniability?
- monocasa 8y agoSo now every bug on a privilege boundary is a backdoor, because of "plausible deniability"?
- kbumsik 8y agoThen what other kinds of software need to use a privilege escalation?
- monocasa 8y agoThe code is designed to be a privilege _deescalation_. It's already running in kernel mode, and is deferring work to a user mode process.
- vardump 8y agoTo create a backdoor, you could not be obvious. Like do something obviously evil in the driver... You'd build it out of many building blocks in several components that individually look like honest mistakes. "Mistakes" that can be combined to create something malicious. That's what you need to achieve plausible deniability. You'll need to make it look innocent. (I also write Windows kernel mode drivers.)
- monocasa 8y agoDid you think that the recent Apache privilege escalation exploit is a malicious piece?
- village-idiot 8y agoProblem: any well written exploit will be designed to look like a mistake.
- xenadu02 8y agoDid your drivers also give usermode code the ability to map arbitrary memory addresses of the usermode code's choosing, thus granting full rw access to all memory pages in the system? Either Huawei's driver developers are both incompetent and stupid or they're injecting malicious backdoors.
- monocasa 8y agoThat's not what this driver does, you need to re-read the article.
- xenadu02 8y ago> Having been able to freely invoke IOCTL handlers of the driver from user-mode, we looked for other capabilities that can be abused. We found one: the driver provided a capability to map any physical page into user-mode with RW permissions. Invoking this handler allowed a code running with low privileges to read-write beyond the process boundaries—to other processes or even to kernel space. This, of course, means a full machine compromise. Please, continue.
- monocasa 8y agoOk, I missed that part. Most people here are up in arms about the page mapping for the code injection. But FWIW, it's a pretty common thing for shitty drivers. Here's one example: https://forum.xda-developers.com/showthread.php?t=2057818 https://forum.xda-developers.com/showthread.php?t=2057818