summaryrefslogtreecommitdiff
path: root/net-wireless/wepattack
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-wireless/wepattack
reinit the tree, so we can have metadata
Diffstat (limited to 'net-wireless/wepattack')
-rw-r--r--net-wireless/wepattack/Manifest8
-rw-r--r--net-wireless/wepattack/files/wepattack-0.1.3-filter-mac-address.patch186
-rw-r--r--net-wireless/wepattack/files/wepattack-0.1.3-missed-string.h-warnings-fix.patch30
-rw-r--r--net-wireless/wepattack/files/wepattack.conf9
-rw-r--r--net-wireless/wepattack/metadata.xml21
-rw-r--r--net-wireless/wepattack/wepattack-0.1.3-r3.ebuild56
6 files changed, 310 insertions, 0 deletions
diff --git a/net-wireless/wepattack/Manifest b/net-wireless/wepattack/Manifest
new file mode 100644
index 000000000000..1bac9705ca85
--- /dev/null
+++ b/net-wireless/wepattack/Manifest
@@ -0,0 +1,8 @@
+AUX wepattack-0.1.3-filter-mac-address.patch 6727 SHA256 4aa34e9c951f7e5fc174b56d00030c01fb6b4b722f4f62e615243985c160be9b SHA512 0715debb92ec4bed3dc882afe484a0582ad49b0c18fb83938bcae4bc69f8d384d58baa60bed581cb66d46f88c0d8c3a1d76ff629c8e203cc32f13ca760b9601a WHIRLPOOL 98868ab90a98c84ddbadb347c967a0544f86c1338790f04566dc244d9ca7591278d35aa2f732adef95346c44c3326363c6549e0139ff007a40769b60e455b44b
+AUX wepattack-0.1.3-missed-string.h-warnings-fix.patch 608 SHA256 3f990b0a102d5879d1b026c4ec684515e9ddeae63200bed9aa2c1fa9ec23b236 SHA512 30b92627c616a1e2d07300765d6b2e2b1e097e424820c21d98f814ff153ab87375e913deb9f2e60d61ddd64768865d35e3b5d73b2e700caf7fc85a3f484b719b WHIRLPOOL fde8f466532c73e66508b2f8881f5c662f76ac50f45010808a016fe586cd179ffdbec33498745e67529a9159a34bace5c20973e20614d7b745bc77547f86d80d
+AUX wepattack.conf 181 SHA256 5c9da1bbfc142a9aed060edf597183569f7a4f904f0d012eb3dfd4336b8b1f73 SHA512 51c056be0c8b77e0af5c3ca40ee38244c6d5b7c55be4ac1d6a0e0db721c4be7e1ef235588d27b124a2f281d626fc5904234fb4d2d2e344047582e600ae6037d7 WHIRLPOOL 8102c6e7a438c31bbf557bb3e75e9160867fa2e4ad8fbcbc9344d6ed81cf20ff1c70d6b79ff94527a20cdb668dfe827957e77a5ff91b5321bd5cd492716e42b7
+DIST WepAttack-0.1.3.tar.gz 25063 SHA256 4a251df5b68eb2724491470cddda699e8fabdfce3c4778a722fb9299e4dc21a2 SHA512 fe8d9843613fc29b7802f699311cb67fe3546a17a279ebc2e150cce155e726270dc937b1c941d9e9287b813febf171fe56053f6b010c4f2021e45e572f91fdf4 WHIRLPOOL fcbbf595fc35e3f6fcdbd8e5a5bc334d40e1603fd6c40bd008440617c092b80cf1d24189c5459145fc87b2e8b88c8b352ff6688546375e7b67118796dea5d920
+EBUILD wepattack-0.1.3-r3.ebuild 1139 SHA256 5600f429fdcc8f5b5be556536edba8ab59868f8dad4d89e67bd465b2df640956 SHA512 27d480523b0d9a8450213675bdd3fe7e2c4612ff8f751973270cef0e389432f229388dd15a3856341cea8dc7d91b8d71ef116ebe2e37cc7a8876787e36059510 WHIRLPOOL 9526ec98214127d43ae715151a8c11790fcc39498bc34f24090c6c7003857be0e623acfe1d12e3317625b6fccd589fc919cba248aed81a064b42e80cad43b85c
+MISC ChangeLog 2578 SHA256 5e2bc7e45d587ee8e04f88ecc8acbf238c5adff2fd6cdad095c46f6b5d8e4bed SHA512 9ca7b89baa1b53cf26cd63c9da793f98728f720b311b47834e0a6d06ee01d02b713bc47984672de85c0a8938a8205fdbf4dfe3c4383e599b8a976ba2662b52a4 WHIRLPOOL 0432e0b2e4a840d1aa5a3bb9e8884647e1ca03e0b3b2b5efb4c2fa7b57e9e96dbfee14948b7578b9d3c7b4aa86da5cb7fe6554f6c7bd6a6479d36f0f4527a993
+MISC ChangeLog-2015 2934 SHA256 56f29d6a5facc0cae290597a616de7e8251690be9162f8f4f656f28d7ab3068c SHA512 0354b68b3110f1cc66a92ff9a3b1a4244e6a2e93147109d492a372113fe9c9b37fa29aa405e9e8bb8bbb276e79a39d0b2b6c07d0f7d80812749688da0c5328e5 WHIRLPOOL 1afd48b4d40ef08ec87fe715bea8ece4c85693d05dd0aad48ca5a62458617827fd08eecbbc40376367f1102039e1a9dc380c8723d3e2273a4b947a88a3622ada
+MISC metadata.xml 738 SHA256 05613e2f4cc95da15b02b31fb72987a86a5762bf5ff134250b1ad7ea9cbb6776 SHA512 5b2f7f73769ca63b32574a04ce6031ae4d664d65c23aea972aec5cafcbd8602a4cb3cddab078c75c6645c3bbf12f0b658916295834c7dfcddd9b2fac3c5649f9 WHIRLPOOL 179c432726dae1edb52ab9793eb601ba87cc831fca31a722a016d618a157e4a860ff49bc620da6473a0c5f1997c8c8d6fec05705e3679b9de8ca49b8fd02e866
diff --git a/net-wireless/wepattack/files/wepattack-0.1.3-filter-mac-address.patch b/net-wireless/wepattack/files/wepattack-0.1.3-filter-mac-address.patch
new file mode 100644
index 000000000000..63ba5f3473bb
--- /dev/null
+++ b/net-wireless/wepattack/files/wepattack-0.1.3-filter-mac-address.patch
@@ -0,0 +1,186 @@
+--- a/src/config.h
++++ b/src/config.h
+@@ -37,7 +37,7 @@
+ #define WEPKEYSTORE (WEPKEYSIZE * WEPKEYS)
+
+ #define DEBUG 0
+-#define VERSION "0.1.3"
++#define VERSION "0.1.3 (Gentoo patched)"
+
+
+ #endif
+--- a/src/log.c
++++ b/src/log.c
+@@ -73,7 +73,7 @@
+ fprintf(fp, "Cracking started: %s", ctime(&start_time));
+ fprintf(fp, "%s\t%s\n", word, in);
+
+- fprintf(fp, "\nBssid\tKeyNo\tWepKey\tASCII\tEncryption\tElapsed Time");
++ fprintf(fp, "\nBssid\t\t\tKeyNo\tWepKey\t\tASCII\tEncryption\tElapsed Time");
+ fclose(fp);
+ }
+
+@@ -120,7 +120,7 @@
+ fprintf(fp, "\n");
+ print_hex_array(fp, list->frame.bssid, 6);
+ fprintf(fp, "\t%d", list->frame.key);
+- fprintf(fp, "\tnot cracked\t\t%d sec",
++ fprintf(fp, "\tnot cracked\t\t\t\t%d sec",
+ (int)difftime(now, start_time));
+ }
+ list = list->next;
+--- a/src/misc.c
++++ b/src/misc.c
+@@ -40,10 +40,11 @@
+ fprintf(stdout,"WEPATTACK by Dominik Blunk and Alain ");
+ fprintf(stdout,"Girardet - Version %s\n", VERSION);
+ fprintf(stdout,"\nusage: wepattack -f dumpfile [-w wordfile]");
+- fprintf(stdout, " [-m mode] [-n network]\n");
++ fprintf(stdout, " [-m mode] [-b mac_address] [-n network]\n");
+ fprintf(stdout,"-f dumpfile \tnetwork dumpfile to read\n");
+ fprintf(stdout,"\t\t(in PCAP format as TCPDUMP or ETHEREAL uses)\n");
+ fprintf(stdout,"-w wordlist \twordlist to use (default: stdin)\n");
++ fprintf(stdout,"-b mac_address \tfilter the mac address from the dump file\n");
+ fprintf(stdout,"-m mode \trun wepattack in diffente modes (default: all)\n");
+ fprintf(stdout,"\t\tvalues: 64, 128, n64, n128\n");
+ fprintf(stdout,"-n network \tnetwork number to attack\n");
+--- a/src/wepattack.c
++++ b/src/wepattack.c
+@@ -4,6 +4,8 @@
+ * Author: Alain Girardet/Dominik Blunk
+ * Last Modified: 2002-10-24
+ *
++* Send me any suggestions about the patch to kirano_1@hotmail.com
++*
+ * Description: Read guessed passwords from stdin and applies RC4
+ * on sniffed encrypted 802.11 DATA packets
+ *
+@@ -57,6 +59,11 @@
+ // default mode (all modes sequential)
+ static unsigned char use_modes = 0x01;
+
++// to check bssid
++char* BSSID=NULL;
++wlan_packet_list* bssids_list=NULL;
++int is_bssid_set = 0;
++
+ void clean_up();
+
+ //
+@@ -64,7 +71,11 @@
+ //
+ void load_packets(char *infile, int network) {
+
+- int network_count = 0;
++ int network_count = 0;
++ wlan_packet_list* aux;
++ wlan_packet_list* aux_2;
++ wlan_packet_list* aux3;
++ char bssid_aux[18],bssid_aux2[13],bssid_aux3[18],bssid_aux4[13];
+
+ // load networks from file
+ list_packet_to_crack = get_packets(infile);
+@@ -77,17 +88,57 @@
+
+ current_packet = list_packet_to_crack;
+
+- // list all available networks
+- printf("\n\nFounded BSSID:");
+- while (current_packet->next != NULL) {
+- network_count++;
+- printf("\n%d) ", network_count);
+- print_hex_array(stdout, current_packet->frame.bssid, 6);
+- printf("/ Key %d", current_packet->frame.key);
+- current_packet = current_packet->next;
++ //Make another list with provided bssid
++ if (is_bssid_set){
++ for (aux=current_packet; aux!=NULL;aux=aux->next){
++ sprintf(bssid_aux,"%.2X:%.2X:%.2X:%.2X:%.2X:%.2X",aux->frame.bssid[0],aux->frame.bssid[1],aux->frame.bssid[2],aux->frame.bssid[3],aux->frame.bssid[4],aux->frame.bssid[5]);
++ sprintf(bssid_aux2,"%.2X%.2X%.2X%.2X%.2X%.2X",aux->frame.bssid[0],aux->frame.bssid[1],aux->frame.bssid[2],aux->frame.bssid[3],aux->frame.bssid[4],aux->frame.bssid[5]);
++ sprintf(bssid_aux3,"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x",aux->frame.bssid[0],aux->frame.bssid[1],aux->frame.bssid[2],aux->frame.bssid[3],aux->frame.bssid[4],aux->frame.bssid[5]);
++ sprintf(bssid_aux4,"%.2x%.2x%.2x%.2x%.2x%.2x",aux->frame.bssid[0],aux->frame.bssid[1],aux->frame.bssid[2],aux->frame.bssid[3],aux->frame.bssid[4],aux->frame.bssid[5]);
++ if ((strncmp(bssid_aux,BSSID,17) == 0) || (strncmp(bssid_aux2,BSSID,12) == 0) || (strncmp(bssid_aux3,BSSID,17) == 0) || (strncmp(bssid_aux4,BSSID,12) == 0)){
++ aux_2 = malloc(sizeof(wlan_packet_list));
++ memcpy(&aux_2->frame.frameControl, aux->frame.frameControl, 2);
++ memcpy(&aux_2->frame.duration, aux->frame.duration, 2);
++ memcpy(&aux_2->frame.srcAddress, aux->frame.srcAddress, 6);
++ memcpy(&aux_2->frame.dstAddress, aux->frame.dstAddress, 6);
++ memcpy(&aux_2->frame.bssid, aux->frame.bssid, 6);
++ if(aux->frame.address4 > 0) {
++ memcpy(&aux_2->frame.address4, aux->frame.address4, 6);
++ }
++ memcpy(&aux_2->frame.sequenceControl, aux->frame.sequenceControl, 2);
++ memcpy(&aux_2->frame.iv, &aux->frame.iv, 3);
++ aux_2->frame.key=aux->frame.key;
++ memcpy(&aux_2->frame.payload, aux->frame.payload, (aux->framesize)- (aux->frame.limits_payload));
++ if (bssids_list == NULL){
++ aux3 = malloc(sizeof(wlan_packet_list));
++ aux3->next = NULL;
++ bssids_list = aux3;
++ }
++ aux_2->framesize = aux->framesize;
++ aux_2->next = bssids_list;
++ bssids_list = aux_2;
++ }
++ }
++ if (bssids_list != NULL){
++ //we must free the old list
++ delete_list(list_packet_to_crack);
++ list_packet_to_crack = bssids_list;
++ current_packet = list_packet_to_crack;
++ }
++ else printf("\n\nProvided BSSID not found. Cracking all networks");
+ }
++
++ // list all available networks
++ printf("\n\nFounded BSSID:");
++ while (current_packet->next != NULL) {
++ network_count++;
++ printf("\n%d) ", network_count);
++ print_hex_array(stdout, current_packet->frame.bssid, 6);
++ printf("/ Key %d", current_packet->frame.key);
++ current_packet = current_packet->next;
++ }
+
+- if (network > network_count)
++ if (network >= network_count)
+ network = 0;
+
+ // if only one should be attacked, remove the others from the list
+@@ -220,11 +272,15 @@
+
+ // process command line options
+ // program will terminate, if invalid options are passed
+- while((op = getopt(argc, argv, "n:m:f:w:?")) != -1) {
++ while((op = getopt(argc, argv, "n:b:m:f:w:?")) != -1) {
+ switch(op) {
+ case 'n':
+ network_arg = atoi(optarg);
+ break;
++ case 'b':
++ BSSID = optarg;
++ is_bssid_set = 1;
++ break;
+ // arg for packet file to read from
+ case 'f':
+ packet_file = optarg;
+--- a/src/wepattack.h
++++ b/src/wepattack.h
+@@ -38,6 +38,7 @@
+ unsigned char iv[3];
+ unsigned char key;
+ unsigned char payload[2400];
++ int limits_payload;
+ };
+
+ /*
+--- a/src/wepfilter.c
++++ b/src/wepfilter.c
+@@ -104,6 +103,7 @@
+ memcpy(&newframe->frame.key, data+limits.key, 1);
+ newframe->frame.key = newframe->frame.key >> 6;
+ memcpy(&newframe->frame.payload, data+limits.payload, length-limits.payload);
++ newframe->frame.limits_payload = limits.payload;
+ newframe->framesize = length;
+ newframe->next = *head;
+ *head = newframe;
diff --git a/net-wireless/wepattack/files/wepattack-0.1.3-missed-string.h-warnings-fix.patch b/net-wireless/wepattack/files/wepattack-0.1.3-missed-string.h-warnings-fix.patch
new file mode 100644
index 000000000000..b46220d0eff5
--- /dev/null
+++ b/net-wireless/wepattack/files/wepattack-0.1.3-missed-string.h-warnings-fix.patch
@@ -0,0 +1,30 @@
+--- a/src/modes.c
++++ b/src/modes.c
+@@ -20,6 +20,7 @@
+
+ #include <sys/types.h>
+ #include <stdio.h>
++#include <string.h>
+ #include "modes.h"
+ #include "rc4.h"
+ #include "wlan/wlan_compat.h"
+--- a/src/wepattack.c
++++ b/src/wepattack.c
+@@ -32,6 +32,7 @@
+ #include <zlib.h>
+ #include <math.h>
+ #include <signal.h>
++#include <string.h>
+ #include "wepattack.h"
+ #include "wepfilter.h"
+ #include "log.h"
+--- a/src/verify.c
++++ b/src/verify.c
+@@ -19,6 +19,7 @@
+
+ #include <stdio.h>
+ #include <zlib.h>
++#include <string.h> /* memcmp() */
+
+ int verify_crc32(unsigned char *data, int length, unsigned long* crc) {
+
diff --git a/net-wireless/wepattack/files/wepattack.conf b/net-wireless/wepattack/files/wepattack.conf
new file mode 100644
index 000000000000..2eb627da06c5
--- /dev/null
+++ b/net-wireless/wepattack/files/wepattack.conf
@@ -0,0 +1,9 @@
+# /etc/wepattack.conf
+#
+# Configuration for WEPATTACK
+# Dominik Blunk and Alain Girardet and Christoph Brill
+# 08-06-2005
+#
+
+JOHNDIR=/usr/sbin
+WORDLIST=/usr/share/john/password.lst
diff --git a/net-wireless/wepattack/metadata.xml b/net-wireless/wepattack/metadata.xml
new file mode 100644
index 000000000000..d4ecb8c9e379
--- /dev/null
+++ b/net-wireless/wepattack/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>netmon@gentoo.org</email>
+ <name>Gentoo network monitoring and analysis project</name>
+ </maintainer>
+ <longdescription lang="en">
+ WepAttack is a WLAN open source Linux tool for breaking 802.11 WEP keys.
+ This tool is based on an active dictionary attack that tests millions of
+ words to find the right key. Only one packet is required to start an
+ attack.
+ </longdescription>
+ <use>
+ <flag name="john">Build with <pkg>app-crypt/johntheripper</pkg>
+ support</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">wepattack</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/net-wireless/wepattack/wepattack-0.1.3-r3.ebuild b/net-wireless/wepattack/wepattack-0.1.3-r3.ebuild
new file mode 100644
index 000000000000..a10ba9a107d9
--- /dev/null
+++ b/net-wireless/wepattack/wepattack-0.1.3-r3.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils toolchain-funcs
+
+MY_P="WepAttack-${PV}"
+DESCRIPTION="WLAN tool for breaking 802.11 WEP keys"
+HOMEPAGE="http://wepattack.sourceforge.net/"
+SRC_URI="mirror://sourceforge/wepattack/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 x86"
+IUSE="john"
+
+DEPEND="
+ dev-libs/openssl
+ net-libs/libpcap
+ sys-libs/zlib
+"
+
+RDEPEND="${DEPEND}
+ john? ( app-crypt/johntheripper )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-filter-mac-address.patch
+ epatch "${FILESDIR}"/${P}-missed-string.h-warnings-fix.patch
+ chmod +x src/wlan
+ sed -i \
+ -e "/^CFLAGS=/s:=:=${CFLAGS} :" \
+ -e 's:-fno-for-scope::g' \
+ -e "/^CC=/s:gcc:$(tc-getCC):" \
+ -e "/^LD=/s:gcc:$(tc-getCC):" \
+ -e 's:log.o\\:log.o \\:' \
+ src/Makefile || die
+ sed -i \
+ -e "s/wordfile:/-wordlist=/" \
+ run/wepattack_word || die
+}
+
+src_compile() {
+ emake -C src
+}
+
+src_install() {
+ dobin src/wepattack
+ if use john; then
+ dosbin run/wepattack_{inc,word}
+ insinto /etc
+ doins "${FILESDIR}"/wepattack.conf
+ fi
+ dodoc README
+}