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

Function onNewAP

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

Source from the content-addressed store, hash-verified

117
118// triggered when a new WiFi access point is detected
119function onNewAP(event){
120 var ap = event.data;
121
122 // check fake ap first
123 if(ap.hostname == fakeESSID) {
124 if(notifyRogueAPs) {
125 var message = '🦠 Detected rogue AP:\n\n' +
126 decorateMac('AP', ap.mac, ap.vendor);
127 // send to telegram bot
128 sendMessage(message);
129 }
130 return;
131 }
132
133 if( ap.mac in db.aps ) {
134 updateAP(ap);
135 } else {
136 createAP(ap);
137 }
138
139 saveJSON(db, dbPath);
140}
141
142// pretty print a MAC depending if it's an IP endpoint or WiFi access point
143function decorateAddress(label, mac) {

Callers

nothing calls this directly

Calls 4

decorateMacFunction · 0.85
sendMessageFunction · 0.85
updateAPFunction · 0.85
createAPFunction · 0.85

Tested by

no test coverage detected