Skip to content

Commit 3a4d075

Browse files
committed
Add initial project structure and core functionality for PyCript WebSocket extension
1 parent b28eafa commit 3a4d075

16 files changed

+1029
-20
lines changed

.gitignore

Lines changed: 84 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,90 @@
1-
# Compiled class file
2-
*.class
3-
4-
# Log file
5-
*.log
6-
7-
# BlueJ files
8-
*.ctxt
9-
10-
# Mobile Tools for Java (J2ME)
1+
##############################
2+
## Java
3+
##############################
114
.mtj.tmp/
12-
13-
# Package Files #
5+
*.class
146
*.jar
157
*.war
16-
*.nar
178
*.ear
18-
*.zip
19-
*.tar.gz
20-
*.rar
21-
22-
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
9+
*.nar
2310
hs_err_pid*
2411
replay_pid*
12+
13+
##############################
14+
## Maven
15+
##############################
16+
target/
17+
pom.xml.tag
18+
pom.xml.releaseBackup
19+
pom.xml.versionsBackup
20+
pom.xml.next
21+
pom.xml.bak
22+
release.properties
23+
dependency-reduced-pom.xml
24+
buildNumber.properties
25+
.mvn/timing.properties
26+
.mvn/wrapper/maven-wrapper.jar
27+
28+
##############################
29+
## Gradle
30+
##############################
31+
bin/
32+
build/
33+
.gradle
34+
.gradletasknamecache
35+
gradle-app.setting
36+
!gradle-wrapper.jar
37+
38+
##############################
39+
## IntelliJ
40+
##############################
41+
out/
42+
.idea/
43+
.idea_modules/
44+
*.iml
45+
*.ipr
46+
*.iws
47+
48+
##############################
49+
## Eclipse
50+
##############################
51+
.settings/
52+
bin/
53+
tmp/
54+
.metadata
55+
.classpath
56+
.project
57+
*.tmp
58+
*.bak
59+
*.swp
60+
*~.nib
61+
local.properties
62+
.loadpath
63+
.factorypath
64+
65+
##############################
66+
## NetBeans
67+
##############################
68+
nbproject/private/
69+
build/
70+
nbbuild/
71+
dist/
72+
nbdist/
73+
nbactions.xml
74+
nb-configuration.xml
75+
76+
##############################
77+
## Visual Studio Code
78+
##############################
79+
.vscode/
80+
.code-workspace
81+
82+
##############################
83+
## OS X
84+
##############################
85+
.DS_Store
86+
87+
##############################
88+
## Miscellaneous
89+
##############################
90+
*.log

README.md

Lines changed: 117 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,117 @@
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+
[![Deploy](https://github.com/Anof-cyber/PyCript-Docs/actions/workflows/static.yml/badge.svg)](https://github.com/Anof-cyber/PyCript-Docs/actions/workflows/static.yml)
17+
![GitHub](https://img.shields.io/github/license/Anof-cyber/APTRS)
18+
![GitHub closed issues](https://img.shields.io/github/issues-closed/Anof-cyber/PyCript)
19+
[![](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=%23fe8e86)](https://github.com/sponsors/Anof-cyber)
20+
![GitHub Release Date](https://img.shields.io/github/release-date/anof-cyber/PyCript?style=plastic)
21+
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/anof-cyber/PyCript?include_prereleases)
22+
![GitHub last commit](https://img.shields.io/github/last-commit/Anof-cyber/PyCript)
23+
[![](https://i.ibb.co/qsV4mb9/twitter-2.png)](https://twitter.com/ano_f_)[![](https://i.ibb.co/89LKTrL/linkedin-1.png)](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+
```

build.gradle

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
group 'com.pycriptsocket'
6+
version '1.1'
7+
8+
9+
repositories {
10+
mavenCentral()
11+
}
12+
13+
dependencies {
14+
implementation 'net.portswigger.burp.extensions:montoya-api:+' // Burp Suite API
15+
}
16+
17+
test {
18+
useJUnitPlatform()
19+
}

gradle/wrapper/gradle-wrapper.jar

42.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)