chg: Change cookie name, update legend, remove old pickled trees

Fix #18
pull/27/head
Raphaël Vinot 2018-03-22 17:22:19 +01:00
parent a7763a0986
commit 247a4a26b0
2 changed files with 32 additions and 4 deletions

View File

@ -30,6 +30,7 @@ if app.secret_key == 'changeme':
Bootstrap(app)
app.config['BOOTSTRAP_SERVE_LOCAL'] = True
app.config['SESSION_COOKIE_NAME'] = 'lookyloo'
app.debug = True
HAR_DIR = 'scraped'
@ -46,8 +47,7 @@ def session_management():
def load_tree(report_dir):
if session.get('tree'):
# TODO delete file
pass
os.unlink(session.get('tree'))
session.clear()
har_files = sorted(glob(os.path.join(HAR_DIR, report_dir, '*.har')))
ct = CrawledTree(har_files)
@ -80,10 +80,13 @@ def scrape():
harfile = item['har']
png = base64.b64decode(item['png'])
child_frames = item['childFrames']
html = item['html']
with open(os.path.join(dirpath, '{0:0{width}}.har'.format(i, width=width)), 'w') as f:
json.dump(harfile, f)
with open(os.path.join(dirpath, '{0:0{width}}.png'.format(i, width=width)), 'wb') as f:
f.write(png)
with open(os.path.join(dirpath, '{0:0{width}}.html'.format(i, width=width)), 'w') as f:
f.write(html)
with open(os.path.join(dirpath, '{0:0{width}}.frames.json'.format(i, width=width)), 'w') as f:
json.dump(child_frames, f)
return tree(0)

View File

@ -27,8 +27,33 @@
<img src="{{ url_for('static', filename='redirect.png') }}"
alt="Redirect" height="20" width="20"> Redirect</br>
<img src="{{ url_for('static', filename='cookie_in_url.png') }}"
alt="Cookie in URL" height="20" width="20"> Cookie in URL</br>
<img src="{{ url_for('static', filename='font.png') }}"
alt="Font" height="20" width="20"> Font</br>
<img src="{{ url_for('static', filename='html.png') }}"
alt="HTML" height="20" width="20"> HTML</br>
<img src="{{ url_for('static', filename='json.png') }}"
alt="JSON" height="20" width="20"> JSON</br>
<img src="{{ url_for('static', filename='css.png') }}"
alt="CSS" height="20" width="20"> CSS</br>
<img src="{{ url_for('static', filename='exe.png') }}"
alt="EXE" height="20" width="20"> EXE</br>
<img src="{{ url_for('static', filename='img.png') }}"
alt="Image" height="20" width="20"> Image</br>
<img src="{{ url_for('static', filename='video.png') }}"
alt="Video" height="20" width="20"> Video</br>
<img src="{{ url_for('static', filename='ifr.png') }}"
alt="iFrame" height="20" width="20"> iFrame</br>
<img src="{{ url_for('static', filename='wtf.png') }}"
alt="Content type not set/unknown" height="20" width="20"> Content type not set/unknown</br>
</div>
<div id=tree-details><center><b>Tree details</b></center></br>
<b>Root URL</b>: {{ root_url }}</br>