Saving most of these for another post 😜…
See you there.
Troll - 464 - Hard
How well do you know your destiny 2 lore? Luke smith will test you.
https://storage.ebucket.dev/out.jar
We start out with a jar
, so let’s decompile it first and see what’s actually going on.
I’m using http://www.javadecompilers.com/ to decompile the jar
as I’m too lazy to download jadx
and the site at least gives multiple options to cross compare.
But the output of the decompilation is still obfuscated 😒.
Here’s the jadx
output changed as little as possible to fix all compilation errors:
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Random;
import java.util.Scanner;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class Main {
private static String [] f0I = null ;
private static int [] f1l = null ;
public static ArrayList < String > questions;
static {
lII ();
m3ll ();
String [] strArr = new String [f1l[ 7 ]];
strArr[f1l[ 0 ]] = f0I[f1l[ 8 ]];
strArr[f1l[ 1 ]] = f0I[f1l[ 9 ]];
strArr[f1l[ 2 ]] = f0I[f1l[ 10 ]];
strArr[f1l[ 3 ]] = f0I[f1l[ 11 ]];
strArr[f1l[ 4 ]] = f0I[f1l[ 12 ]];
strArr[f1l[ 5 ]] = f0I[f1l[ 13 ]];
strArr[f1l[ 6 ]] = f0I[f1l[ 14 ]];
strArr[f1l[ 8 ]] = f0I[f1l[ 15 ]];
strArr[f1l[ 9 ]] = f0I[f1l[ 16 ]];
strArr[f1l[ 10 ]] = f0I[f1l[ 17 ]];
strArr[f1l[ 11 ]] = f0I[f1l[ 18 ]];
strArr[f1l[ 12 ]] = f0I[f1l[ 19 ]];
strArr[f1l[ 13 ]] = f0I[f1l[ 20 ]];
strArr[f1l[ 14 ]] = f0I[f1l[ 21 ]];
strArr[f1l[ 15 ]] = f0I[f1l[ 22 ]];
strArr[f1l[ 16 ]] = f0I[f1l[ 23 ]];
strArr[f1l[ 17 ]] = f0I[f1l[ 24 ]];
strArr[f1l[ 18 ]] = f0I[f1l[ 25 ]];
strArr[f1l[ 19 ]] = f0I[f1l[ 26 ]];
strArr[f1l[ 20 ]] = f0I[f1l[ 27 ]];
strArr[f1l[ 21 ]] = f0I[f1l[ 7 ]];
strArr[f1l[ 22 ]] = f0I[f1l[ 28 ]];
strArr[f1l[ 23 ]] = f0I[f1l[ 29 ]];
strArr[f1l[ 24 ]] = f0I[f1l[ 30 ]];
strArr[f1l[ 25 ]] = f0I[f1l[ 31 ]];
strArr[f1l[ 26 ]] = f0I[f1l[ 32 ]];
strArr[f1l[ 27 ]] = f0I[f1l[ 33 ]];
questions = new ArrayList<>(Arrays. asList (strArr));
}
public static String FLAG = System. getenv (f0I[f1l[ 5 ]]);
public static String answer = f0I[f1l[ 6 ]];
private static String m0I (String llllllllllIlIlI , String llllllllllIlIIl ) {
try {
SecretKeySpec llllllllllIllIl = new SecretKeySpec (Arrays. copyOf (MessageDigest. getInstance ( "MD5" ). digest (llllllllllIlIIl. getBytes (StandardCharsets.UTF_8)), f1l[ 9 ]), "DES" );
Cipher instance = Cipher. getInstance ( "DES" );
instance. init (f1l[ 2 ], llllllllllIllIl);
return new String (instance. doFinal (Base64. getDecoder (). decode (llllllllllIlIlI. getBytes (StandardCharsets.UTF_8))), StandardCharsets.UTF_8);
} catch (Exception llllllllllIlIll ) {
llllllllllIlIll. printStackTrace ();
return null ;
}
}
/* renamed from: l */
private static String m1l (String lllllllllIIlIII , String lllllllllIIllII ) {
String str = new String (Base64. getDecoder (). decode (lllllllllIIlIII. getBytes (StandardCharsets.UTF_8)), StandardCharsets.UTF_8);
StringBuilder lllllllllIIlIll = new StringBuilder ();
char [] lllllllllIIlIlI = lllllllllIIllII. toCharArray ();
int lllllllllIIlIIl = f1l[ 0 ];
char [] charArray = str. toCharArray ();
int length = charArray.length;
int i = f1l[ 0 ];
while ( lIII (i, length)) {
lllllllllIIlIll. append (( char ) (lllllllllIIlIlI[lllllllllIIlIIl % lllllllllIIlIlI.length] ^ charArray[i]));
"" . length ();
lllllllllIIlIIl ++ ;
i ++ ;
"" . length ();
}
return String. valueOf (lllllllllIIlIll);
}
/* renamed from: lI */
private static String m2lI (String lllllllllIlllIl , String lllllllllIllIlI ) {
try {
SecretKeySpec llllllllllIIIII = new SecretKeySpec (MessageDigest. getInstance ( "MD5" ). digest (lllllllllIllIlI. getBytes (StandardCharsets.UTF_8)), "Blowfish" );
Cipher lllllllllIlllll = Cipher. getInstance ( "Blowfish" );
lllllllllIlllll. init (f1l[ 2 ], llllllllllIIIII);
return new String (lllllllllIlllll. doFinal (Base64. getDecoder (). decode (lllllllllIlllIl. getBytes (StandardCharsets.UTF_8))), StandardCharsets.UTF_8);
} catch (Exception e ) {
e. printStackTrace ();
return null ;
}
}
private static void lII () {
f1l = new int [ 35 ];
f1l[ 0 ] = (( - " " . length ()) ^ 49 ) & 49 ;
f1l[ 1 ] = " " . length ();
f1l[ 2 ] = " " . length ();
f1l[ 3 ] = " " . length ();
f1l[ 4 ] = 4 ;
f1l[ 5 ] = 5 ;
f1l[ 6 ] = 6 ;
f1l[ 7 ] = 27 ;
f1l[ 8 ] = 7 ;
f1l[ 9 ] = 8 ;
f1l[ 10 ] = 9 ;
f1l[ 11 ] = 10 ;
f1l[ 12 ] = 11 ;
f1l[ 13 ] = 12 ;
f1l[ 14 ] = 13 ;
f1l[ 15 ] = 14 ;
f1l[ 16 ] = 15 ;
f1l[ 17 ] = 16 ;
f1l[ 18 ] = 17 ;
f1l[ 19 ] = 18 ;
f1l[ 20 ] = 19 ;
f1l[ 21 ] = 20 ;
f1l[ 22 ] = 21 ;
f1l[ 23 ] = 22 ;
f1l[ 24 ] = 23 ;
f1l[ 25 ] = 24 ;
f1l[ 26 ] = 25 ;
f1l[ 27 ] = 26 ;
f1l[ 28 ] = 28 ;
f1l[ 29 ] = 29 ;
f1l[ 30 ] = 30 ;
f1l[ 31 ] = 31 ;
f1l[ 32 ] = 32 ;
f1l[ 33 ] = 33 ;
f1l[ 34 ] = 34 ;
}
private static boolean lIII ( int i , int i2 ) {
return i < i2;
}
private static boolean lIl ( int i , int i2 ) {
return i != i2;
}
/* renamed from: ll */
private static void m3ll () {
f0I = new String [f1l[ 34 ]];
f0I[f1l[ 0 ]] = m0I ( "M/b6LLu69fV+83nC8P7cm3NFbwzMtVJqvcj4KgrkM1oP6WezWoyCF0V4emNjq8Lr" , "RGFHA" );
f0I[f1l[ 1 ]] = m1l ( "K2kHIgEOaRE4BkIwHz5NA2kDLh8LLANrAgRpAT4IET0ZJAMRZVAqAwZpET9NFiEVawgMLVAiC0IwHz5NAycDPAgQaQQjCA9pMQchQiofOR8HKgQnFE5pCSQYQiQZLAUWaRcuGUIvHCoKTA==" , "bIpKm" );
f0I[f1l[ 2 ]] = m2lI ( "dd6iCFEwZ2klnD1az2dXLSR/NK9T/iR3X0il3BwwlhUk9L5OG6hymVElvLh4wIS8Dn/DOqWtgef2jSmMWRtjMw==" , "djaDa" );
f0I[f1l[ 3 ]] = m0I ( "E5g1tM7xB/I=" , "LZHyW" );
f0I[f1l[ 4 ]] = m2lI ( "4AdI/0mTyFRnfr75NpLgag==" , "RpPkm" );
f0I[f1l[ 5 ]] = m2lI ( "L0t7r/fDEXI=" , "OGtWu" );
f0I[f1l[ 6 ]] = m1l ( "ZiNmXH1jIzNcKjJ2MQkqZHNj" , "PBRoI" );
f0I[f1l[ 8 ]] = m2lI ( "YYacupVSSuGFdB7+vShn5fbMz8Bu8XagjZZEXDsbAtODn/xfwfzIDA==" , "qUEDX" );
f0I[f1l[ 9 ]] = m1l ( "OSw0GkoHN3UaAgtkMxsGAmQ7DwcLZDoIShosME4MByo0AkoMKyYdSgcqdRoCC2Q5DxkaZCIHGQZ7" , "nDUnj" );
f0I[f1l[ 10 ]] = m0I ( "4uK7g3MKtHnoNDeRWLb6yPq0yoKwxIQgaQdWnXmUXey5u3eWZk7B6qGCzd55gtMC" , "vOgjG" );
f0I[f1l[ 11 ]] = m0I ( "eOVkXQG4iWlaMF9FrJ2BHY4La192LJOfl5k9i+LuNJ+Lv3/CzEXt7qVOQuoKXX9o" , "PUPyS" );
f0I[f1l[ 12 ]] = m0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] = m2lI ( "g4GLak/p+Mnozn2aqbtcrwOvncQ8dV9ioM7LVe2OuLsgIVdBdolr7WR7+Ab9J0qMfcKu6w4wLJhL7mo3xww1WnDDpqAlRfJPRpj/L7C2geJThwNKc4FnGE1chHctsZRD" , "eVXCB" );
f0I[f1l[ 31 ]] = m1l ( "AD4dCwN3OxsMSzA/Ag0YdzdUDgIvMxBIGzgkAAEEOXYbDks/MxUEHz92ARgEOXYXBwc7MxccAjkxVAkFdzkGCks4MFQYBCAzBlc=" , "WVthk" );
f0I[f1l[ 32 ]] = m1l ( "IwYQFDFUGRwWKRsAWQQtFRpZHjcXHBwWKhEdWQMxEU4dBTgDThgZPVQdDRguVB0JEjwQThYReRVODhI4BAEXSA==" , "tnywY" );
f0I[f1l[ 33 ]] = m1l ( "IwsVciEKChtyJwULFTxsCgwDPycKFgNyPx8NDj5sBw0UN3M=" , "kdbRL" );
}
private static boolean llI ( int i ) {
return i == 0 ;
}
private static boolean lll ( int i ) {
return i != 0 ;
}
public static void main ( String [] strArr ) {
System.out. println (f0I[f1l[ 0 ]]);
System.out. println (f0I[f1l[ 1 ]]);
System.out. println (f0I[f1l[ 2 ]]);
StringBuilder sb = new StringBuilder ();
Scanner scanner = new Scanner (System.in);
while ( lIl (sb. length (), answer. length ())) {
int nextInt = new Random (). nextInt (questions. size ());
String lllllllllllIIll = questions. get (nextInt);
System.out. println (lllllllllllIIll);
String nextLine = scanner. nextLine ();
if ( llI (nextLine. equals (f0I[f1l[ 3 ]]) ? 1 : 0 )) {
sb. append (lllllllllllIIll. charAt (nextInt - Integer. parseInt (nextLine)));
"" . length ();
}
"" . length ();
if ( 0 != 0 ) {
return ;
}
}
if ( lll (String. valueOf (sb). equals (answer) ? 1 : 0 )) {
System.out. println (FLAG);
"" . length ();
if ( " " . length () >= 4 ) {
}
return ;
}
System.out. println (f0I[f1l[ 4 ]]);
}
}
Let’s clean some of this up…
First we can start with the smallest functions and useless statements.
For example, a line with just "".length()
does absolutely nothing, so we can just remove it.
The same can be said for trivial functions like:
private static boolean llI ( int i) {
return i == 0 ;
}
private static boolean lll ( int i) {
return i != 0 ;
}
Here’s what the script looks like with those removed.
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Random;
import java.util.Scanner;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class Main {
private static String [] f0I = null ;
private static int [] f1l = null ;
public static ArrayList < String > questions;
static {
lII ();
m3ll ();
String [] strArr = new String [f1l[ 7 ]];
strArr[f1l[ 0 ]] = f0I[f1l[ 8 ]];
strArr[f1l[ 1 ]] = f0I[f1l[ 9 ]];
strArr[f1l[ 2 ]] = f0I[f1l[ 10 ]];
strArr[f1l[ 3 ]] = f0I[f1l[ 11 ]];
strArr[f1l[ 4 ]] = f0I[f1l[ 12 ]];
strArr[f1l[ 5 ]] = f0I[f1l[ 13 ]];
strArr[f1l[ 6 ]] = f0I[f1l[ 14 ]];
strArr[f1l[ 8 ]] = f0I[f1l[ 15 ]];
strArr[f1l[ 9 ]] = f0I[f1l[ 16 ]];
strArr[f1l[ 10 ]] = f0I[f1l[ 17 ]];
strArr[f1l[ 11 ]] = f0I[f1l[ 18 ]];
strArr[f1l[ 12 ]] = f0I[f1l[ 19 ]];
strArr[f1l[ 13 ]] = f0I[f1l[ 20 ]];
strArr[f1l[ 14 ]] = f0I[f1l[ 21 ]];
strArr[f1l[ 15 ]] = f0I[f1l[ 22 ]];
strArr[f1l[ 16 ]] = f0I[f1l[ 23 ]];
strArr[f1l[ 17 ]] = f0I[f1l[ 24 ]];
strArr[f1l[ 18 ]] = f0I[f1l[ 25 ]];
strArr[f1l[ 19 ]] = f0I[f1l[ 26 ]];
strArr[f1l[ 20 ]] = f0I[f1l[ 27 ]];
strArr[f1l[ 21 ]] = f0I[f1l[ 7 ]];
strArr[f1l[ 22 ]] = f0I[f1l[ 28 ]];
strArr[f1l[ 23 ]] = f0I[f1l[ 29 ]];
strArr[f1l[ 24 ]] = f0I[f1l[ 30 ]];
strArr[f1l[ 25 ]] = f0I[f1l[ 31 ]];
strArr[f1l[ 26 ]] = f0I[f1l[ 32 ]];
strArr[f1l[ 27 ]] = f0I[f1l[ 33 ]];
questions = new ArrayList<>(Arrays. asList (strArr));
}
public static String FLAG = System. getenv (f0I[f1l[ 5 ]]);
public static String answer = f0I[f1l[ 6 ]];
private static String m0I (String llllllllllIlIlI , String llllllllllIlIIl ) {
try {
SecretKeySpec llllllllllIllIl = new SecretKeySpec (Arrays. copyOf (
MessageDigest. getInstance ( "MD5" ). digest (llllllllllIlIIl. getBytes (StandardCharsets.UTF_8)), f1l[ 9 ]),
"DES" );
Cipher instance = Cipher. getInstance ( "DES" );
instance. init (f1l[ 2 ], llllllllllIllIl);
return new String (
instance. doFinal (Base64. getDecoder (). decode (llllllllllIlIlI. getBytes (StandardCharsets.UTF_8))),
StandardCharsets.UTF_8);
} catch (Exception llllllllllIlIll ) {
llllllllllIlIll. printStackTrace ();
return null ;
}
}
private static String m1l (String lllllllllIIlIII , String lllllllllIIllII ) {
String str = new String (Base64. getDecoder (). decode (lllllllllIIlIII. getBytes (StandardCharsets.UTF_8)),
StandardCharsets.UTF_8);
StringBuilder lllllllllIIlIll = new StringBuilder ();
char [] lllllllllIIlIlI = lllllllllIIllII. toCharArray ();
int lllllllllIIlIIl = f1l[ 0 ];
char [] charArray = str. toCharArray ();
int length = charArray.length;
int i = f1l[ 0 ];
while (i < length) {
lllllllllIIlIll. append (( char ) (lllllllllIIlIlI[lllllllllIIlIIl % lllllllllIIlIlI.length] ^ charArray[i]));
lllllllllIIlIIl ++ ;
i ++ ;
}
return String. valueOf (lllllllllIIlIll);
}
private static String m2lI (String lllllllllIlllIl , String lllllllllIllIlI ) {
try {
SecretKeySpec llllllllllIIIII = new SecretKeySpec (
MessageDigest. getInstance ( "MD5" ). digest (lllllllllIllIlI. getBytes (StandardCharsets.UTF_8)),
"Blowfish" );
Cipher lllllllllIlllll = Cipher. getInstance ( "Blowfish" );
lllllllllIlllll. init (f1l[ 2 ], llllllllllIIIII);
return new String (
lllllllllIlllll
. doFinal (Base64. getDecoder (). decode (lllllllllIlllIl. getBytes (StandardCharsets.UTF_8))),
StandardCharsets.UTF_8);
} catch (Exception e ) {
e. printStackTrace ();
return null ;
}
}
private static void lII () {
f1l = new int [ 35 ];
f1l[ 0 ] = 0 ;
f1l[ 1 ] = 1 ;
f1l[ 2 ] = 2 ;
f1l[ 3 ] = 3 ;
f1l[ 4 ] = 4 ;
f1l[ 5 ] = 5 ;
f1l[ 6 ] = 6 ;
f1l[ 7 ] = 27 ;
f1l[ 8 ] = 7 ;
f1l[ 9 ] = 8 ;
f1l[ 10 ] = 9 ;
f1l[ 11 ] = 10 ;
f1l[ 12 ] = 11 ;
f1l[ 13 ] = 12 ;
f1l[ 14 ] = 13 ;
f1l[ 15 ] = 14 ;
f1l[ 16 ] = 15 ;
f1l[ 17 ] = 16 ;
f1l[ 18 ] = 17 ;
f1l[ 19 ] = 18 ;
f1l[ 20 ] = 19 ;
f1l[ 21 ] = 20 ;
f1l[ 22 ] = 21 ;
f1l[ 23 ] = 22 ;
f1l[ 24 ] = 23 ;
f1l[ 25 ] = 24 ;
f1l[ 26 ] = 25 ;
f1l[ 27 ] = 26 ;
f1l[ 28 ] = 28 ;
f1l[ 29 ] = 29 ;
f1l[ 30 ] = 30 ;
f1l[ 31 ] = 31 ;
f1l[ 32 ] = 32 ;
f1l[ 33 ] = 33 ;
f1l[ 34 ] = 34 ;
}
private static void m3ll () {
f0I = new String [f1l[ 34 ]];
f0I[f1l[ 0 ]] = m0I ( "M/b6LLu69fV+83nC8P7cm3NFbwzMtVJqvcj4KgrkM1oP6WezWoyCF0V4emNjq8Lr" , "RGFHA" );
f0I[f1l[ 1 ]] = m1l (
"K2kHIgEOaRE4BkIwHz5NA2kDLh8LLANrAgRpAT4IET0ZJAMRZVAqAwZpET9NFiEVawgMLVAiC0IwHz5NAycDPAgQaQQjCA9pMQchQiofO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MxccAjkxVAkFdzkGCks4MFQYBCAzBlc=" ,
"WVthk" );
f0I[f1l[ 32 ]] = m1l ( "IwYQFDFUGRwWKRsAWQQtFRpZHjcXHBwWKhEdWQMxEU4dBTgDThgZPVQdDRguVB0JEjwQThYReRVODhI4BAEXSA==" ,
"tnywY" );
f0I[f1l[ 33 ]] = m1l ( "IwsVciEKChtyJwULFTxsCgwDPycKFgNyPx8NDj5sBw0UN3M=" , "kdbRL" );
}
public static void main ( String [] strArr ) {
System.out. println (f0I[f1l[ 0 ]]);
System.out. println (f0I[f1l[ 1 ]]);
System.out. println (f0I[f1l[ 2 ]]);
StringBuilder sb = new StringBuilder ();
Scanner scanner = new Scanner (System.in);
while (sb. length () != answer. length ()) {
int nextInt = new Random (). nextInt (questions. size ());
String lllllllllllIIll = questions. get (nextInt);
System.out. println (lllllllllllIIll);
String nextLine = scanner. nextLine ();
if ( ! nextLine. equals (f0I[f1l[ 3 ]])) {
sb. append (lllllllllllIIll. charAt (nextInt - Integer. parseInt (nextLine)));
}
}
scanner. close ();
if (String. valueOf (sb). equals (answer)) {
System.out. println (FLAG);
return ;
}
System.out. println (f0I[f1l[ 4 ]]);
}
}
Let’s take a look at some other simplifiable functions.
For example, this function is only called once in the static block and just fills up the f1l
array with numbers, so let’s rename both the function and array to something more fitting.
private static void lII () {
f1l = new int [ 35 ];
f1l[ 0 ] = 0 ;
f1l[ 1 ] = 1 ;
f1l[ 2 ] = 2 ;
f1l[ 3 ] = 3 ;
f1l[ 4 ] = 4 ;
f1l[ 5 ] = 5 ;
f1l[ 6 ] = 6 ;
f1l[ 7 ] = 27 ;
f1l[ 8 ] = 7 ;
f1l[ 9 ] = 8 ;
f1l[ 10 ] = 9 ;
f1l[ 11 ] = 10 ;
f1l[ 12 ] = 11 ;
f1l[ 13 ] = 12 ;
f1l[ 14 ] = 13 ;
f1l[ 15 ] = 14 ;
f1l[ 16 ] = 15 ;
f1l[ 17 ] = 16 ;
f1l[ 18 ] = 17 ;
f1l[ 19 ] = 18 ;
f1l[ 20 ] = 19 ;
f1l[ 21 ] = 20 ;
f1l[ 22 ] = 21 ;
f1l[ 23 ] = 22 ;
f1l[ 24 ] = 23 ;
f1l[ 25 ] = 24 ;
f1l[ 26 ] = 25 ;
f1l[ 27 ] = 26 ;
f1l[ 28 ] = 28 ;
f1l[ 29 ] = 29 ;
f1l[ 30 ] = 30 ;
f1l[ 31 ] = 31 ;
f1l[ 32 ] = 32 ;
f1l[ 33 ] = 33 ;
f1l[ 34 ] = 34 ;
}
// same as
private static void init_numbers () {
numbers = new int []{ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 27 , 7 , 8 , 9 , 10 , 11 ,
12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 ,
25 , 26 , 28 , 29 , 30 , 31 , 32 , 33 , 34 };
}
We also have the other array, f0I
, that gets filled through another large function. For now, we’ll ignore that function and the decryption function it uses, but printing out f0I
at the start of main
shows that it just contains all the strings used in the program, including all the questions.
...
public static void main ( String [] strArr) {
System.out. println (Arrays. toString (f0I));
...
[Beware! I am **LUKE SMITH**! Creator of FOMO!, I will ask you a series of questions, and at the end if you answer them ALL correctly, you might get flag., If you would like you can skip a question by saying SKIP., SKIP, WRONG! LEAVE!, FLAG, 6a4343aa3cb4cfc411, How many points to reset valor rank?, What is the full name of the final boss in the last wish?, Who was the hunter vanguard before cayde-6?, What is the name of the city on neptune?, What grenade suppresses targets?, What perk used to be exclusive to vault of glass weapons, but now can roll on root of nightmares weapons?, Which weapon foundry is known for its liquid ammo?, Which color was the dead orbit faction most closely associated with?, How many times has banshee, the gunsmith, been reset?, What is the full name version of the EDZ?, During a weak curse week, where is petra venj located?, Where did saint-14 search when looking for osiris?, What is the name of cayde-6's ghost?, Which perk grants bonus damage when surrounded by enemies?, Which exotic weapon resembles a lever-action rifle?, Which weapon foundry tried bribing shaxx?, Who does xur work for?, How many oracles spawn during the 3rd round of oracles during a phase against Atheon?, Which clan completed the scourge of the past raid first?, Which ritual playlist is the drifter associated with?, Which seasonal event featured arbalest as its exotic weapon?, The icon of the extended barrel perk is the same as which shotgun perk?, What was the name of the nordic faction of the black armory?, Which augment allows players to interact with panels by shooting them in the deep stone crypt?, Which mod gives a fixed portion of health upon collecting an orb of power?, Which weapon stat increases the draw and stow speed of a weapon?, How many known ahamkara still live?]
Here’s what the program, with cleaned up names, looks like now:
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Base64;
import java.util.Random;
import java.util.Scanner;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class Main {
private static String [] strings = null ;
private static int [] numbers = null ;
public static ArrayList < String > questions;
static {
init_numbers ();
init_strings ();
String [] strArr = new String [numbers[ 7 ]];
strArr[numbers[ 0 ]] = strings[numbers[ 8 ]];
strArr[numbers[ 1 ]] = strings[numbers[ 9 ]];
strArr[numbers[ 2 ]] = strings[numbers[ 10 ]];
strArr[numbers[ 3 ]] = strings[numbers[ 11 ]];
strArr[numbers[ 4 ]] = strings[numbers[ 12 ]];
strArr[numbers[ 5 ]] = strings[numbers[ 13 ]];
strArr[numbers[ 6 ]] = strings[numbers[ 14 ]];
strArr[numbers[ 8 ]] = strings[numbers[ 15 ]];
strArr[numbers[ 9 ]] = strings[numbers[ 16 ]];
strArr[numbers[ 10 ]] = strings[numbers[ 17 ]];
strArr[numbers[ 11 ]] = strings[numbers[ 18 ]];
strArr[numbers[ 12 ]] = strings[numbers[ 19 ]];
strArr[numbers[ 13 ]] = strings[numbers[ 20 ]];
strArr[numbers[ 14 ]] = strings[numbers[ 21 ]];
strArr[numbers[ 15 ]] = strings[numbers[ 22 ]];
strArr[numbers[ 16 ]] = strings[numbers[ 23 ]];
strArr[numbers[ 17 ]] = strings[numbers[ 24 ]];
strArr[numbers[ 18 ]] = strings[numbers[ 25 ]];
strArr[numbers[ 19 ]] = strings[numbers[ 26 ]];
strArr[numbers[ 20 ]] = strings[numbers[ 27 ]];
strArr[numbers[ 21 ]] = strings[numbers[ 7 ]];
strArr[numbers[ 22 ]] = strings[numbers[ 28 ]];
strArr[numbers[ 23 ]] = strings[numbers[ 29 ]];
strArr[numbers[ 24 ]] = strings[numbers[ 30 ]];
strArr[numbers[ 25 ]] = strings[numbers[ 31 ]];
strArr[numbers[ 26 ]] = strings[numbers[ 32 ]];
strArr[numbers[ 27 ]] = strings[numbers[ 33 ]];
questions = new ArrayList<>(Arrays. asList (strArr));
}
public static String FLAG = System. getenv (strings[numbers[ 5 ]]);
public static String answer = strings[numbers[ 6 ]];
private static String decrypt_des (String a , String b ) {
try {
SecretKeySpec spec = new SecretKeySpec (Arrays. copyOf (
MessageDigest. getInstance ( "MD5" ). digest (b. getBytes (StandardCharsets.UTF_8)),
numbers[ 9 ]),
"DES" );
Cipher des = Cipher. getInstance ( "DES" );
des. init (numbers[ 2 ], spec);
return new String (
des. doFinal (Base64. getDecoder (). decode (a. getBytes (StandardCharsets.UTF_8))),
StandardCharsets.UTF_8);
} catch (Exception e ) {
e. printStackTrace ();
return null ;
}
}
private static String decrypt_xor (String a , String b ) {
String str = new String (Base64. getDecoder (). decode (a. getBytes (StandardCharsets.UTF_8)),
StandardCharsets.UTF_8);
StringBuilder sb = new StringBuilder ();
char [] b_chars = b. toCharArray ();
int j = numbers[ 0 ];
char [] a_chars = str. toCharArray ();
int length = a_chars.length;
int i = numbers[ 0 ];
while (i < length) {
sb. append (( char ) (b_chars[j % b_chars.length] ^ a_chars[i]));
j ++ ;
i ++ ;
}
return String. valueOf (sb);
}
private static String decrypt_blowfish (String a , String b ) {
try {
SecretKeySpec spec = new SecretKeySpec (
MessageDigest. getInstance ( "MD5" ). digest (b. getBytes (StandardCharsets.UTF_8)),
"Blowfish" );
Cipher blowfish = Cipher. getInstance ( "Blowfish" );
blowfish. init (numbers[ 2 ], spec);
return new String (
blowfish
. doFinal (Base64. getDecoder ()
. decode (a. getBytes (StandardCharsets.UTF_8))),
StandardCharsets.UTF_8);
} catch (Exception e ) {
e. printStackTrace ();
return null ;
}
}
private static void init_numbers () {
numbers = new int [] { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 27 , 7 , 8 , 9 , 10 , 11 ,
12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 ,
25 , 26 , 28 , 29 , 30 , 31 , 32 , 33 , 34 };
}
private static void init_strings () {
strings = new String [numbers[ 34 ]];
strings[numbers[ 0 ]] = decrypt_des ( "M/b6LLu69fV+83nC8P7cm3NFbwzMtVJqvcj4KgrkM1oP6WezWoyCF0V4emNjq8Lr" ,
"RGFHA" );
strings[numbers[ 1 ]] = decrypt_xor (
"K2kHIgEOaRE4BkIwHz5NA2kDLh8LLANrAgRpAT4IET0ZJAMRZVAqAwZpET9NFiEVawgMLVAiC0IwHz5NAycDPAgQaQQjCA9pMQchQiofOR8HKgQnFE5pCSQYQiQZLAUWaRcuGUIvHCoKTA==" ,
"bIpKm" );
strings[numbers[ 2 ]] = decrypt_blowfish (
"dd6iCFEwZ2klnD1az2dXLSR/NK9T/iR3X0il3BwwlhUk9L5OG6hymVElvLh4wIS8Dn/DOqWtgef2jSmMWRtjMw==" ,
"djaDa" );
strings[numbers[ 3 ]] = decrypt_des ( "E5g1tM7xB/I=" , "LZHyW" );
strings[numbers[ 4 ]] = decrypt_blowfish ( "4AdI/0mTyFRnfr75NpLgag==" , "RpPkm" );
strings[numbers[ 5 ]] = decrypt_blowfish ( "L0t7r/fDEXI=" , "OGtWu" );
strings[numbers[ 6 ]] = decrypt_xor ( "ZiNmXH1jIzNcKjJ2MQkqZHNj" , "PBRoI" );
strings[numbers[ 8 ]] = decrypt_blowfish ( "YYacupVSSuGFdB7+vShn5fbMz8Bu8XagjZZEXDsbAtODn/xfwfzIDA==" , "qUEDX" );
strings[numbers[ 9 ]] = decrypt_xor (
"OSw0GkoHN3UaAgtkMxsGAmQ7DwcLZDoIShosME4MByo0AkoMKyYdSgcqdRoCC2Q5DxkaZCIHGQZ7" ,
"nDUnj" );
strings[numbers[ 10 ]] = decrypt_des ( "4uK7g3MKtHnoNDeRWLb6yPq0yoKwxIQgaQdWnXmUXey5u3eWZk7B6qGCzd55gtMC" ,
"vOgjG" );
strings[numbers[ 11 ]] = decrypt_des ( "eOVkXQG4iWlaMF9FrJ2BHY4La192LJOfl5k9i+LuNJ+Lv3/CzEXt7qVOQuoKXX9o" ,
"PUPyS" );
strings[numbers[ 12 ]] = decrypt_des ( "UHXIyKrSgcVHARWFDRZ78RFyxDhz8uNAvzJizKPOHx5fG5uBbBCB3A==" , "YWDUY" );
strings[numbers[ 13 ]] = decrypt_des (
"F+5EeR6FRrQiFFbVB1ANdxhJrUxRPVyhkqwgws0XAmXu/pvVbQaL9qffvgK+u0kOFQBzqlPPAvuUGdTDiY2PcBqc6xJ4eElc/HgnYNXn436EAs1MB8o5UIJo0SMBexqsFQBzqlPPAvvH9N1RmFJ8BQ==" ,
"RsvRt" );
strings[numbers[ 14 ]] = decrypt_des (
"DVw06+nt0YxuTCDJRfDhD5K1m5FvyrpFkmUfnNiGx6j2yE/y96DUB7MUFbjn3T4Xlt1F2OC5EIw=" ,
"sDwKZ" );
strings[numbers[ 15 ]] = decrypt_xor (
"DykMOhh4Igo1HyphEjgDeDUNPFA8JAQ9UDczBzAEeCcEOgQxLgt5HTcyEXkTNC4WPBwhYQQqAzciDDgEPSVFLhksKVo=" ,
"XAeYp" );
strings[numbers[ 16 ]] = decrypt_xor (
"Hgc1bxk3BjtvAD8FJzxUPgkxbxY3BjEnETNEYjscM0glOholBSs7HHpIICoROEgwKgczHH0=" , "VhBOt" );
strings[numbers[ 17 ]] = decrypt_xor ( "OT0VOW0HJlQ5JQt1EjghAnUaLCALdQIoPx08GyNtATNUOSULdTEJF1E=" , "nUtMM" );
strings[numbers[ 18 ]] = decrypt_blowfish (
"edwQLeONPQclNxWUb27/t8rFB+gWfNjEvUAa4Zfo0/R0j1U3KhImmzrjUCLuqWDg6EH0G4SW+dU=" ,
"tgLJs" );
strings[numbers[ 19 ]] = decrypt_xor (
"IAA0CwlXDDgdTAQJOBcYWlllWR8SCSMaBFcfORwCVwQ+FgceBjZZChgacRYfHho4ClM=" , "whQyl" );
strings[numbers[ 20 ]] = decrypt_xor ( "IQ0qDEEfFmsMCRNFJRkME0UkHkEVBDIcBFtTbAtBEQ0kCxVJ" , "veKxa" );
strings[numbers[ 21 ]] = decrypt_blowfish (
"FitSGCVFAwM86UBfr9D19x/2NibvF6DKrMd2QXID6TLRX4seI/DQ063o3jGtj6fBA0HqLOs6Z02Gux1pHKcgZg==" ,
"wbUkv" );
strings[numbers[ 22 ]] = decrypt_xor (
"LSM5CzFaLigHLRMocB88Gzs/BnkILiMNNBgnNRt5G2s8DS8fOX0JOg4iPwZ5CCI2BDxF" , "zKPhY" );
strings[numbers[ 23 ]] = decrypt_des ( "z13Xv5GHGP7WC2+WYv39T+3urhKILaG+Nx6NexC96OLHJV7ZcNuC3JIKvji4g3rx" ,
"gmqqx" );
strings[numbers[ 24 ]] = decrypt_blowfish ( "IfOB2u6Mun+oaAudIYaOUqNpZOYlQE9v" , "etzcE" );
strings[numbers[ 25 ]] = decrypt_blowfish (
"pAgOYtfo/KfX9j2ucqpSc6smDo/1GbnA4z8aO3hP2aD2IxwrunTx0y9XeOnASaikOvDrLPUYYXVB5sU1YOJzmkpVLQ7R94WdMHBb+vXbsv5Nk0eyvRlXsg==" ,
"MTvaD" );
strings[numbers[ 26 ]] = decrypt_blowfish (
"/TVvXx3IErUYFDzua4OA18G2gSg52QLow3CPr69+xJbMkXTyBS1keCG1VPzQJSXYgJHIE9+A1b9YnDTU6wYtMw==" ,
"QYLHR" );
strings[numbers[ 27 ]] = decrypt_des (
"MM2+sqt8W/kCJVZZ4arp35LrAX1IRPkQOYa4e6/jMAQ1tTJuL86X2I9UOjKwoiabznuHJbY3ogg=" ,
"UlQSk" );
strings[numbers[ 7 ]] = decrypt_blowfish (
"Cf6N5mya/5KkhookR5KQsegRGLg4gT5f/R80Zha54Hjs4O+7yMZ08O45ukn6T2pxEvxM4ry3s3TXn4bmlXUcHQ==" ,
"elVkr" );
strings[numbers[ 28 ]] = decrypt_xor (
"Jxg8RTkQHzdFPxVQLQ01UxUhETUdFDwBcBERKxc1H1ApACIYUDAWcAcYPEUjEh08RTEAUC4NORAYeRY4HAQ+ED5TADwXO0w=" ,
"spYeP" );
strings[numbers[ 29 ]] = decrypt_xor (
"Ly82JWwPJiRxOBAidz8tFSJ3PipYMz80bBYoJTUlG2cxMC8MLjg/bBchdyUkHWc1PS0bLHcwPhUoJShz" ,
"xGWQL" );
strings[numbers[ 30 ]] = decrypt_blowfish (
"g4GLak/p+Mnozn2aqbtcrwOvncQ8dV9ioM7LVe2OuLsgIVdBdolr7WR7+Ab9J0qMfcKu6w4wLJhL7mo3xww1WnDDpqAlRfJPRpj/L7C2geJThwNKc4FnGE1chHctsZRD" ,
"eVXCB" );
strings[numbers[ 31 ]] = decrypt_xor (
"AD4dCwN3OxsMSzA/Ag0YdzdUDgIvMxBIGzgkAAEEOXYbDks/MxUEHz92ARgEOXYXBwc7MxccAjkxVAkFdzkGCks4MFQYBCAzBlc=" ,
"WVthk" );
strings[numbers[ 32 ]] = decrypt_xor (
"IwYQFDFUGRwWKRsAWQQtFRpZHjcXHBwWKhEdWQMxEU4dBTgDThgZPVQdDRguVB0JEjwQThYReRVODhI4BAEXSA==" ,
"tnywY" );
strings[numbers[ 33 ]] = decrypt_xor ( "IwsVciEKChtyJwULFTxsCgwDPycKFgNyPx8NDj5sBw0UN3M=" , "kdbRL" );
}
public static void main ( String [] strArr ) {
System.out. println (strings[numbers[ 0 ]]);
System.out. println (strings[numbers[ 1 ]]);
System.out. println (strings[numbers[ 2 ]]);
StringBuilder sb = new StringBuilder ();
Scanner scanner = new Scanner (System.in);
while (sb. length () != answer. length ()) {
int questionIndex = new Random (). nextInt (questions. size ());
String nextQuestion = questions. get (questionIndex);
System.out. println (nextQuestion);
String nextLine = scanner. nextLine ();
if ( ! nextLine. equals (strings[numbers[ 3 ]])) {
sb. append (nextQuestion. charAt (questionIndex - Integer. parseInt (nextLine)));
}
}
scanner. close ();
if (String. valueOf (sb). equals (answer)) {
System.out. println (FLAG);
return ;
}
System.out. println (strings[numbers[ 4 ]]);
}
}
Now that we’re finally done cleaning it up, let’s finally look at the main function logic:
public static void main ( String [] strArr) {
System.out. println (strings[numbers[ 0 ]]);
System.out. println (strings[numbers[ 1 ]]);
System.out. println (strings[numbers[ 2 ]]);
StringBuilder sb = new StringBuilder ();
Scanner scanner = new Scanner (System.in);
while (sb. length () != answer. length ()) {
int questionIndex = new Random (). nextInt (questions. size ());
String nextQuestion = questions. get (questionIndex);
System.out. println (nextQuestion);
String nextLine = scanner. nextLine ();
if ( ! nextLine. equals (strings[numbers[ 3 ]])) {
sb. append (nextQuestion. charAt (questionIndex - Integer. parseInt (nextLine)));
}
}
scanner. close ();
if (String. valueOf (sb). equals (answer)) {
System.out. println (FLAG);
return ;
}
System.out. println (strings[numbers[ 4 ]]);
}
First, three strings are printed, which is just the introduction paragraph.
Beware! I am **LUKE SMITH**! Creator of FOMO!
I will ask you a series of questions, and at the end if you answer them ALL correctly, you might get flag.
If you would like you can skip a question by saying SKIP.
Next, we initialize a StringBuilder and a Scanner, and enter a loop.
Inside the loop, a random question is chosen, then if we don’t enter SKIP
, the character at the index questionIndex - int(input)
of the question string itself is appended to the StringBuilder.
Finally, after the StringBuilder has the same length as the answer, the loop ends, and a final check is made, and if the built string is the same as answer
, we get the flag.
Since we have access to the full decompiled file, we can easily just print out the value of answer
:
System.out. println (answer);
6a4343aa3cb4cfc411
Now all we have to do to construct this string is to keep skipping until we reach a question containing the next character, then calculate the proper integer to submit for that character.
I’m gonna skip extracting the questions, as its just the same thing, printing out and copy pasting.
Here’s what my final solve script ended up looking like:
from pwn import remote
# nc 213.133.103.186 7448
r = remote( "213.133.103.186" , 7448 )
questions = [ "How many points to reset valor rank?" ,
"What is the full name of the final boss in the last wish?" ,
"Who was the hunter vanguard before cayde-6?" ,
"What is the name of the city on neptune?" ,
"What grenade suppresses targets?" ,
"What perk used to be exclusive to vault of glass weapons, but now can roll on root of nightmares weapons?" ,
"Which weapon foundry is known for its liquid ammo?" ,
"Which color was the dead orbit faction most closely associated with?" ,
"How many times has banshee, the gunsmith, been reset?" ,
"What is the full name version of the EDZ?" ,
"During a weak curse week, where is petra venj located?" ,
"Where did saint-14 search when looking for osiris?" ,
"What is the name of cayde-6's ghost?" ,
"Which perk grants bonus damage when surrounded by enemies?" ,
"Which exotic weapon resembles a lever-action rifle?" ,
"Which weapon foundry tried bribing shaxx?" ,
"Who does xur work for?" ,
"How many oracles spawn during the 3rd round of oracles during a phase against Atheon?" ,
"Which clan completed the scourge of the past raid first?" ,
"Which ritual playlist is the drifter associated with?" ,
"Which seasonal event featured arbalest as its exotic weapon?" ,
"The icon of the extended barrel perk is the same as which shotgun perk?" ,
"What was the name of the nordic faction of the black armory?" ,
"Which augment allows players to interact with panels by shooting them in the deep stone crypt?" ,
"Which mod gives a fixed portion of health upon collecting an orb of power?" ,
"Which weapon stat increases the draw and stow speed of a weapon?" ,
"How many known ahamkara still live?" ]
key = "6a4343aa3cb4cfc411"
for c in key:
for q in questions:
if c in q:
print (c, q)
r.recvuntil( b 'SKIP. \n ' )
build = ""
while len (build) != len (key):
question = r.recvline().decode().strip()
q_index = questions.index(question)
wanted = key[ len (build)]
if wanted not in question:
r.sendline( b "SKIP" )
continue
print (question, q_index, wanted, build)
wanted_index = question.index(wanted)
r.sendline( str (q_index - wanted_index).encode())
build += wanted
r.interactive()
flag: bucket{D35T1NY_F0M0_0c0f34b03}
Back to TOC