[Forensics-changes] [fcrackzip] 02/93: Imported Debian patch 0.3-2

Giovani Augusto Ferreira giovani-guest at moszumanska.debian.org
Wed Dec 28 03:06:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

giovani-guest pushed a commit to branch debian
in repository fcrackzip.

commit 72a5a956bf8b921532eb44d3f8841a1f004cc585
Author: Francesco Donadon <francesco.donadon at katamail.com>
Date:   Sat Dec 18 20:46:52 2004 +0100

    Imported Debian patch 0.3-2
---
 debian/changelog       |  19 +++++++++
 debian/compat          |   1 +
 debian/control         |  20 +++++++++
 debian/copyright       |  15 +++++++
 debian/docs            |   3 ++
 debian/fcrackzipinfo.1 |  44 +++++++++++++++++++
 debian/rules           | 112 +++++++++++++++++++++++++++++++++++++++++++++++++
 main.c                 |  30 ++++++++++---
 8 files changed, 238 insertions(+), 6 deletions(-)

diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..3a82df7
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,19 @@
+fcrackzip (0.3-2) unstable; urgency=low
+
+  * Added project homepage in long description and fixed a typo.
+  * Added patch from Andreas Jochens to build fcrackzip on AMD64.
+    Thanks Andreas! (Closes: #285915)
+  * Correctly escapes special chars when calling unzip to test
+    passwords. (Closes: #283997)
+  * Let return value of "1" mean good password. (Closes: #258665)
+  * Useless debhelper commands removed from debian/rules.
+  * Sponsored by Emanuele Rocca <ema at debian.org>.
+
+ -- Francesco Donadon <francesco.donadon at katamail.com>  Sat, 18 Dec 2004 20:46:52 +0100
+
+fcrackzip (0.3-1) unstable; urgency=low
+
+  * Initial Release (Closes: #239653).
+
+ -- Francesco Donadon <francesco.donadon at katamail.com>  Sat, 10 Apr 2004 16:06:44 +0200
+
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..b8626c4
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+4
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..c0b094a
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,20 @@
+Source: fcrackzip
+Section: utils
+Priority: optional
+Maintainer: Francesco Donadon <francesco.donadon at katamail.com>
+Build-Depends: debhelper (>= 4.0.0), autotools-dev (>= 20040822.1)
+Standards-Version: 3.6.1
+
+Package: fcrackzip
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Suggests: unzip, wordlist
+Description: password cracker for zip archives
+ fcrackzip is a fast password cracker partly written in assembler.
+ It is able to crack password protected zip files with brute
+ force or dictionary based attacks, optionally testing with
+ unzip its results.
+ .
+ It can also crack cpmask'ed images.
+ .
+ Homepage: http://www.goof.com/pcg/marc/fcrackzip.html
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..3aaf59a
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,15 @@
+This package was debianized by Francesco Donadon <francesco.donadon at katamail.com> on
+Sat, 20 Mar 2004 14:09:22 +0100.
+
+It was downloaded from http://www.goof.com/pcg/marc/fcrackzip.html
+
+Upstream Author: Marc Lehmann <pcg at goof.com>
+
+Copyright:
+(c) Marc Lehmann <pcg at goof.com>
+
+License:
+You are free to distribute this software under the terms of
+the GNU General Public License.
+On Debian systems, the complete text of the GNU General Public
+License can be found in the file `/usr/share/common-licenses/GPL'.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..8bd83f3
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,3 @@
+README
+AUTHORS
+fcrackzip.html
diff --git a/debian/fcrackzipinfo.1 b/debian/fcrackzipinfo.1
new file mode 100644
index 0000000..3142682
--- /dev/null
+++ b/debian/fcrackzipinfo.1
@@ -0,0 +1,44 @@
+.\"                                      Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH FCRACKZIPINFO 1 "tell me about a zip file"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh        disable hyphenation
+.\" .hy        enable hyphenation
+.\" .ad l      left justify
+.\" .ad b      justify to both left and right margins
+.\" .nf        disable filling
+.\" .fi        enable filling
+.\" .br        insert ltell me about a zip fileine break
+.\" .sp <n>    insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+fcrackzipinfo \- tell me about a zip file
+.SH SYNOPSIS
+.B fcrackzipinfo
+.RI " files" ...
+.SH DESCRIPTION
+This manual page documents briefly the
+.B fcrackzipinfo
+command.
+This manual page was written for the Debian distribution
+because the original program does not have a manual page.
+.PP
+.\" TeX users may be more comfortable with the \fB<whatever>\fP and
+.\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+.\" respectively.
+\fBfcrackzipinfo\fP is a program that displays various info from the file(s)
+passed as arguments.
+.SH OPTIONS
+.TP
+.B \-\-help
+Show summary of options.
+.SH SEE ALSO
+.BR fcrackzip (1)
+.br
+.SH AUTHOR
+This manual page was written by Francesco Donadon <francesco.donadon at katamail.com>,
+for the Debian project (but may be used by others).
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..fac92ec
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,112 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+export DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+export DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+
+CFLAGS = -Wall -g
+
+# We don't need these because of the program's optimization is hard-coded
+# 
+#ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+#	CFLAGS += -O0
+#else
+#	CFLAGS += -O2
+#endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+  confflags += --build $(DEB_HOST_GNU_TYPE)
+else
+  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+endif
+
+config.status: configure autotools
+	dh_testdir
+	# Add here commands to configure the package.
+	CFLAGS="$(CFLAGS)" ./configure $(confflags) \
+	--prefix=/usr \
+	--mandir=\$${prefix}/share/man
+
+autotools:
+	-rm -f config.sub config.guess
+	ln -s /usr/share/misc/config.sub
+	ln -s /usr/share/misc/config.guess
+
+build: build-stamp
+
+build-stamp:  config.status
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+	#/usr/bin/docbook-to-man debian/fcrackzip.sgml > fcrackzip.1
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp 
+
+	# Add here commands to clean up after the build process.
+	-$(MAKE) distclean
+#We do not want config.* to be copied, instead we'll just create
+#symbolic links to them
+#ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+#	cp -f /usr/share/misc/config.sub config.sub
+#endif
+#ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+#	cp -f /usr/share/misc/config.guess config.guess
+#endif
+	-rm -f config.sub config.guess
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+	# Add here commands to install the package into debian/fcrackzip.
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/fcrackzip
+	#
+	#As a program called zipinfo is already present in the "unzip" package,
+	#we'll rename our own in fcrackzipinfo
+	mv debian/fcrackzip/usr/bin/zipinfo debian/fcrackzip/usr/bin/fcrackzipinfo
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs NEWS
+	dh_installdocs
+	dh_installexamples noradi.zip
+	dh_installman debian/fcrackzipinfo.1
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install autotools
diff --git a/main.c b/main.c
index 509fb60..3c25f15 100644
--- a/main.c
+++ b/main.c
@@ -23,6 +23,7 @@ typedef enum { FALSE = 0, TRUE = 1 } bool;
 #endif
 #endif
 
+#include <sys/wait.h>
 #include <string.h>
 
 #ifdef USE_UNIX_REDIRECTION
@@ -33,7 +34,7 @@ typedef enum { FALSE = 0, TRUE = 1 } bool;
 
 #include "crack.h"
 
-static int use_unzip;
+int use_unzip;
 static method *crack_method = methods;
 static int method_number = -1;
 static int min_length = -1;
@@ -48,13 +49,30 @@ check_unzip (const char *pw)
 {
   char buff[1024];
   int status;
-
-  sprintf (buff, "unzip -qqtP \"%s\" %s " DEVNULL, pw, file_path[0]);
+  
+  /* shell special char patch, to be changed with something quicker */
+  char patched_pw[1004];
+
+  int count = strlen(pw), i, j = 0;
+  for (i = 0; i < count; i++){
+    if ((pw[i] == '!') || (pw[i] == '$') || (pw[i] == '&') || (pw[i] == '(') || (pw[i] == ')') || (pw[i] == '#') || (pw[i] == ' ')) {
+      patched_pw[j] = '\\';
+      j++;
+    }
+    patched_pw[j] = pw[i];
+    j++;
+  }
+  patched_pw[j] = '\0';
+  
+  sprintf (buff, "unzip -qqtP %s %s " DEVNULL, patched_pw, file_path[0]);
+  
   status = system (buff);
-
+  
 #undef REDIR
-
-  if (status == EXIT_SUCCESS)
+/* In case of "stored" items, unzip returns 1. 
+ * In case of wrong password, the returned value is 122.
+ */
+  if ((status == EXIT_SUCCESS) || (WEXITSTATUS(status) == 1))
     {
       printf("\n\nPASSWORD FOUND!!!!: pw == %s\n", pw);
       exit (EXIT_SUCCESS);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/fcrackzip.git



More information about the forensics-changes mailing list