Skip to content
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

Add a warning log message to keep track of bluekeep scanning/exploits attempts #114

Merged
merged 5 commits into from
Jul 2, 2019

Conversation

Res260
Copy link
Collaborator

@Res260 Res260 commented Jun 9, 2019

@xshill Is it the right place to put this log statement?

Implements #113

@Res260 Res260 requested review from Pourliver and xshill June 9, 2019 17:43
@Res260
Copy link
Collaborator Author

Res260 commented Jun 9, 2019

I look for clients that open the "MS_T120" virtual channel, which is the first step to trigger bluekeep. This is a pretty good heuristic, and works with this PoC: https://github.com/Ekultek/BlueKeep using the bluekeep_weaponized_dos.py file.

PyRDP still crashes, but it's after the log statement, so the statistic still registers.

Note: it does not work with the bluekeep_poc.py file, because the client sends an invalid clientData packet (it says that it opens 5 virtual channels, but it sends data about 8 virtual channels, so the packet is invalid, even though it doesnt seem to bother the windows msts server...)

@Res260
Copy link
Collaborator Author

Res260 commented Jun 12, 2019

Added a commit to fix a bug I introduced.

pyrdp/mitm/MCSMITM.py Outdated Show resolved Hide resolved
@@ -102,6 +106,9 @@ def onConnectInitial(self, pdu: MCSConnectInitialPDU):

if rdpClientDataPDU.networkData:
self.state.channelDefinitions = rdpClientDataPDU.networkData.channelDefinitions
if "MS_T120" in map(lambda channelDef: channelDef.name, rdpClientDataPDU.networkData.channelDefinitions):
self.log.warning("Client tries to open virtual channel 'MS_T120', which most likely means it either"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log statement is quite a mouthful. The point is to be able to interpret this information (someone's trying to use BlueKeep) very quickly. Wouldn't something like "BlueKeep exploit attempt" be more simple, easier to read and say essentially the same thing?

Also, this seems like INFO level to me. Warning should be for when something went wrong with the actual program or the connection, but it's not something that's very serious. Someone trying to use BlueKeep is information that is actually desirable in a honeypot.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I wasnt sure for the warning vs info. I thought warning was good because what follows will probably make pyrdp crash. What do you think?

As for the message, it being long doesnt seem like a problem to me, in fact I think it helps people not knowing details about bluekeep. I dont have strong feelings aboat this however

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more about the form than the content. The message is a full english sentence with 22 words. The most important keyword is at the end (BlueKeep), so I have to read a whole 20 words to get the actual meaning. What's actually useful is "BlueKeep attempt" and optionally "channel MS_T120".

I just think the faster you can recognize individual log message types, the better, so they should be concise while still providing the requisite information. This is what I think someone scrolling through a huge text file full of logs would rather have.

@Res260
Copy link
Collaborator Author

Res260 commented Jun 13, 2019 via email

@Pourliver
Copy link
Contributor

I would say this is INFO level, since even though it makes pyrdp crash, its not a protocol error / unexpected packet.

@Res260
Copy link
Collaborator Author

Res260 commented Jun 13, 2019 via email

@Res260 Res260 requested a review from xshill June 20, 2019 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants