--- /dev/null
+from django.contrib import admin
+
+# Register your models here.
--- /dev/null
+from django.apps import AppConfig
+
+
+class AdsbmapConfig(AppConfig):
+ default_auto_field = 'django.db.models.BigAutoField'
+ name = 'adsbmap'
--- /dev/null
+from django.db import models
+
+# Create your models here.
--- /dev/null
+from django.test import TestCase
+
+# Create your tests here.
--- /dev/null
+from django.urls import path
+
+from . import views
+
+urlpatterns = [
+ path('', views.index, name='index'),
+]
+
--- /dev/null
+from django.shortcuts import render
+from django.http import HttpResponse, HttpRequest
+import os
+
+def index(request):
+ print("===")
+ print(request)
+ print("====")
+ if request.method == 'POST':
+ for key, value in request.POST.items():
+ print(key,value)
+
+ load_file = open('static/'+request.path, mode='rb')
+ if request.path == "/adsb_map_panel.html":
+ print("here")
+ return HttpResponse(load_file, content_type='text/html')
dev_list = list(load_db("select cast(device as text) from devices LIMIT "+limit+" OFFSET "+start))
else:
dev_list = list(load_db("select cast(device as text) from devices where cast(device as text) like '%"+search+"%' LIMIT "+limit+" OFFSET "+start))
- elif device_request == "phy_RTLADSB":
+ elif device_request == "phy-RTLADSB":
if search == "":
dev_list = list(load_db("select cast(device as text) from devices where phyname = 'ADSB' LIMIT "+limit+" OFFSET "+start))
else:
dev_list = list(load_db("select cast(device as text) from devices where phyname = 'UAV' LIMIT "+limit+" OFFSET "+start))
else:
dev_list = list(load_db("select cast(device as text) from devices where cast(device as text) like '%"+search+"%' and phyname = 'UAV' LIMIT "+limit+" OFFSET "+start))
- elif device_request == "phy-Zwave":
+ elif device_request == "phy-Z-Wave":
if search == "":
dev_list = list(load_db("select cast(device as text) from devices where phyname = 'Z-Wave' LIMIT "+limit+" OFFSET "+start))
else:
multikey = multikey[:-1]
multikey = multikey + "}"
return HttpResponse(multikey, content_type='text/json')
+ elif request.path == "/phy/ADSB/map_data.json":
+ #I had to do a stupid lat/long offset to draw the map grid because for some stupid reason python wouldnt do number scales right?
+ #limiting to 100 until i figure out paging
+ min_long = 361.0
+ max_long = 0.0
+ min_lat = 181.0
+ max_lat = 0.0
+ adsblist = "{ \"kismet.adsb.map.devices\": [ "
+ dev_list = list(load_db("select cast(device as text) from devices where phyname = 'ADSB' limit 100"))
+ for device in dev_list:
+ (dev,) = device
+ dev_json = json.loads(dev)
+ newdev = {}
+ newdev['kismet.device.base.first_time'] = dev_json['kismet.device.base.first_time']
+ if "kismet.device.base.location" in dev_json:
+ newdev['kismet.device.base.location'] = dev_json['kismet.device.base.location']
+ (tmp_min_long,tmp_min_lat) = newdev['kismet.device.base.location']['kismet.common.location.min_loc']['kismet.common.location.geopoint']
+ tmp_min_lat = round(tmp_min_lat + 91, 6)
+ tmp_min_long = round(tmp_min_long + 181, 6)
+ if (tmp_min_lat != 91 and tmp_min_long !=181):
+ if (tmp_min_lat < min_lat):
+ min_lat = tmp_min_lat
+ if (tmp_min_long < min_long):
+ min_long = tmp_min_long
+ (tmp_max_long,tmp_max_lat) = newdev['kismet.device.base.location']['kismet.common.location.max_loc']['kismet.common.location.geopoint']
+ tmp_max_lat = round(tmp_max_lat + 91,6)
+ tmp_max_long = round(tmp_max_long +181,6)
+ if (tmp_max_lat != 91 and tmp_max_long !=181):
+ if (tmp_max_lat > max_lat):
+ max_lat = tmp_max_lat
+ if (tmp_max_long > max_long):
+ max_long = tmp_max_long
+ newdev['kismet.device.base.macaddr'] = dev_json['kismet.device.base.macaddr']
+ newdev['adsb.device'] = dev_json['adsb.device']
+ newdev['kismet.device.base.type'] = dev_json['kismet.device.base.type']
+ newdev['kismet.device.base.commonname'] = dev_json['kismet.device.base.commonname']
+ newdev['kismet.device.base.name'] = dev_json['kismet.device.base.name']
+ newdev['kismet.device.base.packets.data'] = dev_json['kismet.device.base.packets.data']
+ newdev['kismet.device.base.frequency'] = dev_json['kismet.device.base.frequency']
+ newdev['kismet.device.base.phyname'] = dev_json['kismet.device.base.phyname']
+ newdev['kismet.device.base.last_time'] = dev_json['kismet.device.base.last_time']
+ newdev['kismet.device.base.key'] = dev_json['kismet.device.base.key']
+ adsblist = adsblist + json.dumps(newdev) + ","
+ adsblist = adsblist[:-1]
+ min_lat = round(min_lat - 91, 6)
+ min_long = round(min_long - 181, 6)
+ max_lat = round(max_lat - 91, 6)
+ max_long = round(max_long - 181, 6)
+ adsblist = adsblist + " ], \"kismet.adsb.map.min_lon\": "+str(min_long) + ", \"kismet.adsb.map.max_lat\": "+str(max_lat)+", \"kismet.adsb.map.min_lat\": "+str(min_lat)+", \"kismet.adsb.map.max_lon\": "+str(max_long)+" }"
+ return HttpResponse(adsblist, content_type='text/json')
ALLOWED_HOSTS = ['sdr-cabinet', 'sdr-cabinet.dyn.spangdorfia.com']
ASGI_APPLICATION = 'logviewer.asgi.application'
+
+X_FRAME_OPTIONS = 'SAMEORIGIN'
path('alerts/alerts_view.json', include('dbview.urls')),
path('phy/phy80211/ssids/views/ssids.json', include('dbview.urls')),
path('css/images/<str:loadfile>', include('kiscontent.urls')),
+ path('adsb_map_panel.html', include('adsbmap.urls')),
path('system/status.json', include('dbview.urls')),
path('alerts/wrapped/last-time/0/alerts.json', include('dbview.urls')),
path('messagebus/last-time/0/messages.json', include('dbview.urls')),
path('channels/channels.json', include('dbview.urls')),
path('devices/views/all/devices.json', include('dbview.urls')),
- #path('devices/views//devices.json', include('dbview.urls')),
path('devices/views/phydot11_accesspoints/devices.json', include('dbview.urls')),
path('devices/views/phy-RADIATION/devices.json', include('dbview.urls')),
path('devices/views/phy-802.15.4/devices.json', include('dbview.urls')),
path('devices/views/phy-Z-Wave/devices.json', include('dbview.urls')),
path('devices/views/phy-RTL433/devices.json', include('dbview.urls')),
path('devices/views/phy-IEEE802.11/devices.json', include('dbview.urls')),
+ path('phy/ADSB/map_data.json', include('dbview.urls')),
path('devices/by-key/<str:devicename>/device.json', include('devices.urls')),
path('devices/multikey/as-object/devices.json', include('dbview.urls')),
- #path('devices/views/phydot11_accesspoints/devices.json', include('dbview.urls')),
- #path('devices/views/phy-RADIATION/devices.json', include('dbviews.urls')),
- #path('devices/views/phy-802.15.4/devices.json', include('dbviews.utls')),
path('datasource/by-uuid/<str:devicename>/source.json', include('devices.urls')),
path('phy/phy80211/ssids/by-hash/<str:devicename>/ssid.json', include('devices.urls')),
path('eventbus/', include('eventbus.urls')),
var local_uri_prefix = "./";
if (typeof(KISMET_URI_PREFIX) !== 'undefined')
local_uri_prefix = KISMET_URI_PREFIX;
+var kismet_ui_adsb;
var kismet_ui_bluetooth;
var kismet_ui_btle;
var kismet_ui_datasources;
var kismet_ui_dot11;
+var kismet_ui_meter;
var kismet_ui_rtl433;
-//var kismet_ui_rtladsb;
-//var kismet_ui_rtlamr;
var kismet_ui_uav;
var kismet_ui_zwave;
async function load_dynamics() {
+kismet_ui_adsb = await import(`${local_uri_prefix}js/kismet.ui.adsb.js`);
kismet_ui_bluetooth = await import(`${local_uri_prefix}js/kismet.ui.bluetooth.js`);
kismet_ui_btle = await import(`${local_uri_prefix}js/kismet.ui.btle.js`);
kismet_ui_datasources = await import(`${local_uri_prefix}js/kismet.ui.datasources.js`);
kismet_ui_dot11 = await import(`${local_uri_prefix}js/kismet.ui.dot11.js`);
+kismet_ui_meter = await import(`${local_uri_prefix}js/kismet.ui.meter.js`);
kismet_ui_rtl433 = await import(`${local_uri_prefix}js/kismet.ui.rtl433.js`);
-//kismet_ui_rtladsb = await import(`${local_uri_prefix}js/kismet.ui.rtladsb.js`);
-//kismet_ui_rtlamr = await import(`${local_uri_prefix}js/kismet.ui.rtlamr.js`);
kismet_ui_uav = await import(`${local_uri_prefix}js/kismet.ui.uav.js`);
kismet_ui_zwave = await import(`${local_uri_prefix}js/kismet.ui.zwave.js`);
}