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
79783e9c
Commit
79783e9c
authored
Jul 13, 2019
by
dorp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added better template for exploit mitigations
parent
040dcaec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
6 deletions
+40
-6
rest.py
pdf_generator/pre_processing/rest.py
+1
-1
exploit_mitigations.tex
pdf_generator/templates/default/exploit_mitigations.tex
+32
-5
template_engine.py
pdf_generator/tex_generation/template_engine.py
+7
-0
No files found.
pdf_generator/pre_processing/rest.py
View file @
79783e9c
...
...
@@ -6,7 +6,7 @@ DEFAULT_URL = 'http://localhost:5000'
def
create_request_url
(
firmware_uid
,
server_url
):
return
'{}/rest/firmware/{}'
.
format
(
server_url
if
server_url
else
DEFAULT_URL
,
firmware_uid
)
return
'{}/rest/firmware/{}
?summary=true
'
.
format
(
server_url
if
server_url
else
DEFAULT_URL
,
firmware_uid
)
def
request_firmware_data
(
request_url
):
...
...
pdf_generator/templates/default/exploit_mitigations.tex
View file @
79783e9c
...
...
@@ -7,10 +7,38 @@
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
Summary
NX
&
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
&
\VAR
{
selected
_
summary | filter
_
chars
}
\\
\BLOCK
{
endfor
}
\BLOCK
{
if selected
_
summary | contains('NX')
}
\VAR
{
selected
_
summary | filter
_
chars
}
(
\VAR
{
selected
_
analysis['summary'][selected
_
summary] | elements
_
count
}
)
\BLOCK
{
endif
}
\BLOCK
{
endfor
}
\\
\hline
Canary
&
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
\BLOCK
{
if selected
_
summary | contains('Canary')
}
\VAR
{
selected
_
summary | filter
_
chars
}
(
\VAR
{
selected
_
analysis['summary'][selected
_
summary] | elements
_
count
}
)
\BLOCK
{
endif
}
\BLOCK
{
endfor
}
\\
\hline
PIE
&
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
\BLOCK
{
if selected
_
summary | contains('PIE')
}
\VAR
{
selected
_
summary | filter
_
chars
}
(
\VAR
{
selected
_
analysis['summary'][selected
_
summary] | elements
_
count
}
)
\BLOCK
{
endif
}
\BLOCK
{
endfor
}
\\
\hline
RELRO
&
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
\BLOCK
{
if selected
_
summary | contains('RELRO')
}
\VAR
{
selected
_
summary | filter
_
chars
}
(
\VAR
{
selected
_
analysis['summary'][selected
_
summary] | elements
_
count
}
)
\BLOCK
{
endif
}
\BLOCK
{
endfor
}
\\
\hline
\BLOCK
{
endif
}
\end{longtable}
\ No newline at end of file
\end{longtable}
pdf_generator/tex_generation/template_engine.py
View file @
79783e9c
...
...
@@ -98,6 +98,12 @@ def split_output_lines(output_value, max_length=92):
return
output
def
item_contains_string
(
item
,
string
):
if
not
isinstance
(
item
,
str
):
return
False
return
string
in
item
def
create_jinja_environment
(
templates_to_use
=
'default'
):
template_directory
=
Path
(
Path
(
__file__
)
.
parent
.
parent
,
'templates'
,
templates_to_use
)
environment
=
jinja2
.
Environment
(
...
...
@@ -128,6 +134,7 @@ def _add_filters_to_jinja(environment):
environment
.
filters
[
'filter_list'
]
=
filter_chars_in_list
environment
.
filters
[
'split_hash'
]
=
split_hash
environment
.
filters
[
'split_output_lines'
]
=
split_output_lines
environment
.
filters
[
'contains'
]
=
item_contains_string
class
Engine
:
...
...
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