Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(bug) fix screenshot csv parser #1299 #1300

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions web/reNgine/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,11 +1203,22 @@ def screenshot(self, ctx={}, description=None):

# Loop through results and save objects in DB
screenshot_paths = []
with open(output_path, 'r') as file:
reader = csv.reader(file)
required_cols = [
'Protocol',
'Port',
'Domain',
'Request Status',
'Screenshot Path'
]
with open(output_path, 'r', newline='') as file:
reader = csv.DictReader(file)
for row in reader:
# ('Protocol', 'Port', 'Domain', 'Resolved', 'Request Status', 'Title', 'Category', 'Default Creds', 'Screenshot Path', ' Source Path')
protocol, port, subdomain_name, ip, status, title, category, creds, screenshot_path, source_path = tuple(row)
parsed_row = {col: row[col] for col in required_cols if col in row}
protocol = parsed_row['Protocol']
port = parsed_row['Port']
subdomain_name = parsed_row['Domain']
status = parsed_row['Request Status']
screenshot_path = parsed_row['Screenshot Path']
logger.info(f'{protocol}:{port}:{subdomain_name}:{status}')
subdomain_query = Subdomain.objects.filter(name=subdomain_name)
if self.scan:
Expand Down
Loading