Skip to content

Commit

Permalink
screenshots quickfix for aquatone session file
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdade committed Apr 17, 2020
1 parent 1188315 commit 3c39126
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions natlas-agent/natlas/screenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def base64_image(path):
def get_web_screenshots(target, scan_id, xml_data, proctimeout):
data_dir = utils.get_data_dir(scan_id)
outFiles = f"{data_dir}/aquatone.{scan_id}"

output = []
logger.info(f"Attempting to take screenshots for {target}")

p1 = subprocess.Popen(["echo", xml_data], stdout=subprocess.PIPE) # nosec
Expand All @@ -44,10 +44,12 @@ def get_web_screenshots(target, scan_id, xml_data, proctimeout):
logger.warning(f"TIMEOUT: Killing aquatone against {target}")
process.kill()

with open(os.path.join(outFiles, 'aquatone_session.json')) as f:
session = json.load(f)
session_path = os.path.join(outFiles, 'aquatone_session.json')
if not os.path.isfile(session_path):
return output

output = []
with open(session_path) as f:
session = json.load(f)

if session['stats']['screenshotSuccessful'] > 0:
logger.info(f"{target} - Success: {session['stats']['screenshotSuccessful']}, Fail: {session['stats']['screenshotFailed']}")
Expand Down

0 comments on commit 3c39126

Please sign in to comment.