-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Lexmark Universal Print Driver Local Privilege Escalation #15519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -0,0 +1,94 @@ | |||
## Vulnerable Application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a msftidy_docs.rb
tool to lint the markdown docs. If you wouldn't mind, could you please address it's comments:
tools/dev/msftidy_docs.rb documentation/modules/exploit/windows/local/lexmark_driver_privesc.md
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md - [INFO] Missing Section: ## Options
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md:25 - [WARNING] Should use single backquotes (`) for single line literals instead of triple backquotes (```)
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md:26 - [WARNING] Should use single backquotes (`) for single line literals instead of triple backquotes (```)
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md:27 - [WARNING] Should use single backquotes (`) for single line literals instead of triple backquotes (```)
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md:34 - [WARNING] Code blocks using triple backquotes (```) should not be indented
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md:94 - [WARNING] Code blocks using triple backquotes (```) should not be indented
The other thing is that each of the sections are indented when they don't need to be. In particular the scenarios section's indentation is then copied over into the rendered markdown output.
@smcintyre-r7 rolled in the changes you suggested and retested successfully. Also ran doc tidy and fixed up the wonky spacing issues 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks very good, just left a few comments, most are the same as on the other PR.
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md
Outdated
Show resolved
Hide resolved
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md
Outdated
Show resolved
Hide resolved
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md
Outdated
Show resolved
Hide resolved
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md
Outdated
Show resolved
Hide resolved
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md
Outdated
Show resolved
Hide resolved
@jacob-baines Going to go ahead and try fix up some of these issues so long this morning so we can clear up some of this work that I can take on myself. Hopefully this should help save you some time and make the actual issue list a little more accurate r.e issues I'm not able to resolve myself. |
Sounds good, @gwillcox-r7. Thanks! I should be able to tackle the remaining issues this evening. |
…ions of the vulnerability and fix some minor issues
When you make the changes and forget to lint your own work 🤦♂️ Lets fix that up. |
@jacob-baines Created a more detailed description and fixed a few issues, but let me know if you don't like the format of the description and we can always adjust. Just tried to condense it down a bit whilst also explaining why the adjusting of the XML file is important. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall changes look good, though I am concerned r.e effect of the changes on the fact that the exploit
method now needs to be run alongside the check
method, vs acting independently of the check
method.
As mentioned, I switched over to using pnputil to discover the vulnerable drivers. This is desirable for the case where the driver was put in the driver store by an admin or an attacker (via CVE-2021-34481) but never installed during add printer operations. Metasploit's implementation of the Ricoh driver exploitation and the (just landed) Canon driver exploit wouldn't see vulnerable drivers in that context because neither examine the driver store. I'll try to decouple check/exploit now. |
Ah in my experiments the driver had to be installed as a vulnerable driver for the vulnerable directory to be created. This is why I kept that check in for other module, along with the fact that the patch didn't seem to update the version output by |
No worries. Looking back, I think the original pull request assumes that everyone would know all the things I yammered on about for 40ish minutes at DC... which is obviously an unfair assumption. Either way, I don't think this particular module can have a check that will say definitely if the target is vulnerable (without exploitation) 🤷♂️ As to the Thursday cutoff, I won't be able to make any adjustments today. This moment that I'm writing this is about the only free moment I'll have all day. 😓 If you think the module is close, I'm happy for whatever edits you might have time to introduce. Otherwise, I doubt I'll make an updates by Thurs. evening. |
Yep thats fine, we can just make something that goes "hey this looks like its vulnerable" based on some criteria and return And yeah no worries on the DC detail stuff, its understandable that it may have been a little confusing and you assumed people had watched your talk; happens to all of us 😄 I should have also noticed a few details on my end so that's my bad as well 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change and a minor edge case I found, but should be able to fix these up for you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few other places that need to be updated for conistency of documentation but this otherwise looks good to test and land.
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md
Outdated
Show resolved
Hide resolved
documentation/modules/exploit/windows/local/lexmark_driver_privesc.md
Outdated
Show resolved
Hide resolved
Release NotesA new module has been added to exploit CVE-2021-35449, a privilege escalation issue in a variety of Lexmark drivers including the Universal Print Driver. Successful exploitation allows local attackers to gain |
This pull request is for CVE-2021-35449, a privilege escalation issue in a variety of Lexmark drivers including the Universal Print Driver. I promised this module in my DEFCON talk, Bring Your Own Print Driver Vulnerability. In that talk, I demonstrate that low privileged users can install arbitrary drivers, so having vulnerable drivers in your back pocket is quite nice. This module does not interface with an evil printer, but it will escalate to SYSTEM if the driver is present.
The pull request is very much modeled after @space-r7's Ricoh privilege escalation module... to the point that they are credited in the module.
Verification
List the steps needed to make sure this thing works
msfconsole
use exploit/windows/local/lexmark_driver_privesc
set SESSION <sess_no>
run
Example Output
Here is example output (also included in documentation):
About the patch
Unfortunately the patch doesn't make the .gdl file unreadable - it just seemed to strip out the .dll parsing. As such, it's difficult to know via check() if the target is vulnerable... without exploiting it. 🤷 Open to ideas!
Edit: Vulnerable CAB file
LMUD1o40.zip