Skip to contentSkip to conversation

cowpatty: new package

PATCH New Guillaume W. Bres 2 participants 2 messages Apr 13, 2018 – Apr 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cowpatty: new package

CowPatty is a C based tool to identify weak WPA passphrases contained in a pcap file.

Use the github.com/gwbres/cowpatty fork at the moment because Makefile in the mainstream is faulty. (-lssl flag is missing and some recipes had to be reordered).
I will have the buildroot configuration eventually point to the original mainstrean as soon as Makefile is corrected.

The package is easy to build, it requires the -lssl -lpcap and -lcrypto flags. Build tests passed for the 7 default toolchains with a simple config snippet made of "BR2_PACKAGE_COWPATTY=y". But please double check the proposed dependencies & package selections.
I set the package to select libpcap & libopenssl at the moment.

Tested & used on RPI 1 & 3 here:

/usr/bin/cowpatty -r eap-test.dump -f dict -s somethingclever [...]
1079 passphrases tested in 97.18 seconds: 11.10 passphrases/second

I put the package in network apps. but this is more of a util. tool than anything, so you might want to change that to.

---
 DEVELOPERS                     |  1 +
 package/Config.in              |  1 +
 package/cowpatty/Config.in     |  9 +++++++++
 package/cowpatty/cowpatty.hash |  3 +++
 package/cowpatty/cowpatty.mk   | 24 ++++++++++++++++++++++++
 5 files changed, 38 insertions(+)
 create mode 100644 package/cowpatty/Config.in
 create mode 100644 package/cowpatty/cowpatty.hash
 create mode 100644 package/cowpatty/cowpatty.mk
DEVELOPERS +1 -0
index 05693d3..560494b 100644
@@ -793,6 +793,7 @@ F:	package/c-icap-modules/
 F:	package/sdl2/
 
 N:	Guillaume William Brs <[email protected]>
+F:	package/cowpatty/
 F:	package/liquid-dsp/
 F:	package/pixiewps/
 F:	package/reaver/
package/Config.in +1 -0
index ddbbcff..162280f 100644
@@ -1683,6 +1683,7 @@ menu "Networking applications"
 	source "package/connman/Config.in"
 	source "package/connman-gtk/Config.in"
 	source "package/conntrack-tools/Config.in"
+	source "package/cowpatty/Config.in"
 	source "package/crda/Config.in"
 	source "package/ctorrent/Config.in"
 	source "package/cups/Config.in"
package/cowpatty/Config.in new file +9 -0
new file mode 100644
index 0000000..7fb6814
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_COWPATTY
+	bool "cowpatty"
+	select BR2_PACKAGE_LIBPCAP
+	select BR2_PACKAGE_OPENSSL
+	help
+	  CowPatty is a C based tool to identify
+	  weak WPA passphrases.
+
+	  https://wifinetnews.com/archives/2003/11/weakness_in_passphrase_choice_in_wpa_interface.html
package/cowpatty/cowpatty.hash new file +3 -0
new file mode 100644
index 0000000..0725c11
@@ -0,0 +1,3 @@
+# locally computed
+sha256 131d5285fa64c072b80f87a5be5914828fc2c2816157d6dc40b8749ba02d69fa cowpatty-83fd1589c142676d26cabe1d56e9ff8bb288683a.tar.gz
+sha256 dcc100d4161cc0b7177545ab6e47216f84857cda3843847c792a25289852dcaa COPYING
package/cowpatty/cowpatty.mk new file +24 -0
new file mode 100644
index 0000000..8c7ec23
@@ -0,0 +1,24 @@
+################################################################################
+#
+# cowpatty
+#
+################################################################################
+
+COWPATTY_VERSION = 83fd1589c142676d26cabe1d56e9ff8bb288683a
+COWPATTY_SITE = $(call github,gwbres,cowpatty,$(COWPATTY_VERSION))
+COWPATTY_LICENSE = GPL-2.0+
+COWPATTY_LICENSE_FILES = COPYING
+
+COWPATTY_DEPENDENCIES = libpcap
+COWPATTY_DEPENDENCIES += libopenssl
+
+define COWPATTY_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) CC=$(TARGET_CC) -C $(@D)
+endef
+
+define COWPATTY_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) DESTDIR=$(TARGET_DIR) \
+		PREFIX=/usr -C $(@D) install
+endef
+
+$(eval $(generic-package))
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 cowpatty: new package

Hello Guillaume,

Quoted 5 lines · Guillaume W. Bres

CowPatty is a C based tool to identify weak WPA passphrases contained in a pcap file.

Use the github.com/gwbres/cowpatty fork at the moment because Makefile in the mainstream is faulty. (-lssl flag is missing and some recipes had to be reordered).

Please use the original upstream, and add some patches (generated with git format-patch) in package/cowpatty/ to fix the problems. Ideally, those patches should be submitted to the upstream project.

Quoted 2 lines

I will have the buildroot configuration eventually point to the original mainstrean as soon as Makefile is corrected.

Please don't use "I" in commit logs, but rather a formulation like: "Due to <foo>, we chose to use ..."

Also, please wrap your commit logs to 72 characters.

Quoted 4 lines

The package is easy to build, it requires the -lssl -lpcap and -lcrypto flags. Build tests passed for the 7 default toolchains with a simple config snippet made of "BR2_PACKAGE_COWPATTY=y". But please double check the proposed dependencies & package selections.

Messages such as "please double check the proposed ..." should not be part of the commit log.

Quoted 1 line

I set the package to select libpcap & libopenssl at the moment.

Ditto.

Quoted 8 lines

Tested & used on RPI 1 & 3 here:

/usr/bin/cowpatty -r eap-test.dump -f dict -s somethingclever [...]
1079 passphrases tested in 97.18 seconds: 11.10 passphrases/second

I put the package in network apps. but this is more of a util. tool than anything, so you might want to change that to.

Don't use "I" as well here.

May I suggest that you read the commit logs from other contributors, to see how they are typically written, and that you take inspiration from this ?

Quoted 6 lines
package/cowpatty/cowpatty.mk new file +0 -0
new file mode 100644
index 0000000..8c7ec23

package/cowpatty/cowpatty.mk line 9

Quoted 9 lines
package/cowpatty/cowpatty.mk new file +9 -0
@@ -0,0 +1,24 @@
+################################################################################
+#
+# cowpatty
+#
+################################################################################
+
+COWPATTY_VERSION = 83fd1589c142676d26cabe1d56e9ff8bb288683a
+COWPATTY_SITE = $(call github,gwbres,cowpatty,$(COWPATTY_VERSION))
+COWPATTY_LICENSE = GPL-2.0+

The license seems to be GPL-2.0, not GPL-2.0+. Do you see any evidence that it is "version 2 or later" ?

package/cowpatty/cowpatty.mk line 13

Quoted 4 lines
package/cowpatty/cowpatty.mk new file +4 -0
+COWPATTY_LICENSE_FILES = COPYING
+
+COWPATTY_DEPENDENCIES = libpcap
+COWPATTY_DEPENDENCIES += libopenssl

Just one line is enough.

Did you verify static linking with libpcap + libnl enabled ? It might very well fail like it did for the "reaver" package.

package/cowpatty/cowpatty.mk line 16

Quoted 3 lines
package/cowpatty/cowpatty.mk new file +3 -0
+
+define COWPATTY_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) CC=$(TARGET_CC) -C $(@D)

Please try to use $(TARGET_CONFIGURE_OPTS) instead of CC=$(TARGET_CC).

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com