Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

analyse.c File Reference

#include <include.h>
#include <src/analyse.h>
#include <src/interface.h>
#include <src/crt_io.h>
#include <src/conversion.h>
#include <src/manuf.h>

Include dependency graph for analyse.c:

Go to the source code of this file.

Defines

#define HISTO_SIGNAL_SIZE   32
#define HISTO_SIGNAL_CHAN   14

Functions

void LogPutSSID_byAddMAc (UINT8 AddMac[WLAN_ADDR_LEN], char *SSID)
void LogPutSSID_byBSSID (UINT8 BSSID[WLAN_ADDR_LEN], char *SSID)
void CalculCoef (UINT32 X[4], UINT32 Y[4], float *a, float *b)
UINT8 CompareAddMac (UINT8 AddMac1[WLAN_ADDR_LEN], UINT8 AddMac2[WLAN_ADDR_LEN])
void LogPutSN (UINT8 AddMac[WLAN_ADDR_LEN], UINT32 SN)
void LogPutRate (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 Rate)
void LogPutMaxRate (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 Rate)
void LogDetectedClient (UINT8 AddMac[WLAN_ADDR_LEN])
void LogPutBSSID (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 BSSID[WLAN_ADDR_LEN])
void LogPutDS (UINT8 AddMac[WLAN_ADDR_LEN])
void LogPutWep (UINT8 BSSID[WLAN_ADDR_LEN], UINT8 hasWep)
void LogPutChannel_byAddMac (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 Channel)
void LogPutChannel_byBSSID (UINT8 BSSID[WLAN_ADDR_LEN], UINT8 Channel)
void LogPutChannel (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 BSSID[WLAN_ADDR_LEN], UINT8 Channel)
void LogPutSSID_byAddMac (UINT8 AddMac[WLAN_ADDR_LEN], char *SSID)
void LogPutSSID (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 BSSID[WLAN_ADDR_LEN], char *SSID)
void LogPutIsAP (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 hasWep, UINT16 bcn_int)
void LogPutIsP2P (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 hasWep, UINT16 bcn_int)
void LogPutOtherInformation (UINT8 AddMac[WLAN_ADDR_LEN], char *OtherInformation)
void LogPutTimestamp (UINT8 AddMac[WLAN_ADDR_LEN], UINT64 TimeStamp)
void LogPutSeqNum (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 AddMacDst[WLAN_ADDR_LEN], UINT16 SeqNum)
void LogPutLastIV (UINT8 AddMac[WLAN_ADDR_LEN], UINT8 IV[4])
void LogWriteReport (void)
void LogWriteDOT (FILE *filename)
void LogWriteHisto (void)
void WritePanel (UINT8 GoodPacket)
void DoSummary (void)
UINT8 IDS_BcnInt (void)
UINT8 IDS_TimeStamp (void)
UINT8 IDS_Var_SeqNum (void)
UINT8 IDS_Detect_FakeAP (void)
UINT8 IDS (void)

Variables

static UINT8 ID []
static UINT16 NumberOfDetectedClient = 0
static ClientInfo_t ClientInfo [8192]
const UINT8 BroadcastMAC [WLAN_ADDR_LEN]
WINDOW * Panel_WND
WINDOW * RealTime_WND
ScanResult_t Res
Statistics_t Stats
UINT8 ids_warning
ConfigStruct config
pthread_mutex_t screen_mutex
 MUTEX for lock screen, so only one func write to it at the same time.


Define Documentation

#define HISTO_SIGNAL_SIZE   32
 

Referenced by LogWriteHisto().

#define HISTO_SIGNAL_CHAN   14
 

Referenced by LogWriteHisto().


Function Documentation

void LogPutSSID_byAddMAc UINT8  AddMac[WLAN_ADDR_LEN],
char *  SSID
 

void LogPutSSID_byBSSID UINT8  BSSID[WLAN_ADDR_LEN],
char *  SSID
 

Definition at line 259 of file analyse.c.

