Update public source
This commit is contained in:
@@ -360,6 +360,12 @@ def get_category(
|
|||||||
):
|
):
|
||||||
return "handshake"
|
return "handshake"
|
||||||
|
|
||||||
|
if (
|
||||||
|
str(access_point["encryption"] or "").strip().upper()
|
||||||
|
== "OPEN"
|
||||||
|
):
|
||||||
|
return "open"
|
||||||
|
|
||||||
return "other"
|
return "other"
|
||||||
|
|
||||||
|
|
||||||
@@ -1264,6 +1270,18 @@ def render_search_page(
|
|||||||
Handshake / PMKID
|
Handshake / PMKID
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
data-category="open"
|
||||||
|
checked
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="map-layer-dot map-layer-dot-open"
|
||||||
|
></span>
|
||||||
|
Open AP
|
||||||
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
@@ -1351,6 +1369,8 @@ def render_search_page(
|
|||||||
"search-password",
|
"search-password",
|
||||||
handshake:
|
handshake:
|
||||||
"search-handshake",
|
"search-handshake",
|
||||||
|
open:
|
||||||
|
"search-open",
|
||||||
other:
|
other:
|
||||||
"search-other"
|
"search-other"
|
||||||
};
|
};
|
||||||
@@ -1522,6 +1542,37 @@ def render_search_page(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
map.addLayer(
|
||||||
|
{
|
||||||
|
id:
|
||||||
|
"search-open",
|
||||||
|
|
||||||
|
type:
|
||||||
|
"circle",
|
||||||
|
|
||||||
|
source:
|
||||||
|
"search-aps",
|
||||||
|
|
||||||
|
filter: [
|
||||||
|
"==",
|
||||||
|
[
|
||||||
|
"get",
|
||||||
|
"category"
|
||||||
|
],
|
||||||
|
"open"
|
||||||
|
],
|
||||||
|
|
||||||
|
paint: {
|
||||||
|
"circle-radius": 7,
|
||||||
|
"circle-stroke-width": 2,
|
||||||
|
"circle-color":
|
||||||
|
"#AB47BC",
|
||||||
|
"circle-stroke-color":
|
||||||
|
"#0f141a"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
map.addLayer(
|
map.addLayer(
|
||||||
{
|
{
|
||||||
id:
|
id:
|
||||||
@@ -1569,6 +1620,7 @@ def render_search_page(
|
|||||||
[
|
[
|
||||||
"search-password",
|
"search-password",
|
||||||
"search-handshake",
|
"search-handshake",
|
||||||
|
"search-open",
|
||||||
"search-other"
|
"search-other"
|
||||||
].forEach(
|
].forEach(
|
||||||
(layerId) => {
|
(layerId) => {
|
||||||
|
|||||||
+288
-235
@@ -1320,63 +1320,76 @@ map.on(
|
|||||||
// Access Points
|
// Access Points
|
||||||
// ==================================================
|
// ==================================================
|
||||||
|
|
||||||
const apFeatures = [];
|
const apFeatures = [];
|
||||||
const handshakeFeatures = [];
|
const handshakeFeatures = [];
|
||||||
const pmkidFeatures = [];
|
const pmkidFeatures = [];
|
||||||
const passwordFeatures = [];
|
const passwordFeatures = [];
|
||||||
|
const openFeatures = [];
|
||||||
|
|
||||||
|
|
||||||
markers.forEach(
|
markers.forEach(
|
||||||
function(ap)
|
function(ap)
|
||||||
{
|
{
|
||||||
const feature = {
|
const feature = {
|
||||||
type:"Feature",
|
type:"Feature",
|
||||||
geometry:{
|
geometry:{
|
||||||
type:"Point",
|
type:"Point",
|
||||||
coordinates:[
|
coordinates:[
|
||||||
ap.lon,
|
ap.lon,
|
||||||
ap.lat
|
ap.lat
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
properties:{
|
properties:{
|
||||||
popup:ap.popup || "",
|
popup:ap.popup || "",
|
||||||
handshake:ap.handshake,
|
handshake:ap.handshake,
|
||||||
pmkid:ap.pmkid,
|
pmkid:ap.pmkid,
|
||||||
cracked:ap.cracked
|
cracked:ap.cracked,
|
||||||
}
|
encryption:ap.encryption
|
||||||
};
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// All Access Points source.
|
// All Access Points source.
|
||||||
// Every AP belongs here so that clustering
|
// Every AP belongs here so that clustering
|
||||||
// represents the complete AP population.
|
// represents the complete AP population.
|
||||||
apFeatures.push(
|
apFeatures.push(
|
||||||
feature
|
feature
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if(ap.cracked)
|
if(ap.cracked)
|
||||||
{
|
{
|
||||||
passwordFeatures.push(
|
passwordFeatures.push(
|
||||||
feature
|
feature
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(ap.pmkid)
|
else if(ap.pmkid)
|
||||||
{
|
{
|
||||||
pmkidFeatures.push(
|
pmkidFeatures.push(
|
||||||
feature
|
feature
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(ap.handshake)
|
else if(ap.handshake)
|
||||||
{
|
{
|
||||||
handshakeFeatures.push(
|
handshakeFeatures.push(
|
||||||
feature
|
feature
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
);
|
else if(
|
||||||
|
String(ap.encryption || "")
|
||||||
|
.trim()
|
||||||
|
.toUpperCase() === "OPEN"
|
||||||
|
)
|
||||||
|
{
|
||||||
|
openFeatures.push(
|
||||||
|
feature
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
const createSource =
|
const createSource =
|
||||||
@@ -1454,6 +1467,13 @@ map.on(
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
createSource(
|
||||||
|
|
||||||
|
"open-aps",
|
||||||
|
|
||||||
|
openFeatures
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
// ==================================================
|
// ==================================================
|
||||||
// AP clusters
|
// AP clusters
|
||||||
@@ -1670,6 +1690,16 @@ paint:{
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
addPointLayer(
|
||||||
|
|
||||||
|
"open-ap-points",
|
||||||
|
|
||||||
|
"open-aps",
|
||||||
|
|
||||||
|
"#AB47BC"
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
// ==================================================
|
// ==================================================
|
||||||
// Popups
|
// Popups
|
||||||
@@ -1685,153 +1715,155 @@ paint:{
|
|||||||
|
|
||||||
"password-points"
|
"password-points"
|
||||||
|
|
||||||
|
"open-ap-points"
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
popupLayers.forEach(
|
popupLayers.forEach(
|
||||||
function(layerId)
|
function(layerId)
|
||||||
{
|
{
|
||||||
map.on(
|
map.on(
|
||||||
"click",
|
"click",
|
||||||
layerId,
|
layerId,
|
||||||
function(e)
|
function(e)
|
||||||
{
|
{
|
||||||
if(
|
if(
|
||||||
!e.features
|
!e.features
|
||||||
||
|
||
|
||||||
!e.features.length
|
!e.features.length
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const feature =
|
const feature =
|
||||||
e.features[0];
|
e.features[0];
|
||||||
|
|
||||||
if(
|
if(
|
||||||
!feature
|
!feature
|
||||||
||
|
||
|
||||||
!feature.properties
|
!feature.properties
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const popup =
|
const popup =
|
||||||
feature.properties.popup
|
feature.properties.popup
|
||||||
||
|
||
|
||||||
"<b>Access Point</b>";
|
"<b>Access Point</b>";
|
||||||
|
|
||||||
new maplibregl.Popup()
|
new maplibregl.Popup()
|
||||||
.setLngLat(
|
.setLngLat(
|
||||||
feature.geometry.coordinates
|
feature.geometry.coordinates
|
||||||
)
|
)
|
||||||
.setHTML(
|
.setHTML(
|
||||||
popup
|
popup
|
||||||
)
|
)
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
map.on(
|
map.on(
|
||||||
"mouseenter",
|
"mouseenter",
|
||||||
layerId,
|
layerId,
|
||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
map.getCanvas().style.cursor =
|
map.getCanvas().style.cursor =
|
||||||
"pointer";
|
"pointer";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
map.on(
|
map.on(
|
||||||
"mouseleave",
|
"mouseleave",
|
||||||
layerId,
|
layerId,
|
||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
map.getCanvas().style.cursor =
|
map.getCanvas().style.cursor =
|
||||||
"";
|
"";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// ==================================================
|
// ==================================================
|
||||||
// Cluster click
|
// Cluster click
|
||||||
// ==================================================
|
// ==================================================
|
||||||
|
|
||||||
map.on(
|
map.on(
|
||||||
"click",
|
"click",
|
||||||
"ap-clusters",
|
"ap-clusters",
|
||||||
function(e)
|
function(e)
|
||||||
{
|
{
|
||||||
const features =
|
const features =
|
||||||
map.queryRenderedFeatures(
|
map.queryRenderedFeatures(
|
||||||
e.point,
|
e.point,
|
||||||
{
|
{
|
||||||
layers:[
|
layers:[
|
||||||
"ap-clusters"
|
"ap-clusters"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if(
|
if(
|
||||||
!features.length
|
!features.length
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const clusterId =
|
const clusterId =
|
||||||
features[0].properties
|
features[0].properties
|
||||||
.cluster_id;
|
.cluster_id;
|
||||||
|
|
||||||
map.getSource("aps")
|
map.getSource("aps")
|
||||||
.getClusterExpansionZoom(
|
.getClusterExpansionZoom(
|
||||||
clusterId,
|
clusterId,
|
||||||
function(
|
function(
|
||||||
error,
|
error,
|
||||||
zoom
|
zoom
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
map.easeTo({
|
map.easeTo({
|
||||||
center:
|
center:
|
||||||
features[0]
|
features[0]
|
||||||
.geometry
|
.geometry
|
||||||
.coordinates,
|
.coordinates,
|
||||||
|
|
||||||
zoom:zoom
|
zoom:zoom
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
map.on(
|
map.on(
|
||||||
"mouseenter",
|
"mouseenter",
|
||||||
"ap-clusters",
|
"ap-clusters",
|
||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
map.getCanvas().style.cursor =
|
map.getCanvas().style.cursor =
|
||||||
"pointer";
|
"pointer";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
map.on(
|
map.on(
|
||||||
"mouseleave",
|
"mouseleave",
|
||||||
"ap-clusters",
|
"ap-clusters",
|
||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
map.getCanvas().style.cursor =
|
map.getCanvas().style.cursor =
|
||||||
"";
|
"";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// ==================================================
|
// ==================================================
|
||||||
@@ -1887,76 +1919,85 @@ paint:{
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// ==================================================
|
// ==================================================
|
||||||
// Layer switcher
|
// Layer switcher
|
||||||
// ==================================================
|
// ==================================================
|
||||||
|
|
||||||
document.querySelectorAll(
|
document.querySelectorAll(
|
||||||
".session-map-controls input[data-layer]"
|
".session-map-controls input[data-layer]"
|
||||||
).forEach(
|
).forEach(
|
||||||
function(input)
|
function(input)
|
||||||
{
|
{
|
||||||
input.addEventListener(
|
input.addEventListener(
|
||||||
"change",
|
"change",
|
||||||
function()
|
function()
|
||||||
{
|
{
|
||||||
const layer =
|
const layer =
|
||||||
input.dataset.layer;
|
input.dataset.layer;
|
||||||
|
|
||||||
|
|
||||||
layerState[layer] =
|
layerState[layer] =
|
||||||
input.checked;
|
input.checked;
|
||||||
|
|
||||||
|
|
||||||
if(layer === "gps")
|
if(layer === "gps")
|
||||||
{
|
{
|
||||||
setLayerVisibility(
|
setLayerVisibility(
|
||||||
[
|
[
|
||||||
"gps-track"
|
"gps-track"
|
||||||
],
|
],
|
||||||
input.checked
|
input.checked
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(layer === "handshake")
|
if(layer === "handshake")
|
||||||
{
|
{
|
||||||
setLayerVisibility(
|
setLayerVisibility(
|
||||||
[
|
[
|
||||||
"handshake-points",
|
"handshake-points",
|
||||||
"pmkid-points"
|
"pmkid-points"
|
||||||
],
|
],
|
||||||
input.checked
|
input.checked
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(layer === "password")
|
if(layer === "password")
|
||||||
{
|
{
|
||||||
setLayerVisibility(
|
setLayerVisibility(
|
||||||
[
|
[
|
||||||
"password-points"
|
"password-points"
|
||||||
],
|
],
|
||||||
input.checked
|
input.checked
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(layer === "open")
|
||||||
|
{
|
||||||
|
setLayerVisibility(
|
||||||
|
[
|
||||||
|
"open-ap-points"
|
||||||
|
],
|
||||||
|
input.checked
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if(layer === "all")
|
if(layer === "all")
|
||||||
{
|
{
|
||||||
setLayerVisibility(
|
setLayerVisibility(
|
||||||
[
|
[
|
||||||
"ap-points",
|
"ap-points",
|
||||||
"ap-clusters",
|
"ap-clusters",
|
||||||
"ap-cluster-count"
|
"ap-cluster-count"
|
||||||
],
|
],
|
||||||
input.checked
|
input.checked
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
// ==================================================
|
// ==================================================
|
||||||
@@ -2054,6 +2095,18 @@ window.setTimeout(
|
|||||||
Password
|
Password
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
data-layer="open"
|
||||||
|
checked
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
class="map-layer-dot map-layer-dot-open"
|
||||||
|
></span>
|
||||||
|
Open AP
|
||||||
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
|
|||||||
Reference in New Issue
Block a user