Add Peyara Remote Mouse RCE Module#21491
Open
capture0x wants to merge 1 commit into
Open
Conversation
| require 'http/cookie' | ||
|
|
||
| class MetasploitModule < Msf::Exploit::Remote | ||
| Rank = NormalRanking |
Contributor
There was a problem hiding this comment.
Why only NormalRanking?
| end | ||
|
|
||
| def socketio_uri | ||
| "#{normalize_uri(target_uri.path, 'socket.io/')}?EIO=4&transport=websocket" |
Contributor
There was a problem hiding this comment.
This should be probably inlined.
| end | ||
|
|
||
| def socketio_uri | ||
| "#{normalize_uri(target_uri.path, 'socket.io/')}?EIO=4&transport=websocket" |
Contributor
There was a problem hiding this comment.
The GET parameters should be passed with vars_get.
|
|
||
| safe_wsclose(wsock) | ||
|
|
||
| return CheckCode::Appears('Socket.IO service on the Peyara Remote Mouse port returned an Engine.IO open frame') if open_frame&.start_with?('0') |
Contributor
There was a problem hiding this comment.
Does this mean that the application is definitely vulnerable? Is there a way to detect a version?
Comment on lines
+106
to
+109
| unless open_frame&.start_with?('0') | ||
| safe_wsclose(wsock) | ||
| fail_with(Failure::UnexpectedReply, 'The service did not return a Socket.IO open frame') | ||
| end |
Contributor
There was a problem hiding this comment.
This is already checked in check, no need to check it here as well.
Comment on lines
+126
to
+128
| def socketio_event(event, data) | ||
| "42#{JSON.generate([event, data])}" | ||
| end |
Comment on lines
+68
to
+69
| OptFloat.new('KEY_DELAY', [true, 'Delay between keyboard events in seconds', 0.2]), | ||
| OptFloat.new('WINDOW_DELAY', [true, 'Delay after opening the command prompt in seconds', 1.0]), |
Contributor
There was a problem hiding this comment.
I don't think this parameters needs to be stored as datastore, you can use fixed delay probably
Comment on lines
+79
to
+83
| def safe_wsclose(wsock) | ||
| wsock&.wsclose | ||
| rescue StandardError | ||
| nil | ||
| end |
| nil | ||
| end | ||
|
|
||
| def recv_wstext(wsock, timeout = datastore['WS_TIMEOUT']) |
Contributor
There was a problem hiding this comment.
Why do you need to pass WS_TIMEOUT as parameter rather than use it directly?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds an exploit module for Peyara Remote Mouse v1.0.1 unauthenticated RCE.
The module connects to the Socket.IO WebSocket service on TCP port 1313 and sends unauthenticated keyboard events to open cmd.exe and execute a Windows command payload.
References:
Verification: