|
1 |
| -# PyCript-WebSocket |
2 |
| -Burp Suite extension for bypassing client-side encryption for pentesting and bug bounty in WebSocket |
| 1 | +# PyCript WebSocket |
| 2 | +<p align="center"> |
| 3 | + <img src="https://i.ibb.co/KqGXSq0/Py-Cript-Banner.png" /> |
| 4 | +</p> |
| 5 | + |
| 6 | + |
| 7 | +PyCript WebSocket is a Burp Suite extension that enables users to encrypt and decrypt WebSocket messages for manual and automated application penetration testing. Built with the same logic as the original PyCript, this extension provides a separate solution specifically for WebSockets. It allows users to implement custom encryption and decryption logic using languages like Python, Go, Node.js, C, Bash, etc., ensuring flexibility for unique testing needs. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +> [!Note] |
| 12 | +> This is another version of Original PyCript Extension for WebSocket Messages |
| 13 | +
|
| 14 | + |
| 15 | + |
| 16 | +[](https://github.com/Anof-cyber/PyCript-Docs/actions/workflows/static.yml) |
| 17 | + |
| 18 | + |
| 19 | +[](https://github.com/sponsors/Anof-cyber) |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +[](https://twitter.com/ano_f_)[](https://www.linkedin.com/in/sourav-kalal/) |
| 24 | + |
| 25 | + |
| 26 | +## Support |
| 27 | + |
| 28 | +<a href="https://www.buymeacoffee.com/AnoF"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=AnoF&button_colour=FF5F5F&font_colour=ffffff&font_family=Arial&outline_colour=000000&coffee_colour=FFDD00" /></a> |
| 29 | + |
| 30 | +<a href="https://github.com/sponsors/Anof-cyber"><img src="https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86" alt="Sponsor Anof-cyber" width="230" height="50"></a> |
| 31 | + |
| 32 | + |
| 33 | +## Reference |
| 34 | +- [Original PyCript Extension](https://github.com/Anof-cyber/PyCript) |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +## Features |
| 39 | + |
| 40 | +- [X] Encrypt & Decrypt Web Socket Messages for both To Server and To Client |
| 41 | +- [X] View and Modify the encrypted Messages in plain text |
| 42 | +- [X] Complete freedom for encryption and decryption logic |
| 43 | + |
| 44 | + |
| 45 | +## Demo Code |
| 46 | + |
| 47 | +- Demo Code for Encryption Decryption in PyCript WebSocket |
| 48 | + |
| 49 | + |
| 50 | +> [!Note] |
| 51 | +> PyCript Web Socket has separate Logic to handle encryption and decryption and demo code from Original PyCript will not work with the PyCript WebSocket version. The main logic is same in both the extension yet it differs at some level. DO NOT USE https://github.com/Anof-cyber/PyCript-Template for PyCript WebSocket. |
| 52 | +
|
| 53 | + |
| 54 | +Below Example is in JavaScript, You can use any language including Bash, C, Python, Java, Go etc. |
| 55 | + |
| 56 | +##### Decryption Code |
| 57 | +```javascript |
| 58 | +// String Decryption with AES 128 UTF8 |
| 59 | +const fs = require('fs'); |
| 60 | +const path = require('path'); |
| 61 | +var CryptoJS = require("crypto-js"); |
| 62 | +const { program } = require('commander'); |
| 63 | +const { Buffer } = require('buffer'); |
| 64 | + |
| 65 | +program |
| 66 | + .option('-d, --data <file_path>', 'Path to JSON file containing base64 encoded + encrypted data'); |
| 67 | + |
| 68 | +program.parse(process.argv); |
| 69 | +const options = program.opts(); |
| 70 | + |
| 71 | +const filePath = options.data; |
| 72 | +const absoluteFilePath = path.resolve(filePath); |
| 73 | +var data = fs.readFileSync(absoluteFilePath, 'utf8') |
| 74 | +// call the functions to handle decryption, |
| 75 | +const originalText = decryptMessage(data); |
| 76 | + |
| 77 | +// write decrypt data to same temp file. |
| 78 | +fs.writeFileSync(absoluteFilePath,originalText) |
| 79 | + |
| 80 | +function decryptMessage(encryptedMessage) { |
| 81 | + // your decryption logic |
| 82 | + return decrypted_data; |
| 83 | + } |
| 84 | + |
| 85 | +``` |
| 86 | + |
| 87 | +##### Encryption Code |
| 88 | + |
| 89 | +```javascript |
| 90 | +// String Decryption with AES 128 UTF8 |
| 91 | +const fs = require('fs'); |
| 92 | +const path = require('path'); |
| 93 | +var CryptoJS = require("crypto-js"); |
| 94 | +const { program } = require('commander'); |
| 95 | +const { Buffer } = require('buffer'); |
| 96 | + |
| 97 | +program |
| 98 | + .option('-d, --data <file_path>', 'Path to JSON file containing base64 encoded + encrypted data'); |
| 99 | + |
| 100 | +program.parse(process.argv); |
| 101 | +const options = program.opts(); |
| 102 | + |
| 103 | +const filePath = options.data; |
| 104 | +const absoluteFilePath = path.resolve(filePath); |
| 105 | +var data = fs.readFileSync(absoluteFilePath, 'utf8') |
| 106 | +// call the functions to handle encryption, |
| 107 | +const originalText = encryptMessage(data); |
| 108 | + |
| 109 | +// write encrypted data to same temp file. |
| 110 | +fs.writeFileSync(absoluteFilePath,originalText) |
| 111 | + |
| 112 | +function encryptMessage(message) { |
| 113 | + // your encryption logic |
| 114 | + return encrypted_message; |
| 115 | + } |
| 116 | + |
| 117 | +``` |
0 commit comments