Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fact_pdf_report
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fact-depend
fact_pdf_report
Commits
224944db
Commit
224944db
authored
Jun 08, 2020
by
lwilms
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored
parent
91933577
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
25 deletions
+11
-25
docker_entry.py
docker_entry.py
+11
-25
No files found.
docker_entry.py
View file @
224944db
...
...
@@ -35,38 +35,25 @@ def move_pdf_report(pdf_path):
def
count_mitigations
(
summary
):
for
mitigation
in
[
'Canary'
,
'NX'
,
'RELRO'
,
'PIE'
]:
count
=
count_this_mitigation
(
summary
,
mitigation
)
if
count
!=
0
:
return
count
return
count
def
count_this_mitigation
(
summary
,
mitigation
):
count
=
0
testing
=
True
for
selected_summary
in
summary
:
if
'Canary'
in
selected_summary
:
count
+=
len
(
summary
[
selected_summary
])
for
selected_summary
in
summary
:
if
'NX'
in
selected_summary
:
if
testing
:
if
count
!=
0
:
return
count
testing
=
False
count
+=
len
(
summary
[
selected_summary
])
testing
=
True
for
selected_summary
in
summary
:
if
'RELRO'
in
selected_summary
:
count
+=
len
(
summary
[
selected_summary
])
if
testing
:
if
count
!=
0
:
return
count
testing
=
False
for
selected_summary
in
summary
:
if
'PIE'
in
selected_summary
:
if
mitigation
in
selected_summary
:
count
+=
len
(
summary
[
selected_summary
])
return
count
def
main
(
template_style
):
analysis
,
meta_data
=
get_data
()
try
:
if
'exploit_mitigations'
in
analysis
:
analysis
[
'exploit_mitigations'
][
'count'
]
=
count_mitigations
(
analysis
[
'exploit_mitigations'
][
'summary'
])
except
KeyError
:
pass
with
TemporaryDirectory
()
as
tmp_dir
:
create_templates
(
analysis
,
meta_data
,
tmp_dir
,
template_style
)
...
...
@@ -80,9 +67,8 @@ if __name__ == '__main__':
exit
(
main
(
'new_template'
))
# TODO
# ips_and_uris NOT TESTED
# file_hashes
# elf_analysis
# cpu_architecture
# users_and_passwords
# software_components
# unpacker
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment