kismetwireless/python-kismet-db

kismet_log_devices_to_json produces unexpected json

solsticedhiver opened this issue · 0 comments

The output file of kismet_log_devices_to_json is a correct json file but it is a list of strings, which is not usefull.

It seems each object of the list has been converted to a string by out of placed quote at the start and end of each line of the file, and all the quotes inside the "object" are escaped with \.

For example:

[
"{<object1>}",
"{<object2>}",
"{<object3>}"
]

To get a usefull json file, one can use:

sed -e 's/\\"/"/g' -e 's/ "{/ {/g' -e 's/}",$/},/g' -e 's/}"$/}/g'  broken.json > fixed.json

The correct output should have been:

[
{<object1>},
{<object2>},
{<object3>}
]

where each object has quote not escaped.

Tested with a KismetDB version: 6