References ClientInfo, CompareAddMac(), NumberOfDetectedClient, and WLAN_SSID_MAXLEN.

Referenced by LogPutSSID().

void CalculCoef UINT32  X[4],
UINT32  Y[4],
float *  a,
float *  b
 

Function : CalculCoef Resolve equation Y = a.X + b

Definition at line 771 of file analyse.c.

References HISTORY_SIZE.

UINT8 CompareAddMac UINT8  AddMac1[WLAN_ADDR_LEN],
UINT8  AddMac2[WLAN_ADDR_LEN]
 

Compare two MAC address

Definition at line 64 of file analyse.c.

Referenced by LogDetectedClient(), LogPutBSSID(), LogPutChannel(), LogPutChannel_byAddMac(), LogPutChannel_byBSSID(), LogPutDS(), LogPutIsAP(), LogPutIsP2P(), LogPutLastIV(), LogPutMaxRate(), LogPutOtherInformation(), LogPutRate(), LogPutSeqNum(), LogPutSN(), LogPutSSID(), LogPutSSID_byAddMac(), LogPutSSID_byBSSID(), LogPutTimestamp(), and LogPutWep().

void LogPutSN UINT8  AddMac[WLAN_ADDR_LEN],
UINT32  SN
 

Definition at line 77 of file analyse.c.

References ClientInfo, CompareAddMac(), HISTORY_SIZE, NumberOfDetectedClient, ClientInfo_t::SN, ClientInfo_t::SNMax, ClientInfo_t::SNMed, ClientInfo_t::SNMin, and UINT32.

Referenced by analyseBeacon(), analyseData(), analyseMGMT(), analyseProbeRep(), analyseProbeReq(), analysePSPOLL(), and analyseRTS().

void LogPutRate UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  Rate
 

Definition at line 105 of file analyse.c.

References ClientInfo, CompareAddMac(), NumberOfDetectedClient, ClientInfo_t::RateMax, and ClientInfo_t::RateMin.

Referenced by analyseBeacon(), analyseData(), analyseMGMT(), analyseProbeRep(), analyseProbeReq(), analysePSPOLL(), and analyseRTS().

void LogPutMaxRate UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  Rate
 

Definition at line 121 of file analyse.c.

References ClientInfo, CompareAddMac(), ClientInfo_t::MaxSpeed, and NumberOfDetectedClient.

Referenced by ProcessTagBits().

void LogDetectedClient UINT8  AddMac[WLAN_ADDR_LEN]  ) 
 

Definition at line 131 of file analyse.c.

References AddMacToManufModel(), AddMacToManufName(), BroadcastMAC, ClientInfo, CompareAddMac(), debug, MANUF_MAXSTRINGLENGTH, MAX_NUMBER_OF_DETECTED_CLIENT, NumberOfDetectedClient, and WLAN_ADDR_LEN.

Referenced by analyseACK(), analyseBeacon(), analyseCTS(), analyseData(), analyseMGMT(), analyseProbeRep(), analyseProbeReq(), analysePSPOLL(), and analyseRTS().

void LogPutBSSID UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  BSSID[WLAN_ADDR_LEN]
 

Definition at line 165 of file analyse.c.

References BroadcastMAC, ClientInfo, CompareAddMac(), NumberOfDetectedClient, and WLAN_ADDR_LEN.

Referenced by analyseBeacon(), analyseData(), analyseProbeRep(), and analyseProbeReq().

void LogPutDS UINT8  AddMac[WLAN_ADDR_LEN]  ) 
 

Definition at line 180 of file analyse.c.

References ClientInfo, CompareAddMac(), ClientInfo_t::IsDS, and NumberOfDetectedClient.

Referenced by analyseData().

void LogPutWep UINT8  BSSID[WLAN_ADDR_LEN],
UINT8  hasWep
 

Definition at line 192 of file analyse.c.

References ClientInfo, CompareAddMac(), ClientInfo_t::hasWep, and NumberOfDetectedClient.

