summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorAntoine Brodin <antoine@FreeBSD.org>2015-03-27 12:26:22 +0000
committerAntoine Brodin <antoine@FreeBSD.org>2015-03-27 12:26:22 +0000
commit3248b91347d34f37c6a20bcb80fab847d81acf63 (patch)
treed8ab7160d005b0d975285cdc283990d1d65b71b6 /security
parentUpdate to 2.2.0 (diff)
Adjust to run better with new versions of openpyxl
Notes
Notes: svn path=/head/; revision=382401
Diffstat (limited to 'security')
-rw-r--r--security/py-volatility/Makefile7
-rw-r--r--security/py-volatility/files/patch-setup.py4
-rw-r--r--security/py-volatility/files/patch-volatility_plugins_malware_psxview.py88
-rw-r--r--security/py-volatility/files/patch-volatility_plugins_timeliner.py35
4 files changed, 126 insertions, 8 deletions
diff --git a/security/py-volatility/Makefile b/security/py-volatility/Makefile
index 227915e3791d..9dd57c40d087 100644
--- a/security/py-volatility/Makefile
+++ b/security/py-volatility/Makefile
@@ -3,7 +3,7 @@
PORTNAME= volatility
PORTVERSION= 2.4
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= security python
MASTER_SITES= http://downloads.volatilityfoundation.org/releases/${PORTVERSION}/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -33,11 +33,6 @@ DOCSDIR= ${PREFIX}/share/doc/py-${PORTNAME}
PYDISTUTILS_INSTALLARGS+=--install-data ${DATADIR}
-post-patch:
- @${REINPLACE_CMD} 's,openpyxl.style,openpyxl.styles,' \
- ${WRKSRC}/volatility/plugins/malware/psxview.py \
- ${WRKSRC}/volatility/plugins/timeliner.py
-
post-install:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}${DOCSDIR}
diff --git a/security/py-volatility/files/patch-setup.py b/security/py-volatility/files/patch-setup.py
index a9ebb22037ff..15910b47cedb 100644
--- a/security/py-volatility/files/patch-setup.py
+++ b/security/py-volatility/files/patch-setup.py
@@ -1,6 +1,6 @@
---- setup.py.orig 2014-08-03 18:09:32 +0000
+--- setup.py.orig 2014-08-03 18:09:32 UTC
+++ setup.py
-@@ -44,7 +44,10 @@
+@@ -44,7 +44,10 @@ def find_files(topdirs, py = False):
ret = []
for topdir in topdirs:
for r, _ds, fs in os.walk(topdir):
diff --git a/security/py-volatility/files/patch-volatility_plugins_malware_psxview.py b/security/py-volatility/files/patch-volatility_plugins_malware_psxview.py
new file mode 100644
index 000000000000..c74fc705de05
--- /dev/null
+++ b/security/py-volatility/files/patch-volatility_plugins_malware_psxview.py
@@ -0,0 +1,88 @@
+--- volatility/plugins/malware/psxview.py.orig 2014-08-03 18:09:34 UTC
++++ volatility/plugins/malware/psxview.py
+@@ -32,7 +32,7 @@ try:
+ from openpyxl.workbook import Workbook
+ from openpyxl.writer.excel import ExcelWriter
+ from openpyxl.cell import get_column_letter
+- from openpyxl.style import Color, Fill
++ from openpyxl.styles import Color, Fill, Style, PatternFill, Border, Side, Alignment, Protection, Font
+ from openpyxl.cell import Cell
+ from openpyxl import load_workbook
+ has_openpyxl = True
+@@ -208,6 +208,57 @@ class PsXview(common.AbstractWindowsComm
+ yield offset, source[offset], ps_sources
+
+ def render_xlsx(self, outfd, data):
++ BoldStyle = Style(font=Font(name='Calibri',
++ size=11,
++ bold=True,
++ italic=False,
++ vertAlign=None,
++ underline='none',
++ strike=False,
++ color='FFFFFFFF'),
++ fill=PatternFill(fill_type="solid",
++ start_color='FF000000',
++ end_color='FF000000'))
++ RedStyle = Style(font=Font(name='Calibri',
++ size=11,
++ bold=False,
++ italic=False,
++ vertAlign=None,
++ underline='none',
++ strike=False,
++ color='FF000000'),
++ border=Border(left=Side(border_style="thick",
++ color='FF000000'),
++ right=Side(border_style="thick",
++ color='FF000000'),
++ top=Side(border_style="thick",
++ color='FF000000'),
++ bottom=Side(border_style="thick",
++ color='FF000000'),
++ diagonal=Side(border_style="thick",
++ color='FF000000'),
++ diagonal_direction=0,
++ outline=Side(border_style="thick",
++ color='FF000000'),
++ vertical=Side(border_style="thick",
++ color='FF000000'),
++ horizontal=Side(border_style="thick",
++ color='FF000000')),
++ fill=PatternFill(start_color = 'FFFF0000',
++ end_color = 'FFFF0000',
++ fill_type = 'solid'))
++ GreenStyle = Style(font=Font(name='Calibri',
++ size=11,
++ bold=False,
++ italic=False,
++ vertAlign=None,
++ underline='none',
++ strike=False,
++ color='FF000000'),
++ fill=PatternFill(start_color = "FF00FF00",
++ end_color = "FF00FF00",
++ fill_type = "solid"))
++
+ wb = Workbook(optimized_write = True)
+ ws = wb.create_sheet()
+ ws.title = "Psxview Output"
+@@ -274,15 +325,13 @@ class PsXview(common.AbstractWindowsComm
+ wb = load_workbook(filename = self._config.OUTPUT_FILE)
+ ws = wb.get_sheet_by_name(name = "Psxview Output")
+ for col in xrange(1, 12):
+- ws.cell("{0}{1}".format(get_column_letter(col), 1)).style.font.bold = True
++ ws.cell("{0}{1}".format(get_column_letter(col), 1)).style = BoldStyle
+ for row in xrange(2, total + 1):
+ for col in xrange(4, 11):
+ if ws.cell("{0}{1}".format(get_column_letter(col), row)).value == "False":
+- ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.fill_type = Fill.FILL_SOLID
+- ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.start_color.index = "FFFF0000"
++ ws.cell("{0}{1}".format(get_column_letter(col), row)).style = RedStyle
+ else:
+- ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.fill_type = Fill.FILL_SOLID
+- ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.start_color.index = "FF00FF00"
++ ws.cell("{0}{1}".format(get_column_letter(col), row)).style = GreenStyle
+ wb.save(filename = self._config.OUTPUT_FILE)
+
+ def render_text(self, outfd, data):
diff --git a/security/py-volatility/files/patch-volatility_plugins_timeliner.py b/security/py-volatility/files/patch-volatility_plugins_timeliner.py
new file mode 100644
index 000000000000..6b5a043c84e3
--- /dev/null
+++ b/security/py-volatility/files/patch-volatility_plugins_timeliner.py
@@ -0,0 +1,35 @@
+--- volatility/plugins/timeliner.py.orig 2014-08-03 18:49:58 UTC
++++ volatility/plugins/timeliner.py
+@@ -56,7 +56,6 @@ try:
+ from openpyxl.workbook import Workbook
+ from openpyxl.writer.excel import ExcelWriter
+ from openpyxl.cell import get_column_letter
+- from openpyxl.style import Color, Fill
+ from openpyxl.cell import Cell
+ from openpyxl import load_workbook
+ has_openpyxl = True
+@@ -193,11 +192,6 @@ class TimeLiner(common.AbstractWindowsCo
+ if line != None:
+ outfd.write(line)
+
+- def fill(self, ws, row, max = 6, color = "RED"):
+- for col in xrange(1, max):
+- ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.fill_type = Fill.FILL_SOLID
+- ws.cell("{0}{1}".format(get_column_letter(col), row)).style.fill.start_color.index = colors.get(color, "RED")
+-
+ def render_xlsx(self, outfd, data):
+ wb = Workbook(optimized_write = True)
+ ws = wb.create_sheet()
+@@ -214,12 +208,9 @@ class TimeLiner(common.AbstractWindowsCo
+ if self._config.HIGHLIGHT != None:
+ wb = load_workbook(filename = self._config.OUTPUT_FILE)
+ ws = wb.get_sheet_by_name(name = "Timeline Output")
+- for col in xrange(1, len(header) + 1):
+- ws.cell("{0}{1}".format(get_column_letter(col), 1)).style.font.bold = True
+ for row in xrange(2, total + 1):
+ for col in xrange(2, len(header)):
+ if ws.cell("{0}{1}".format(get_column_letter(col), row)).value in self.suspicious.keys():
+- self.fill(ws, row, len(header) + 1, self.suspicious[ws.cell("{0}{1}".format(get_column_letter(col), row)).value]["color"])
+ ws.cell("{0}{1}".format(get_column_letter(col + 1), row)).value = self.suspicious[ws.cell("{0}{1}".format(get_column_letter(col), row)).value]["reason"]
+
+ wb.save(filename = self._config.OUTPUT_FILE)