master
1// Instructional script for cracking EZ_21 locks.
2// Syntax: script {t: #s.some_user.their_loc }
3// By mushin0
4
5function (context, args){
6 var target = args.t; // target = #s.some_user.their_loc
7 var response = target.call({}); // response = #s.some_user.their_loc.call({})
8 var substring1 = "EZ_21"; // check var for lock type
9 var substring2 = "UNLOCKED"; // check var for unlocked
10 var i = 0; // counter for array
11
12 // response.indexOf(substring) searches for substring within response and reports back
13 // an int higher than -1 if it is found, otherwise it is -1
14
15 if ( response.indexOf(substring1) > -1 ){ // check for lock type
16 while ( response.indexOf(substring2) === -1 ) { // check for unlocked
17 var passwords = ["unlock","open","release"]; // init array with passwords
18 var response = target.call ({EZ_21: passwords[i] });// Try passwords
19 i++; // increment i for array
20 }}
21
22 return response;
23
24}