X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=hdw-sniff.c;h=8b35e82fb451388ff124767104b9957cacd9f141;hb=326723124c4b55eccaa297c1636f9d345255d7bd;hp=7a549e5ecc3e1ea43970b792b7436935efb049e7;hpb=2d887777866454a450211bd1373b0f716abb9fb4;p=my-code%2Fhdw-sniff.git diff --git a/hdw-sniff.c b/hdw-sniff.c index 7a549e5..8b35e82 100644 --- a/hdw-sniff.c +++ b/hdw-sniff.c @@ -54,9 +54,10 @@ int main(int argc, char *argv[]) { else { if((file_fd=open(argv[3],O_RDWR | O_CREAT))!=0) { printf("writing to logfile %s ...\n",argv[3]); + dprintf(file_fd,"|iv - --|id|crypted_snap - --|\n"); } else { - printf("can't open logfile!\n"); + printf("can't open logfile. not logged to file!\n"); } } @@ -184,6 +185,7 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, /* frame type */ /* management */ if(!(w_hdr->frame_ctl & 0x0c)) { + tmp_buf1[0]='\0'; tmp_buf2[0]='\0'; if((w_hdr->frame_ctl & IEEE802_11_STYPE_ASSOC_REQ)>0) strcpy(tmp_buf,"association request"); else if((w_hdr->frame_ctl & IEEE802_11_STYPE_ASSOC_RESP)>0) @@ -216,10 +218,12 @@ void pcap_process(u_char *info,const struct pcap_pkthdr *pcap_header, strcpy(tmp_buf,"deauthentification"); else strcpy(tmp_buf,"impossible situation \%) - go mail the author."); } - else strcpy(tmp_buf,"control & data frame type not supported yet"); - /* print out frame type */ + else strcpy(tmp_buf,"control or data frame type"); + printf("=> %s\n",tmp_buf); - printf(" %s%s\n",tmp_buf1,tmp_buf2); + if(strlen(tmp_buf1)>0 & strlen(tmp_buf2)>0) printf(" %s%s\n", + tmp_buf1, + tmp_buf2); printf("duration/id: 0x%x\n",w_hdr->duration_id); printf("version check ... %s\n", ((w_hdr->frame_ctl & IEEE802_11_FCTL_VERS)==0x00)?