Referenced by LogPutIsAP().

void LogPutChannel_byAddMac UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  Channel
 

Definition at line 203 of file analyse.c.

References ClientInfo_t::Channel, ClientInfo, CompareAddMac(), and NumberOfDetectedClient.

Referenced by LogPutChannel().

void LogPutChannel_byBSSID UINT8  BSSID[WLAN_ADDR_LEN],
UINT8  Channel
 

Definition at line 216 of file analyse.c.

References ClientInfo_t::Channel, ClientInfo, CompareAddMac(), and NumberOfDetectedClient.

Referenced by LogPutChannel().

void LogPutChannel UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  BSSID[WLAN_ADDR_LEN],
UINT8  Channel
 

Definition at line 228 of file analyse.c.

References BroadcastMAC, CompareAddMac(), LogPutChannel_byAddMac(), and LogPutChannel_byBSSID().

Referenced by ProcessTagBits().

void LogPutSSID_byAddMac UINT8  AddMac[WLAN_ADDR_LEN],
char *  SSID
 

Definition at line 240 of file analyse.c.

References ClientInfo, CompareAddMac(), NumberOfDetectedClient, and WLAN_SSID_MAXLEN.

Referenced by LogPutSSID().

void LogPutSSID UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  BSSID[WLAN_ADDR_LEN],
char *  SSID
 

Definition at line 278 of file analyse.c.

References BroadcastMAC, CompareAddMac(), LogPutSSID_byAddMac(), and LogPutSSID_byBSSID().

Referenced by ProcessTagBits().

void LogPutIsAP UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  hasWep,
UINT16  bcn_int
 

Definition at line 291 of file analyse.c.

References ClientInfo_t::bcn_int, ClientInfo, CompareAddMac(), ClientInfo_t::hasWep, HISTORY_SIZE, ClientInfo_t::IsAP, LogPutWep(), NumberOfDetectedClient, and WLAN_ADDR_LEN.

Referenced by analyseBeacon(), analyseData(), and analyseProbeRep().

void LogPutIsP2P UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  hasWep,
UINT16  bcn_int
 

Definition at line 313 of file analyse.c.

References ClientInfo_t::bcn_int, ClientInfo, CompareAddMac(), debug, ClientInfo_t::hasWep, HISTORY_SIZE, ClientInfo_t::IsAP, ClientInfo_t::IsP2P, and NumberOfDetectedClient.

Referenced by analyseBeacon(), and analyseProbeRep().

void LogPutOtherInformation UINT8  AddMac[WLAN_ADDR_LEN],
char *  OtherInformation
 

Definition at line 334 of file analyse.c.

References ClientInfo, CompareAddMac(), MAXSIZE_OTHERINFORMATION, and NumberOfDetectedClient.

Referenced by ProcessTagBits().

void LogPutTimestamp UINT8  AddMac[WLAN_ADDR_LEN],
UINT64  TimeStamp
 

Get a timestamp of a BSSID and put it in the fifo of TS

Todo:
TODO Save System Timestamp

Definition at line 348 of file analyse.c.

References ClientInfo, CompareAddMac(), debug, HISTORY_SIZE, NumberOfDetectedClient, and ClientInfo_t::TimeStamp.

Referenced by analyseBeacon(), and analyseProbeRep().

void LogPutSeqNum UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  AddMacDst[WLAN_ADDR_LEN],
UINT16  SeqNum
 

Get a Sequence Number of a BSSID and put it in the fifo of SeqNum

TODO : Analyse also when it's not a broadcast packet ad a new array (Mac@ cli, SeqNum)

Definition at line 371 of file analyse.c.

References BroadcastMAC, ClientInfo, CompareAddMac(), HISTORY_SIZE, NumberOfDetectedClient, ClientInfo_t::SeqNum, and WLAN_GET_SEQ_SEQNUM.

Referenced by analyseBeacon(), analyseMGMT(), analyseProbeRep(), analyseProbeReq(), and analysePSPOLL().

