-
-
Notifications
You must be signed in to change notification settings - Fork 35
Update SSID_Fetcher_UserScript.user.js #62
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 |
|---|---|---|
|
|
@@ -4,41 +4,62 @@ | |
| // @match *://pocketoption.com/* | ||
| // @match *://*.pocketoption.com/* | ||
| // @grant none | ||
| // @version 1.2 | ||
| // @version 1.3 | ||
| // @author Six | ||
| // @description Intercepts auth SSID from PocketOption | ||
| // ==/UserScript== | ||
|
|
||
| (function() { | ||
| 'use strict'; | ||
|
|
||
| const originalSend = WebSocket.prototype.send; | ||
| // Hook the WebSocket constructor | ||
| const OriginalWebSocket = window.WebSocket; | ||
|
|
||
| WebSocket.prototype.send = function(data) { | ||
| window.WebSocket = function(url, protocols) { | ||
| const socket = new OriginalWebSocket(url, protocols); | ||
| // Manual tag as fallback in case the native .url property is restricted | ||
| try { | ||
| socket._interceptUrl = url.toString(); | ||
| } catch (e) {} | ||
| return socket; | ||
| }; | ||
|
|
||
| // Maintain prototype chain | ||
| window.WebSocket.prototype = OriginalWebSocket.prototype; | ||
| window.WebSocket.prototype.constructor = window.WebSocket; | ||
|
|
||
| // Hook the send method | ||
| const originalSend = OriginalWebSocket.prototype.send; | ||
|
|
||
| OriginalWebSocket.prototype.send = function(data) { | ||
| // Get the URL from the native property or our fallback tag | ||
| const socketUrl = (this.url || this._interceptUrl || "").toLowerCase(); | ||
|
|
||
| // STRICT EXCLUSION: If the URL belongs to events-po.com, bypass the logic immediately | ||
| if (socketUrl.includes("events-po.com")) { | ||
| return originalSend.apply(this, arguments); | ||
| } | ||
|
|
||
| // Intercept authentication messages (Real or Demo) | ||
| 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 | ||
|
|
||
| // Security Check | ||
| const userWantsToProceed = confirm(`Auth string intercepted from:\n${socketUrl}\n\nWould you like to show the full string and copy it to your clipboard?`); | ||
|
|
||
| if (userWantsToProceed) { | ||
| // Copy the ENTIRE string | ||
| navigator.clipboard.writeText(data).then(() => { | ||
| alert("Auth String Copied to Clipboard:\n\n" + data); | ||
| }).catch(err => { | ||
| console.error('Clipboard copy failed:', err); | ||
| alert("Auth String Found (Auto-copy failed):\n\n" + data); | ||
| }); | ||
| } | ||
| } | ||
|
|
||
| // Always execute original send to maintain platform functionality | ||
| return originalSend.apply(this, arguments); | ||
|
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. |
||
| }; | ||
|
|
||
| console.log('[SSID Fetcher] Hooked and waiting for authentication...'); | ||
| console.log('Hooked. ignoring auth msgs from events-po.com.'); | ||
| })(); | ||
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.
The
argumentsobject is generally discouraged in modern JavaScript due to performance implications and less readable code. It's better to explicitly passdataif that's the only argument needed, or use rest parameters if multiple arguments are expected.