Give Me Flag - 150

As the name of the file implies, this program will give you the flag.

givemeflag

Solves: 80





파일을 열어보면 CA FE BA BE 00 00 00 이런식으로 hex값이 띄어쓰기가 되있는것을 알 수 있고,
f = open('givemeflag','r').read()

>>> open('/Users/jinwoo/Downloads/give2','w').write(open('/Users/jinwoo/Downloads/givemeflag','r').read().replace(" ","").decode('hex'))

를 해주고 확인해보면

➜  Downloads  file give2

give2: compiled Java class data, version 51.0

java class라는것을 알 수 있다.


jad로 class를 디컴파일해준뒤 소스를 수정하면

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
import java.io.PrintStream;
import java.lang.reflect.Array;
 
public class givemeflag
{
 
    public givemeflag()
    {
    }
 
    public static void main(String[] args){
        String flag="";
            int ai1[] = {
                4329434743014339435143014344433943244339
                43014351433943214326434343204335
            };
            int ai[]  = {
                4329434743014339435143014344433943244339
                43014351433943214326434343204335
            };
            for(int i = 0; i < Array.getLength(ai1); i++)
            {
                    flag+=(char)(ai[i] ^ 0x1092);
            }
            System.out.println(flag);
    }
}
 
 
cs

 ➜  Downloads  java givemeflag

{i_am_java_master}


FLAG : {i_am_java_master}

+ Recent posts