当前位置:Gxlcms > PHP教程 > php-enable_functions-enumeration-script.php

php-enable_functions-enumeration-script.php

时间:2021-07-01 10:21:17 帮助过:26人阅读

php 危险函数枚举 用于安全运维 和渗透测试
  1. msg("php enable_functions enumeration script");
  2. $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');
  3. $dis_func_arr = explode(",",get_cfg_var("disable_functions"));
  4. if($dis_func_arr[0]){
  5. foreach ($func_arr as $func) {
  6. if(!in_array($func,$dis_func_arr)){
  7. msg("Function: $func enable",1);
  8. }
  9. }
  10. }else{
  11. msg("disable_functions none !!!",1);
  12. }
  13. function msg($text,$type=0){
  14. $def="[*]";
  15. $color="green";
  16. if($type ==1){
  17. $def="[+]" ;
  18. $color="red";
  19. }else if ($type==-1){
  20. $def="[-]";
  21. }
  22. echo "$def $text
    ";
  23. }
  24. ?>

人气教程排行