From e70ca3ea585304a1fed7475b9a9cdface81917eb Mon Sep 17 00:00:00 2001 From: hackbard Date: Mon, 20 Jun 2005 19:40:06 +0000 Subject: [PATCH] commit often and soon --- main.c | 15 +++++++++------ parse.c | 17 +++++++++++++++-- parse.h | 2 +- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/main.c b/main.c index b7d0b53..d26fbf2 100644 --- a/main.c +++ b/main.c @@ -14,7 +14,7 @@ int display_console(t_info *info,char *string) { int x,y,size,count,cnt,i,s; t_display *display; t_sta *sta; - char help[32]; + char help[128]; display=(t_display *)&(info->display); @@ -105,14 +105,17 @@ int display_console(t_info *info,char *string) { snprintf(help,13,"data: %06d",sta->count_data); display_string(display,1,7,help,12); - snprintf(help,33,"ethernet snap: %02x %02x %02x %02x %02x %02x", - sta->snap[0],sta->snap[1],sta->snap[2], - sta->snap[3],sta->snap[4],sta->snap[5]); - display_string(display,1,9,help,32); snprintf(help,25,"bssid: %02x:%02x:%02x:%02x:%02x:%02x", sta->bssid[0],sta->bssid[1],sta->bssid[2], sta->bssid[3],sta->bssid[4],sta->bssid[5]); - display_string(display,1,10,help,24); + display_string(display,1,9,help,24); + if(sta->wep==WEP) { + snprintf(help,67,"iv + keynr | crypted snap: %02x %02x %02x %02x | %02x %02x %02x %02x %02x %02x", + sta->snap[0],sta->snap[1],sta->snap[2],sta->snap[3], + sta->snap[4],sta->snap[5],sta->snap[6],sta->snap[7], + sta->snap[8],sta->snap[9]); + display_string(display,1,10,help,66); + } } /* footer */ diff --git a/parse.c b/parse.c index 0da5e6f..494ac06 100644 --- a/parse.c +++ b/parse.c @@ -102,6 +102,7 @@ void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,cons beacon_fb=(t_beacon_fb *)(package+sizeof(t_frame3_hdr)); // check sta memcpy(new_sta.addr,f3hdr->addr2,ADDR_LEN); + memcpy(new_sta.bssid,f3hdr->addr3,ADDR_LEN); ret=list_search_data(&(info->sniffed_sta),&new_sta,ADDR_LEN); if((ret==L_EMPTY_LIST)|(ret==L_NO_SUCH_ELEMENT)) { list_add_element(&(info->sniffed_sta),&new_sta,sizeof(t_sta)); @@ -185,7 +186,7 @@ void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,cons else if(info->mode&MODE_PRISM) sta->sq=(prismhdr->signal.data)-(prismhdr->noise.data); if(new) { - strcpy(sc,"flite 'new station. data package'"); + strcpy(sc,"flite 'station found by data package'"); system(sc); } if(foo) { @@ -193,7 +194,19 @@ void parse_package(unsigned char *ptr,const struct pcap_pkthdr *pcap_header,cons strcpy(sc,"flite 'wds package'"); system(sc); } - memcpy(sta->snap,data,6); + memcpy(sta->snap,data,10); + if((data[0]==0xaa)&(data[1]==0xaa)&(data[2]==0x03)& + (data[3]==0x00)&(data[4]==0x00)&(data[5]==0x00)) { + sta->wep=0; + strcpy(sc,"flite 'not crypted'"); + system(sc); + } + else { + sta->wep=WEP; + strcpy(sc,"flite ' crypted'"); + system(sc); + } + //} display_console(info,"last: got data frame"); diff --git a/parse.h b/parse.h index 4c1d770..9814b01 100644 --- a/parse.h +++ b/parse.h @@ -149,7 +149,7 @@ typedef struct s_sta { char active; char key[WEP_MAX_DIGITS]; int sq; - u8 snap[6]; + u8 snap[10]; u8 bssid[ADDR_LEN]; } t_sta; -- 2.39.2