void LogPutLastIV UINT8  AddMac[WLAN_ADDR_LEN],
UINT8  IV[4]
 

Put the last IV find in packets

Definition at line 392 of file analyse.c.

References ClientInfo, CompareAddMac(), ClientInfo_t::LastIV, and NumberOfDetectedClient.

void LogWriteReport void   ) 
 

Write the final report

Definition at line 410 of file analyse.c.

References AddMacToManufModel(), AddMacToManufName(), ClientInfo, NumberOfDetectedClient, and RateToString().

Referenced by main().

void LogWriteDOT FILE *  filename  ) 
 

Write the .dot file with all informations we have

Definition at line 508 of file analyse.c.

References ClientInfo, and NumberOfDetectedClient.

Referenced by main().

void LogWriteHisto void   ) 
 

Definition at line 565 of file analyse.c.

References debug, HISTO_SIGNAL_CHAN, HISTO_SIGNAL_SIZE, Statistics_t::MaxSignal, NumberOfDetectedClient, and Stats.

Referenced by main().

void WritePanel UINT8  GoodPacket  ) 
 

Definition at line 616 of file analyse.c.

References ClientInfo, COL_WND_PANEL, config, debug, ConfigStruct::DoNotDisplay, ConfigStruct::FirstNIC, HISTOSIZE, IS_BIT_SET, ClientInfo_t::Manuf, NumberOfDetectedClient, Panel_WND, POS_HISTO, POS_MAC, POS_SSID, Posit, Res, ROW_WND_PANEL, screen_mutex, ScanResult_t::Signal, ClientInfo_t::SNMax, ClientInfo_t::SNMed, and ScanResult_t::SrcMac.

Referenced by main().

void DoSummary void   ) 
 

Function to calculate some stats

Definition at line 738 of file analyse.c.

References Statistics_t::AP, Statistics_t::Channel, ClientInfo_t::Channel, ClientInfo, NumberOfDetectedClient, Statistics_t::STA, and Stats.

Referenced by WriteSummary().

UINT8 IDS_BcnInt void   ) 
 

IDS module : Analysis of Beacons Intervals

Beacon interval history is suspect

Definition at line 806 of file analyse.c.

References ClientInfo, HISTORY_SIZE, NumberOfDetectedClient, and Send_IDS_Warning().

Referenced by IDS().

UINT8 IDS_TimeStamp void   ) 
 

TS history is suspect

Definition at line 838 of file analyse.c.

References ClientInfo, HISTORY_SIZE, NumberOfDetectedClient, and Send_IDS_Warning().

Referenced by IDS().

UINT8 IDS_Var_SeqNum void   ) 
 

Analyse SeqNumber variation to determine if a problem is occur, like an usurpation of MAC ADD

SeqNum history is suspect

Definition at line 884 of file analyse.c.

References ClientInfo, debug, HISTORY_SIZE, NumberOfDetectedClient, and Send_IDS_Warning().

Referenced by IDS().

UINT8 IDS_Detect_FakeAP void   ) 
 

Definition at line 918 of file analyse.c.

Referenced by IDS().

UINT8 IDS void   ) 
 

Function to analyse data and try to determine an Intrusion or a DOS Try also to determine a jammer like FakeAP

ret == 0x01; Beacon interval history is suspect ret == 0x02; TS history is suspect ret == 0x04; SeqNum history is suspect

Definition at line 929 of file analyse.c.

References IDS_BcnInt(), IDS_Detect_FakeAP(), IDS_TimeStamp(), and IDS_Var_SeqNum().

Referenced by main().


Variable Documentation

UINT8 ID[] [static]
 

Initial value:

    "$Id: analyse.c,v 1.36 2005/02/23 11:36:52 poggij Exp $"

Definition at line 41 of file analyse.c.

UINT16 NumberOfDetectedClient = 0 [static]
 

Definition at line 43 of file analyse.c.

