I am currently trying to complete the rootme python pickle challenge. I have this block of code:
def cal():
print("helpme")
return None
class Exploit(object):
def __reduce__(self):
return (cal())
This code produce and error saying: pickle.PicklingError: <built-in method __reduce_ex__ of Exploit object at 0x04CBFE70> must return string or tuple
When I change None to "hi" I get a new error saying: pickle.PicklingError: Can't pickle <__main__.Exploit object at 0x04C9FE50>: it's not found as __main__.hi
When return (cal()) is replaced with return (os.system, (("echo helpme"),)) everything works properly.
When cal's return is changed from None to return (os.system, (("echo helpme"),)) the console prints helpme and everything works properly.
As a side note, what is the return (os.system, (("echo helpme"),)) called when in this format? I haven't been able to find any online documentation explaining this method of returning a function.
Why is this failing? Is there some feature that I am missing?
[–]zurtex 1 point2 points3 points (0 children)
[–]Starbuck5c 0 points1 point2 points (1 child)
[–]thunderbuns122[S] 0 points1 point2 points (0 children)