diff options
author | Mike Frysinger <vapier@gentoo.org> | 2004-04-25 21:26:23 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2004-04-25 21:26:23 +0000 |
commit | 7597caa61aa58d845548c1e811dcaba43cee4bc1 (patch) | |
tree | 1811d859eff56720bd5b561412d3d2cfb8a6b1e3 /net-wireless/wepattack | |
parent | add inherit eutils (diff) | |
download | gentoo-2-7597caa61aa58d845548c1e811dcaba43cee4bc1.tar.gz gentoo-2-7597caa61aa58d845548c1e811dcaba43cee4bc1.tar.bz2 gentoo-2-7597caa61aa58d845548c1e811dcaba43cee4bc1.zip |
ver bump #47980
Diffstat (limited to 'net-wireless/wepattack')
-rw-r--r-- | net-wireless/wepattack/ChangeLog | 11 | ||||
-rw-r--r-- | net-wireless/wepattack/files/0.1.3-filter-mac-address.patch | 271 | ||||
-rw-r--r-- | net-wireless/wepattack/files/digest-wepattack-0.1.3-r1 (renamed from net-wireless/wepattack/files/digest-wepattack-0.1.3) | 0 | ||||
-rw-r--r-- | net-wireless/wepattack/metadata.xml | 5 | ||||
-rw-r--r-- | net-wireless/wepattack/wepattack-0.1.3-r1.ebuild (renamed from net-wireless/wepattack/wepattack-0.1.3.ebuild) | 23 |
5 files changed, 302 insertions, 8 deletions
diff --git a/net-wireless/wepattack/ChangeLog b/net-wireless/wepattack/ChangeLog index 3e2d57125793..9ef8764f950f 100644 --- a/net-wireless/wepattack/ChangeLog +++ b/net-wireless/wepattack/ChangeLog @@ -1,11 +1,16 @@ # ChangeLog for net-wireless/wepattack # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/wepattack/ChangeLog,v 1.3 2003/10/21 00:01:44 wschlich Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/wepattack/ChangeLog,v 1.4 2004/04/25 21:26:23 vapier Exp $ - 21 Oct 2003; Wolfram Schlich <wschlich@gentoo.org> wepattack-0.1.3.ebuild: - Fixed permission problem with FEATURES="userpriv" (wrong directory permissions) +*wepattack-0.1.3-r1 (25 Apr 2004) + + 25 Apr 2004; Mike Frysinger <vapier@gentoo.org> : + Add support for filtering by mac address #47980 by Federico Moro. *wepattack-0.1.3 (21 Dec 2002) + 21 Oct 2003; Wolfram Schlich <wschlich@gentoo.org> wepattack-0.1.3.ebuild: + Fixed permission problem with FEATURES="userpriv" (wrong directory permissions) + 21 Dec 2002; Mike Frysinger <vapier@gentoo.org> : Initial import. Ebuild submitted by me. diff --git a/net-wireless/wepattack/files/0.1.3-filter-mac-address.patch b/net-wireless/wepattack/files/0.1.3-filter-mac-address.patch new file mode 100644 index 000000000000..088eb50ade97 --- /dev/null +++ b/net-wireless/wepattack/files/0.1.3-filter-mac-address.patch @@ -0,0 +1,271 @@ +diff -U 3 -r /src/config.h src/config.h +--- /src/config.h 2002-10-24 15:16:34.000000000 +0200 ++++ src/config.h 2004-04-07 00:39:51.000000000 +0200 +@@ -37,7 +37,7 @@ + #define WEPKEYSTORE (WEPKEYSIZE * WEPKEYS) + + #define DEBUG 0 +-#define VERSION "0.1.3" ++#define VERSION "0.1.3 (Gentoo patched)" + + + #endif +diff -U 3 -r /src/log.c src/log.c +--- /src/log.c 2002-10-24 15:15:55.000000000 +0200 ++++ src/log.c 2004-04-07 00:39:51.000000000 +0200 +@@ -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); + } + +@@ -101,7 +101,7 @@ + fprintf(fp, "\t%d Bit", ((bssid->encryption&0x0F)+3)*8); + if ((bssid->encryption&0x60) == MODE_KEYGEN) + fprintf(fp, " (KEYGEN)"); +- ++ + fprintf(fp, "\t%d sec", (int)difftime(now, start_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; +diff -U 3 -r /src/misc.c src/misc.c +--- /src/misc.c 2002-10-24 15:15:42.000000000 +0200 ++++ src/misc.c 2004-04-07 00:39:51.000000000 +0200 +@@ -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"); +diff -U 3 -r /src/modes.c src/modes.c +--- /src/modes.c 2002-10-24 15:15:19.000000000 +0200 ++++ src/modes.c 2004-04-07 00:39:51.000000000 +0200 +@@ -153,7 +153,7 @@ + rc4_key_gen = generate_rc4_key(padded_key, + generate_length, current_packet->frame.iv); + +- // process rc4 on first byte of stream ++ // process rc4 on first byte of stream + process_rc4_key(current_packet->frame.payload, 1 ,rc4_key_gen); + + // verify if snap header is equal then second verify crc32 +@@ -184,4 +184,3 @@ + + return 0; + } +- +diff -U 3 -r /src/wepattack.c src/wepattack.c +--- /src/wepattack.c 2002-10-24 15:14:29.000000000 +0200 ++++ src/wepattack.c 2004-04-07 00:43:56.000000000 +0200 +@@ -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 +@@ -98,12 +149,13 @@ + network_count++; + current_packet = current_packet->next; + } ++ + // extract one packet from list + list_packet_to_crack = get_one_packet(list_packet_to_crack, + current_packet->frame.bssid, current_packet->frame.key); + network_count = 1; + } +- ++ + printf("\n%d network%s loaded...\n", network_count, network_count>1?"s":""); + + } +@@ -220,14 +272,20 @@ + + // 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; ++ printf("BSSID: %s\n", BSSID); ++ break; + // arg for packet file to read from + case 'f': + packet_file = optarg; ++ printf("FILE: %s\n", optarg); + pf = fopen(packet_file,"r"); + if (!pf) { + printf("Dumpfile error: No such file or directory!\n\n"); +@@ -310,10 +368,9 @@ + word_count++; + + // main loop to process key in modes on every packet +- loop_packets(key); ++ loop_packets(key); + } + + clean_up(); + + } +- +diff -U 3 -r /src/wepattack.h src/wepattack.h +--- /src/wepattack.h 2002-10-24 15:14:22.000000000 +0200 ++++ src/wepattack.h 2004-04-07 00:39:51.000000000 +0200 +@@ -38,6 +38,7 @@ + unsigned char iv[3]; + unsigned char key; + unsigned char payload[2400]; ++ int limits_payload; + }; + + /* +diff -U 3 -r /src/wepfilter.c src/wepfilter.c +--- /src/wepfilter.c 2002-10-24 15:14:13.000000000 +0200 ++++ src/wepfilter.c 2004-04-07 00:39:51.000000000 +0200 +@@ -86,8 +86,7 @@ + // + // puts new element at the beginning of the list (pointed by head) + // +-void push(wlan_packet_list** head, const u_char* data, int length, +-packet_delimiter limits) { ++void push(wlan_packet_list** head, const u_char* data, int length,packet_delimiter limits) { + + wlan_packet_list* newframe = malloc(sizeof(wlan_packet_list)); + memcpy(&newframe->frame.frameControl, data+limits.frame_control, 2); +@@ -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; +@@ -113,9 +113,7 @@ + // callback function that is passed to pcap_loop() and called each time a + // packet is recieved + // +-void my_callback(u_char *useless, const struct pcap_pkthdr* pkthdr, +- const u_char* packet) { +- ++void my_callback(u_char *useless, const struct pcap_pkthdr* pkthdr, const u_char* packet) { + static int count = 1; + FILE *fp; + unsigned int framesize = pkthdr->caplen; diff --git a/net-wireless/wepattack/files/digest-wepattack-0.1.3 b/net-wireless/wepattack/files/digest-wepattack-0.1.3-r1 index 4b33aff94895..4b33aff94895 100644 --- a/net-wireless/wepattack/files/digest-wepattack-0.1.3 +++ b/net-wireless/wepattack/files/digest-wepattack-0.1.3-r1 diff --git a/net-wireless/wepattack/metadata.xml b/net-wireless/wepattack/metadata.xml new file mode 100644 index 000000000000..03aa50bab7e3 --- /dev/null +++ b/net-wireless/wepattack/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>netmon</herd> +</pkgmetadata> diff --git a/net-wireless/wepattack/wepattack-0.1.3.ebuild b/net-wireless/wepattack/wepattack-0.1.3-r1.ebuild index 02c8d02070c1..1ea8b6e159ab 100644 --- a/net-wireless/wepattack/wepattack-0.1.3.ebuild +++ b/net-wireless/wepattack/wepattack-0.1.3-r1.ebuild @@ -1,6 +1,8 @@ -# Copyright 1999-2003 Gentoo Technologies, Inc. +# Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-wireless/wepattack/wepattack-0.1.3.ebuild,v 1.5 2003/10/21 00:01:44 wschlich Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-wireless/wepattack/wepattack-0.1.3-r1.ebuild,v 1.1 2004/04/25 21:26:23 vapier Exp $ + +inherit eutils MY_P="WepAttack-${PV}" DESCRIPTION="WLAN tool for breaking 802.11 WEP keys" @@ -10,6 +12,7 @@ SRC_URI="mirror://sourceforge/wepattack/${MY_P}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="x86" +IUSE="" DEPEND="sys-libs/zlib net-libs/libpcap @@ -17,15 +20,25 @@ DEPEND="sys-libs/zlib S=${WORKDIR}/${MY_P} -src_compile() { +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/${PV}-filter-mac-address.patch cd src chmod +x wlan - sed -i -e "/^CFLAGS=/s:=:=${CFLAGS} :" Makefile + sed -i \ + -e "/^CFLAGS=/s:=:=${CFLAGS} :" \ + -e 's:-fno-for-scope::g' \ + Makefile +} + +src_compile() { + cd src emake || die } src_install() { - dobin src/wepattack run/wepattack_{inc,word} + dobin src/wepattack run/wepattack_{inc,word} || die insinto /etc doins conf/wepattack.conf dodoc README |