summaryrefslogtreecommitdiff
path: root/security/caldera/files/patch-plugins_human_templates_human.html
blob: 8c233fdb62455af94fd9d1cd56e2e50165e934c0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--- plugins/human/templates/human.html	2024-02-16 15:54:12.707381000 -0500
+++ plugins/human/templates/human.html	2024-02-16 16:00:05.903013000 -0500
@@ -106,6 +106,7 @@
                   <select x-model="selectedPlatform" id="base-platform">
                     <option value="" disabled>Select target OS</option>
                     <option value="darwin">MacOS</option>
+                    <option value="freebsd">FreeBSD</option>
                     <option value="linux">Linux</option>
                     <option value="windows-psh">Windows (PowerShell)</option>
                   </select>
@@ -349,7 +350,8 @@
         if (
           this.selectedPlatform != "linux" &&
           this.selectedPlatform != "windows-psh" &&
-          this.selectedPlatform != "darwin"
+          this.selectedPlatform != "darwin" &&
+          this.selectedPlatform != "freebsd"
         ) {
           toast("Please select a platform", false);
           return;
@@ -435,8 +437,42 @@
               this.humans[this.selectedHuman].task_cluster_interval +
               " --extra " +
               extra;
-
             break;
+          case "freebsd":
+            this.commandBlock =
+              "curl -sk -o '" +
+              this.humans[this.selectedHuman].name +
+              ".tar.gz' -X POST -H 'file:" +
+              this.humans[this.selectedHuman].name +
+              ".tar.gz' " +
+              this.serverIp +
+              "/file/download 2>&1 && mkdir '" +
+              this.humans[this.selectedHuman].name +
+              "' && tar -C '" +
+              this.humans[this.selectedHuman].name +
+              "' -zxvf '" +
+              this.humans[this.selectedHuman].name +
+              ".tar.gz' " +
+              " && virtualenv -p python3.9 '" +
+              this.humans[this.selectedHuman].name +
+              "' && '" +
+              this.humans[this.selectedHuman].name +
+              "/bin/pip' install -r '" +
+              this.humans[this.selectedHuman].name +
+              "/requirements.txt' && '" +
+              this.humans[this.selectedHuman].name +
+              "/bin/python' '" +
+              this.humans[this.selectedHuman].name +
+              "/human.py' --clustersize " +
+              this.humans[this.selectedHuman].tasks_per_cluster +
+              " " +
+              "--taskinterval " +
+              this.humans[this.selectedHuman].task_interval +
+              " --taskgroupinterval " +
+              this.humans[this.selectedHuman].task_cluster_interval +
+              " --extra " +
+              extra;
+            break;
           case "linux":
             this.commandBlock =
               "curl -sk -o '" +
@@ -514,6 +550,10 @@
         extra.forEach((command) => {
           switch (platform) {
             case "darwin":
+              command = command.replace(/\\/g, "\\\\");
+              command = command.replace(/"/g, '\\"');
+              break;
+            case "freebsd":
               command = command.replace(/\\/g, "\\\\");
               command = command.replace(/"/g, '\\"');
               break;