Index: head/security/fcrackzip/Makefile =================================================================== --- head/security/fcrackzip/Makefile (revision 388849) +++ head/security/fcrackzip/Makefile (revision 388850) @@ -1,29 +1,31 @@ # Created by: Stefan Walter # $FreeBSD$ PORTNAME= fcrackzip PORTVERSION= 1.0 PORTREVISION= 1 CATEGORIES= security archivers MASTER_SITES= http://oldhome.schmorp.de/data/marc/ \ http://distfiles.macports.org/${PORTNAME}/ -MAINTAINER= stefan@FreeBSD.org +MAINTAINER= bofh@FreeBSD.org COMMENT= Portable, fast, and featureful ZIP password cracker + +LICENSE= GPLv2 GNU_CONFIGURE= yes USES= perl5 USE_PERL5= build PLIST_FILES= bin/fcrackzip bin/fcrackzipinfo man/man1/fcrackzip.1.gz post-patch: @${REINPLACE_CMD} -e 's/zipinfo/fcrackzipinfo/g' ${WRKSRC}/zipinfo.c do-install: ${INSTALL_PROGRAM} ${WRKSRC}/fcrackzip ${STAGEDIR}${PREFIX}/bin ${INSTALL_PROGRAM} ${WRKSRC}/zipinfo \ ${STAGEDIR}${PREFIX}/bin/fcrackzipinfo ${INSTALL_MAN} ${WRKSRC}/fcrackzip.1 ${STAGEDIR}${MANPREFIX}/man/man1 .include Index: head/security/fcrackzip/files/patch-crack.h =================================================================== --- head/security/fcrackzip/files/patch-crack.h (revision 388849) +++ head/security/fcrackzip/files/patch-crack.h (revision 388850) @@ -1,10 +1,10 @@ ---- crack.h.orig Tue Mar 20 21:56:11 2007 -+++ crack.h Tue Mar 20 21:56:20 2007 -@@ -24,7 +24,6 @@ +--- crack.h.orig 2000-06-18 23:19:07 UTC ++++ crack.h +@@ -24,7 +24,6 @@ extern u8 bf_next[256]; extern u8 bf_last; extern int verbosity; -extern int use_unzip; #define FILE_SIZE 12 #define CRC_SIZE 2 Index: head/security/fcrackzip/files/patch-main.c =================================================================== --- head/security/fcrackzip/files/patch-main.c (revision 388849) +++ head/security/fcrackzip/files/patch-main.c (revision 388850) @@ -1,116 +1,116 @@ ---- main.c.orig 2005-09-10 21:58:44.000000000 +0200 -+++ main.c 2011-05-17 21:59:32.000000000 +0200 -@@ -44,13 +44,112 @@ +--- main.c.orig 2005-09-10 19:58:44 UTC ++++ main.c +@@ -44,13 +44,112 @@ static int modul = 1; static FILE *dict_file; +char * +path_for_shell (char *dest, const char *str) +{ + /* backslash shell special charatcers */ + + char ch, *p = dest; + size_t len = strlen(str); + int i; + + for (i = 0; i < len; i++) + { + ch = str[i]; + + switch (ch) + { + /* ASCII table order */ + case 0x20: /* space */ + case '!': + case '"': + case '#': + case '$': + case '&': + case 0x27: /* single quote */ + case '(': + case ')': + case '*': + case '+': + case 0x2C: /* comma */ + case ':': + case ';': + case '<': + case '>': + case '?': + case '[': + case '\\': + case ']': + case '^': + case '`': + case '{': + case '|': + case '}': + case '~': + /* backslash special characters */ + *p++ = '\\'; + *p++ = ch; + break; + default: + *p++ = ch; + } + } + + /* terminate string */ + *p = '\0'; + + return dest; +} + +char * +escape_pw (char *dest, const char *str) +{ + /* backslash shell special charatcers */ + + char ch, *p = dest; + size_t len = strlen(str); + int i; + + for (i = 0; i < len; i++) + { + ch = str[i]; + + switch (ch) + { + /* ASCII table order */ + case '"': + case '$': + case 0x27: /* single quote */ + case '\\': + case '`': + /* backslash special characters */ + *p++ = '\\'; + *p++ = ch; + break; + default: + *p++ = ch; + } + } + + /* terminate string */ + *p = '\0'; + + return dest; +} + int REGPARAM check_unzip (const char *pw) { char buff[1024]; + char path[1024]; + char escpw[256]; int status; - sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, pw, file_path[0]); + escape_pw (escpw, pw); + path_for_shell (path, file_path[0]); + + sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, escpw, path); + status = system (buff); #undef REDIR Index: head/security/fcrackzip/pkg-descr =================================================================== --- head/security/fcrackzip/pkg-descr (revision 388849) +++ head/security/fcrackzip/pkg-descr (revision 388850) @@ -1,6 +1,6 @@ Fcrackzip is a fast and featureful ZIP password cracker, written in portable C (and optional x86 assembly). It allows the user to recover forgotten ZIP archive passwords, using either a brute force or dictionary attack on the provided files. -WWW: http://home.schmorp.de/marc/fcrackzip.html +WWW: http://home.schmorp.de/marc/fcrackzip.html