ThinPHP5

hacker4年前关于黑客接单697

规矩,大家立即上基础教程,很少bb,这里有了你要想学习培训的 *** 黑客基础教程,浓浓的干货知识赠给大伙儿,沒有空话,现在开始!

ThinPHP5.1 程序运行系统漏洞

0x1 系统漏洞剖析

补丁下载文档地理位置:/thinkphp/library/think/route/dispatch/Url.php 56-66行



        if ($this->param['auto_search']) {
            $controller = $this->autoFindController($module, $path);
        } else {
            // 分析控制板
            $controller = !empty($path) ? array_shift($path) : null;
        }

        if (!preg_match('/^[A-Za-z](\w|\.)*$/', $controller)) { patch fix vuls
            throw new HttpException(404, 'controller not exists:' . $controller);
        }

        // 分析实际操作

具体步骤文档:/thinkphp/library/think/route/dispatch/Module.php

<?php

        parent::init();

        $result = $this->dispatch;
        /*
        $result详细被恳求的url
        thinkphp一切正常适用 
        index.php/index/index/index
        index.php?s=index/index/index
        两种方式的路由器
        $result="index/index/index"
        */
        if (is_string($result)) {
            $result = explode('/', $result);
        }

        if ($this->rule->getConfig('app_multi_module')) {
            // 多控制模块布署
            $module    = strip_tags(strtolower($
result[0] ?: $this->rule->getConfig('default_module')));
            $bind      = $this->rule->getRouter()->getBind();
            $available = false;

            if ($bind && preg_match('/^[a-z]/is', $bind)) {
                // 关联控制模块
                list($bindModule) = explode('/', $bind);
                if (empty($result[0])) {
                    $module = $bindModule;
                }
                $available = true;
            } elseif (!in_array($module, $this->rule->getConfig('deny_module_list')) && is_dir($this->app->getAppPath() . $module)) {
                $available = true;
            } elseif ($this->rule->getConfig('empty_module')) {
                $module    = $this->rule->getConfig('empty_module');
                $available = true;
            }
            二十四小时接单子的 *** 黑客
            // 控制模块复位
            // echo $this->app->getAppPath() . $module."<br>";
            // var_dump(is_dir($this->app->getAppPath() . $module));

            //echo $module,$available;die();
            if ($module && $available) {
                // 复位控制模块
                //echo 123123;
                $this->request->setModule($module);
                $this->app->init($module);
            } else {
                throw new HttpException(404, 'module not exists:' . $module);
            }
        }

        // 是不是全自动变换控制板和实际操作名
        var_dump($result);
        $convert = is_bool($this->convert) ? $this->convert : $this->rule->getConfig('url_convert');
        // 获得控制板名
        $controller = strip_tags($result[1] ?: $this->rule->getConfig('default_controller')); //切分了/以后取第二个主要参数

        $this->controller = $convert ? strtolower($controller) : $controller;

        // 获得实际操作名
        $this->actionName = strip_tags($result[2] ?: $this->rule->getConfig('default_action')); //切分了/以后取第三个主要参数
        echo 'init:'.$this->controller."<br>";
        // 设定当今恳求的控制板、实际操作
        $this->request
            ->setController(Loader::parseName($this->c
ontroller, 1))
            ->setAction($this->actionName);

        return $this;
    }

    public function exec()
    {
        // 监视module_init
        $this->app['hook']->listen('module_init');

        try {
            // 实例化控制板
            echo 'exec:'.$this->controller."<br>";
            $instance = $this->app->controller($this->controller,
                $this->rule->getConfig('url_controller_layer'),
                $this->rule->getConfig('controller_suffix'),
                $this->rule->getConfig('empty_controller'));

         ...
            //echo 123;die();
            $data = $this->app->invokeReflectMethod($instance, $reflect, $vars);

...

在看 $this->app->controller函数原型 /thinkphp/library/think/App.php

  public function controller($name, $layer = 'controller', $appendSuffix = false, $empty = '')
    {   
        echo $name, $layer, $appendSuffix."<br>";
        list($module, $class) = $this->parseModuleAndClass($name, $layer, $appendSuffix); //重中之重启用了parseModuleAndClass
        var_dump(class_exists($class));
        echo 'class:'.$class."<br>";
        if (class_exists($class)) {
            echo 'class_exists<br>';
            return $this->__get($class);
        } elseif ($empty && class_exists($emptyClass = $this->parseClass($module, $layer, $empty, $appendSuffix))) {
            return $this->__get($emptyClass);
        }

        throw new ClassNotFoundException('class not exists:' . $class, $class);
    }

    protected function parseModuleAndClass($name, $layer, $appendSuffix)
    {   echo 'parseModuleAndClass:'.$name."<br>";
        if (false !== strpos($name, '\\')) { //假如name种包括\则取值给class
            $class  = $name;

            $module = $this->request->module();

        } else {
            if (strpos($name, '/')) {
                list($module, $name) = explode('/', $name, 2);
            } else {
                $module = $this->request->module();
            }

            $class = $this->parseClass($module, $layer, $name, $appendSuffix);
        }

        return [$module, $class];
    }

0x2 漏洞检测

见到这儿基础就能了解了 假如浏览

http://127.0.0.1:8023/index.php?s=index/think\Loader/esss&a=1asdasd

就可以启用think\Loader 这一namespace下边的esss涵数,以便便捷检测,我还在loader里加了一个esss涵数,截屏以下

下边要是寻找一个点能程序运行就可以 刚提前准备找点exploit就出来?大家是恶魔吗?

阅读推荐: *** 黑客大批量侵入网站教程

 

标签: 黑客技术

相关文章

Fiddler爬取手机端机器设备的数据文件

Fiddler爬取手机端机器设备的数据文件

要想Fiddler爬取手机端机器设备的数据文件,其实不是很难,先而言说移动终端如何去浏览互联网?看过下边这幅图,就懂了。   能够看得出来,挪动端数据文件,全是要走wifi出来,因此我们...

wifiphisher专用工具完全免费使用方法

wifiphisher专用工具完全免费使用方法

什么叫Wifiphisher? Wifiphisher是一种WiFi黑客工具,能够对无线网络/ WiFi互联网实行迅速的全自动互联网中间人攻击,目地是发觉客户和登陆密码凭证。   与无线网...

什么叫做一句话木马?便是一句简易的开发语言

什么叫做一句话木马?便是一句简易的开发语言

什么叫做一句话木马? 便是一句简易的开发语言,一句话木马分成Php,asp,aspx等   中国菜刀: 联接一句话木马的专用工具;   试验的目地: 根据一句话木马来操纵大家的网...

浅析黑客特征分析与反攻击

要想更好的保护网络不受黑客的攻击,就必须对黑客的攻击方法、攻击原理、攻击过程有深入的、详细的了解, 只有这样才能更有效、更具有针对性的进行主动防护。下面通过对黑客攻击方法的特征分析,来研究如...

伦理道德网络黑客和IT安全系数,那么学习培训Nmap是尤为重

伦理道德网络黑客和IT安全系数,那么学习培训Nmap是尤为重

什么叫Nmap? Nmap是IT观念上的“互联网映射器” - “互联网”的简称。您能够 将Nmap视作最知名的一个,事实上是最有效的黑客工具之一。期。假如您认真完成规化图,伦理道德网络黑客和IT安全...

Nagios是不是适用全部电脑操作系统?

Nagios是不是适用全部电脑操作系统?

什么叫Nagios? Nagios是一个互联网和监视系统程序运行。它监控您特定的服务项目和服务器,当事儿受到影响或事儿越来越更强时友情提示。Nagios的很多作用包含:监控器全部IT系统架构,马上了...