9 ms·
Ring0VBA – Getting Ring0 Using a Word Document
- planede 4y agoWhere is the scary warning about macros within the document? I thought that macros are not executed by default, and you must trust the source for executing the macros. I am not trying to downplay it, it's still a privilege escalation. But is triggering it via Word macros in any way special? edit: At my work computer, the setting is "disable all macros with notification". I suspect, but I am not sure that this is the default for a fresh Office install. With this setting running macros on a random Word document is not much different than running a random .exe file. Of course, privilege escalation is equally serious in both cases.
- iueotnmunto 4y agoMacros use ZoneInfo NTFS hidden properties to determine the source of the document (local, trusted, internet, etc). I'm unsure of the default for local, but internet downloaded macros are prompt by default. Group policy can be used to explicitly deny or globally permit. I believe there's also the ability to cryptographically sign macros if required.
- mschuster91 4y agoGiven how many organizations run on widely shared Excel sheets with shitloads of macros someone wrote thirty years ago, it makes sense to use Excel sheets as a spreader mechanism. Basically, a multi-stage hack: 1) Get RCE on an user's computer in some way (e.g. via a browser exploit chain, yet another exploit in a public reachable Citrix instance, tech support scam) 2) Scan the MRU lists of all users for Excel files on network drives, Onedrive, Dropbox and other common share tools 3) Once the files become accessible (e.g. because the user connected to the VPN), open each file and check if it has macros. If yes, inject spreader payload (e.g. a credential stealer, a miner or a crypter). If no, continue to the next file. 4) Other users now open these Excel files, execute the macros because they expect to be asked that question, and now the payload executes.
- INTPenis 4y agoOh yeah I agree. We had a couple of horrendous systems made with Excel and VBS about 10 years ago and in order to work with them I had to enable and disable all sorts of stuff before I could work freely. On my work computer of course. I believe there are best practices for office computer security policy.
- deleted 4y ago[deleted]
- dgan 4y agoWell on one hand, VBA is a full blown programming language, so I would expect to be able to do that... On the other hand, I am lucky JS running in browser doesn't have access to my drivers
- wilhil 4y agoWell... you can flash and update the firmware of a mobile connected via USB through a browser... so, not sure how accurate this is!
- laundermaf 4y agoTo be fair, you're supposed to get a permission dialog and it seems you have to pick the specific device(s) to connect to them. https://web.dev/usb/#get-access-to-usb-devices https://web.dev/usb/#get-access-to-usb-devices However I suppose that the mere existence of this API means that there could be a way to bypass the request; The browser already does have full access to every device.
- mschuster91 4y agoSweet jesus that's easy. Wonder if stuff like Samsung ODIN (which already has a OSS clone) could be ported to that.
- selfhoster11 4y agoWeb MiniDisc folks ported the reverse-engineered the NetMD protocol tools to JS, and can now upload audio and patch device firmware on any MD device connected via Chrome/Chromium. Porting Odin is likely to be feasible.
- rany_ 4y agoHas been done with https://github.com/kdrag0n/fastboot.js https://github.com/kdrag0n/fastboot.js, might be feasible with Odin as well..
- kevingadd 4y ago
- Rygian 4y ago> As a person who is novice to the driver exploitation scene, I was in a search for a driver which is very-easy to exploit. While on the search, I encountered Souhail Hammou’s really well written blogpost about how he exploited MalwareFox AntiMalware’s driver (zam64.sys) to escalate privileges. Using an anti-malware piece of software as a stepping stone to get Ring0 is beyond irony. I wish for a world where the general public were able to consider all software as malware by default, unless it has been proven "moreless safe" by at least three independent security audits paid with public money.
- omnibrain 4y ago> Using an anti-malware piece of software as a stepping stone to get Ring0 is beyond irony. If you think about it: not really. "Anti-malware" software often uses rootkit technologies to do "its job". In turn it gets handed the keys to the kingdom to do "everything".
- badsectoracula 4y ago> I wish for a world where the general public were able to consider all software as malware by default, unless it has been proven "moreless safe" by at least three independent security audits paid with public money. Yes, what we need is more roadblocks in there, to ensure software that has captured large segments of their respective markets remain entrenched and make it harder for new developers and projects to dethrone them while giving the government (of which country?) control over what software people can run - no way this will be abused at all X-P.
- speed_spread 4y agoFood for thought: That's how cars are put on the market nowadays. Not saying you're wrong, though.
- wongarsu 4y agoIt's also part of the story how we ended up with a duopoly of airplane manufacturers. I think there's room for regulation and forced audits. The important part is that the compliance costs are small compared to development and production costs. That's true in the car industry unless you have really low volume, while airplanes are pushed over the threshold by much lower volume and much higher regulation.
- deleted 4y ago[deleted]
- letters90 4y agoCool to see an environment supporting each other in it security research. He mentions his community on: https://www.vx-underground.org/ https://www.vx-underground.org/ Cool papers, code snippets, nice to spend some time on. Nice gimmik with the banner.
- DethNinja 4y agoDo Windows care about vulnerable drivers? Is there anyway to prevent installation/execution of drivers with such CVEs?
- Cthulhu_ 4y agoYeah, avoid dodgy anti-malware software; don't run as administrator; stick with windows official drivers and allow them to be updated when windows pushes an update; don't mess around with software and drivers.
- userbinator 4y agoAnd then you'll end up with letting them take away features, introduce new bugs and other bloatware you never had before (seems to happen semiregularly with GPU drivers...), can't use hardware you bought because they broke its driver at some point, etc. No, personal responsibility and community trust is infinitely preferable to corporate authoritarianism.
- jeroenhd 4y agoThe problem with that approach is that malware can bring its own signed driver to load and exploit. Microsoft would need to blacklist the known vulnerable drivers to solve this problem, but then devices will stop working.
- logical_person 4y agowrong, loading drivers requires admin.
- anthk 4y agoNo, just use SDI Tool Origin if you have to suffer Windows.
- dobin 4y agoMicrosoft Defender Application Control Policy: https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-defender-application-control/microsoft-recommended-driver-block-rules https://learn.microsoft.com/en-us/windows/security/threat-pr... List of vulnerable drivers: https://github.com/eclypsium/Screwed-Drivers/blob/master/DRIVERS.md https://github.com/eclypsium/Screwed-Drivers/blob/master/DRI...
- jbirer 4y agoAt this point, if you are still using Windows, you can't complain about being hacked.
- unnouinceput 4y agoAnd what operating system you recommend that would protect you from the stupidity of the user? Linux? MacOS? Because both would equally fail to this just as well. Use an OS with Admin/root privileges and then complaining why you can pwn said computer is stupidity, isn't it?
- jbirer 4y agoMy personal choice is Linux but MacOS doesn't have anything near the amount of exploits and vulnerabilities that get released daily for Windows.
- unnouinceput 4y agoDo tell me the exploits and vulnerabilities that got released daily for Windows (mind you, for the OS itself, not for a poorly configured system or user stupidity) in the past month. I am curious of those "daily" exploits and vulnerabilities.
- trelane 4y agoMalware is software. Just like any other software, it targets market share and ease of "use". So choosing a less popular OS (and, as an ecosystem, having lots of healthy competition) is a good strategy.
- deleted 4y ago[deleted]
- pvg 4y agoEschew flamebait. Avoid generic tangents. Omit internet tropes. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- dobin 4y agoNote this is partially covered in MITRE Technique T1068 BYOVD "Bring Your Own Vulnerable Driver". If the driver is not already loaded, it necessary to be local admin to be able to load it.
- rtev 4y agoYep, this kind of thing is typically used as an EDR-killer when you want to touch protected processes and perform lateral movement. It’s interesting to see it used here as part of initial access tooling.
- dobin 4y agoI also mostly seen it as EDR/AV killer. A bit overkill as initial access, but thats part of the joke of the article
- samsaga2 4y agoWhy is Windows so vulnerable to things like this? It's a design problem?
- unnouinceput 4y agoNo, it's a usability problem. People use it with full Admin rights and then are amazed that when they run something from an untrusted source their computer gets pwned. Or are you implying that Linux is immune to this? Because it's not. This is equivalent to running a bash script downloaded from internet with root privileges and then writing that you pwned Linux. Remember, VBA IS!!! a programming language, having the same access as any other programming language (tied to your user). Now if this guy would've ran this macro using a normal user and then the computer would've been pwned, now that's a privilege escalation.
- pjmlp 4y agoNot sure how it looks like nowadays, but during the early days of Mac OS X going mainstream, a common question on forums was how to run as root by default, some people never learn.
- crest 4y agoBecause of course your application settings (themes, plugins etc.) have to be stored under '/Library'… sigh
- dementiapatent 4y agoTo argue against this, a Word document has no business running arbitrary code with access to system drivers. I think it's more like opening a document in GEdit and realizing that your whole system got hacked. Macros were another billion dollar mistake: https://www.zdnet.com/article/the-cost-of-ransomware-around-the-globe-to-go-beyond-265-billion-in-the-next-decade/ https://www.zdnet.com/article/the-cost-of-ransomware-around-...
- wongarsu 4y ago
- userbinator 4y agoI feel like this is close to https://devblogs.microsoft.com/oldnewthing/20150923-00/?p=91531 https://devblogs.microsoft.com/oldnewthing/20150923-00/?p=91... since most people tend to treat Windows on their personal machines as a single-user system and always have the highest privileges anyway.
- meandmycode 4y agoSeems quite a baited title, especially given some comments are jumping on Windows or VBA here - the actual title should be "getting ring0 by installing a terribly designed and dubious kernel driver", but that doesn't sound so impressive.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- trelane 4y ago> getting ring0 by installing a terribly designed and dubious kernel driver Given that most drivers are software written by hardware companies and, as soon as the device is sold, are just a liability, is this really going to be a huge barrier? How often do drivers get updated, say 1 or 2 years post release? Same thing as many non-subscription wireless routers.
- meandmycode 4y agoSure, but is this unique to Windows or Word? and there are various ways Microsoft could kill bit this driver if it was widely exploited with no support from the company that made it
- gw99 4y agoWord is a useful vector because a lot of hardening software throws a load of stuff on the Windows UI to stop you executing anything but does not touch VBA. I've had to use VBA many times to work around abhorrent user controls that prevented work from being done.
- trelane 4y agoWindows does hardware support primarily though proprietary drivers specific to that hardware. Outside of that, its own innate hardware support is quite lackluster compared to other OSes (especially Linux, due to the pressure to put drivers in the kernel, where they're open and maintained.) Sure, they can unilaterally kill any software on their platform, it's perhaps an important thing to note about it and other platforms where this is true. (Answering questions of ownership and user rights that inherently arise from this and other similar facts are left as an exercise to the reader). However, that also comes at the cost of disabling the hardware that the driver serves, at least until it's fixed.
- brazzy 4y agoAm I overlooking something or is this completely uninteresting from a security POV? Not only does it require a vulnerable niche driver to be installed, it also requires the user to enable VBA macros on a document of unknown provenance, which everyone by now should know is the digital equivalent of licking the floor of a public bathroom. In fact, how is "Getting Ring0" even relevant once you're running untrusted code on Windows where in 98% of all cases (and 100% when we're talking about opening Word Documents) there is exactly one user who can access everything interesting on the system?
- myuzio 4y agoThe author seems more about having fun than actually making a point.