ThinPHP5

hacker4年前关于黑客接单695

规矩,大家立即上基础教程,很少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就出来?大家是恶魔吗?

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

 

标签: 黑客技术

相关文章

Linux网络黑客系统软件

Linux网络黑客系统软件

留意:全部这种专用工具全是捆缚在一起的Linux发行版,如Kali Linux或BackBox,因此大家一定会建议安裝一个适合的Linux网络黑客系统软件,使您的日常生活更轻轻松松 - 特别是在是由...

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

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

什么叫Keepass? Keepass是互联网技术中能用的密码管理器之一。它能够储存很多能够根据一个主密码解锁的登陆密码。这仅仅记牢一个高品质的登陆密码,而且依然能够为不一样的账号应用唯一的登陆密码...

dedecms找后台和解密注意事项

解密:织梦密码是cmd5加密,为20位,去掉前三位与后一位。 后台:默认的是dede/login.php 有时后台也可以利用http://chncto.com/include/fcke...

挖洞经验 | 从Youtube的视频ID和频道ID中发现漏洞

挖洞经验 | 从Youtube的视频ID和频道ID中发现漏洞

大家好,今天分享这篇Writeup是关于Youtube的两个漏洞,确切来说,是Youtube Studio平台(https://studio.youtube.com/)漏洞。作者通过其中涉及的视频...

什么叫NetworkMiner互联网挖矿由网络信息安全手机

什么叫NetworkMiner互联网挖矿由网络信息安全手机

什么叫NetworkMiner? 互联网挖矿由网络信息安全手机软件经销商Netresec建立。Netresec主要从事互联网调查取证和数据流量剖析的手机软件和程序流程。显而易见,做为安全性技术专业工...

什么是免疫程序调试?免疫系统疾病CANVASpentes

什么是免疫程序调试?免疫系统疾病CANVASpentes

immunity debugger 翻译中文也可了解为“免疫力程序调试”;   什么是免疫程序调试? 免疫系统疾病CANVAS pentesting专用工具能够用于检测你的系统软件真的是多...