-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: small fix or general refactoring i did not bother commenting
- Loading branch information
1 parent
71ac5bb
commit bc7d1d9
Showing
3 changed files
with
105 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
var fakeESSID = random.String(16, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); | ||
var fakeBSSID = random.Mac() | ||
|
||
// uses graph.to_dot and graphviz to generate a png graph | ||
function createGraph(who, where) { | ||
// generates a .dot file with the graph for this mac | ||
run('graph.to_dot ' + who); | ||
// uses graphviz to make a png of it | ||
run('!dot -Tpng bettergraph.dot > ' + where); | ||
} | ||
|
||
function onDeauthentication(event) { | ||
var data = event.data; | ||
|
||
createGraph(data.address1, '/tmp/graph_deauth.png'); | ||
|
||
var message = '🚨 Detected deauthentication frame:\n\n' + | ||
// 'Time: ' + event.time + "\n" + | ||
// 'GPS: lat=' + session.GPS.Latitude + " lon=" + session.GPS.Longitude + " updated_at=" + | ||
//session.GPS.Updated.String() + "\n\n" + | ||
'RSSI: ' + data.rssi + "\n" + | ||
'Reason: ' + data.reason + "\n" + | ||
'Address1: ' + data.address1 + "\n" + | ||
'Address2: ' + data.address2 + "\n" + | ||
'Address3: ' + data.address3; | ||
|
||
// send to telegram bot | ||
sendMessage(message); | ||
sendPhoto("/tmp/graph_deauth.png"); | ||
} | ||
|
||
function onNewAP(event){ | ||
var ap = event.data; | ||
if(ap.hostname == fakeESSID) { | ||
createGraph(ap.mac, '/tmp/graph_ap.png'); | ||
|
||
var message = '🦠 Detected rogue AP:\n\n' + | ||
// 'Time: ' + event.time + "\n" + | ||
// 'GPS: lat=' + session.GPS.Latitude + " lon=" + session.GPS.Longitude + " updated_at=" + | ||
//session.GPS.Updated.String() + "\n\n" + | ||
'AP: ' + ap.mac + ' (' + ap.vendor + ')'; | ||
|
||
// send to telegram bot | ||
sendMessage(message); | ||
sendPhoto("/tmp/graph_ap.png"); | ||
} | ||
} | ||
|
||
function onHandshake(event){ | ||
var data = event.data; | ||
var what = 'handshake'; | ||
|
||
createGraph(data.station, '/tmp/graph_handshake.png'); | ||
|
||
if(data.pmkid != null) { | ||
what = "RSN PMKID"; | ||
} else if(data.full) { | ||
what += " (full)"; | ||
} else if(data.half) { | ||
what += " (half)"; | ||
} | ||
|
||
var message = '💰 Captured ' + what + ':\n\n' + | ||
//'Time: ' + event.time + "\n" + | ||
//'GPS: lat=' + session.GPS.Latitude + " lon=" + session.GPS.Longitude + " updated_at=" + | ||
//session.GPS.Updated.String() + "\n\n" + | ||
'Station: ' + data.station + "\n" + | ||
'AP: ' + data.ap; | ||
|
||
// send to telegram bot | ||
sendMessage(message); | ||
sendPhoto("/tmp/graph_handshake.png"); | ||
} | ||
|
||
function onNewNode(event) { | ||
var node = event.data; | ||
|
||
if(node.type != 'ssid' && node.type != 'ble_server' && graph.IsConnected(node.type, node.id)) { | ||
createGraph(node.id, '/tmp/graph_node.png'); | ||
|
||
var message = '🖥️ Detected previously unknown ' + node.type + ':\n\n' + | ||
'Type: ' + node.type + "\n" + | ||
'MAC: ' + node.id; | ||
|
||
// send to telegram bot | ||
sendMessage(message); | ||
sendPhoto("/tmp/graph_node.png"); | ||
} | ||
} | ||
|
||
function onTick(event) { | ||
run('wifi.probe ' + fakeBSSID + ' ' + fakeESSID); | ||
} |