Referenced by DoSummary(), IDS_BcnInt(), IDS_TimeStamp(), IDS_Var_SeqNum(), LogDetectedClient(), LogPutBSSID(), LogPutChannel_byAddMac(), LogPutChannel_byBSSID(), LogPutDS(), LogPutIsAP(), LogPutIsP2P(), LogPutLastIV(), LogPutMaxRate(), LogPutOtherInformation(), LogPutRate(), LogPutSeqNum(), LogPutSN(), LogPutSSID_byAddMac(), LogPutSSID_byBSSID(), LogPutTimestamp(), LogPutWep(), LogWriteDOT(), LogWriteHisto(), LogWriteReport(), and WritePanel().

ClientInfo_t ClientInfo[8192] [static]
 

Definition at line 44 of file analyse.c.

Referenced by DoSummary(), IDS_BcnInt(), IDS_TimeStamp(), IDS_Var_SeqNum(), LogDetectedClient(), LogPutBSSID(), LogPutChannel_byAddMac(), LogPutChannel_byBSSID(), LogPutDS(), LogPutIsAP(), LogPutIsP2P(), LogPutLastIV(), LogPutMaxRate(), LogPutOtherInformation(), LogPutRate(), LogPutSeqNum(), LogPutSN(), LogPutSSID_byAddMac(), LogPutSSID_byBSSID(), LogPutTimestamp(), LogPutWep(), LogWriteDOT(), LogWriteReport(), and WritePanel().

const UINT8 BroadcastMAC[WLAN_ADDR_LEN]
 

Initial value:

    { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }

Definition at line 45 of file analyse.c.

Referenced by LogDetectedClient(), LogPutBSSID(), LogPutChannel(), LogPutSeqNum(), and LogPutSSID().

WINDOW* Panel_WND
 

Definition at line 60 of file scanner.c.

Referenced by InitScreen(), main(), RefreshAllWND(), RefreshRealTime_WND_th(), and WritePanel().

WINDOW * RealTime_WND
 

Definition at line 60 of file scanner.c.

Referenced by debug(), debugTS(), DumpHexPaquets(), InitScreen(), main(), RefreshAllWND(), RefreshRealTime_WND_th(), and warning().

ScanResult_t Res
 

Definition at line 59 of file scanner.c.

Referenced by analyseACK(), analyseBeacon(), analyseCTS(), analyseData(), analyseMGMT(), analyseProbeRep(), analyseProbeReq(), analysePSPOLL(), analyseRTS(), dataIsCrypted(), main(), processPacket(), ProcessTagBits(), selectChannel(), selectChannelWLAN(), UpdateOtherInformation(), and WritePanel().

Statistics_t Stats
 

Definition at line 61 of file scanner.c.

Referenced by dataIsCrypted(), DoSummary(), LogWriteHisto(), main(), processPacket(), and WriteSummary().

UINT8 ids_warning
 

Referenced by main().

ConfigStruct config
 

Definition at line 57 of file scanner.c.

Referenced by ChangeChannel_th(), closePacket(), debug(), debugTS(), DispConf(), fatal(), getPacket(), InitConfiguration(), main(), openCard(), openCardCISCO(), openPacket(), parse_keystring(), ParseCommandLine(), RefreshRealTime_WND_th(), selectChannel(), selectChannelCISCO(), Send_IDS_Warning(), shutCard(), shutCardCISCO(), warning(), WritePanel(), and WriteSummary().

pthread_mutex_t screen_mutex
 

MUTEX for lock screen, so only one func write to it at the same time.

Definition at line 66 of file scanner.c.

Referenced by check_keys_th(), debug(), debugTS(), DumpHexPaquets(), main(), parse_keystring(), PrintScaleChannel(), RefreshAllWND(), RefreshRealTime_WND_th(), stop_signal(), warning(), WritePanel(), and WriteSummary().


Generated on Fri Feb 25 12:02:39 2005 for WifiScanner by  doxygen 1.4.1