[47667] trunk/dports/security/stegdetect
blb at macports.org
blb at macports.org
Tue Mar 3 01:56:02 PST 2009
Revision: 47667
http://trac.macports.org/changeset/47667
Author: blb at macports.org
Date: 2009-03-03 01:56:01 -0800 (Tue, 03 Mar 2009)
Log Message:
-----------
security/stegdetect - make it build (ticket #13637); doesn't depend on jpeg
since it has its own, modified, jpeg library; install a rules.ini.sample
(and copy in post-activate if it isn't present)
Modified Paths:
--------------
trunk/dports/security/stegdetect/Portfile
Added Paths:
-----------
trunk/dports/security/stegdetect/files/
trunk/dports/security/stegdetect/files/patch-Makefile.in.diff
trunk/dports/security/stegdetect/files/patch-configure.diff
trunk/dports/security/stegdetect/files/patch-file_Makefile.in.diff
trunk/dports/security/stegdetect/files/patch-stegdetect.c.diff
trunk/dports/security/stegdetect/files/rules.ini.sample
Modified: trunk/dports/security/stegdetect/Portfile
===================================================================
--- trunk/dports/security/stegdetect/Portfile 2009-03-03 09:36:07 UTC (rev 47666)
+++ trunk/dports/security/stegdetect/Portfile 2009-03-03 09:56:01 UTC (rev 47667)
@@ -3,7 +3,7 @@
PortSystem 1.0
name stegdetect
version 0.6
-revision 1
+revision 2
categories security graphics
maintainers nomaintainer
description tool for detecting steganographic content in jpeg images.
@@ -19,7 +19,8 @@
checksums md5 850a3551b5c450b9f450a919ad021767
-depends_lib port:jpeg
+patchfiles patch-Makefile.in.diff patch-configure.diff \
+ patch-file_Makefile.in.diff patch-stegdetect.c.diff
configure.args --mandir=${prefix}/share/man
post-configure {
@@ -27,6 +28,9 @@
}
post-destroot {
+ xinstall -m 755 -d ${destroot}${prefix}/share/stegbreak
+ xinstall -m 644 -W ${filespath} rules.ini.sample \
+ ${destroot}${prefix}/share/stegbreak
file delete ${destroot}${prefix}/share/magic \
${destroot}${prefix}/share/magic.inc \
${destroot}${prefix}/share/magic.mime \
@@ -34,6 +38,13 @@
${destroot}${prefix}/share/man/man4/magic.4
}
+post-activate {
+ if {![file exists ${prefix}/share/stegbreak/rules.ini]} {
+ file copy ${prefix}/share/stegbreak/rules.ini.sample \
+ ${prefix}/share/stegbreak/rules.ini
+ }
+}
+
platform darwin 8 powerpc {
configure.compiler gcc-3.3
}
Added: trunk/dports/security/stegdetect/files/patch-Makefile.in.diff
===================================================================
--- trunk/dports/security/stegdetect/files/patch-Makefile.in.diff (rev 0)
+++ trunk/dports/security/stegdetect/files/patch-Makefile.in.diff 2009-03-03 09:56:01 UTC (rev 47667)
@@ -0,0 +1,11 @@
+--- Makefile.in.orig 2004-08-31 08:59:42.000000000 -0600
++++ Makefile.in 2009-03-03 02:18:48.000000000 -0700
+@@ -70,7 +70,7 @@
+
+ JPEGDIR = ./jpeg-6b
+ JPEGINC = -I$(JPEGDIR)
+-JPEGLIB = -L$(JPEGDIR) -ljpeg
++JPEGLIB = $(JPEGDIR)/libjpeg.a
+ JPEGDEP = $(JPEGDIR)/libjpeg.a
+
+ FILEDIR = ./file
Added: trunk/dports/security/stegdetect/files/patch-configure.diff
===================================================================
--- trunk/dports/security/stegdetect/files/patch-configure.diff (rev 0)
+++ trunk/dports/security/stegdetect/files/patch-configure.diff 2009-03-03 09:56:01 UTC (rev 47667)
@@ -0,0 +1,13 @@
+--- configure.orig 2004-08-31 08:59:44.000000000 -0600
++++ configure 2009-03-03 02:22:45.000000000 -0700
+@@ -2563,6 +2563,10 @@
+ echo $ECHO_N "checking blowfish object... $ECHO_C" >&6
+
+ case "$target" in
++*-*-darwin*)
++ echo "$as_me:2563: result: bf_enc.o" >&5
++echo "${ECHO_T}bf_enc.o" >&6
++ BFOBJ=bf_enc.o;;
+ i386-*-*)
+ echo "$as_me:2567: result: bf-586.o" >&5
+ echo "${ECHO_T}bf-586.o" >&6
Added: trunk/dports/security/stegdetect/files/patch-file_Makefile.in.diff
===================================================================
--- trunk/dports/security/stegdetect/files/patch-file_Makefile.in.diff (rev 0)
+++ trunk/dports/security/stegdetect/files/patch-file_Makefile.in.diff 2009-03-03 09:56:01 UTC (rev 47667)
@@ -0,0 +1,14 @@
+--- file/Makefile.in.orig 2004-08-29 17:11:06.000000000 -0600
++++ file/Makefile.in 2009-03-03 02:12:42.000000000 -0700
+@@ -504,9 +504,9 @@
+ done >> $@
+
+ magic.inc: magic
+- echo -n "\"" > $@
++ /bin/echo -n "\"" > $@
+ sed -e 's/\\/\\\\/g' -e 's/"/\\\"/g' -e 's/$$/\ \\/' magic >> $@
+- echo -n "\"" >> $@
++ /bin/echo -n "\"" >> $@
+
+ file.1: Makefile file.man
+ @rm -f $@
Added: trunk/dports/security/stegdetect/files/patch-stegdetect.c.diff
===================================================================
--- trunk/dports/security/stegdetect/files/patch-stegdetect.c.diff (rev 0)
+++ trunk/dports/security/stegdetect/files/patch-stegdetect.c.diff 2009-03-03 09:56:01 UTC (rev 47667)
@@ -0,0 +1,283 @@
+--- stegdetect.c.orig 2004-09-02 22:01:35.000000000 -0600
++++ stegdetect.c 2009-03-03 02:15:20.000000000 -0700
+@@ -78,7 +78,7 @@
+ float DCThist[257];
+ float scale = 1; /* Sensitivity scaling */
+
+-static int debug = 0;
++static int stegdebug = 0;
+ static int quiet = 0;
+ static int ispositive = 0; /* Current images contain stego */
+ static char *transformname; /* Current transform name */
+@@ -135,7 +135,7 @@
+ sum = count = 0;
+ for (i = x; i < y; i++) {
+ if ((i & ~63) == i) {
+- if (debug & DBG_PRINTONES)
++ if (stegdebug & DBG_PRINTONES)
+ fprintf(stdout, "%d] %d\n", i, count);
+ sum += count;
+ count = 0;
+@@ -159,7 +159,7 @@
+ DCThist[off + 128]++;
+ }
+
+- if (debug & DBG_PRINTHIST) {
++ if (stegdebug & DBG_PRINTHIST) {
+ for (i = 0; i < 256; i++) {
+ fprintf(stdout, "%4d: %8.1f\n", i - 128, DCThist[i]);
+ }
+@@ -291,7 +291,7 @@
+ */
+ if ((fbar > f/4) &&
+ ((f - f/3) - (fbar + f/3) > 0)) {
+- if ((debug & DBG_CHIDIFF) && (one || two))
++ if ((stegdebug & DBG_CHIDIFF) && (one || two))
+ fprintf(stdout,
+ "%4d: %8.3f - %8.3f skipped (%f)\n",
+ i*2 - 128,
+@@ -356,7 +356,7 @@
+ ymt += DCTobs[i];
+ ytt += DCTtheo[i];
+
+- if (debug & DBG_CHIDIFF) {
++ if (stegdebug & DBG_CHIDIFF) {
+ if (DCTobs[i] || DCTtheo[i])
+ fprintf(stdout, "%4d: %8.3f - %8.3f\n", i,
+ DCTobs[i],
+@@ -368,7 +368,7 @@
+ chi = ymt - ytt;
+
+
+- if (debug & DBG_CHICALC) {
++ if (stegdebug & DBG_CHICALC) {
+ fprintf(stdout,
+ " (%8.3f - %8.3f)^2 = %8.3f / %8.3f = %8.3f | %8.3f\n",
+ ymt, ytt,
+@@ -388,7 +388,7 @@
+
+ f = 1 - chi2cdf(sumchi, dgf - 1);
+
+- if (debug & DBG_CHIEND) {
++ if (stegdebug & DBG_CHIEND) {
+ fprintf(stdout,
+ "Categories: %d, Chi: %f, Q: %f, dis: %f -> %f\n",
+ dgf, sumchi, f, discard, f * (1 - discard));
+@@ -435,7 +435,7 @@
+ while (_iteration < (imaxiter))
+
+ #define BINSEARCH_NEXT(thresh) \
+- if (debug & DBG_BINSRCH) \
++ if (stegdebug & DBG_BINSRCH) \
+ fprintf(stdout, "sum: %f, percent: %f, good: %f\n", \
+ sum, percent, _good); \
+ if (_iteration == 0) { \
+@@ -481,7 +481,7 @@
+ break;
+ if (f > 0.4)
+ sum += f * percent;
+- if ((debug & DBG_CHI) && f != 0)
++ if ((stegdebug & DBG_CHI) && f != 0)
+ fprintf(stdout, "%04f[:] %8.5f%% %f\n",
+ i, f * 100, sum);
+ }
+@@ -491,7 +491,7 @@
+
+ BINSEARCH_IFABORT(end) {
+ abort:
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout,
+ "Accumulation: no detection possible\n");
+ return (-1);
+@@ -528,8 +528,8 @@
+ }
+ }
+
+- if ((debug & DBG_CHI) &&
+- ((debug & DBG_PRINTZERO) || f != 0))
++ if ((stegdebug & DBG_CHI) &&
++ ((stegdebug & DBG_PRINTZERO) || f != 0))
+ fprintf(stdout, "%04f: %8.5f%%\n",
+ i, f * 100);
+ }
+@@ -537,7 +537,7 @@
+ length = jsteg_size(data, bits, NULL);
+ minlen = where/8;
+ maxlen = (where + percent)/8;
+- if (debug & DBG_ENDVAL) {
++ if (stegdebug & DBG_ENDVAL) {
+ fprintf(stdout,
+ "Accumulation (%d): %f%% - %f (%f) (%d:%d - %d)\n",
+ (int)percent,
+@@ -596,7 +596,7 @@
+ f = chi2test(data, bits, unify_false_outguess,
+ off - range, off + range);
+ sum += f;
+- if ((debug & DBG_CHI) && f != 0)
++ if ((stegdebug & DBG_CHI) && f != 0)
+ fprintf(stdout, "%04d[:] %8.5f%%\n",
+ i, f * 100);
+ }
+@@ -618,8 +618,8 @@
+ sum += f;
+ if (f > 0.001)
+ count++;
+- if ((debug & DBG_CHI) &&
+- ((debug & DBG_PRINTZERO) || f != 0))
++ if ((stegdebug & DBG_CHI) &&
++ ((stegdebug & DBG_PRINTZERO) || f != 0))
+ fprintf(stdout, "%04d: %8.5f%%\n", i, f * 100);
+ }
+
+@@ -631,7 +631,7 @@
+
+ norm = sum / norm_outguess[off];
+
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout,
+ "Accumulation (%4.1f%%): %8.3f%% (%8.3f%%) (%4.1f)\n",
+ percent,
+@@ -714,7 +714,7 @@
+ else if (sum >= 15 && res <= -1)
+ negative = 1;
+
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ printf("Zero/One: %d : %d -> %5.1f%s\n",
+ one, zero, (float)res/2, negative ? " **" : "");
+
+@@ -740,7 +740,7 @@
+ (!DCThist[i] || !DCThist[i+1]))
+ res++;
+ }
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ printf("Empty pairs: %d\n", res);
+ if (res > 3)
+ return (1);
+@@ -770,7 +770,7 @@
+
+ buildDCTreset();
+ f = chi2test(data, bits, unify_jphide, 0, jphpos[0]);
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout, "Pos[0]: %04d: %8.5f%%\n", jphpos[0], f*100);
+
+ /* If JPhide was used, we should get a high value at this position */
+@@ -793,7 +793,7 @@
+
+ false = 0;
+ f2 = chi2test(data, bits, unify_false_jphide, 0, jphpos[0]);
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout, "Pos[0]: %04d[:] %8.5f%%: %8.5f%%\n",
+ jphpos[0], f2*100, (f2 - f)*100);
+
+@@ -802,13 +802,13 @@
+ return (0);
+
+ f = chi2test(data, bits, unify_jphide, jphpos[0]/2, jphpos[0]);
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout, "Pos[0]/2: %04d: %8.5f%%\n", jphpos[0], f*100);
+ if (f < 0.9)
+ return (0);
+
+ f2 = chi2test(data, bits, unify_false_jphide, jphpos[0]/2, jphpos[0]);
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout, "Pos[0]/2: %04d[:] %8.5f%%: %8.5f%%\n",
+ jphpos[0], f2*100, (f2 - f)*100);
+ if (f2 * 0.95 > f)
+@@ -816,7 +816,7 @@
+
+ f = chi2test(data, bits, unify_jphide, 0, jphpos[0]/2);
+ f2 = chi2test(data, bits, unify_false_jphide, 0, jphpos[0]/2);
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout, "0->1/2: %04d[:] %8.5f%% %8.5f%%\n",
+ jphpos[0], f*100, f2*100);
+
+@@ -864,8 +864,8 @@
+ else if (f < 0.2)
+ break;
+
+- if ((debug & DBG_CHI) &&
+- ((debug & DBG_PRINTZERO) || f != 0))
++ if ((stegdebug & DBG_CHI) &&
++ ((stegdebug & DBG_PRINTZERO) || f != 0))
+ fprintf(stdout, "%04d: %8.5f%% %8.5f%% %.2f %.2f %s\n",
+ i, f * 100, f2*100, sum, false,
+ (i <= jphpos[0] && f2*0.99 > f) ||
+@@ -876,7 +876,7 @@
+
+ sum /= 1000;
+
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout, "Accumulation (neg = %d, %d): %f%% [%d]\n",
+ negative, range, sum * 100, jphpos[1]);
+
+@@ -913,7 +913,7 @@
+ sum += f;
+ else if (f < 0.2)
+ break;
+- if ((debug & DBG_CHI) && f != 0)
++ if ((stegdebug & DBG_CHI) && f != 0)
+ fprintf(stdout, "%04d[:] %8.5f%%\n",
+ i, f * 100);
+ }
+@@ -939,12 +939,12 @@
+ else if (f < 0.2)
+ break;
+
+- if ((debug & DBG_CHI) &&
+- ((debug & DBG_PRINTZERO) || f != 0))
++ if ((stegdebug & DBG_CHI) &&
++ ((stegdebug & DBG_PRINTZERO) || f != 0))
+ fprintf(stdout, "%04d: %8.5f%%\n", i, f * 100);
+ }
+
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout, "Accumulation (%4.0f): %f%%\n",
+ percent,
+ sum * 100);
+@@ -1277,7 +1277,7 @@
+ if (jdcts != NULL)
+ free(jdcts);
+ scans = 0;
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout,
+ "Disabled by comment check: %d\n",
+ ncomments);
+@@ -1291,7 +1291,7 @@
+ if (jdcts != NULL)
+ free(jdcts);
+ scans = 0;
+- if (debug & DBG_ENDVAL)
++ if (stegdebug & DBG_ENDVAL)
+ fprintf(stdout,
+ "Disabled by header check: %d.%d %#0x\n",
+ major, minor, marker);
+@@ -1478,7 +1478,7 @@
+ fprintf(stdout, "Stegdetect Version %s\n", VERSION);
+ exit(1);
+ case 'd':
+- debug = atoi(optarg);
++ stegdebug = atoi(optarg);
+ break;
+ case 't':
+ scans = 0;
+@@ -1580,7 +1580,7 @@
+ detect(line, scans);
+ }
+
+- if (debug & FLAG_JPHIDESTAT) {
++ if (stegdebug & FLAG_JPHIDESTAT) {
+ fprintf(stdout, "Positive rejected because of\n"
+ "\tRunlength: %d\n"
+ "\tZero-One: %d\n"
Added: trunk/dports/security/stegdetect/files/rules.ini.sample
===================================================================
--- trunk/dports/security/stegdetect/files/rules.ini.sample (rev 0)
+++ trunk/dports/security/stegdetect/files/rules.ini.sample 2009-03-03 09:56:01 UTC (rev 47667)
@@ -0,0 +1,59 @@
+#
+# This file is part of John the Ripper password cracker,
+# Copyright (c) 1996-98 by Solar Designer
+#
+# Wordlist mode rules
+[List.Rules:Wordlist]
+# Try words as they are
+:
+# Lowercase every pure alphanumeric word
+-c >3!?XlQ
+# Capitalize every pure alphanumeric word
+-c >2(?a!?XcQ
+# Lowercase and pluralize pure alphabetic words
+<*>2!?Alp
+# Lowercase pure alphabetic words and append '1'
+<*>2!?Al$1
+# Capitalize pure alphabetic words and append '1'
+-c <*>2!?Ac$1
+# Duplicate reasonably short pure alphabetic words (fred -> fredfred)
+<7>1!?Ald
+# Lowercase and reverse pure alphabetic words
+>3!?AlMrQ
+# Prefix pure alphabetic words with '1'
+>2!?Al^1
+# Uppercase pure alphanumeric words
+-c >2!?XuQ
+# Lowercase pure alphabetic words and append a digit or simple punctuation
+<*>2!?Al$[2!37954860.?]
+# Words containing punctuation, which is then squeezed out, lowercase
+/?p@?p>3l
+# Words with vowels removed, lowercase
+/?v@?v>3l
+# Words containing whitespace, which is then squeezed out, lowercase
+/?w@?w>3l
+# Capitalize and duplicate short pure alphabetic words (fred -> FredFred)
+-c <7>1!?Acd
+# Capitalize and reverse pure alphabetic words (fred -> derF)
+-c <+>2!?Acr
+# Reverse and capitalize pure alphabetic words (fred -> Derf)
+-c >2!?AMrQc
+# Lowercase and reflect pure alphabetic words (fred -> fredderf)
+<7>1!?AlMrQrf
+# Uppercase the last letter of pure alphabetic words (fred -> freD)
+-c <+>2!?AMrQcr
+# Prefix pure alphabetic words with '2' or '4'
+>2!?Al^[24]
+# Capitalize pure alphabetic words and append a digit or simple punctuation
+-c <*>2!?Ac$[2!3957468.?0]
+# Prefix pure alphabetic words with digits
+>2!?Al^[379568]
+# Capitalize and pluralize pure alphabetic words of reasonable length
+-c <*>2!?Acp
+# Lowercase/capitalize pure alphabetic words of reasonable length and convert:
+# crack -> cracked, crack -> cracking
+<*>2!?Al[PI]
+-c <*>2!?Ac[PI]
+# Try the second half of split passwords
+-s x**
+-s-c x**MlQ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090303/395e9aed/attachment-0001.html>
More information about the macports-changes
mailing list