跳转到主内容
websoft网络软件专家 - 深耕网络技术,打造实用软件!

漏洞扫描php实现代码_PHP教程

#!/usr/bin/ php-q php /** * Php Vulnerability Scanner by KingOfSka @ http://www.contropoterecrew.org * still very early release, just for testing and coding purpose :) * * Change ...

*/$reqmade = 0 ;$time_start = getmicrotime();set_time_limit(0);error_reporting(E_ERROR);$checkedpages[]=;$result[] = ;$links[] = ;$checkedlinks[] = ;echo "Starting scan on $host:Starting page: $start_page";$site_links = index_site();$count = count($site_links);echo "Starting to scan $count pages...

";foreach($site_links as $cur){echo "Testing: $cur";test_page($cur);}PHP 8.5.5 PHP 8.5.5 是 PHP 8.5 分支的维护更新版本。该版本延续了“小步快跑”的迭代逻辑,通过深度错误修复、底层性能微调以及安全加固,旨在为开发者提供一个更健壮、更高效的运行环境。该版本严格遵守语义化版本规范,不包含破坏性变更。

下载$time_end = getmicrotime();$result[time] = substr($time_end - $time_start,0,4);$result[connections] = $reqmade;$result[scanned] = count($checkedpages);echo "Report:";foreach ($result[vuln] as $type=> $url){echo "$type vulnerability found:";$url = array_unique($url);foreach($url as $cur){echo "$cur";}}$server = get_server_info();echo "Additional infos:";echo "Site running on: ".$server[software]."";echo "Powered by: ".$server[powered]."";echo "Scan took ".$result[time]." seconds to scan ".$result[scanned]." pages using ".$result[connections]." connections";function index_site(){global $start_page;array($links);$tmp = get_links($start_page,true);foreach($tmp as $cur){$tmp2 = get_links($cur,true);$links = array_merge_recursive($links,$tmp2);}$links = array_unique(clean_array($links));$links[] = $start_page;sort($links);return($links);}/*** Testes a form using global vuln locator, both GET and POST method, and print result to screen* @author KingOfSka* @param array $form Form to test* @return void*/ function test_form($form){$ret = ;$tmp = ;global $host,$port,$locator,$debug,$result ;if($form[action][0] != / AND stripos($form[action],http://) === FALSE ){$form[action] = /.$form[action];}if ($form[method] = get){foreach($form[vars] as $current){foreach($locator as $testing){$testing = urlencode($testing);$conn = fsockopen ("$host", $port, $errno, $errstr, 30);if (!$conn) {echo "$errstr ($errno)";} else {if (!stripos(?,$data[action])){$req = "GET ".$form[action]."?$current=$testing HTTP/1.0 Host: $host Connection: Close

";}else{$req= "GET ".$form[action]."&$current=$testing HTTP/1.0 Host: $host Connection: Close

";}if ($debug == TRUE){echo $req;}fputs ($conn, $req);while (!feof($conn)) {$tmp .= fgets ($conn,128);}fclose ($conn);do_test($tmp,$form[action],$current);$tmp = ;}}}}else if ($form[method] = post){foreach($form[vars] as $current){foreach($locator as $testing){$testing = urlencode($testing);$conn = fsockopen ("$host", $port, $errno, $errstr, 30);&nbs http://www.bkjia.com/PHPjc/508460.html www.bkjia.com true http://www.bkjia.com/PHPjc/508460.html TechArticle#!/usr/bin/php -q ?php /** * Php Vulnerability Scanner by KingOfSka @ http://www.contropoterecrew.org * still very early release, just for testing and coding purpose :) * * Change...

相关文章