This commit is contained in:
Maxime Vorwerk
2024-06-09 14:48:10 +02:00
parent 3fd4d0d326
commit 584e1cef2d
59 changed files with 786 additions and 0 deletions

45
vault-door-4/VaultDoor4.java Executable file
View File

@@ -0,0 +1,45 @@
import java.util.*;
class VaultDoor4 {
public static void main(String args[]) {
VaultDoor4 vaultDoor = new VaultDoor4();
Scanner scanner = new Scanner(System.in);
System.out.print("Enter vault password: ");
String userInput = scanner.next();
String input = userInput.substring("picoCTF{".length(),userInput.length()-1);
if (vaultDoor.checkPassword(input)) {
System.out.println("Access granted.");
} else {
System.out.println("Access denied!");
}
}
// I made myself dizzy converting all of these numbers into different bases,
// so I just *know* that this vault will be impenetrable. This will make Dr.
// Evil like me better than all of the other minions--especially Minion
// #5620--I just know it!
//
// .:::. .:::.
// :::::::.:::::::
// :::::::::::::::
// ':::::::::::::'
// ':::::::::'
// ':::::'
// ':'
// -Minion #7781
public boolean checkPassword(String password) {
byte[] passBytes = password.getBytes();
byte[] myBytes = {
106 , 85 , 53 , 116 , 95 , 52 , 95 , 98 ,
0x55, 0x6e, 0x43, 0x68, 0x5f, 0x30, 0x66, 0x5f,
0142, 0131, 0164, 063 , 0163, 0137, 0143, 061 ,
'9' , '4' , 'f' , '7' , '4' , '5' , '8' , 'e' ,
};
for (int i=0; i<32; i++) {
if (passBytes[i] != myBytes[i]) {
return false;
}
}
return true;
}
}

14
vault-door-4/sol.py Executable file
View File

@@ -0,0 +1,14 @@
#!/home/maxime/.pyvenv/bin/python3
row_1 = [106 , 85 , 53 , 116 , 95 , 52 , 95 , 98]
row_2 = [0x55, 0x6e, 0x43, 0x68, 0x5f, 0x30, 0x66, 0x5f]
row_3 = [0o142, 0o131, 0o164, 0o63 , 0o163, 0o137, 0o143, 0o61]
row_4 = ['9' , '4' , 'f' , '7' , '4' , '5' , '8' , 'e']
print(''.join(
list(map(lambda a: chr(a), row_1)) +
list(map(lambda a: chr(a), row_2)) +
list(map(lambda a: chr(a), row_3)) +
row_4
))