Open-AudIT
https://www.open-audit.org/phpBB3/

GetAesKey Function - System Drive Letter
https://www.open-audit.org/phpBB3/viewtopic.php?f=8&t=3419
Page 1 of 1

Author:  Chad [ Mon Sep 21, 2009 10:05 am ]
Post subject:  GetAesKey Function - System Drive Letter

This function has drive C hardcoded for getting info. Well it's probably a good assumption that most people have a 'C:', it's not necessary for the drive C to even exist. It could use getenv to get the system drive letter, then nothing would need to be hardcoded. The following is a fix using getenv...

[code]
case "Windows":
preg_match("/\b[0-9a-fA-F]{4}-[0-9a-fA-F]{4}\b/", shell_exec('vol ' . getenv('SystemDrive')), $m);
$AesKey = (strlen($m[0]) > 0) ? $m[0] : "openaudit";
break;
[/code]

Page 1 of 1 All times are UTC + 10 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/