Ignore:
Timestamp:
Aug 25, 2011, 1:39:23 PM (13 years ago)
Author:
rick
Message:

Make sure all bssid are upper case to avoid fake unique matches.

Location:
src/django_gheat/gheat/management/commands
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/django_gheat/gheat/management/commands/import_droidstumbler.py

    r9559 r9565  
    4040  except IntegrityError, e:
    4141    logger.error("Unable to import - %s" %  e)
     42    raise
    4243  return count
    4344
     
    6364    try:
    6465      epoch, msg_type, lat, lon, accuracy, ssid, bssid, level, frequency, capabilities = row
     66      bssid = bssid.upper()
    6567    except ValueError:
    6668      # Known error, please ignore
     
    9496      ssid, encryption = ap_pool[bssid]
    9597      # Special trick in SSID ts avoid escaping in later stage
    96       item = str((bssid,ssid.replace('%','%%'),encryption))
     98      item = str((bssid.upper(),ssid.replace('%','%%'),encryption))
    9799      sql_values.append(item)
    98100    counters['ap_added'] = bulk_sql('gheat_accespoint (`mac`, `ssid`, `encryptie`)',sql_values)
  • src/django_gheat/gheat/management/commands/import_kismet.py

    r9563 r9565  
    7676      ssid, encryption = ap_pool[bssid]
    7777      # Special trick in SSID ts avoid escaping in later stage
    78       item = str((bssid,ssid.replace('%','%%'),encryption))
     78      item = str((bssid.upper(),ssid.replace('%','%%'),encryption))
    7979      sql_values.append(item)
    8080    counters['ap_added'] = bulk_sql('gheat_accespoint (`mac`, `ssid`, `encryptie`)',sql_values)
    8181
    82   # Determine which Wireless to add
     82  # Determine which Wireless Clients to add
    8383  bssid_list_present = WirelessClient.objects.filter(mac__in=client_pool.keys()).values_list('mac', flat=True)
    8484  bssid_list_insert = set(client_pool.keys()) - set(bssid_list_present)
     
    8888    sql_values = []
    8989    for bssid in bssid_list_insert:
    90       sql_values.append("('%s')" % bssid)
     90      sql_values.append("('%s')" % bssid.upper())
    9191    counters['client_added'] = bulk_sql('gheat_wirelessclient (`mac`)',sql_values)
    9292
Note: See TracChangeset for help on using the changeset viewer.