bonktools 3.0.0 → 3.1.0

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.
@@ -1,36 +1,37 @@
1
1
  -----BEGIN CERTIFICATE-----
2
- MIIGTDCCBDSgAwIBAgIQOXpmzCdWNi4NqofKbqvjsTANBgkqhkiG9w0BAQwFADBf
3
- MQswCQYDVQQGEwJHQjEYMBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTYwNAYDVQQD
4
- Ey1TZWN0aWdvIFB1YmxpYyBTZXJ2ZXIgQXV0aGVudGljYXRpb24gUm9vdCBSNDYw
5
- HhcNMjEwMzIyMDAwMDAwWhcNMzYwMzIxMjM1OTU5WjBgMQswCQYDVQQGEwJHQjEY
6
- MBYGA1UEChMPU2VjdGlnbyBMaW1pdGVkMTcwNQYDVQQDEy5TZWN0aWdvIFB1Ymxp
7
- YyBTZXJ2ZXIgQXV0aGVudGljYXRpb24gQ0EgRFYgUjM2MIIBojANBgkqhkiG9w0B
8
- AQEFAAOCAY8AMIIBigKCAYEAljZf2HIz7+SPUPQCQObZYcrxLTHYdf1ZtMRe7Yeq
9
- RPSwygz16qJ9cAWtWNTcuICc++p8Dct7zNGxCpqmEtqifO7NvuB5dEVexXn9RFFH
10
- 12Hm+NtPRQgXIFjx6MSJcNWuVO3XGE57L1mHlcQYj+g4hny90aFh2SCZCDEVkAja
11
- EMMfYPKuCjHuuF+bzHFb/9gV8P9+ekcHENF2nR1efGWSKwnfG5RawlkaQDpRtZTm
12
- M64TIsv/r7cyFO4nSjs1jLdXYdz5q3a4L0NoabZfbdxVb+CUEHfB0bpulZQtH1Rv
13
- 38e/lIdP7OTTIlZh6OYL6NhxP8So0/sht/4J9mqIGxRFc0/pC8suja+wcIUna0HB
14
- pXKfXTKpzgis+zmXDL06ASJf5E4A2/m+Hp6b84sfPAwQ766rI65mh50S0Di9E3Pn
15
- 2WcaJc+PILsBmYpgtmgWTR9eV9otfKRUBfzHUHcVgar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9w0BAQsFAAOCAYEAAJBJChB6HYYN6/cBVmvr89rMx+ZmIBemeplt
29
+ LdqDeDgzUxaHIA0x65bTldBW2QnuSobf+h+fnaTHc3/MkNZ3K5PcY6n45e72nAis
30
+ mxnHZWfvsW3SZY3LEyagKdodiqnjdZNA92CRPgkvLey0X4QGW3MPgWws1Fv1dsL/
31
+ u/q0h5NtdX/FuTgJ3IncfAurhSxvWLhoIuMrq4GyXfFU6NeFLOc7qxKzlWopLauZ
32
+ OdUCnhNgVDUU1cojkPdCdII7PRfF8z1mOL2CpjXcT5MglIWExPEOlyw/FYkAM2V6
33
+ xE+DH0eh2K6CYr3WXqAp9/1OY6f13wHfOm3EInX/N1QEVzTjkIuCRuoHL8iuxos0
34
+ 5l5K0oZIdLV9Jm+3QXjkF6W4Jv/B8cA/IhimR7+AlpjrCGBj3sz3LIMbQCXAMKy0
35
+ bjxY1MXD/pd6Uw3fVpLMRLV475APxwMB/lhqJuv6kHlgTQ7gwIPwB5fYWHIQzlxe
36
+ t217eGbT7tfXnVw/ywSwbEMgekAx
37
+ -----END CERTIFICATE-----
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bonktools",
3
- "version": "3.0.0",
3
+ "version": "3.1.0",
4
4
  "description": "Advanced Bonk.io bot library with physics simulation and game state management",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Download Sectigo certificate chain for bonk.io servers
4
- * This script builds a complete certificate chain for bonk.io servers
3
+ * Extract certificate chain directly from bonk.io server
4
+ * This avoids curl, HTTP downloads, proxies, and firewall blocks
5
5
  */
6
6
 
7
7
  const { execSync } = require('child_process');
@@ -9,111 +9,42 @@ const fs = require('fs');
9
9
  const path = require('path');
10
10
 
11
11
  const OUTPUT_FILE = path.join(__dirname, '..', 'bonk_fullchain.pem');
12
- const BONK_SERVER = 'b2ny1.bonk.io';
12
+ const BONK_HOST = 'b2ny1.bonk.io';
13
+ const BONK_PORT = 443;
13
14
 
