From 5dc6610854adb9a9519f51a51e350751866081e6 Mon Sep 17 00:00:00 2001 From: pvalchev Date: Tue, 14 Jan 2003 23:52:39 +0000 Subject: [PATCH] dstumbler improvements: - print the times of last seen, etc in proper, human-readable format - print the times in local timezone format, not GMT - quick hack to make dstumbler beep when it discovers a new base station. it works, as opposed to what was there before (using /dev/spkr) Thanks to Nikolay Sturm for testing sound --- security/bsd-airtools/Makefile | 4 +-- .../patches/patch-dstumbler_aps_c | 36 +++++++++++++++++++ .../patches/patch-dstumbler_audio_c | 33 +++++++++++++++++ .../patches/patch-dstumbler_dstumbler_h | 12 +++++++ .../patches/patch-dstumbler_log_c | 30 ++++++++++++++++ 5 files changed, 113 insertions(+), 2 deletions(-) create mode 100644 security/bsd-airtools/patches/patch-dstumbler_aps_c create mode 100644 security/bsd-airtools/patches/patch-dstumbler_audio_c create mode 100644 security/bsd-airtools/patches/patch-dstumbler_dstumbler_h create mode 100644 security/bsd-airtools/patches/patch-dstumbler_log_c diff --git a/security/bsd-airtools/Makefile b/security/bsd-airtools/Makefile index bf94834a685..c9be17e754b 100644 --- a/security/bsd-airtools/Makefile +++ b/security/bsd-airtools/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.2 2002/12/29 20:31:39 fgsch Exp $ +# $OpenBSD: Makefile,v 1.3 2003/01/14 23:52:39 pvalchev Exp $ COMMENT= "wireless auditing suite" DISTNAME= bsd-airtools-v0.2 -PKGNAME= bsd-airtools-0.2 +PKGNAME= bsd-airtools-0.2p1 CATEGORIES= security net EXTRACT_SUFX= .tgz diff --git a/security/bsd-airtools/patches/patch-dstumbler_aps_c b/security/bsd-airtools/patches/patch-dstumbler_aps_c new file mode 100644 index 00000000000..cb678be339b --- /dev/null +++ b/security/bsd-airtools/patches/patch-dstumbler_aps_c @@ -0,0 +1,36 @@ +$OpenBSD: patch-dstumbler_aps_c,v 1.1 2003/01/14 23:52:40 pvalchev Exp $ +--- dstumbler/aps.c.orig Tue Feb 26 04:01:31 2002 ++++ dstumbler/aps.c Sat Nov 23 11:43:42 2002 +@@ -101,8 +101,7 @@ parse_ap(const char *iface) + redraw_aps(); + + if(audiomode) +- audio_play((!new.weped || new.weped == 2) ? +- SPKR_AP_PLAY_NOWEP : SPKR_AP_PLAY_WEP); ++ audio_play(); + + if(aps_new == 0 || autosel) + redraw_apinfo(); +@@ -320,9 +319,9 @@ redraw_apinfo(void) + if(then != now || apnew || apchange) + { + if(apnew || apchange || !then) +- gmtime_r((time_t *)&ptr->firstseen.tv_sec, &firsttm); ++ localtime_r((time_t *)&ptr->firstseen.tv_sec, &firsttm); + +- gmtime_r((time_t *)&ptr->lastseen.tv_sec, &lasttm); ++ localtime_r((time_t *)&ptr->lastseen.tv_sec, &lasttm); + then = now; + } + +@@ -353,8 +352,8 @@ redraw_apinfo(void) + " %s\n" + " Channel: %-2d %s\n" + " Signal/Noise: %d/%d/%d\n" +- " First Seen: %d:%d:%d\n" +- " Last Seen: %d:%d:%d\n", ++ " First Seen: %02d:%02d:%02d\n" ++ " Last Seen: %02d:%02d:%02d\n", + ptr->ssid, ptr->bssid[0], ptr->bssid[1], ptr->bssid[2], ptr->bssid[3], + ptr->bssid[4], ptr->bssid[5], mfg_buf, ptr->chan, mon_buf, ptr->quality[0], + ptr->quality[1], ptr->quality[2], firsttm.tm_hour, firsttm.tm_min, diff --git a/security/bsd-airtools/patches/patch-dstumbler_audio_c b/security/bsd-airtools/patches/patch-dstumbler_audio_c new file mode 100644 index 00000000000..211c7041c2f --- /dev/null +++ b/security/bsd-airtools/patches/patch-dstumbler_audio_c @@ -0,0 +1,33 @@ +$OpenBSD: patch-dstumbler_audio_c,v 1.1 2003/01/14 23:52:40 pvalchev Exp $ +--- dstumbler/audio.c.orig Tue Dec 4 19:34:40 2001 ++++ dstumbler/audio.c Sat Nov 23 11:43:09 2002 +@@ -61,17 +61,20 @@ audio_graph(int pitch) + b = (pitch % 10) / 2; + + snprintf(audio_buf, AUDIO_BUF_LEN - 1, "L8o%dao%da", a, b); +- audio_play(audio_buf); ++/* audio_play(audio_buf); */ ++ audio_play(); + + return; + } + + /* +- * play specified audio string though the audio device ++ * Beep when a hostap is found + */ + void +-audio_play(char *string) ++audio_play(void) + { ++ printf("\007"); ++#if 0 + if((sp_fd = open(SPKR_DEV, O_WRONLY|O_NONBLOCK|O_SYNC)) < 0) + { + alert("error: unable to open speaker device: %s", strerror(errno)); +@@ -89,4 +92,5 @@ audio_play(char *string) + alert("error: error closing speaker device: %s", strerror(errno)); + return; + } ++#endif + } diff --git a/security/bsd-airtools/patches/patch-dstumbler_dstumbler_h b/security/bsd-airtools/patches/patch-dstumbler_dstumbler_h new file mode 100644 index 00000000000..2c0b0cdf905 --- /dev/null +++ b/security/bsd-airtools/patches/patch-dstumbler_dstumbler_h @@ -0,0 +1,12 @@ +$OpenBSD: patch-dstumbler_dstumbler_h,v 1.1 2003/01/14 23:52:40 pvalchev Exp $ +--- dstumbler/dstumbler.h.orig Sat Nov 23 11:42:14 2002 ++++ dstumbler/dstumbler.h Sat Nov 23 11:42:23 2002 +@@ -450,7 +450,7 @@ void mon_stop(void); + * audio.c + */ + void audio_graph(int); +-void audio_play(char *); ++void audio_play(void); + + /* + * log.c diff --git a/security/bsd-airtools/patches/patch-dstumbler_log_c b/security/bsd-airtools/patches/patch-dstumbler_log_c new file mode 100644 index 00000000000..7d54fea151f --- /dev/null +++ b/security/bsd-airtools/patches/patch-dstumbler_log_c @@ -0,0 +1,30 @@ +$OpenBSD: patch-dstumbler_log_c,v 1.1 2003/01/14 23:52:40 pvalchev Exp $ +--- dstumbler/log.c.orig Fri Nov 8 15:00:50 2002 ++++ dstumbler/log.c Fri Nov 8 15:01:08 2002 +@@ -55,7 +55,7 @@ log_ap(FILE *fd, struct aps_s *ap, struc + { + struct tm tmval; + +- gmtime_r((time_t *)&log->seen.tv_sec, &tmval); ++ localtime_r((time_t *)&log->seen.tv_sec, &tmval); + + fprintf(fd, "%c %4.7f\t%c %4.7f\t( %s )\t%s\t" + "( %02x:%02x:%02x:%02x:%02x:%02x )\t" +@@ -122,7 +122,7 @@ log_node(FILE *fd, struct aps_s *ap, str + { + struct tm tmval; + +- gmtime_r((time_t *)&log->seen.tv_sec, &tmval); ++ localtime_r((time_t *)&log->seen.tv_sec, &tmval); + + fprintf(fd, "#NODE %c %4.7f\t%c %4.7f\t" + "( %02x:%02x:%02x:%02x:%02x:%02x )\t%s\t" +@@ -208,7 +208,7 @@ log_start(char *logfile) + return NULL; + } + +- gmtime_r((time_t *)&curr_time, &tmval); ++ localtime_r((time_t *)&curr_time, &tmval); + + /* print file header */ + fprintf(fd,