mirror of https://github.com/hak5/openwrt.git
parent
bcd56256b2
commit
35d67f3e7e
|
@ -3,9 +3,9 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=kismet
|
PKG_NAME:=kismet
|
||||||
PKG_VERSION:=2005-04-R1
|
PKG_VERSION:=2005-07-R1a
|
||||||
PKG_RELEASE:=3
|
PKG_RELEASE:=1
|
||||||
PKG_MD5SUM:=19b4f192eb11a418ed3f6bf65c1226af
|
PKG_MD5SUM:=9f59bce7d6cc8504ff602f150e578ab5
|
||||||
|
|
||||||
PKG_SOURCE_URL:=http://www.kismetwireless.net/code
|
PKG_SOURCE_URL:=http://www.kismetwireless.net/code
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
@ -49,7 +49,9 @@ $(PKG_BUILD_DIR)/.configured:
|
||||||
$(DISABLE_LARGEFILE) \
|
$(DISABLE_LARGEFILE) \
|
||||||
$(DISABLE_NLS) \
|
$(DISABLE_NLS) \
|
||||||
--enable-syspcap=yes \
|
--enable-syspcap=yes \
|
||||||
|
--disable-setuid \
|
||||||
--disable-wsp100 \
|
--disable-wsp100 \
|
||||||
|
--disable-gpsmap \
|
||||||
);
|
);
|
||||||
touch $@
|
touch $@
|
||||||
|
|
||||||
|
@ -62,7 +64,7 @@ $(PKG_BUILD_DIR)/.built:
|
||||||
|
|
||||||
$(IPKG_KISMET):
|
$(IPKG_KISMET):
|
||||||
install -d -m0755 $(IDIR_KISMET)/usr/bin/
|
install -d -m0755 $(IDIR_KISMET)/usr/bin/
|
||||||
cp -fpR $(PKG_BUILD_DIR)/scripts/kismet $(IDIR_KISMET)/usr/bin/
|
install -m0755 $(PKG_BUILD_DIR)/scripts/kismet $(IDIR_KISMET)/usr/bin/kismet
|
||||||
$(IPKG_BUILD) $(IDIR_KISMET) $(PACKAGE_DIR)
|
$(IPKG_BUILD) $(IDIR_KISMET) $(PACKAGE_DIR)
|
||||||
|
|
||||||
$(IPKG_KISMET_CLIENT):
|
$(IPKG_KISMET_CLIENT):
|
||||||
|
@ -71,16 +73,16 @@ $(IPKG_KISMET_CLIENT):
|
||||||
install -m0644 ./files/client_manuf $(IDIR_KISMET_CLIENT)/etc/kismet/
|
install -m0644 ./files/client_manuf $(IDIR_KISMET_CLIENT)/etc/kismet/
|
||||||
install -m0644 ./files/kismet.conf $(IDIR_KISMET_CLIENT)/etc/kismet/
|
install -m0644 ./files/kismet.conf $(IDIR_KISMET_CLIENT)/etc/kismet/
|
||||||
install -m0644 ./files/kismet_ui.conf $(IDIR_KISMET_CLIENT)/etc/kismet/
|
install -m0644 ./files/kismet_ui.conf $(IDIR_KISMET_CLIENT)/etc/kismet/
|
||||||
install -d -m0755 $(IDIR_KISMET_CLIENT)/usr/sbin
|
install -d -m0755 $(IDIR_KISMET_CLIENT)/usr/bin
|
||||||
cp -fpR $(PKG_BUILD_DIR)/kismet_client $(IDIR_KISMET_CLIENT)/usr/sbin/
|
cp -fpR $(PKG_BUILD_DIR)/kismet_client $(IDIR_KISMET_CLIENT)/usr/bin/
|
||||||
$(RSTRIP) $(IDIR_KISMET_CLIENT)
|
$(RSTRIP) $(IDIR_KISMET_CLIENT)
|
||||||
$(IPKG_BUILD) $(IDIR_KISMET_CLIENT) $(PACKAGE_DIR)
|
$(IPKG_BUILD) $(IDIR_KISMET_CLIENT) $(PACKAGE_DIR)
|
||||||
|
|
||||||
$(IPKG_KISMET_DRONE):
|
$(IPKG_KISMET_DRONE):
|
||||||
install -d -m0755 $(IDIR_KISMET_DRONE)/etc/kismet/
|
install -d -m0755 $(IDIR_KISMET_DRONE)/etc/kismet/
|
||||||
install -m0644 ./files/kismet_drone.conf $(IDIR_KISMET_DRONE)/etc/kismet/
|
install -m0644 ./files/kismet_drone.conf $(IDIR_KISMET_DRONE)/etc/kismet/
|
||||||
install -d -m0755 $(IDIR_KISMET_DRONE)/usr/sbin
|
install -d -m0755 $(IDIR_KISMET_DRONE)/usr/bin
|
||||||
cp -fpR $(PKG_BUILD_DIR)/kismet_drone $(IDIR_KISMET_DRONE)/usr/sbin/
|
cp -fpR $(PKG_BUILD_DIR)/kismet_drone $(IDIR_KISMET_DRONE)/usr/bin/
|
||||||
$(RSTRIP) $(IDIR_KISMET_DRONE)
|
$(RSTRIP) $(IDIR_KISMET_DRONE)
|
||||||
$(IPKG_BUILD) $(IDIR_KISMET_DRONE) $(PACKAGE_DIR)
|
$(IPKG_BUILD) $(IDIR_KISMET_DRONE) $(PACKAGE_DIR)
|
||||||
|
|
||||||
|
@ -89,11 +91,11 @@ $(IPKG_KISMET_SERVER):
|
||||||
install -m0644 ./files/ap_manuf $(IDIR_KISMET_SERVER)/etc/kismet/
|
install -m0644 ./files/ap_manuf $(IDIR_KISMET_SERVER)/etc/kismet/
|
||||||
install -m0644 ./files/client_manuf $(IDIR_KISMET_SERVER)/etc/kismet/
|
install -m0644 ./files/client_manuf $(IDIR_KISMET_SERVER)/etc/kismet/
|
||||||
install -m0644 ./files/kismet.conf $(IDIR_KISMET_SERVER)/etc/kismet/
|
install -m0644 ./files/kismet.conf $(IDIR_KISMET_SERVER)/etc/kismet/
|
||||||
mkdir -p $(IDIR_KISMET_SERVER)/usr/sbin
|
mkdir -p $(IDIR_KISMET_SERVER)/usr/bin
|
||||||
cp -fpR $(PKG_BUILD_DIR)/kismet_server $(IDIR_KISMET_SERVER)/usr/sbin/
|
cp -fpR $(PKG_BUILD_DIR)/kismet_server $(IDIR_KISMET_SERVER)/usr/bin/
|
||||||
$(RSTRIP) $(IDIR_KISMET_SERVER)
|
$(RSTRIP) $(IDIR_KISMET_SERVER)
|
||||||
$(IPKG_BUILD) $(IDIR_KISMET_SERVER) $(PACKAGE_DIR)
|
$(IPKG_BUILD) $(IDIR_KISMET_SERVER) $(PACKAGE_DIR)
|
||||||
|
|
||||||
mostlyclean:
|
mostlyclean:
|
||||||
$(MAKE) -C $(PKG_BUILD_DIR) clean
|
# $(MAKE) -C $(PKG_BUILD_DIR) clean
|
||||||
rm -f $(PKG_BUILD_DIR)/.built
|
rm -f $(PKG_BUILD_DIR)/.built
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,347 +0,0 @@
|
||||||
diff -urN kismet-2005-04-R1.old/kismet_drone.cc kismet-2005-04-R1.dev/kismet_drone.cc
|
|
||||||
--- kismet-2005-04-R1.old/kismet_drone.cc 2005-04-03 07:33:42.000000000 +0200
|
|
||||||
+++ kismet-2005-04-R1.dev/kismet_drone.cc 2005-04-27 17:10:22.000000000 +0200
|
|
||||||
@@ -32,11 +32,8 @@
|
|
||||||
#include "packet.h"
|
|
||||||
|
|
||||||
#include "packetsource.h"
|
|
||||||
-#include "prism2source.h"
|
|
||||||
#include "pcapsource.h"
|
|
||||||
#include "wtapfilesource.h"
|
|
||||||
-#include "wsp100source.h"
|
|
||||||
-#include "vihasource.h"
|
|
||||||
#include "dronesource.h"
|
|
||||||
#include "packetsourcetracker.h"
|
|
||||||
#include "kis_packsources.h"
|
|
||||||
diff -urN kismet-2005-04-R1.old/kismet_server.cc kismet-2005-04-R1.dev/kismet_server.cc
|
|
||||||
--- kismet-2005-04-R1.old/kismet_server.cc 2005-04-03 07:33:42.000000000 +0200
|
|
||||||
+++ kismet-2005-04-R1.dev/kismet_server.cc 2005-04-27 17:10:35.000000000 +0200
|
|
||||||
@@ -37,11 +37,8 @@
|
|
||||||
#include "packet.h"
|
|
||||||
|
|
||||||
#include "packetsource.h"
|
|
||||||
-#include "prism2source.h"
|
|
||||||
#include "pcapsource.h"
|
|
||||||
#include "wtapfilesource.h"
|
|
||||||
-#include "wsp100source.h"
|
|
||||||
-#include "vihasource.h"
|
|
||||||
#include "dronesource.h"
|
|
||||||
#include "packetsourcetracker.h"
|
|
||||||
#include "kis_packsources.h"
|
|
||||||
diff -urN kismet-2005-04-R1.old/kis_packsources.cc kismet-2005-04-R1.dev/kis_packsources.cc
|
|
||||||
--- kismet-2005-04-R1.old/kis_packsources.cc 2005-04-03 07:33:42.000000000 +0200
|
|
||||||
+++ kismet-2005-04-R1.dev/kis_packsources.cc 2005-04-27 17:11:22.000000000 +0200
|
|
||||||
@@ -58,15 +58,10 @@
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "pcapfile");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+ REG_EMPTY_CARD(sourcetracker, "cisco");
|
|
||||||
+ REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
|
|
||||||
#if defined(HAVE_LIBPCAP) && defined(HAVE_LINUX_WIRELESS)
|
|
||||||
// Linux wext-driven cards
|
|
||||||
- sourcetracker->RegisterPacketsource("cisco", 1, "IEEE80211b", 6,
|
|
||||||
- pcapsource_wext_registrant,
|
|
||||||
- monitor_cisco, unmonitor_cisco,
|
|
||||||
- chancontrol_wext, 1);
|
|
||||||
- sourcetracker->RegisterPacketsource("cisco_wifix", 1, "IEEE80211b", 6,
|
|
||||||
- pcapsource_ciscowifix_registrant,
|
|
||||||
- monitor_cisco_wifix, NULL, NULL, 1);
|
|
||||||
sourcetracker->RegisterPacketsource("hostap", 1, "IEEE80211b", 6,
|
|
||||||
pcapsource_wext_registrant,
|
|
||||||
monitor_hostap, unmonitor_hostap,
|
|
||||||
@@ -142,8 +137,6 @@
|
|
||||||
|
|
||||||
#else
|
|
||||||
// Register the linuxwireless pcap stuff as null
|
|
||||||
- REG_EMPTY_CARD(sourcetracker, "cisco");
|
|
||||||
- REG_EMPTY_CARD(sourcetracker, "cisco_wifix");
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "hostap");
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "orinoco");
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "acx100");
|
|
||||||
@@ -179,14 +172,7 @@
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "wrt54g");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-#if defined(SYS_LINUX) && defined(HAVE_LINUX_NETLINK)
|
|
||||||
- sourcetracker->RegisterPacketsource("wlanng_legacy", 1, "IEEE80211b", 6,
|
|
||||||
- prism2source_registrant,
|
|
||||||
- monitor_wlanng_legacy, NULL,
|
|
||||||
- chancontrol_wlanng_legacy, 1);
|
|
||||||
-#else
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "wlanng_legacy");
|
|
||||||
-#endif
|
|
||||||
|
|
||||||
#if defined(HAVE_LIBPCAP) && defined(SYS_OPENBSD)
|
|
||||||
sourcetracker->RegisterPacketsource("cisco_openbsd", 1, "IEEE80211b", 6,
|
|
||||||
@@ -228,21 +214,8 @@
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "wtapfile");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-#if defined(HAVE_WSP100)
|
|
||||||
- sourcetracker->RegisterPacketsource("wsp100", 0, "IEEE80211b", 6,
|
|
||||||
- wsp100source_registrant,
|
|
||||||
- monitor_wsp100, NULL, chancontrol_wsp100, 0);
|
|
||||||
-#else
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "wsp100");
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
-#if defined(HAVE_VIHAHEADERS)
|
|
||||||
- sourcetracker->RegisterPacketsource("viha", 1, "IEEE80211b", 6,
|
|
||||||
- vihasource_registrant,
|
|
||||||
- NULL, NULL, chancontrol_viha, 0);
|
|
||||||
-#else
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "viha");
|
|
||||||
-#endif
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
diff -urN kismet-2005-04-R1.old/kis_packsources.h kismet-2005-04-R1.dev/kis_packsources.h
|
|
||||||
--- kismet-2005-04-R1.old/kis_packsources.h 2005-04-03 07:33:42.000000000 +0200
|
|
||||||
+++ kismet-2005-04-R1.dev/kis_packsources.h 2005-04-27 17:10:43.000000000 +0200
|
|
||||||
@@ -22,11 +22,8 @@
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "packetsource.h"
|
|
||||||
-#include "prism2source.h"
|
|
||||||
#include "pcapsource.h"
|
|
||||||
#include "wtapfilesource.h"
|
|
||||||
-#include "wsp100source.h"
|
|
||||||
-#include "vihasource.h"
|
|
||||||
#include "dronesource.h"
|
|
||||||
#include "packetsourcetracker.h"
|
|
||||||
|
|
||||||
diff -urN kismet-2005-04-R1.old/Makefile.in kismet-2005-04-R1.dev/Makefile.in
|
|
||||||
--- kismet-2005-04-R1.old/Makefile.in 2005-04-03 07:33:42.000000000 +0200
|
|
||||||
+++ kismet-2005-04-R1.dev/Makefile.in 2005-04-27 17:10:09.000000000 +0200
|
|
||||||
@@ -40,8 +40,8 @@
|
|
||||||
|
|
||||||
# Objects
|
|
||||||
PSO = util.o ringbuf.o configfile.o speech.o ifcontrol.o iwcontrol.o packet.o \
|
|
||||||
- pcapsource.o prism2source.o wtapfilesource.o wsp100source.o \
|
|
||||||
- dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
|
|
||||||
+ pcapsource.o wtapfilesource.o \
|
|
||||||
+ dronesource.o packetsourcetracker.o kis_packsources.o \
|
|
||||||
wtapdump.o wtaplocaldump.o gpsdump.o airsnortdump.o fifodump.o \
|
|
||||||
gpsd.o manuf.o \
|
|
||||||
packetracker.o timetracker.o alertracker.o finitestate.o \
|
|
||||||
@@ -50,8 +50,8 @@
|
|
||||||
PS = kismet_server
|
|
||||||
|
|
||||||
DRONEO = util.o ringbuf.o configfile.o getopt.o ifcontrol.o iwcontrol.o packet.o \
|
|
||||||
- tcpstreamer.o prism2source.o pcapsource.o wtapfilesource.o wsp100source.o \
|
|
||||||
- dronesource.o vihasource.o packetsourcetracker.o kis_packsources.o \
|
|
||||||
+ tcpstreamer.o pcapsource.o wtapfilesource.o \
|
|
||||||
+ dronesource.o packetsourcetracker.o kis_packsources.o \
|
|
||||||
timetracker.o gpsd.o server_globals.o kismet_drone.o
|
|
||||||
DRONE = kismet_drone
|
|
||||||
|
|
||||||
diff -urN kismet-2005-04-R1.old/pcapsource.cc kismet-2005-04-R1.dev/pcapsource.cc
|
|
||||||
--- kismet-2005-04-R1.old/pcapsource.cc 2005-04-03 07:33:42.000000000 +0200
|
|
||||||
+++ kismet-2005-04-R1.dev/pcapsource.cc 2005-04-27 16:58:10.000000000 +0200
|
|
||||||
@@ -282,8 +282,6 @@
|
|
||||||
|
|
||||||
if (datalink_type == DLT_PRISM_HEADER) {
|
|
||||||
ret = Prism2KisPack(packet, data, moddata);
|
|
||||||
- } else if (datalink_type == KDLT_BSD802_11) {
|
|
||||||
- ret = BSD2KisPack(packet, data, moddata);
|
|
||||||
#ifdef HAVE_RADIOTAP
|
|
||||||
} else if (datalink_type == DLT_IEEE802_11_RADIO) {
|
|
||||||
ret = Radiotap2KisPack(packet, data, moddata);
|
|
||||||
@@ -418,46 +416,6 @@
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
-int PcapSource::BSD2KisPack(kis_packet *packet, uint8_t *data, uint8_t *moddata) {
|
|
||||||
- int callback_offset = 0;
|
|
||||||
-
|
|
||||||
- // Process our hacked in BSD type
|
|
||||||
- if (callback_header.caplen < sizeof(bsd_80211_header)) {
|
|
||||||
- snprintf(errstr, 1024, "pcap bsd converter saw undersized capture frame for bsd header.");
|
|
||||||
- packet->len = 0;
|
|
||||||
- packet->caplen = 0;
|
|
||||||
- return 0;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- packet->caplen = kismin(callback_header.caplen - sizeof(bsd_80211_header),
|
|
||||||
- (uint32_t) MAX_PACKET_LEN);
|
|
||||||
- packet->len = packet->caplen;
|
|
||||||
-
|
|
||||||
- bsd_80211_header *bsdhead = (bsd_80211_header *) callback_data;
|
|
||||||
-
|
|
||||||
- packet->signal = bsdhead->wi_signal;
|
|
||||||
- packet->noise = bsdhead->wi_silence;
|
|
||||||
-
|
|
||||||
- // Set our offset
|
|
||||||
- callback_offset = sizeof(bsd_80211_header);
|
|
||||||
- memcpy(packet->data, callback_data + callback_offset, 24);
|
|
||||||
-
|
|
||||||
- // Adjust for driver appended headers
|
|
||||||
- if (packet->data[0] > 0x08) {
|
|
||||||
- packet->len -= 22;
|
|
||||||
- packet->caplen -= 22;
|
|
||||||
- memcpy(packet->data + 24, callback_data + callback_offset + 46,
|
|
||||||
- packet->caplen - 2);
|
|
||||||
- } else {
|
|
||||||
- packet->len -= 30;
|
|
||||||
- packet->caplen -= 30;
|
|
||||||
- memcpy(packet->data + 24, callback_data + callback_offset + 46,
|
|
||||||
- packet->caplen - 2);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return 1;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
#ifdef HAVE_RADIOTAP
|
|
||||||
/*
|
|
||||||
* Convert MHz frequency to IEEE channel number.
|
|
||||||
@@ -949,17 +907,6 @@
|
|
||||||
return new PcapSourceWextFCS(in_name, in_device);
|
|
||||||
}
|
|
||||||
|
|
||||||
-KisPacketSource *pcapsource_ciscowifix_registrant(string in_name, string in_device, char *in_err) {
|
|
||||||
- vector<string> devbits = StrTokenize(in_device, ":");
|
|
||||||
-
|
|
||||||
- if (devbits.size() < 2) {
|
|
||||||
- snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'", in_device.c_str());
|
|
||||||
- return NULL;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return new PcapSourceWext(in_name, devbits[1]);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
KisPacketSource *pcapsource_11g_registrant(string in_name, string in_device,
|
|
||||||
char *in_err) {
|
|
||||||
return new PcapSource11G(in_name, in_device);
|
|
||||||
@@ -1004,132 +951,6 @@
|
|
||||||
|
|
||||||
// Monitor commands
|
|
||||||
#ifdef HAVE_LINUX_WIRELESS
|
|
||||||
-// Cisco uses its own config file in /proc to control modes
|
|
||||||
-int monitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
|
|
||||||
- FILE *cisco_config;
|
|
||||||
- char cisco_path[128];
|
|
||||||
-
|
|
||||||
- linux_ifparm *ifparm = (linux_ifparm *) malloc(sizeof(linux_ifparm));
|
|
||||||
- (*in_if) = ifparm;
|
|
||||||
-
|
|
||||||
- if (Ifconfig_Get_Flags(in_dev, in_err, &ifparm->flags) < 0) {
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- if (Iwconfig_Get_SSID(in_dev, in_err, ifparm->essid) < 0)
|
|
||||||
- return -1;
|
|
||||||
-
|
|
||||||
- if ((ifparm->channel = Iwconfig_Get_Channel(in_dev, in_err)) < 0)
|
|
||||||
- return -1;
|
|
||||||
-
|
|
||||||
- if (Iwconfig_Get_Mode(in_dev, in_err, &ifparm->mode) < 0)
|
|
||||||
- return -1;
|
|
||||||
-
|
|
||||||
- if (Ifconfig_Delta_Flags(in_dev, in_err, IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
|
|
||||||
- return -1;
|
|
||||||
-
|
|
||||||
- // Try the iwpriv
|
|
||||||
- if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 1, 0, in_err) >= 0) {
|
|
||||||
- return 0;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- // Zero the ssid - nonfatal
|
|
||||||
- Iwconfig_Set_SSID(in_dev, in_err, NULL);
|
|
||||||
-
|
|
||||||
- // Build the proc control path
|
|
||||||
- snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", in_dev);
|
|
||||||
-
|
|
||||||
- if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
|
|
||||||
- snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
|
|
||||||
- cisco_path, errno, strerror(errno));
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- fprintf(cisco_config, "Mode: r\n");
|
|
||||||
- fprintf(cisco_config, "Mode: y\n");
|
|
||||||
- fprintf(cisco_config, "XmitPower: 1\n");
|
|
||||||
-
|
|
||||||
- fclose(cisco_config);
|
|
||||||
-
|
|
||||||
- // Channel can't be set on cisco with these drivers.
|
|
||||||
-
|
|
||||||
- return 0;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-int unmonitor_cisco(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
|
|
||||||
- linux_ifparm *ifparm = (linux_ifparm *) (*in_if);
|
|
||||||
- int ret = -1;
|
|
||||||
-
|
|
||||||
- // Try the iwpriv
|
|
||||||
- if (Iwconfig_Set_IntPriv(in_dev, "setRFMonitor", 0, 0, in_err) >= 0) {
|
|
||||||
- // If we're the new drivers, unmonitor
|
|
||||||
- if (Ifconfig_Set_Flags(in_dev, in_err, ifparm->flags) < 0) {
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- // Reset the SSID since monitor mode nukes it
|
|
||||||
- if (Iwconfig_Set_SSID(in_dev, in_err, ifparm->essid) < 0)
|
|
||||||
- return -1;
|
|
||||||
-
|
|
||||||
- if (ifparm->channel > 0) {
|
|
||||||
- if (Iwconfig_Set_Channel(in_dev, ifparm->channel, in_err) < 0)
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- ret = 1;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- free(ifparm);
|
|
||||||
-
|
|
||||||
- return ret;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-// Cisco uses its own config file in /proc to control modes
|
|
||||||
-//
|
|
||||||
-// I was doing this with ioctls but that seems to cause lockups while
|
|
||||||
-// this method doesn't. I don't think I like these drivers.
|
|
||||||
-int monitor_cisco_wifix(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
|
|
||||||
- FILE *cisco_config;
|
|
||||||
- char cisco_path[128];
|
|
||||||
- vector<string> devbits = StrTokenize(in_dev, ":");
|
|
||||||
-
|
|
||||||
- if (devbits.size() < 2) {
|
|
||||||
- snprintf(in_err, STATUS_MAX, "Invalid device pair '%s'", in_dev);
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- // Bring the device up, zero its ip, and set promisc
|
|
||||||
- if (Ifconfig_Delta_Flags(devbits[0].c_str(), in_err,
|
|
||||||
- IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
|
|
||||||
- return -1;
|
|
||||||
- if (Ifconfig_Delta_Flags(devbits[1].c_str(), in_err,
|
|
||||||
- IFF_UP | IFF_RUNNING | IFF_PROMISC) < 0)
|
|
||||||
- return -1;
|
|
||||||
-
|
|
||||||
- // Zero the ssid, nonfatally
|
|
||||||
- Iwconfig_Set_SSID(devbits[0].c_str(), in_err, NULL);
|
|
||||||
- Iwconfig_Set_SSID(devbits[1].c_str(), in_err, NULL);
|
|
||||||
-
|
|
||||||
- // Build the proc control path
|
|
||||||
- snprintf(cisco_path, 128, "/proc/driver/aironet/%s/Config", devbits[0].c_str());
|
|
||||||
-
|
|
||||||
- if ((cisco_config = fopen(cisco_path, "w")) == NULL) {
|
|
||||||
- snprintf(in_err, STATUS_MAX, "Unable to open cisco control file '%s' %d:%s",
|
|
||||||
- cisco_path, errno, strerror(errno));
|
|
||||||
- return -1;
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- fprintf(cisco_config, "Mode: r\n");
|
|
||||||
- fprintf(cisco_config, "Mode: y\n");
|
|
||||||
- fprintf(cisco_config, "XmitPower: 1\n");
|
|
||||||
-
|
|
||||||
- fclose(cisco_config);
|
|
||||||
-
|
|
||||||
- // Channel can't be set on cisco with these drivers.
|
|
||||||
-
|
|
||||||
- return 0;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
// Hostap uses iwpriv and iwcontrol settings to control monitor mode
|
|
||||||
int monitor_hostap(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
|
|
||||||
int ret;
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,181 @@
|
||||||
|
diff -urN kismet.old/kis_packsources.cc kismet.dev/kis_packsources.cc
|
||||||
|
--- kismet.old/kis_packsources.cc 2005-08-15 00:15:11.107594000 +0200
|
||||||
|
+++ kismet.dev/kis_packsources.cc 2005-08-15 01:56:36.467769104 +0200
|
||||||
|
@@ -215,7 +215,7 @@
|
||||||
|
#endif
|
||||||
|
sourcetracker->RegisterPacketsource("wrt54g", 1, "na", 0,
|
||||||
|
pcapsource_wrt54g_registrant,
|
||||||
|
- monitor_wrt54g, NULL, NULL, 0);
|
||||||
|
+ monitor_wrt54g, unmonitor_wrt54g, chancontrol_wext, 0);
|
||||||
|
#else
|
||||||
|
REG_EMPTY_CARD(sourcetracker, "wlanng");
|
||||||
|
REG_EMPTY_CARD(sourcetracker, "wlanng_avs");
|
||||||
|
diff -urN kismet.old/packetsourcetracker.cc kismet.dev/packetsourcetracker.cc
|
||||||
|
--- kismet.old/packetsourcetracker.cc 2005-08-15 00:33:14.628874000 +0200
|
||||||
|
+++ kismet.dev/packetsourcetracker.cc 2005-08-15 01:20:41.284203096 +0200
|
||||||
|
@@ -984,6 +984,7 @@
|
||||||
|
(meta_packsources[chanpak.meta_num]->device.c_str(),
|
||||||
|
chanpak.channel, errstr,
|
||||||
|
(void *) (meta_packsources[chanpak.meta_num]->capsource)) < 0) {
|
||||||
|
+#if 0
|
||||||
|
|
||||||
|
meta_packsources[chanpak.meta_num]->consec_errors++;
|
||||||
|
|
||||||
|
@@ -1005,6 +1006,7 @@
|
||||||
|
CHANFLAG_FATAL));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
} else {
|
||||||
|
// Otherwise reset the error count
|
||||||
|
meta_packsources[chanpak.meta_num]->consec_errors = 0;
|
||||||
|
diff -urN kismet.old/pcapsource.cc kismet.dev/pcapsource.cc
|
||||||
|
--- kismet.old/pcapsource.cc 2005-08-15 00:40:28.291416000 +0200
|
||||||
|
+++ kismet.dev/pcapsource.cc 2005-08-15 01:55:53.972229408 +0200
|
||||||
|
@@ -115,6 +115,53 @@
|
||||||
|
u_char callback_data[MAX_PACKET_LEN];
|
||||||
|
|
||||||
|
// Open a source
|
||||||
|
+int PcapSourceWrt54g::OpenSource() {
|
||||||
|
+ channel = 0;
|
||||||
|
+
|
||||||
|
+ errstr[0] = '\0';
|
||||||
|
+
|
||||||
|
+ char *unconst = strdup("prism0");
|
||||||
|
+
|
||||||
|
+ pd = pcap_open_live(unconst, MAX_PACKET_LEN, 1, 1000, errstr);
|
||||||
|
+
|
||||||
|
+ #if defined (SYS_OPENBSD) || defined(SYS_NETBSD) && defined(HAVE_RADIOTAP)
|
||||||
|
+ /* Request desired DLT on multi-DLT systems that default to EN10MB. We do this
|
||||||
|
+ later anyway but doing it here ensures we have the desired DLT from the get go. */
|
||||||
|
+ pcap_set_datalink(pd, DLT_IEEE802_11_RADIO);
|
||||||
|
+ #endif
|
||||||
|
+
|
||||||
|
+ free(unconst);
|
||||||
|
+
|
||||||
|
+ if (strlen(errstr) > 0)
|
||||||
|
+ return -1; // Error is already in errstr
|
||||||
|
+
|
||||||
|
+ paused = 0;
|
||||||
|
+
|
||||||
|
+ errstr[0] = '\0';
|
||||||
|
+
|
||||||
|
+ num_packets = 0;
|
||||||
|
+
|
||||||
|
+ if (DatalinkType() < 0)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+#ifdef HAVE_PCAP_NONBLOCK
|
||||||
|
+ pcap_setnonblock(pd, 1, errstr);
|
||||||
|
+#elif !defined(SYS_OPENBSD)
|
||||||
|
+ // do something clever (Thanks to Guy Harris for suggesting this).
|
||||||
|
+ int save_mode = fcntl(pcap_get_selectable_fd(pd), F_GETFL, 0);
|
||||||
|
+ if (fcntl(pcap_get_selectable_fd(pd), F_SETFL, save_mode | O_NONBLOCK) < 0) {
|
||||||
|
+ snprintf(errstr, 1024, "fcntl failed, errno %d (%s)",
|
||||||
|
+ errno, strerror(errno));
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+ if (strlen(errstr) > 0)
|
||||||
|
+ return -1; // Ditto
|
||||||
|
+
|
||||||
|
+ return 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+// Open a source
|
||||||
|
int PcapSource::OpenSource() {
|
||||||
|
channel = 0;
|
||||||
|
|
||||||
|
@@ -1561,45 +1608,39 @@
|
||||||
|
|
||||||
|
int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if,
|
||||||
|
void *in_ext) {
|
||||||
|
- char cmdline[2048];
|
||||||
|
+ char cmdline[2048];
|
||||||
|
int mode;
|
||||||
|
int wlmode = 0;
|
||||||
|
|
||||||
|
- vector<string> devbits = StrTokenize(in_dev, ":");
|
||||||
|
+ vector<string> devbits = StrTokenize(in_dev, ":");
|
||||||
|
|
||||||
|
- if (devbits.size() < 2) {
|
||||||
|
- snprintf(cmdline, 2048, "/usr/sbin/wl monitor 1");
|
||||||
|
- if (RunSysCmd(cmdline) < 0) {
|
||||||
|
- snprintf(in_err, 1024, "Unable to set mode using 'wl monitor 1'. Some "
|
||||||
|
- "custom firmware images require you to specify the origial "
|
||||||
|
- "device and a new dynamic device and use the iwconfig controls. "
|
||||||
|
- "see the README for how to configure your capture source.");
|
||||||
|
- return -1;
|
||||||
|
- }
|
||||||
|
- } else {
|
||||||
|
- // Get the mode ... If this doesn't work, try the old wl method.
|
||||||
|
- if (Iwconfig_Get_Mode(devbits[0].c_str(), in_err, &mode) < 0) {
|
||||||
|
- fprintf(stderr, "WARNING: Getting wireless mode via ioctls failed, "
|
||||||
|
- "defaulting to trying the 'wl' command.\n");
|
||||||
|
- wlmode = 1;
|
||||||
|
- }
|
||||||
|
+ snprintf(cmdline, 2048, "/usr/sbin/iwpriv %s set_monitor 1", in_dev);
|
||||||
|
+ if (RunSysCmd(cmdline) < 0) {
|
||||||
|
+ snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 1'. Some "
|
||||||
|
+ "custom firmware images require you to specify the origial "
|
||||||
|
+ "device and a new dynamic device and use the iwconfig controls. "
|
||||||
|
+ "see the README for how to configure your capture source.", in_dev);
|
||||||
|
+ return -1;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- if (wlmode == 1) {
|
||||||
|
- snprintf(cmdline, 2048, "/usr/sbin/wl monitor 1");
|
||||||
|
- if (RunSysCmd(cmdline) < 0) {
|
||||||
|
- snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
|
||||||
|
- return -1;
|
||||||
|
- }
|
||||||
|
- } else if (mode != LINUX_WLEXT_MONITOR) {
|
||||||
|
- // Set it
|
||||||
|
- if (Iwconfig_Set_Mode(devbits[0].c_str(), in_err,
|
||||||
|
- LINUX_WLEXT_MONITOR) < 0) {
|
||||||
|
- snprintf(in_err, STATUS_MAX, "Unable to set iwconfig monitor "
|
||||||
|
- "mode. If you are using an older wrt54g, try specifying "
|
||||||
|
- "only the ethernet device, not ethX:prismX");
|
||||||
|
- return -1;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
+ return 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int unmonitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if,
|
||||||
|
+ void *in_ext) {
|
||||||
|
+ char cmdline[2048];
|
||||||
|
+ int mode;
|
||||||
|
+ int wlmode = 0;
|
||||||
|
+
|
||||||
|
+ vector<string> devbits = StrTokenize(in_dev, ":");
|
||||||
|
+
|
||||||
|
+ snprintf(cmdline, 2048, "/usr/sbin/iwpriv %s set_monitor 0", in_dev);
|
||||||
|
+ if (RunSysCmd(cmdline) < 0) {
|
||||||
|
+ snprintf(in_err, 1024, "Unable to set mode using 'iwpriv %s set_monitor 0'. Some "
|
||||||
|
+ "custom firmware images require you to specify the origial "
|
||||||
|
+ "device and a new dynamic device and use the iwconfig controls. "
|
||||||
|
+ "see the README for how to configure your capture source.", in_dev);
|
||||||
|
+ return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
diff -urN kismet.old/pcapsource.h kismet.dev/pcapsource.h
|
||||||
|
--- kismet.old/pcapsource.h 2005-08-15 00:42:50.849744000 +0200
|
||||||
|
+++ kismet.dev/pcapsource.h 2005-08-15 01:56:07.649150200 +0200
|
||||||
|
@@ -265,6 +265,7 @@
|
||||||
|
PcapSourceWrt54g(string in_name, string in_dev) : PcapSource(in_name, in_dev) {
|
||||||
|
fcsbytes = 4;
|
||||||
|
}
|
||||||
|
+ int OpenSource();
|
||||||
|
int FetchPacket(kis_packet *packet, uint8_t *data, uint8_t *moddata);
|
||||||
|
protected:
|
||||||
|
carrier_type IEEE80211Carrier();
|
||||||
|
@@ -388,6 +389,7 @@
|
||||||
|
#ifdef SYS_LINUX
|
||||||
|
// linksys wrt54g monitoring
|
||||||
|
int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext);
|
||||||
|
+int unmonitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// This should be expanded to handle BSD...
|
|
@ -1,109 +0,0 @@
|
||||||
diff -urN kismet.old/kis_packsources.cc kismet.dev/kis_packsources.cc
|
|
||||||
--- kismet.old/kis_packsources.cc 2005-07-25 12:18:47.230369000 +0200
|
|
||||||
+++ kismet.dev/kis_packsources.cc 2005-07-25 12:54:44.654390736 +0200
|
|
||||||
@@ -165,7 +165,7 @@
|
|
||||||
chancontrol_wlanng_avs, 1);
|
|
||||||
sourcetracker->RegisterPacketsource("wrt54g", 1, "na", 0,
|
|
||||||
pcapsource_wrt54g_registrant,
|
|
||||||
- monitor_wrt54g, NULL, NULL, 0);
|
|
||||||
+ monitor_wrt54g, NULL, chancontrol_wext, 1);
|
|
||||||
#else
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "wlanng");
|
|
||||||
REG_EMPTY_CARD(sourcetracker, "wlanng_avs");
|
|
||||||
diff -urN kismet.old/packetsourcetracker.cc kismet.dev/packetsourcetracker.cc
|
|
||||||
--- kismet.old/packetsourcetracker.cc 2005-04-03 07:33:42.000000000 +0200
|
|
||||||
+++ kismet.dev/packetsourcetracker.cc 2005-07-25 13:29:45.698983408 +0200
|
|
||||||
@@ -978,6 +978,7 @@
|
|
||||||
(meta_packsources[chanpak.meta_num]->device.c_str(),
|
|
||||||
chanpak.channel, errstr,
|
|
||||||
(void *) (meta_packsources[chanpak.meta_num]->capsource)) < 0) {
|
|
||||||
+#if 0
|
|
||||||
|
|
||||||
meta_packsources[chanpak.meta_num]->consec_errors++;
|
|
||||||
|
|
||||||
@@ -999,6 +1000,7 @@
|
|
||||||
CHANFLAG_FATAL));
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
} else {
|
|
||||||
// Otherwise reset the error count
|
|
||||||
meta_packsources[chanpak.meta_num]->consec_errors = 0;
|
|
||||||
diff -urN kismet.old/pcapsource.cc kismet.dev/pcapsource.cc
|
|
||||||
--- kismet.old/pcapsource.cc 2005-07-25 12:18:47.234368000 +0200
|
|
||||||
+++ kismet.dev/pcapsource.cc 2005-07-25 12:51:19.426590104 +0200
|
|
||||||
@@ -140,6 +140,48 @@
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
+
|
|
||||||
+// Open a source
|
|
||||||
+int PcapSourceWrt54g::OpenSource() {
|
|
||||||
+ channel = 0;
|
|
||||||
+
|
|
||||||
+ errstr[0] = '\0';
|
|
||||||
+
|
|
||||||
+ char *unconst = strdup("prism0");
|
|
||||||
+
|
|
||||||
+ pd = pcap_open_live(unconst, MAX_PACKET_LEN, 1, 1000, errstr);
|
|
||||||
+
|
|
||||||
+ free(unconst);
|
|
||||||
+
|
|
||||||
+ if (strlen(errstr) > 0)
|
|
||||||
+ return -1; // Error is already in errstr
|
|
||||||
+
|
|
||||||
+ paused = 0;
|
|
||||||
+
|
|
||||||
+ errstr[0] = '\0';
|
|
||||||
+
|
|
||||||
+ num_packets = 0;
|
|
||||||
+
|
|
||||||
+ if (DatalinkType() < 0)
|
|
||||||
+ return -1;
|
|
||||||
+
|
|
||||||
+#ifdef HAVE_PCAP_NONBLOCK
|
|
||||||
+ pcap_setnonblock(pd, 1, errstr);
|
|
||||||
+#elif !defined(SYS_OPENBSD)
|
|
||||||
+ // do something clever (Thanks to Guy Harris for suggesting this).
|
|
||||||
+ int save_mode = fcntl(pcap_get_selectable_fd(pd), F_GETFL, 0);
|
|
||||||
+ if (fcntl(pcap_get_selectable_fd(pd), F_SETFL, save_mode | O_NONBLOCK) < 0) {
|
|
||||||
+ snprintf(errstr, 1024, "fcntl failed, errno %d (%s)",
|
|
||||||
+ errno, strerror(errno));
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+ if (strlen(errstr) > 0)
|
|
||||||
+ return -1; // Ditto
|
|
||||||
+
|
|
||||||
+ return 1;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
// Datalink, override as appropriate
|
|
||||||
carrier_type PcapSource::IEEE80211Carrier() {
|
|
||||||
int ch = FetchChannel();
|
|
||||||
@@ -1609,7 +1651,7 @@
|
|
||||||
int monitor_wrt54g(const char *in_dev, int initch, char *in_err, void **in_if, void *in_ext) {
|
|
||||||
char cmdline[2048];
|
|
||||||
|
|
||||||
- snprintf(cmdline, 2048, "/usr/sbin/wl monitor 1");
|
|
||||||
+ snprintf(cmdline, 2048, "/usr/sbin/iwpriv %s set_monitor 1", in_dev);
|
|
||||||
if (RunSysCmd(cmdline) < 0) {
|
|
||||||
snprintf(in_err, 1024, "Unable to execute '%s'", cmdline);
|
|
||||||
return -1;
|
|
||||||
diff -urN kismet.old/pcapsource.h kismet.dev/pcapsource.h
|
|
||||||
--- kismet.old/pcapsource.h 2005-04-03 07:33:42.000000000 +0200
|
|
||||||
+++ kismet.dev/pcapsource.h 2005-07-25 12:49:22.089428064 +0200
|
|
||||||
@@ -250,11 +250,13 @@
|
|
||||||
|
|
||||||
// Override packet fetching logic on this one to discard jumbo corrupt packets
|
|
||||||
// that it likes to generate
|
|
||||||
+// Override OpenSource() to use prism0 as pcap device
|
|
||||||
class PcapSourceWrt54g : public PcapSource {
|
|
||||||
public:
|
|
||||||
PcapSourceWrt54g(string in_name, string in_dev) : PcapSource(in_name, in_dev) {
|
|
||||||
fcsbytes = 4;
|
|
||||||
}
|
|
||||||
+ int OpenSource();
|
|
||||||
int FetchPacket(kis_packet *packet, uint8_t *data, uint8_t *moddata);
|
|
||||||
protected:
|
|
||||||
carrier_type IEEE80211Carrier();
|
|
Loading…
Reference in New Issue