14
- /**
15
- * Download intermediate certificate from Sectigo
16
- */
17
- function downloadIntermediateCert() {
18
- try {
19
- console.log('Downloading intermediate certificate from Sectigo...');
20
-
21
- // Use HTTP (not HTTPS) to avoid certificate issues
22
- const intermediateUrl = 'http://crt.sectigo.com/SectigoPublicServerAuthenticationCADVR36.crt';
23
-
24
- // Download and convert DER to PEM
25
- const command = `curl -s "${intermediateUrl}" | openssl x509 -inform DER -outform PEM`;
26
-
27
- const intermediatePem = execSync(command, {
28
- encoding: 'utf8',
29
- maxBuffer: 10 * 1024 * 1024
30
- });
31
-
32
- if (!intermediatePem || !intermediatePem.includes('BEGIN CERTIFICATE')) {
33
- throw new Error('Failed to download intermediate certificate');
34
- }
35
-
36
- return intermediatePem;
37
- } catch (error) {
38
- console.warn('Warning: Could not download intermediate certificate:', error.message);
39
- return null;
40
- }
41
- }
15
+ function main() {
16
+ console.log('Extracting certificate chain directly from bonk.io server...');
42
17
 
43
- /**
44
- * Download root certificate
45
- */
46
- function downloadRootCert() {
47
18
  try {
48
- console.log('Downloading root certificate...');
49
-
50
- // USERTrust RSA Certification Authority (root)
51
- const rootUrl = 'http://crt.usertrust.com/USERTrustRSACertificationAuthority.crt';
19
+ // Windows não suporta < /dev/null
20
+ // Usamos echo. para encerrar a conexão corretamente
21
+ const cmd = `echo.|openssl s_client -showcerts -connect ${BONK_HOST}:${BONK_PORT}`;
52
22
 
53
- // Download and convert DER to PEM
54
- const command = `curl -s "${rootUrl}" | openssl x509 -inform DER -outform PEM`;
55
-
56
- const rootPem = execSync(command, {
23
+ const output = execSync(cmd, {
57
24
  encoding: 'utf8',
58
- maxBuffer: 10 * 1024 * 1024
25
+ maxBuffer: 20 * 1024 * 1024
59
26
  });
60
27
 
61
- if (!rootPem || !rootPem.includes('BEGIN CERTIFICATE')) {
62
- throw new Error('Failed to download root certificate');
63
- }
64
-
65
- return rootPem;
66
- } catch (error) {
67
- console.warn('Warning: Could not download root certificate:', error.message);
68
- return null;
69
- }
70
- }
71
-
72
- /**
73
- * Main function to download and save certificate chain
74
- */
75
- function main() {
76
- console.log('Building Sectigo certificate chain for bonk.io...');
77
-
78
- try {
79
- const certs = [];
80
- let certCount = 0;
81
-
82
- // Download intermediate certificate
83
- const intermediate = downloadIntermediateCert();
84
- if (intermediate) {
85
- certs.push(intermediate);
86
- certCount++;
87
- }
88
-
89
- // Download root certificate
90
- const root = downloadRootCert();
91
- if (root) {
92
- certs.push(root);
93
- certCount++;
94
- }
28
+ const certs = output.match(/-----BEGIN CERTIFICATE-----[\s\S]+?-----END CERTIFICATE-----/g);
95
29
 
96
- if (certs.length === 0) {
97
- throw new Error('Failed to download any certificates');
30
+ if (!certs || certs.length === 0) {
31
+ throw new Error('No certificates found in server response');
98
32
  }
99
33
 
100
- // Combine certificates (intermediate first, then root)
101
- const fullChain = certs.join('\n');
34
+ const uniqueCerts = [...new Set(certs)];
102
35
 
103
- // Save to file
104
- fs.writeFileSync(OUTPUT_FILE, fullChain, 'utf8');
36
+ fs.writeFileSync(OUTPUT_FILE, uniqueCerts.join('\n\n'), 'utf8');
105
37
 
106
- console.log(`✓ Downloaded ${certCount} certificate(s)`);
107
- console.log(`✓ Certificate chain saved to: ${OUTPUT_FILE}`);
108
- console.log('✓ You can now run your bot with: npm run host-bot or npm run simple-bot');
109
- } catch (error) {
110
- console.error('Error downloading certificates:', error.message);
111
- console.error('\nNote: This script requires curl and openssl to be installed on your system.');
38
+ console.log(`✓ Extracted ${uniqueCerts.length} certificate(s)`);
39
+ console.log(`✓ Full chain saved to: ${OUTPUT_FILE}`);
40
+ console.log('✓ Chain captured directly from the server 🔥');
41
+ } catch (err) {
42
+ console.error('Failed to extract certificates:', err.message);
112
43
  process.exit(1);
113
44
  }
114
45
  }
115
46
 
116
- // Run if called directly
47
+
117
48
  if (require.main === module) {
118
49
  main();
119
50
  }