mirror of
https://github.com/rapid7/metasploit-payloads
synced 2025-01-02 11:36:22 +01:00
Add a fallback to get the hostname
This commit is contained in:
parent
074c8514d2
commit
7f21e9a29b
@ -670,12 +670,15 @@ if (!function_exists('core_machine_id')) {
|
||||
register_command('core_machine_id', COMMAND_ID_CORE_MACHINE_ID);
|
||||
function core_machine_id($req, &$pkt) {
|
||||
my_print("doing core_machine_id");
|
||||
if (is_callable('gethostname')) {
|
||||
if (can_call_function('gethostname')) {
|
||||
# introduced in 5.3
|
||||
$machine_id = gethostname();
|
||||
} else {
|
||||
} elseif(can_call_function('php_uname')) {
|
||||
$machine_id = php_uname('n');
|
||||
}
|
||||
} else {
|
||||
$machine_id = getenv('HOSTNAME');
|
||||
}
|
||||
$serial = "";
|
||||
|
||||
if (is_windows()) {
|
||||
|
Loading…
Reference in New Issue
Block a user