MCPcopy Index your code
hub / github.com/bettercap/scripts / onNewEndpoint

Function onNewEndpoint

security_monitor/functions.js:96–116  ·  view source on GitHub ↗
(event)

Source from the content-addressed store, hash-verified

94
95// triggered when a new IPv4 or IPv6 endpoint is detected on the LAN
96function onNewEndpoint(event) {
97 var endpoint = event.data;
98 var msg = null;
99
100 if( endpoint.mac in db.endpoints ){
101 log('known endpoint ' + endpoint.mac + ' connected');
102
103 updateEndpoint(endpoint);
104 } else {
105 var msg = "🚨 Unknown endpoint connected:\n\n" +
106 decorateEndpoint(endpoint, '');
107
108 createEndpoint(endpoint);
109 }
110
111 saveJSON(db, dbPath);
112
113 if(notifyUknownEndpoints && msg != null) {
114 sendMessage(msg);
115 }
116}
117
118// triggered when a new WiFi access point is detected
119function onNewAP(event){

Callers

nothing calls this directly

Calls 4

updateEndpointFunction · 0.85
decorateEndpointFunction · 0.85
createEndpointFunction · 0.85
sendMessageFunction · 0.85

Tested by

no test coverage detected