Suninatas Game 31

challenges

Game 31

1
2
3
* Info : This PDF file don't attack your PC. Just using for study.
Analyze this PDF and Find a Flag.
Auth Key = lowercase(MD5(Flag))
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
❯ pdfid Hello_SuNiNaTaS.pdf
PDFiD 0.2.10 Hello_SuNiNaTaS.pdf
PDF Header: %PDF-1.4
obj 40
endobj 40
stream 11
endstream 11
xref 2
trailer 2
startxref 2
/Page 1
/Encrypt 0
/ObjStm 0
/JS 1 <-
/JavaScript 2 <-
/AA 0
/OpenAction 0
/AcroForm 0
/JBIG2Decode 0
/RichMedia 0
/Launch 0
/EmbeddedFile 0 <-
/XFA 0
/Colors > 2^24 0

❯ pdf-parser -h
Options:
-s SEARCH, --search=SEARCH
string to search in indirect objects (except streams)
-f, --filter pass stream object through filters (FlateDecode,
ASCIIHexDecode, ASCII85Decode, LZWDecode and
RunLengthDecode only)
-o OBJECT, --object=OBJECT
id(s) of indirect object(s) to select, use comma (,)
to separate ids (version independent)
-w, --raw raw output for data and filters
...


❯ pdf-parser -s JavaScript Hello_SuNiNaTaS.pdf
This program has not been tested with this version of Python (3.14.2)
Should you encounter problems, please use Python version 3.12.2
obj 30 0
Type:
Referencing: 31 0 R, 38 0 R

<<
/JavaScript 31 0 R <-
/EmbeddedFiles 38 0 R <- not scan in pdfid, but exist in pdf-parser, this is a nest object
>>

obj 36 0
Type:
Referencing:

❯ pdf-parser -o 38 Hello_SuNiNaTaS.pdf
This program has not been tested with this version of Python (3.14.2)
Should you encounter problems, please use Python version 3.12.2
obj 38 0
Type:
Referencing: 40 0 R

<<
/Names
<<
/UF (object 2)
/F (object 2)
/Type /Filespec
/EF 40 0 R
>>
]
>>

❯ pdf-parser -o 39 -f -d nested.pdf Hello_SuNiNaTaS.pdf
This program has not been tested with this version of Python (3.14.2)
Should you encounter problems, please use Python version 3.12.2
obj 39 0
Type:
Referencing:
Contains stream <-

<<
/Subtype /a
/Filter /FlateDecode
/Length 565
/DL 823
/Params
<<
/Size 823
/ModDate (D:20160525212830Z)
/CreationDate (D:20160525213559Z)
>>
>>

❯ file nested.pdf
nested.pdf: PDF document, version 1.7, 1 page(s)

❯ pdfid nested.pdf
PDFiD 0.2.10 nested.pdf
PDF Header: %PDF-1.7
obj 5
endobj 5
stream 1
endstream 1
xref 1
trailer 1
startxref 1
/Page 1
/Encrypt 1 <-!!
/ObjStm 0
/JS 1 <-
/JavaScript 1 <-
/AA 0
/OpenAction 1 <-
/AcroForm 0
/JBIG2Decode 0
/RichMedia 0
/Launch 0
/EmbeddedFile 0
/XFA 0
/Colors > 2^24 0

~/Downloads took 3s
❯ qpdf --decrypt nested.pdf decrypted.pdf
❯ pdfid decrypted.pdf
PDFiD 0.2.10 decrypted.pdf
PDF Header: %PDF-1.7
obj 5
endobj 5
stream 1
endstream 1
xref 1
trailer 1
startxref 1
/Page 1
/Encrypt 0
/ObjStm 0
/JS 1
/JavaScript 1
/AA 0
/OpenAction 1
/AcroForm 0
/JBIG2Decode 0
/RichMedia 0
/Launch 0
/EmbeddedFile 0
/XFA 0
/Colors > 2^24 0

❯ pdf-parser -s js decrypted.pdf
This program has not been tested with this version of Python (3.14.2)
Should you encounter problems, please use Python version 3.12.2
obj 2 0
Type: /Action
Referencing: 4 0 R

<<
/JS 4 0 R <- Object 4 is a stream object
/S /JavaScript
/Type /Action
>>

❯ pdf-parser -o 4 decrypted.pdf
This program has not been tested with this version of Python (3.14.2)
Should you encounter problems, please use Python version 3.12.2
obj 4 0
Type:
Referencing:
Contains stream

<<
/Filter /FlateDecode
/Length 45
>>

❯ pdf-parser -o 4 -f -d dump decrypted.pdf

cat dump
"HERE IS FLAGS *********************"# omg flag is here, don't forget to md5 it
SunINatAsGOodWeLL!@#$

other way to waste time

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
30
31
32
33
34
35
~/Downloads
❯ pdf-parser -o 35 -f -w Hello_SuNiNaTaS.pdf
This program has not been tested with this version of Python (3.14.2)
Should you encounter problems, please use Python version 3.12.2
obj 35 0
Type:
Referencing: 36 0 R, 37 0 R
<</S 36 0 R/JS 37 0 R>>

<<
/S 36 0 R
/JS 37 0 R
>>

<</S 36 0 R/JS 37 0 R>>


~/Downloads
❯ pdf-parser -o 37 -f -w Hello_SuNiNaTaS.pdf
This program has not been tested with this version of Python (3.14.2)
Should you encounter problems, please use Python version 3.12.2
obj 37 0
Type:
Referencing: 1 4 R
Contains stream

<<
/Length 5220
>>

No filters


~/Downloads
❯ pdf-parser -o 37 -d payload.js Hello_SuNiNaTaS.pdf
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
30
31
32
33
var Base64 = {
_keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
decode: function (input) {
for (var ah = 0; ah < input.length; ah++) {
input = input.replace("'+'", "");
}
var rlLwarzv = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (i < input.length) {
enc1 = this._keyStr.indexOf(input.charAt(i++));
enc2 = this._keyStr.indexOf(input.charAt(i++));
enc3 = this._keyStr.indexOf(input.charAt(i++));
enc4 = this._keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2)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gpiRlpwVW14d1VWZFdaRFJUTWsxNFZHNU9XQXBpUm5CWVdsZDRZ
V1ZXV25KVmEyUmFWakZLV0ZWdE5VOWhRWEJUWWxaS1ZWWkdVa05UCk1WWlhWMWhvV0dKR2NITlZi
WGh6VGxaYVNHUkhSbWhWV0VKVVdXMTBTMWRXV25SalJYUnBDazFWY0ZoWGExcHJWMnN3ZVdGR2FG
VlcKYkhBeldsZDRZVk5GTlZkYVJuQldWMFZLVlZkWE1UQlRNVlpIVjJ0a1dtVnJXbkJEYXpGV1kw
Wm9XR0V5YUV4V01HUkxWMVpXYzFacwpjR2tLVW01Q2IxZHNaRFJaVjFKSVZtdG9VRlp1UWxkV01G
WkxWbFprV0dSR1pHdE5WbHBJVjJ0YWIyRXhTWGRYYmtaRVlsVndXRll5CmRHOVhSMFY1WVVaU1Yx
SXphSEpWYlhNeFZqRldjd3BqUjJ0TFZXMTRkMkl4V2xkVmEyUlhUVlZzTkZadGVITlpWa3B5VjJ4
a1YySnUKUW5WVWJFVTVVRkU5UFE9PQ==

# 10 times of base64 decode

I am sorry, This is not Key~!!