From fb0f32d568534b7020ffda4fdfd21cbe1966af9e Mon Sep 17 00:00:00 2001 From: Jonathan Foster Date: Sun, 14 Mar 2021 22:17:59 -0400 Subject: [PATCH 1/3] Fix geopoint location reference --- kismetdb/scripts/log_to_kml.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kismetdb/scripts/log_to_kml.py b/kismetdb/scripts/log_to_kml.py index f5f6c9b..75ac0f7 100644 --- a/kismetdb/scripts/log_to_kml.py +++ b/kismetdb/scripts/log_to_kml.py @@ -97,8 +97,8 @@ def main(): title = mac kml.newpoint(name=title, - coords=[(loc["kismet.common.location.lon"], - loc["kismet.common.location.lat"], + coords=[(loc["kismet.common.location.geopoint"][0], + loc["kismet.common.location.geopoint"][1], loc["kismet.common.location.alt"])]) num_plotted = num_plotted + 1 From 203bd71ce1b44af9da76495e09fa682920f5e5b6 Mon Sep 17 00:00:00 2001 From: Jonathan Foster Date: Sun, 14 Mar 2021 22:53:21 -0400 Subject: [PATCH 2/3] Add debug option to output error messages --- kismetdb/scripts/log_to_kml.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kismetdb/scripts/log_to_kml.py b/kismetdb/scripts/log_to_kml.py index 75ac0f7..6f968ab 100644 --- a/kismetdb/scripts/log_to_kml.py +++ b/kismetdb/scripts/log_to_kml.py @@ -30,6 +30,8 @@ def main(): parser.add_argument("--ssid", action="store", dest="ssid", help=("Only plot networks which match the SSID " "(or SSID regex)")) + parser.add_argument("--debug", action="store_true", dest="debug", + help="Enable debug mode") results = parser.parse_args() @@ -102,9 +104,13 @@ def main(): loc["kismet.common.location.alt"])]) num_plotted = num_plotted + 1 - except TypeError: + except TypeError as err: + if results.debug: + print("Type error: {}".format(err)) continue - except KeyError: + except KeyError as err: + if results.debug: + print("Key error: {}".format(err)) continue kml.save(results.outfile) print("Exported {} devices to {}".format(num_plotted, results.outfile)) From 6d2ae84ad8a9486a3f8d65fa871d6e4d3b890e5d Mon Sep 17 00:00:00 2001 From: Jonathan Foster Date: Sun, 14 Mar 2021 22:51:39 -0400 Subject: [PATCH 3/3] Fix missing out file default value --- kismetdb/scripts/log_to_kml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kismetdb/scripts/log_to_kml.py b/kismetdb/scripts/log_to_kml.py index 6f968ab..e6f54f3 100644 --- a/kismetdb/scripts/log_to_kml.py +++ b/kismetdb/scripts/log_to_kml.py @@ -16,7 +16,7 @@ def main(): parser.add_argument("--in", action="store", dest="infile", help="Input (.kismet) file") parser.add_argument("--out", action="store", dest="outfile", - help="Output filename (optional)") + default="out.kml", help="Output filename (optional)") parser.add_argument("--start-time", action="store", dest="starttime", help="Only list devices seen after given time") parser.add_argument("--min-signal", action="store", dest="minsignal",