Skip to content

Commit 5f329d6

Browse files
committed
fix(python): good to know misstakes
1 parent 79ec86b commit 5f329d6

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

demos/python-cheat-sheet/good-to-know/content.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,19 @@ help() # less pager -> :e/flag.txt
99
assert len(set( [ *open("/flag.txt"), open("/flag.txt").read(), set(open("/flag.txt")).pop() ] )) == 1
1010

1111
# to stderr
12-
int(*open("/flag.txt"))
13-
float(*open("/flag.txt"))
14-
complex(*open("/flag.txt"))
1512
exit(set(open("/flag.txt")))
16-
exit(*open("/flag.txt"))
17-
open(*open("/flag.txt"))
13+
exit([*open("/flag.txt")])
1814
compile(".","/flag.txt","exec")
1915
raise Exception(*open("/flag.txt"))
2016

2117
# to stdout
22-
help(*open("/flag.txt"))
18+
help([*open("/etc/passwd")][0]) # 1, 2, 3
2319
print(*open("/flag.txt"))
2420
type("", (), {"__init__": lambda s: print(open("flag.txt").read())})()
2521
memoryview(open("flag.txt", "rb").read()).tobytes()
2622

2723
# to stdin
28-
input(*open("/flag.txt"))
24+
input([*open("/etc/passwd")])
2925

3026
# https://book.hacktricks.xyz/generic-methodologies-and-resources/python/bypass-python-sandboxes#read-file-with-builtins-help-and-license
3127
license._Printer__filenames = ['/flag.txt']; license()

0 commit comments

Comments
 (0)