-
-
Notifications
You must be signed in to change notification settings - Fork 35
Create SSID_Fetcher_UserScript.user.js #61
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // ==UserScript== | ||
| // @name PocketOption SSID Fetcher | ||
| // @namespace SixsPocketOptionSSIDFetcher | ||
| // @match *://pocketoption.com/* | ||
| // @match *://*.pocketoption.com/* | ||
| // @grant none | ||
| // @version 1.2 | ||
| // @author Six | ||
| // @description Intercepts auth SSID from PocketOption | ||
| // ==/UserScript== | ||
|
|
||
| (function() { | ||
| 'use strict'; | ||
|
|
||
| const originalSend = WebSocket.prototype.send; | ||
|
|
||
| WebSocket.prototype.send = function(data) { | ||
| if (typeof data === 'string' && data.startsWith('42["auth",')) { | ||
| try { | ||
| const jsonStr = data.substring(2); | ||
| const parsedData = JSON.parse(jsonStr); | ||
|
|
||
| if (parsedData[0] === 'auth' && parsedData[1] && parsedData[1].session) { | ||
| const ssid = parsedData[1].session; | ||
|
|
||
| // Ask the user before showing sensitive info (basic security check) | ||
| const userwantsToShow = confirm("SSID Intercepted. Would you like to display the Session ID (SSID)?"); | ||
|
|
||
| if (userwantsToShow) { | ||
| alert("Your SSID is:\n\n" + ssid); | ||
| } else { | ||
| console.log("[SSID Fetcher] Display dismissed by user."); | ||
| } | ||
| } | ||
| } catch (e) { | ||
| // Ignore parsing errors to prevent site disruption | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Silently ignoring errors in the console.error("[SSID Fetcher] Error parsing WebSocket message:", e); |
||
| } | ||
| } | ||
|
|
||
| return originalSend.apply(this, arguments); | ||
| }; | ||
|
|
||
| console.log('[SSID Fetcher] Hooked and waiting for authentication...'); | ||
| })(); | ||
Oops, something went wrong.
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.
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.
Displaying the SSID in an
alertbox is not very user-friendly, as it's difficult to copy the long string. A better user experience would be to copy the SSID to the clipboard directly and notify the user. This also improves the variable naming to follow camelCase convention.Important: To use
GM_setClipboard, you'll also need to update the script's metadata by changing line 6 from// @grant noneto// @grant GM_setClipboard.