yolkbot 0.1.1-alpha.44 → 0.1.1-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/build/global.js +1 -6
- package/browser/build/module.js +1 -6
- package/package.json +2 -5
- package/src/api.js +36 -24
- package/src/globals.js +15 -0
- package/src/socket.js +4 -10
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yolkbot",
|
|
3
3
|
"description": "create a shell shockers bot in under 10 lines.",
|
|
4
|
-
"version": "0.1.1-alpha.
|
|
4
|
+
"version": "0.1.1-alpha.46",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shell shockers",
|
|
7
7
|
"shellshock.io",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"axios": "^1.8.3",
|
|
83
82
|
"smallsocks": "^1.0.0",
|
|
83
|
+
"undici": "^7.7.0",
|
|
84
84
|
"ws": "^8.18.0"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
@@ -89,8 +89,5 @@
|
|
|
89
89
|
"esbuild": "^0.25.0",
|
|
90
90
|
"eslint": "^9.20.1",
|
|
91
91
|
"globals": "^15.15.0"
|
|
92
|
-
},
|
|
93
|
-
"scripts": {
|
|
94
|
-
"lint": "eslint --fix"
|
|
95
92
|
}
|
|
96
93
|
}
|
package/src/api.js
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import globals from './globals.js';
|
|
3
2
|
import yolkws from './socket.js';
|
|
4
3
|
|
|
5
|
-
import { FirebaseKey,
|
|
6
|
-
|
|
7
|
-
let SocksProxyAgent;
|
|
8
|
-
if (ProxiesEnabled) SocksProxyAgent = (await import('smallsocks')).SocksProxyAgent;
|
|
4
|
+
import { FirebaseKey, UserAgent } from './constants/index.js';
|
|
9
5
|
|
|
10
6
|
const queryServices = async (request, proxy = '', instance = 'shellshock.io') => {
|
|
11
7
|
let ws;
|
|
@@ -87,20 +83,24 @@ async function loginWithCredentials(email, password, prox = '', instance = 'shel
|
|
|
87
83
|
|
|
88
84
|
while (!SUCCESS) {
|
|
89
85
|
try {
|
|
90
|
-
request = await
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
86
|
+
request = await globals.fetch(`https://identitytoolkit.googleapis.com/v1/accounts:${endpoint}?key=${FirebaseKey}`, {
|
|
87
|
+
method: 'POST',
|
|
88
|
+
body: JSON.stringify({
|
|
89
|
+
email: email,
|
|
90
|
+
password: password,
|
|
91
|
+
returnSecureToken: true
|
|
92
|
+
}),
|
|
95
93
|
headers: {
|
|
94
|
+
'content-type': 'application/json',
|
|
96
95
|
'origin': 'https://shellshock.io',
|
|
97
96
|
'user-agent': UserAgent,
|
|
98
97
|
'x-client-version': 'Chrome/JsCore/9.17.2/FirebaseCore-web',
|
|
99
98
|
'x-firebase-locale': 'en'
|
|
100
99
|
},
|
|
101
|
-
|
|
102
|
-
})
|
|
103
|
-
|
|
100
|
+
dispatcher: new globals.ProxyAgent(prox)
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
body = await request.json();
|
|
104
104
|
token = body.idToken;
|
|
105
105
|
SUCCESS = true;
|
|
106
106
|
} catch (error) {
|
|
@@ -148,14 +148,20 @@ async function loginWithRefreshToken(refreshToken, prox = '', instance = 'shells
|
|
|
148
148
|
|
|
149
149
|
while (!SUCCESS) {
|
|
150
150
|
try {
|
|
151
|
-
request = await
|
|
151
|
+
request = await globals.fetch(`https://securetoken.googleapis.com/v1/token?key=${FirebaseKey}`, {
|
|
152
|
+
method: 'POST',
|
|
153
|
+
body: formData,
|
|
152
154
|
headers: {
|
|
155
|
+
'content-type': 'application/x-www-form-urlencoded',
|
|
156
|
+
'origin': 'https://shellshock.io',
|
|
153
157
|
'user-agent': UserAgent,
|
|
154
|
-
'x-client-version': 'Chrome/JsCore/9.17.2/FirebaseCore-web'
|
|
158
|
+
'x-client-version': 'Chrome/JsCore/9.17.2/FirebaseCore-web',
|
|
159
|
+
'x-firebase-locale': 'en'
|
|
155
160
|
},
|
|
156
|
-
|
|
157
|
-
})
|
|
158
|
-
|
|
161
|
+
dispatcher: new globals.ProxyAgent(prox)
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
body = await request.json();
|
|
159
165
|
token = body.id_token;
|
|
160
166
|
SUCCESS = true;
|
|
161
167
|
} catch (error) {
|
|
@@ -188,16 +194,22 @@ async function loginWithRefreshToken(refreshToken, prox = '', instance = 'shells
|
|
|
188
194
|
}
|
|
189
195
|
|
|
190
196
|
async function loginAnonymously(prox = '', instance = 'shellshock.io') {
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
197
|
+
const req = await globals.fetch('https://identitytoolkit.googleapis.com/v1/accounts:signUp?key=' + FirebaseKey, {
|
|
198
|
+
method: 'POST',
|
|
199
|
+
body: JSON.stringify({
|
|
200
|
+
returnSecureToken: true
|
|
201
|
+
}),
|
|
194
202
|
headers: {
|
|
203
|
+
'content-type': 'application/json',
|
|
204
|
+
'origin': 'https://shellshock.io',
|
|
195
205
|
'user-agent': UserAgent,
|
|
196
|
-
'x-client-version': 'Chrome/JsCore/9.17.2/FirebaseCore-web'
|
|
206
|
+
'x-client-version': 'Chrome/JsCore/9.17.2/FirebaseCore-web',
|
|
207
|
+
'x-firebase-locale': 'en'
|
|
197
208
|
},
|
|
198
|
-
|
|
209
|
+
dispatcher: new globals.ProxyAgent(prox)
|
|
199
210
|
});
|
|
200
211
|
|
|
212
|
+
const body = await req.json();
|
|
201
213
|
const token = body.idToken;
|
|
202
214
|
|
|
203
215
|
if (!token) {
|
package/src/globals.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const globals = {};
|
|
2
|
+
|
|
3
|
+
if (typeof process !== 'undefined') {
|
|
4
|
+
globals.fetch = (await import('undici')).fetch;
|
|
5
|
+
globals.SocksProxyAgent = (await import('smallsocks')).SocksProxyAgent;
|
|
6
|
+
globals.ProxyAgent = (await import('undici')).ProxyAgent;
|
|
7
|
+
globals.WebSocket = (await import('ws')).default;
|
|
8
|
+
} else {
|
|
9
|
+
globals.fetch = fetch;
|
|
10
|
+
globals.SocksProxyAgent = undefined;
|
|
11
|
+
globals.ProxyAgent = class {};
|
|
12
|
+
globals.WebSocket = WebSocket;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default globals;
|
package/src/socket.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import globals from './globals.js';
|
|
2
|
+
import { IsBrowser, UserAgent } from './constants/index.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const WS = IsBrowser ? window.WebSocket : NodeWebSocket;
|
|
6
|
-
|
|
7
|
-
let SocksProxyAgent;
|
|
8
|
-
if (ProxiesEnabled) SocksProxyAgent = (await import('smallsocks')).SocksProxyAgent;
|
|
9
|
-
|
|
10
|
-
class yolkws extends WS {
|
|
4
|
+
class yolkws extends globals.WebSocket {
|
|
11
5
|
constructor(url, proxy) {
|
|
12
6
|
if (IsBrowser) super(url);
|
|
13
7
|
else {
|
|
14
8
|
super(url, {
|
|
15
|
-
agent: proxy ? new SocksProxyAgent(proxy) : undefined,
|
|
9
|
+
agent: proxy ? new globals.SocksProxyAgent(proxy) : undefined,
|
|
16
10
|
headers: {
|
|
17
11
|
'user-agent': UserAgent,
|
|
18
12
|
'accept-language': 'en-US,en;q=0.9'
|