new: gateway.change event for MITM monitoring

This commit is contained in:
Simone Margaritelli 2021-04-10 22:59:03 +02:00
parent 43a93fd866
commit c47e3f6195
8 changed files with 144 additions and 5 deletions

View file

@ -36,4 +36,7 @@ onEvent('wifi.client.handshake', onHandshake);
onEvent('wifi.ap.new', onNewAP);
// register for new nodes in the graph
onEvent('graph.node.new', onNewNode);
onEvent('graph.node.new', onNewNode);
// register for gateway changes
onEvent('gateway.change', onGatewayChange)

View file

@ -90,6 +90,17 @@ function onNewNode(event) {
}
}
function onGatewayChange(event) {
var change = event.data;
var message = '🚨 Detected ' + change.type + ' gateway change, possible MITM attack:\n\n' +
'Prev: ' + change.prev.ip + ' (' + change.prev.mac + ")\n" +
'New: ' + change.new.ip + ' (' + change.new.mac + ")";
// send to telegram bot
sendMessage(message);
}
function onTick(event) {
run('wifi.probe ' + fakeBSSID + ' ' + fakeESSID);
}