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
87e257d8
Commit
87e257d8
authored
Jul 15, 2019
by
dorp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored templates (step 1)
parent
989ea9e7
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
90 additions
and
180 deletions
+90
-180
base64_decoder.tex
pdf_generator/templates/default/base64_decoder.tex
+0
-16
binwalk.tex
pdf_generator/templates/default/binwalk.tex
+6
-7
cpu_architecture.tex
pdf_generator/templates/default/cpu_architecture.tex
+0
-16
crypto_material.tex
pdf_generator/templates/default/crypto_material.tex
+0
-16
exploit_mitigations.tex
pdf_generator/templates/default/exploit_mitigations.tex
+6
-7
file_hashes.tex
pdf_generator/templates/default/file_hashes.tex
+1
-1
file_type.tex
pdf_generator/templates/default/file_type.tex
+1
-1
generic.tex
pdf_generator/templates/default/generic.tex
+7
-3
init_systems.tex
pdf_generator/templates/default/init_systems.tex
+0
-16
ip_and_uri_finder.tex
pdf_generator/templates/default/ip_and_uri_finder.tex
+6
-7
main.tex
pdf_generator/templates/default/main.tex
+30
-40
malware_scanner.tex
pdf_generator/templates/default/malware_scanner.tex
+6
-6
printable_strings.tex
pdf_generator/templates/default/printable_strings.tex
+6
-8
string_evaluator.tex
pdf_generator/templates/default/string_evaluator.tex
+6
-8
unpacker.tex
pdf_generator/templates/default/unpacker.tex
+6
-8
users_and_passwords.tex
pdf_generator/templates/default/users_and_passwords.tex
+0
-17
template_engine.py
pdf_generator/tex_generation/template_engine.py
+7
-1
test_rest.py
test/unit/pre_processing/test_rest.py
+2
-2
No files found.
pdf_generator/templates/default/base64_decoder.tex
deleted
100644 → 0
View file @
989ea9e7
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
Summary
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
&
\VAR
{
selected
_
summary | filter
_
chars
}
\\
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
pdf_generator/templates/default/binwalk.tex
View file @
87e257d8
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
\subsection*
{
Binwalk (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version'] | filter
_
chars
}
\\
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
Signature Analysis:
}
\\
...
...
@@ -22,4 +20,5 @@
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
\ No newline at end of file
\end{longtable}
}
\ No newline at end of file
pdf_generator/templates/default/cpu_architecture.tex
deleted
100644 → 0
View file @
989ea9e7
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
Summary
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
&
\VAR
{
selected
_
summary | filter
_
chars
}
\\
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
pdf_generator/templates/default/crypto_material.tex
deleted
100644 → 0
View file @
989ea9e7
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
Summary
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
&
\VAR
{
selected
_
summary | filter
_
chars
}
\\
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
pdf_generator/templates/default/exploit_mitigations.tex
View file @
87e257d8
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
\subsection*
{
Exploit Mitigation (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
NX
&
...
...
@@ -41,4 +38,5 @@
\hline
\BLOCK
{
endif
}
\end{longtable}
\end{longtable}
}
\ No newline at end of file
pdf_generator/templates/default/file_hashes.tex
View file @
87e257d8
\subsection*
{
h
ashes (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
\subsection*
{
H
ashes (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
{
\fontfamily
{
lmss
}
\selectfont
\begin{tabular}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
...
...
pdf_generator/templates/default/file_type.tex
View file @
87e257d8
\subsection*
{
file t
ype (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
\subsection*
{
File T
ype (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
...
...
pdf_generator/templates/default/generic.tex
View file @
87e257d8
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\subsection*
{
\VAR
{
plugin
_
name | plugin
_
name | filter
_
chars
}
(v.
\VAR
{
selected
_
analysis['plugin
_
version'] | filter
_
chars
}
)
}
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
...
...
@@ -13,4 +16,5 @@
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
\ No newline at end of file
\end{longtable}
}
\ No newline at end of file
pdf_generator/templates/default/init_systems.tex
deleted
100644 → 0
View file @
989ea9e7
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
Summary
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
&
\VAR
{
selected
_
summary | filter
_
chars
}
\\
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
pdf_generator/templates/default/ip_and_uri_finder.tex
View file @
87e257d8
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
\subsection*
{
IPs and URIs (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
IPs v4
\BLOCK
{
for ip in selected
_
analysis['ips
_
v4'] | check
_
list | filter
_
list
}
&
\VAR
{
ip
}
\\
...
...
@@ -32,4 +29,5 @@
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
\end{longtable}
}
\ No newline at end of file
pdf_generator/templates/default/main.tex
View file @
87e257d8
\documentclass
{
article
}
\usepackage
[english]
{
babel
}
\usepackage
[utf8]
{
inputenc
}
\usepackage
{
amsmath
}
...
...
@@ -37,102 +38,91 @@
\section*
{
Analysis
}
\BLOCK
{
if "base64
_
decoder" in analysis
}
\subsection*
{
base64 decoder
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
base64
_
decoder.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "binwalk" in analysis
}
\subsection*
{
binwalk
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
binwalk.tex
}
}
\BLOCK
{
endif
}
\
BLOCK
{
if "cpu
_
architcture" in analysis
}
\subsection*
{
cpu architecture
}
{
\fontfamily
{
lmss
}
\selectfont
\
newpage
\BLOCK
{
if "cpu
_
architecture" in analysis
}
\input
{
cpu
_
architecture.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "crypto
_
material" in analysis
}
\subsection*
{
crypto material
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
crypto
_
material.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "exploit
_
mitigations" in analysis
}
\subsection*
{
exploit mitigations
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
exploit
_
mitigations.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "file
_
hashes" in analysis
}
\input
{
file
_
hashes.tex
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "file
_
type" in analysis
}
\input
{
file
_
type.tex
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "init
_
systems" in analysis
}
\subsection*
{
init systems
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
init
_
systems.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "ip
_
and
_
uri
_
finder" in analysis
}
\subsection*
{
ip and uri finder
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
ip
_
and
_
uri
_
finder.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "software
_
components" in analysis
}
\subsection*
{
software components
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
software
_
components.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "printable
_
strings" in analysis
}
\subsection*
{
printable strings
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
printable
_
strings.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "users
_
and
_
passwords" in analysis
}
\subsection*
{
users and passwords
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
users
_
and
_
passwords.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "string
_
evaluator" in analysis
}
\subsection*
{
string evaluator
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
string
_
evaluator.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "unpacker" in analysis
}
\subsection*
{
unpacker
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
unpacker.tex
}
}
\BLOCK
{
endif
}
\newpage
\BLOCK
{
if "malware
_
scanner" in analysis
}
\subsection*
{
malware scanner
}
{
\fontfamily
{
lmss
}
\selectfont
\input
{
malware
_
scanner.tex
}
}
\BLOCK
{
endif
}
\end{document}
...
...
pdf_generator/templates/default/malware_scanner.tex
View file @
87e257d8
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
\subsection*
{
Malware (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
MD5
&
\VAR
{
selected
_
analysis['md5']
}
\\
...
...
@@ -39,4 +37,5 @@
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
\end{longtable}
}
\ No newline at end of file
pdf_generator/templates/default/printable_strings.tex
View file @
87e257d8
\begin{tabular}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
\subsection*
{
String Stats (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
{
\fontfamily
{
lmss
}
\selectfont
\begin{tabular}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
String Count
&
\VAR
{
selected
_
analysis['strings'] | elements
_
count
}
\\
\hline
\end{tabular}
\ No newline at end of file
\end{tabular}
}
\ No newline at end of file
pdf_generator/templates/default/string_evaluator.tex
View file @
87e257d8
\begin{tabular}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
\subsection*
{
String Eval Stats (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
{
\fontfamily
{
lmss
}
\selectfont
\begin{tabular}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
String Count
&
\VAR
{
selected
_
analysis['string
_
eval'] | elements
_
count
}
\\
\hline
\end{tabular}
\ No newline at end of file
\end{tabular}
}
\ No newline at end of file
pdf_generator/templates/default/unpacker.tex
View file @
87e257d8
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
\subsection*
{
Unpacker (v.
\VAR
{
selected
_
analysis['plugin
_
version']
}
)
}
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version'] | filter
_
chars
}
\\
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Plugin
&
\VAR
{
selected
_
analysis['plugin
_
used'] | filter
_
chars
}
\\
\hline
...
...
@@ -21,4 +18,5 @@
Entropy
&
\VAR
{
selected
_
analysis['entropy'] | nice
_
number
}
\\
\hline
\end{longtable}
\ No newline at end of file
\end{longtable}
}
\ No newline at end of file
pdf_generator/templates/default/users_and_passwords.tex
deleted
100644 → 0
View file @
989ea9e7
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
Summary
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
&
\VAR
{
selected
_
summary | filter
_
chars
}
\\
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
\ No newline at end of file
pdf_generator/tex_generation/template_engine.py
View file @
87e257d8
...
...
@@ -123,6 +123,11 @@ def create_jinja_environment(templates_to_use='default'):
return
environment
def
plugin_name
(
name
):
parts
=
name
.
split
(
'_'
)
return
' '
.
join
((
'{}{}'
.
format
(
part
[
0
:
1
]
.
upper
(),
part
[
1
:])
for
part
in
parts
))
def
_add_filters_to_jinja
(
environment
):
environment
.
filters
[
'number_format'
]
=
byte_number_filter
environment
.
filters
[
'nice_unix_time'
]
=
nice_unix_time
...
...
@@ -131,6 +136,7 @@ def _add_filters_to_jinja(environment):
environment
.
filters
[
'elements_count'
]
=
len
environment
.
filters
[
'base64_to_png'
]
=
convert_base64_to_png_filter
environment
.
filters
[
'check_list'
]
=
lambda
x
:
x
if
x
else
[
'list is empty'
]
environment
.
filters
[
'plugin_name'
]
=
plugin_name
environment
.
filters
[
'filter_list'
]
=
filter_chars_in_list
environment
.
filters
[
'split_hash'
]
=
split_hash
environment
.
filters
[
'split_output_lines'
]
=
split_output_lines
...
...
@@ -156,4 +162,4 @@ class Engine:
except
jinja2
.
TemplateNotFound
:
logging
.
warning
(
'Falling back on generic template for {}'
.
format
(
plugin
))
template
=
self
.
_environment
.
get_template
(
GENERIC_TEMPLATE
)
return
template
.
render
(
selected_analysis
=
analysis
,
tmp_dir
=
self
.
_tmp_dir
)
return
template
.
render
(
plugin_name
=
plugin
,
selected_analysis
=
analysis
,
tmp_dir
=
self
.
_tmp_dir
)
test/unit/pre_processing/test_rest.py
View file @
87e257d8
...
...
@@ -33,5 +33,5 @@ def test_request_firmware_data_bad_response(monkeypatch): # pylint: disable=inv
def
test_create_request_url
():
assert
create_request_url
(
'X'
,
None
)
==
'{}/rest/firmware/X'
.
format
(
DEFAULT_URL
)
assert
create_request_url
(
'X'
,
'Y'
)
==
'Y/rest/firmware/X'
assert
create_request_url
(
'X'
,
None
)
==
'{}/rest/firmware/X
?summary=true
'
.
format
(
DEFAULT_URL
)
assert
create_request_url
(
'X'
,
'Y'
)
==
'Y/rest/firmware/X
?summary=true
'
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