1
1
<template >
2
2
<el-row :gutter =" 26" >
3
- <el-col :span =" 6 " >
3
+ <el-col :span =" 8 " >
4
4
<el-card >
5
5
<div slot =" header" class =" clearfix" >
6
6
<span class =" header-text" >Game info</span >
19
19
</template >
20
20
</countdown >
21
21
</div >
22
- <div class = " row2 " >
23
- <div class = " column2 " >
22
+ <el-row :gutter = " 10 " >
23
+ <el-col :span = " 12 " >
24
24
<div class =" text item" ><a :href =" boardLink" >Scoreboard</a ></div >
25
- <div class =" text item" >Username: {{ username }}</div >
26
- <div class =" text item" >Password: {{ password }}</div >
27
- <el-button @click =" downloadKeyFile" >Download key file</el-button >
28
- </div >
29
- <div class =" column2" >
30
- <div >
31
- <el-input
32
- :rows =" 4"
33
- type =" textarea"
34
- placeholder =" Enter ssh public key"
35
- v-model =" keyContent"
36
- ></el-input >
37
- <el-button @click =" uploadKeyFile" >Upload key</el-button >
25
+ <div class =" text item" ><a :href =" mongolLink" >MonGol</a ></div >
26
+ <div class =" text item" >
27
+ Username:
28
+ <span class =" copiable" @click =" copyText(`${username}`)" >{{
29
+ username
30
+ }}</span >
38
31
</div >
39
- </div >
40
- </div >
41
- </el-card >
42
- </el-col >
43
- <el-col :span =" 6" >
44
- <el-card >
45
- <div slot =" header" class =" clearfix" >
46
- <span class =" header-text" >Mongol</span >
47
- <a :href =" mongolLink" style =" float : right ; padding : 3px 0 " type =" text"
48
- >Open</a
49
- >
50
- </div >
51
- <div class =" text item" >Credentials are the same</div >
32
+ <div class =" text item" >
33
+ Password:
34
+ <span class =" copiable" @click =" copyText(`${password}`)" >{{
35
+ password
36
+ }}</span >
37
+ </div >
38
+ </el-col >
39
+ </el-row >
52
40
</el-card >
53
41
</el-col >
54
- <el-col :span =" 6 " >
42
+ <el-col :span =" 8 " >
55
43
<el-card >
56
44
<div slot =" header" class =" clearfix" >
57
45
<span class =" header-text" >Farm</span >
58
46
<a :href =" farmLink" style =" float : right ; padding : 3px 0 " type =" text"
59
47
>Open</a
60
48
>
61
49
</div >
62
- <el-button @click =" downloadStartSploit"
63
- >Download start sploit</el-button
64
- >
50
+ <el-row justify =" space-around" type =" flex" >
51
+ <el-button :span =" 6" @click =" downloadNeoRunner"
52
+ >🖨️ Neo runner
53
+ </el-button >
54
+ <el-button :span =" 6" @click =" downloadStartSploit"
55
+ >🖨️ Start sploit
56
+ </el-button >
57
+ </el-row >
65
58
</el-card >
66
59
</el-col >
67
- <el-col :span =" 6 " >
60
+ <el-col :span =" 8 " >
68
61
<el-card >
69
62
<div slot =" header" class =" clearfix" >
70
63
<span class =" header-text" >Vulnboxes</span >
80
73
<a :href =" getGoxyLink(vulnbox)" >Goxy</a >
81
74
</div >
82
75
<ul >
83
- <li v-for =" (serviceName , j) of vulnbox.services" :key =" j" >
84
- {{ serviceName }}:
76
+ <li v-for =" (service , j) of vulnbox.services" :key =" j" >
77
+ {{ service.name }}:
85
78
<a
86
- :href = " getServiceLink(vulnbox, serviceName) "
87
- v-if = " serviceMap[serviceName].proto === 'http' "
88
- >{{ getServiceLink(vulnbox, serviceName ) }}</a
79
+ v-if = " service.proto === 'http' "
80
+ :href = " getServiceLink(vulnbox, service) "
81
+ >{{ getServiceLink(vulnbox, service ) }}</a
89
82
>
90
83
<span
91
84
v-else
92
85
class =" copiable"
93
- @click =" copyText(getServiceLink(vulnbox, serviceName ))"
94
- >{{ getServiceLink(vulnbox, serviceName ) }}</span
86
+ @click =" copyText(getServiceLink(vulnbox, service ))"
87
+ >{{ getServiceLink(vulnbox, service ) }}</span
95
88
>
96
89
</li >
97
90
</ul >
98
91
</div >
92
+ <div >
93
+ <el-row >
94
+ <el-input
95
+ v-model =" keyContent"
96
+ :rows =" 4"
97
+ placeholder =" Enter ssh public key"
98
+ style =" margin-bottom : 10px "
99
+ type =" textarea"
100
+ ></el-input >
101
+ </el-row >
102
+ <el-row justify =" center" type =" flex" >
103
+ <el-button :span =" 8" @click =" uploadKeyFile" >Upload key</el-button >
104
+ <el-button :span =" 8" @click =" downloadKeyFile"
105
+ >Download key file
106
+ </el-button >
107
+ </el-row >
108
+ </div >
99
109
</el-card >
100
110
</el-col >
101
111
</el-row >
102
112
</template >
103
113
104
114
<script >
115
+ import moment from " moment" ;
116
+
105
117
export default {
106
118
data : function () {
107
119
return {
108
120
config: null ,
109
121
username: " " ,
110
122
password: " " ,
111
123
vulnboxes: [],
112
- services: [],
113
124
game: {},
114
125
endTime: {},
115
- serviceMap: {},
116
126
keyContent: " "
117
127
};
118
128
},
@@ -131,18 +141,14 @@ export default {
131
141
this .vulnboxes = this .config .vulnboxes ;
132
142
133
143
this .game = this .config .game ;
134
- this .endTime = new Date (this .game .end );
144
+ this .endTime = moment (this .game .end );
135
145
console .log (this .endTime );
136
146
137
- this .services = this .config .services ;
138
- for (let service of this .services ) {
139
- this .serviceMap [service .name ] = service;
140
- }
141
147
this .$notify ({
142
148
title: " Config load" ,
143
149
message: " Success" ,
144
150
type: " success" ,
145
- duration: 1500
151
+ duration: 1000
146
152
});
147
153
} catch (e) {
148
154
this .config = {};
@@ -155,7 +161,8 @@ export default {
155
161
}
156
162
},
157
163
downloadFile : async function (path , name ) {
158
- this .$http .get (path).then (response => {
164
+ try {
165
+ const response = await this .$http .get (path);
159
166
let fileURL = window .URL .createObjectURL (new Blob ([response .data ]));
160
167
let fileLink = document .createElement (" a" );
161
168
@@ -164,14 +171,24 @@ export default {
164
171
document .body .appendChild (fileLink);
165
172
166
173
fileLink .click ();
167
- });
174
+ } catch (e) {
175
+ this .$notify ({
176
+ title: " Download file" ,
177
+ message: ` Error downloading ${ name} : ${ e} ` ,
178
+ type: " error" ,
179
+ duration: 3000
180
+ });
181
+ }
168
182
},
169
183
downloadKeyFile : async function () {
170
184
await this .downloadFile (" /key_file" , " ssh_key" );
171
185
},
172
186
downloadStartSploit : async function () {
173
187
await this .downloadFile (" /start_sploit.py" , " start_sploit.py" );
174
188
},
189
+ downloadNeoRunner : async function () {
190
+ await this .downloadFile (" /run_neo.sh" , " run_neo.sh" );
191
+ },
175
192
uploadKeyFile : async function () {
176
193
try {
177
194
await this .$http .post (" /add_ssh_key/" , { key: this .keyContent });
@@ -192,10 +209,10 @@ export default {
192
209
return ` http://${ this .username } :${ this .password } @${ vulnbox .host } :${ vulnbox .goxy_port } ` ;
193
210
},
194
211
getServiceLink : function (vulnbox , service ) {
195
- if (this . serviceMap [ service] .proto === " http" ) {
196
- return ` http://${ vulnbox .host } :${ this . serviceMap [ service] .port } ` ;
212
+ if (service .proto === " http" ) {
213
+ return ` http://${ vulnbox .host } :${ service .port } ` ;
197
214
} else {
198
- return ` ${ vulnbox .host } ${ this . serviceMap [ service] .port } ` ;
215
+ return ` ${ vulnbox .host } ${ service .port } ` ;
199
216
}
200
217
},
201
218
copyText : function (text ) {
@@ -280,12 +297,4 @@ export default {
280
297
cursor : pointer ;
281
298
color : blue ;
282
299
}
283
-
284
- .row2 {
285
- display : flex ;
286
- }
287
-
288
- .column2 {
289
- flex : 50% ;
290
- }
291
300
</style >
0 commit comments