Index: head/security/sandsifter/Makefile =================================================================== --- head/security/sandsifter/Makefile (revision 490791) +++ head/security/sandsifter/Makefile (revision 490792) @@ -1,44 +1,49 @@ # $FreeBSD$ PORTNAME= sandsifter -PORTVERSION= 0.20170906 +PORTVERSION= 1.03 +DISTVERSIONPREFIX=v CATEGORIES= security MAINTAINER= rene@FreeBSD.org COMMENT= Processor fuzzer for x86 CPUs LICENSE= BSD3CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE ONLY_FOR_ARCHS= amd64 i386 ONLY_FOR_ARCHS_REASON=Designed for x86 BUILD_DEPENDS= ${LOCALBASE}/include/capstone/capstone.h:devel/capstone3 RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}capstone>0:devel/py-capstone@${PY_FLAVOR} USES= gmake python localbase shebangfix - USE_GITHUB= yes -GH_ACCOUNT= xoreaxeaxeax -GH_TAGNAME= 8375e6123d093629e3e4437d7903839fd0742c2a -SHEBANG_FILES= sifter.py summarize.py +GH_ACCOUNT= rigred +SHEBANG_FILES= sifter.py sifter-summarize.py + OPTIONS_DEFINE= DOCS PORTDOCS= references/* +post-patch: + ${REINPLACE_CMD} -e 's,/proc/cpuinfo,/compat/linux/proc/cpuinfo,' \ + -e 's,/usr/sbin,${PREFIX}/sbin,' \ + ${WRKSRC}/sifter.py + do-install: (cd ${WRKSRC} && ${COPYTREE_SHARE} gui ${STAGEDIR}${DATADIR}) (cd ${WRKSRC} && ${COPYTREE_SHARE} pyutil ${STAGEDIR}${DATADIR}) - ${INSTALL_PROGRAM} ${WRKSRC}/injector ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/sifter-injector ${STAGEDIR}${PREFIX}/sbin ${INSTALL_SCRIPT} ${WRKSRC}/sifter.py ${STAGEDIR}${DATADIR} - ${INSTALL_SCRIPT} ${WRKSRC}/summarize.py ${STAGEDIR}${DATADIR} + ${INSTALL_SCRIPT} ${WRKSRC}/sifter-summarize.py ${STAGEDIR}${DATADIR} ${RLN} ${STAGEDIR}${DATADIR}/sifter.py ${STAGEDIR}${PREFIX}/bin/sifter - ${RLN} ${STAGEDIR}${DATADIR}/summarize.py ${STAGEDIR}${PREFIX}/bin/summarize + ${RLN} ${STAGEDIR}${DATADIR}/sifter-summarize.py ${STAGEDIR}${PREFIX}/bin/sifter-summarize ${MKDIR} ${STAGEDIR}${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/README.md ${STAGEDIR}${DOCSDIR} post-install-DOCS-on: ${INSTALL_DATA} ${WRKSRC}/references/* ${STAGEDIR}${DOCSDIR} .include Index: head/security/sandsifter/distinfo =================================================================== --- head/security/sandsifter/distinfo (revision 490791) +++ head/security/sandsifter/distinfo (revision 490792) @@ -1,3 +1,3 @@ -TIMESTAMP = 1523479892 -SHA256 (xoreaxeaxeax-sandsifter-0.20170906-8375e6123d093629e3e4437d7903839fd0742c2a_GH0.tar.gz) = 5c77f7d7158b4b3a4a6f723526361ae0f0560b5495b4ef95f7a4f4f4472f0c49 -SIZE (xoreaxeaxeax-sandsifter-0.20170906-8375e6123d093629e3e4437d7903839fd0742c2a_GH0.tar.gz) = 5285733 +TIMESTAMP = 1547931250 +SHA256 (rigred-sandsifter-v1.03_GH0.tar.gz) = aece752dbe1831b2c215d9345b124ad9fb0180996dc81bff34fdc3a609332e9c +SIZE (rigred-sandsifter-v1.03_GH0.tar.gz) = 5288254 Index: head/security/sandsifter/files/patch-Makefile =================================================================== --- head/security/sandsifter/files/patch-Makefile (revision 490791) +++ head/security/sandsifter/files/patch-Makefile (nonexistent) @@ -1,11 +0,0 @@ ---- Makefile.orig 2017-07-27 19:17:30 UTC -+++ Makefile -@@ -32,7 +32,7 @@ - all: injector - - injector: injector.o -- $(CC) $(CFLAGS) $< -O3 -Wall -l:libcapstone.a -o $@ -pthread -+ $(CC) $(CFLAGS) $(LIBS) $(LDFLAGS) $< -Wall -l:libcapstone.a -o $@ -pthread - - %.o: %.c - $(CC) $(CFLAGS) -c $< -o $@ -Wall Property changes on: head/security/sandsifter/files/patch-Makefile ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/security/sandsifter/files/patch-sifter.py =================================================================== --- head/security/sandsifter/files/patch-sifter.py (revision 490791) +++ head/security/sandsifter/files/patch-sifter.py (nonexistent) @@ -1,42 +0,0 @@ ---- sifter.py.orig 2017-09-30 17:57:06 UTC -+++ sifter.py -@@ -27,10 +27,10 @@ import code - import copy - from ctypes import * - --INJECTOR = "./injector" -+INJECTOR = "injector" - arch = "" - --OUTPUT = "./data/" -+OUTPUT = os.getenv("HOME") + "/.sandsifter/" - LOG = OUTPUT + "log" - SYNC = OUTPUT + "sync" - TICK = OUTPUT + "tick" -@@ -679,7 +679,7 @@ class Gui: - time.sleep(self.TIME_SLICE) - - def get_cpu_info(): -- with open("/proc/cpuinfo", "r") as f: -+ with open("/compat/linux/proc/cpuinfo", "r") as f: - cpu = [l.strip() for l in f.readlines()[:7]] - return cpu - -@@ -808,9 +808,16 @@ def main(): - if not os.path.exists(OUTPUT): - os.makedirs(OUTPUT) - -+ real_injector, errors = \ -+ subprocess.Popen( -+ ['which', INJECTOR], -+ stdout=subprocess.PIPE, -+ stderr=subprocess.PIPE -+ ).communicate() -+ real_injector = real_injector.replace('\n', '') # strip newline from shell output - injector_bitness, errors = \ - subprocess.Popen( -- ['file', INJECTOR], -+ ['file', real_injector], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE - ).communicate() Property changes on: head/security/sandsifter/files/patch-sifter.py ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/security/sandsifter/pkg-descr =================================================================== --- head/security/sandsifter/pkg-descr (revision 490791) +++ head/security/sandsifter/pkg-descr (revision 490792) @@ -1,9 +1,12 @@ The sandsifter audits x86 processors for hidden instructions and hardware bugs, by systematically generating machine code to search through a processor's instruction set, and monitoring execution for anomalies. Sandsifter has uncovered secret processor instructions from every major vendor; ubiquitous software bugs in disassemblers, assemblers, and emulators; flaws in enterprise hypervisors; and both benign and security-critical hardware bugs in x86 chips. -WWW: https://github.com/xoreaxeaxeax/sandsifter +Run this program under sudo so that it will use the correct directories +to store its data. + +WWW: https://github.com/rigred/sandsifter Index: head/security/sandsifter/pkg-message =================================================================== --- head/security/sandsifter/pkg-message (revision 490791) +++ head/security/sandsifter/pkg-message (revision 490792) @@ -1,5 +1,7 @@ *** ATTENTION *** Before using this tool you should do the following as root: # sysctl security.bsd.map_at_zero=1 # mount -t linprocfs linproc /compat/linux/proc + +Also make sure you use a 256-color capable terminal of at least 40 rows high. Index: head/security/sandsifter/pkg-plist =================================================================== --- head/security/sandsifter/pkg-plist (revision 490791) +++ head/security/sandsifter/pkg-plist (revision 490792) @@ -1,16 +1,16 @@ -bin/injector bin/sifter -bin/summarize +bin/sifter-summarize +sbin/sifter-injector %%PORTDOCS%%%%DOCSDIR%%/README.md %%PORTDOCS%%%%DOCSDIR%%/domas_breaking_the_x86_isa.pdf %%PORTDOCS%%%%DOCSDIR%%/domas_breaking_the_x86_isa_wp.pdf %%PORTDOCS%%%%DOCSDIR%%/sandsifter.gif %%PORTDOCS%%%%DOCSDIR%%/screenshot.png %%PORTDOCS%%%%DOCSDIR%%/summarizer.png %%DATADIR%%/gui/__init__.py %%DATADIR%%/gui/gui.py %%DATADIR%%/pyutil/__init__.py %%DATADIR%%/pyutil/colors.py %%DATADIR%%/pyutil/progress.py %%DATADIR%%/sifter.py -%%DATADIR%%/summarize.py +%%DATADIR%%/sifter-summarize.py