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
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
217 additions
and
307 deletions
+217
-307
base64_decoder.tex
pdf_generator/templates/default/base64_decoder.tex
+0
-16
binwalk.tex
pdf_generator/templates/default/binwalk.tex
+21
-22
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
+40
-41
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
+18
-14
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
+29
-30
main.tex
pdf_generator/templates/default/main.tex
+30
-40
malware_scanner.tex
pdf_generator/templates/default/malware_scanner.tex
+32
-32
printable_strings.tex
pdf_generator/templates/default/printable_strings.tex
+9
-11
string_evaluator.tex
pdf_generator/templates/default/string_evaluator.tex
+9
-11
unpacker.tex
pdf_generator/templates/default/unpacker.tex
+18
-20
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
}
\\
\hline
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
Signature Analysis:
}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
\VAR
{
selected
_
analysis['signature
_
analysis'] | filter
_
chars
}}
\\
\hline
Entropy Graph
&
\includegraphics
[scale = 0.7]
{
\VAR
{
selected
_
analysis['entropy
_
analysis
_
graph'] | base64
_
to
_
png('entropy
_
analysis
_
graph', tmp
_
dir)
}}
\\
\hline
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
Summary:
}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
Signature Analysis:
}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{}
\\
\BLOCK
{
for data in selected
_
analysis['summary']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
\VAR
{
data | filter
_
chars
}}
\\
\BLOCK
{
endfor
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
\VAR
{
selected
_
analysis['signature
_
analysis'] | filter
_
chars
}}
\\
\hline
\BLOCK
{
endif
}
\end{longtable}
\ No newline at end of file
Entropy Graph
&
\includegraphics
[scale = 0.7]
{
\VAR
{
selected
_
analysis['entropy
_
analysis
_
graph'] | base64
_
to
_
png('entropy
_
analysis
_
graph', tmp
_
dir)
}}
\\
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
Summary:
}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{}
\\
\BLOCK
{
for data in selected
_
analysis['summary']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
\VAR
{
data | filter
_
chars
}}
\\
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\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']
}
\\
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
NX
&
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
\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
}
\\
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
NX
&
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
\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}
\BLOCK
{
endif
}
\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
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
\subsection*
{
\VAR
{
plugin
_
name | plugin
_
name | filter
_
chars
}
(v.
\VAR
{
selected
_
analysis['plugin
_
version'] | filter
_
chars
}
)
}
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
\hline
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Time of Analysis
&
\VAR
{
selected
_
analysis['analysis
_
date'] | nice
_
unix
_
time
}
\\
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
Summary
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
&
\VAR
{
selected
_
summary | filter
_
chars
}
\\
\BLOCK
{
endfor
}
Plugin Version
&
\VAR
{
selected
_
analysis['plugin
_
version']
}
\\
\hline
\BLOCK
{
endif
}
\end{longtable}
\ No newline at end of file
\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/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']
}
\\
\hline
IPs v4
\BLOCK
{
for ip in selected
_
analysis['ips
_
v4'] | check
_
list | filter
_
list
}
&
\VAR
{
ip
}
\\
\BLOCK
{
endfor
}
\hline
IPs v6
\BLOCK
{
for ip in selected
_
analysis['ips
_
v6'] | check
_
list | filter
_
list
}
&
\VAR
{
ip
}
\\
\BLOCK
{
endfor
}
\hline
{
\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
}
\\
\BLOCK
{
endfor
}
\hline
URIs
\BLOCK
{
for uri in selected
_
analysis['uris
'] | check
_
list | filter
_
list
}
&
\VAR
{
uri
}
\\
\BLOCK
{
endfor
}
\hline
IPs v6
\BLOCK
{
for ip in selected
_
analysis['ips
_
v6
'] | check
_
list | filter
_
list
}
&
\VAR
{
ip
}
\\
\BLOCK
{
endfor
}
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
Summary:
}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{}
\\
\BLOCK
{
for data in selected
_
analysis['summary']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
\VAR
{
data | filter
_
chars
}}
\\
URIs
\BLOCK
{
for uri in selected
_
analysis['uris'] | check
_
list | filter
_
list
}
&
\VAR
{
uri
}
\\
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
\BLOCK
{
if selected
_
analysis['summary']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
Summary:
}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{}
\\
\BLOCK
{
for data in selected
_
analysis['summary']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
\VAR
{
data | filter
_
chars
}}
\\
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\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']
}
\\
\hline
MD5
&
\VAR
{
selected
_
analysis['md5']
}
\\
\hline
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
System Version
&
\VAR
{
selected
_
analysis['system
_
version
']
}
\\
\hline
MD5
&
\VAR
{
selected
_
analysis['md5
']
}
\\
\hline
Scanners Number
&
\VAR
{
selected
_
analysis['number
_
of
_
scanners
']
}
\\
\hline
System Version
&
\VAR
{
selected
_
analysis['system
_
version
']
}
\\
\hline
Positives
&
\VAR
{
selected
_
analysis['positive
s']
}
\\
\hline
Scanners Number
&
\VAR
{
selected
_
analysis['number
_
of
_
scanner
s']
}
\\
\hline
Scanners
\BLOCK
{
for scanner in selected
_
analysis['scanners']
}
&
\VAR
{
scanner
}
\\
\BLOCK
{
endfor
}
\hline
Positives
&
\VAR
{
selected
_
analysis['positives']
}
\\
\hline
Scanns
\BLOCK
{
for scan in selected
_
analysis['scans']
}
\BLOCK
{
for value in selected
_
analysis['scans'][scan]
}
&
\VAR
{
scan
}
::
\VAR
{
value
}
:
\VAR
{
selected
_
analysis['scans'][scan][value]
}
\\
Scanners
\BLOCK
{
for scanner in selected
_
analysis['scanners']
}
&
\VAR
{
scanner
}
\\
\BLOCK
{
endfor
}
\BLOCK
{
endfor
}
\hline
\hline
\BLOCK
{
if selected
_
analysis['summary']
}
Summary
\BLOCK
{
for selected
_
summary in selected
_
analysis['summary']
}
&
\VAR
{
selected
_
summary | filter
_
chars
}
\\
Scanns
\BLOCK
{
for scan in selected
_
analysis['scans']
}
\BLOCK
{
for value in selected
_
analysis['scans'][scan]
}
&
\VAR
{
scan
}
::
\VAR
{
value
}
:
\VAR
{
selected
_
analysis['scans'][scan][value]
}
\\
\BLOCK
{
endfor
}
\BLOCK
{
endfor
}
\hline
\BLOCK
{
endif
}
\end{longtable}
\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/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']
}
\\
\hline
String Count
&
\VAR
{
selected
_
analysis['strings'] | elements
_
count
}
\\
\hline
\end{tabular}
\ No newline at end of file
{
\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
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']
}
\\
\hline
String Count
&
\VAR
{
selected
_
analysis['string
_
eval'] | elements
_
count
}
\\
\hline
\end{tabular}
\ No newline at end of file
{
\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
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
}
\\
\hline
{
\fontfamily
{
lmss
}
\selectfont
\begin{longtable}
{
|p
{
3cm
}
|p
{
11.5cm
}
|
}
\hline
Plugin
&
\VAR
{
selected
_
analysis['plugin
_
used'] | filter
_
chars
}
\\
\hline
Plugin
&
\VAR
{
selected
_
analysis['plugin
_
used'] | filter
_
chars
}
\\
\hline
Extracted
&
\VAR
{
selected
_
analysis['number
_
of
_
unpacked
_
files']
}
\\
\hline
Extracted
&
\VAR
{
selected
_
analysis['number
_
of
_
unpacked
_
files']
}
\\
\hline
\BLOCK
{
if selected
_
analysis['output']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
Output:
}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
\VAR
{
selected
_
analysis['output'] | split
_
output
_
lines | filter
_
chars
}}
\\
\hline
\BLOCK
{
endif
}
\BLOCK
{
if selected
_
analysis['output']
}
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
Output:
}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{}
\\
\multicolumn
{
2
}{
|p
{
14.5cm
}
|
}{
\VAR
{
selected
_
analysis['output'] | split
_
output
_
lines | filter
_
chars
}}
\\
Entropy
&
\VAR
{
selected
_
analysis['entropy'] | nice
_
number
}
\\
\hline
\BLOCK
{
endif
}
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