Php dangerous function enumeration for security O & M and penetration testing
- Msg ("php enable_functions enumeration script ");
- $ Func_arr = array ('disk _ total_space ', 'disk _ free_space', 'exec ', 'passthru', 'shell _ exec', 'system', 'popen ', 'show _ source', 'pclose', 'proc _ open', 'dl ', 'chmod', 'php _ real_logo_guid', 'php _ egg_logo_guid ', 'php _ ini_scanned_files ', 'php _ ini_loaded_file', 'readlink', 'linkinfo ', 'symlink', 'link', 'set _ file_buffer', 'exec ', 'system', 'escapeshellcmd', 'escapeshellarg ', 'passthru', 'proc _ close', 'proc _ terminate', 'proc _ get_status', 'proc _ nice ', 'getmyuid', 'getmygid', 'getmyinode', 'putenv', 'getopt', 'sys _ getloadavg ', 'get _ current_user', 'Magic _ quotes_runtime ', 'set _ magic_quotes_runtime', 'import _ request_variables ', 'debug _ zval_dump', 'ini _ alter ', 'dl', 'pclose', 'popen ', 'stream _ socket_client ', 'stream _ socket_server', 'stream _ socket_accept ', 'stream _ socket_pair', 'stream _ get_transports ', 'stream _ wrapper_restore ', 'Get _ headers', 'mail', 'MB _ send_mail ', 'openlog', 'syslog', 'closelog', 'flock ', 'pfsockopen ', 'posix _ kill', 'Apache _ child_terminate ', 'Apache _ get_modules', 'Apache _ get_version ', 'Apache _ lookup_uri', 'Apache _ reset_timeout ', 'Apache _ response_headers', 'virtual ');
- $ Dis_func_arr = explode (",", get_cfg_var ("disable_functions "));
- If ($ dis_func_arr [0]) {
- Foreach ($ func_arr as $ func ){
- If (! In_array ($ func, $ dis_func_arr )){
- Msg ("Function:Http://www.php.net/manual/zh/function.?func.php target = blank> $ funcEnable ", 1 );
- }
- }
- } Else {
- Msg ("disable_functions none !!! ", 1 );
- }
- Function msg ($ text, $ type = 0 ){
- $ Def = "[*]";
- $ Color = "green ";
- If ($ type = 1 ){
- $ Def = "[+]";
- $ Color = "red ";
- } Else if ($ type =-1 ){
- $ Def = "[-]";
- }
- Echo "$ def $ text
";
- }
- ?>
|