0

0

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

php中文网

php中文网

发布时间:2016-07-13 17:34:32

|

1549人浏览过

|

来源于php中文网

原创

#!/usr/bin/php -q #!/usr/bin/php -q

/**
*     Php Vulnerability Scanner by KingOfSka @ http://www.contropoterecrew.org
*    still very early release, just for testing and coding purpose :)
*   
*    Changelog:
*   
*    12/09/06    Version 0.1 : First "working" version, should work on "almost" site, report any bug to help me :)
*    25/09/06        0.2 : Better crawling, less bandwith/resource usage, speed improved, better vuln finding code
*
**/

print_r(
-------------------------------------------------------------------------------
Php Vulnerability Scanner by KingOfska @ http://contropotere.netsons.org
    kingofska [at] gmail [dot] com
-------------------------------------------------------------------------------
);

if ($argc print_r(
Early release, please send bug report to help improving this script
--------------------------------------------------------------------------------
Usage: .$argv[0]. host [start_path][port][debug]
host:      target server (ip/hostname)
path:      path from which to start scanning, if none entered starts from /
port:       port of the http server, default 80

Examples:
.$argv[0]. localhost /folder/script.php 81

立即学习PHP免费学习笔记(深入)”;

--------------------------------------------------------------------------------
);
die;
}
$host= $argv[1]; // Insert the host site i.e. : www.website.com
$start_page = $argv[2];     // Insert the start page for the scan, if empty will start from index.*
$port = 80 ;
$additional_vars = array(id,page);
$locator = array("123",\;!--"=&{()},some_inexisistent_file_to_include.php); //XSS Locator from ha.ckers.org

$debug = TRUE;
/**    Compatibility for php *    stripos() function made by rchillet at hotmail dot com
*
*/
if (!function_exists("stripos")) {
function stripos($str,$needle,$offset=0)
{
     return strpos(strtolower($str),strtolower($needle),$offset);
}
}
/**
*    Do not edit below unless you know what you do...
*/
$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);

}

ColorMagic
ColorMagic

AI调色板生成工具

下载

$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

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/508460.htmlTechArticle#!/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...

相关文章

PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载

相关标签:

本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门AI工具

更多
DeepSeek
DeepSeek

幻方量化公司旗下的开源大模型平台

豆包大模型
豆包大模型

字节跳动自主研发的一系列大型语言模型

通义千问
通义千问

阿里巴巴推出的全能AI助手

腾讯元宝
腾讯元宝

腾讯混元平台推出的AI助手

文心一言
文心一言

文心一言是百度开发的AI聊天机器人,通过对话可以生成各种形式的内容。

讯飞写作
讯飞写作

基于讯飞星火大模型的AI写作工具,可以快速生成新闻稿件、品宣文案、工作总结、心得体会等各种文文稿

即梦AI
即梦AI

一站式AI创作平台,免费AI图片和视频生成。

ChatGPT
ChatGPT

最最强大的AI聊天机器人程序,ChatGPT不单是聊天机器人,还能进行撰写邮件、视频脚本、文案、翻译、代码等任务。

相关专题

更多
漫蛙app官网链接入口
漫蛙app官网链接入口

漫蛙App官网提供多条稳定入口,包括 https://manwa.me、https

41

2026.02.27

deepseek在线提问
deepseek在线提问

本合集汇总了DeepSeek在线提问技巧与免登录使用入口,助你快速上手AI对话、写作、分析等功能。阅读专题下面的文章了解更多详细内容。

2

2026.02.27

AO3官网直接进入
AO3官网直接进入

AO3官网最新入口合集,汇总2026年可用官方及镜像链接,助你快速稳定访问Archive of Our Own平台。阅读专题下面的文章了解更多详细内容。

28

2026.02.27

php框架基础教程
php框架基础教程

本合集涵盖2026年最新PHP框架入门知识与基础教程,适合初学者快速掌握主流框架核心概念与使用方法。阅读专题下面的文章了解更多详细内容。

1

2026.02.27

php框架怎么用
php框架怎么用

本合集专为零基础学习者打造,系统介绍主流PHP框架的安装、配置与基础用法,助你快速入门Web开发。阅读专题下面的文章了解更多详细内容。

2

2026.02.27

无禁词AI聊天软件下载大全
无禁词AI聊天软件下载大全

本合集精选多款免费、无违禁词限制的AI聊天软件,支持自定义角色、剧情畅聊,体验真实互动感。阅读专题下面的文章了解更多详细内容。

6

2026.02.27

ai志愿助手2026
ai志愿助手2026

本合集汇总了2026年主流AI志愿助手官方入口及官网地址,涵盖圆梦志愿、蝶变志愿等智能填报平台,助你高效精准填志愿。阅读专题下面的文章了解更多详细内容。

1

2026.02.27

高清视频免费观看软件
高清视频免费观看软件

精选多款高清视频免费观看软件,涵盖海量电视剧、电影、综艺等资源,支持在线播放、无广告干扰、画质清晰流畅。阅读专题下面的文章了解更多详细内容。

8

2026.02.27

快看漫画地址大全
快看漫画地址大全

2026年快看漫画官方入口、APP下载地址及网页版在线阅读地址汇总,涵盖平台最新功能与热门作品推荐。阅读专题下面的文章了解更多详细内容

1

2026.02.27

热门下载

更多
网站特效
/
网站源码
/
网站素材
/
前端模板

精品课程

更多
相关推荐
/
热门推荐
/
最新课程
PHP安全与漏洞
PHP安全与漏洞

共12课时 | 2.2万人学习

PHP课程
PHP课程

共137课时 | 12.6万人学习

JavaScript ES5基础线上课程教学
JavaScript ES5基础线上课程教学

共6课时 | 11.3万人学习

关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号