drupal

Drupal 远程代码执行漏洞(CVE-2019-6339)简单复现

☆樱花仙子☆ 提交于 2020-04-11 19:48:20
1.搭建环境docker 出于时间考虑,这里采用的是vulhub的镜像进行复现的地址 https://vulhub.org/#/environments/drupal/CVE-2019-6339/ 2.poc https://github.com/thezdi/PoC/blob/master/Drupal/drupal_xss_rce.zip 管理员修改资料处上传头像 3.先查看一下之前上传的图片的地址 Drupal的默认文件保存地址是/site/default/files/pictures/xxx-xxx/图片名字 phar: // ./sites/default/files/pictures/2020-04/blog-ZDI-CAN-7232-cat.jpg 然后设置一个临时目录 4.查看效果 这里列举出了/etc/passwd,证明是可以执行命令的 5. 简单分析了一下poc,然后修改一下 这里执行的是一条很简单的命令,稍微替换一下,比如ps -aux,此时是7个字节数,要把s对应的字节数目改成7 看一下结果 本来打算写个马的。。。但是www-data在这个html这个目录下权限是如下 aaa.txt是通过rce在www-data权限下的touch命令创建的,aa则是root用户创建的 -rw-r--r-- 1 root root 43 Apr 4 07:55 aa.txt

MySQL corrupts after every server restart

萝らか妹 提交于 2020-04-07 08:40:28
问题 I Have a bit of an odd problem. I am running MySQL and Drupal site from a windows environment (not by choice but it is just how things have worked out) and most of the time the site is fine however every time the server is restarted (from updates or for maintenance) The MySQL Database will corrupt. When I log in to MySQL Work bench I notice that the server status is stopped and when I try to start it I get the error: ERROR Fatal error: Can't open and lock privilege tables: Can't find file:

MySQL corrupts after every server restart

与世无争的帅哥 提交于 2020-04-07 08:40:06
问题 I Have a bit of an odd problem. I am running MySQL and Drupal site from a windows environment (not by choice but it is just how things have worked out) and most of the time the site is fine however every time the server is restarted (from updates or for maintenance) The MySQL Database will corrupt. When I log in to MySQL Work bench I notice that the server status is stopped and when I try to start it I get the error: ERROR Fatal error: Can't open and lock privilege tables: Can't find file:

drupal常用api

丶灬走出姿态 提交于 2020-03-09 07:27:19
最短的函数 // 语言字串,除了可以获取对应语言外,还可以设置字串变量。可以是!var, @var或 %var,%var就添加元素外层。@var会过滤HTML,!var会原样输出HTML,%var会添加span外层。 t('my name is @name', array('@name' => 'willam')); // 一个链接 l('User Edit', 'user/1/edit'); 判断首页 drupal_is_front_page(); GLOBALS $GLOBALS['base_url'] // URL root GLOBAL 文档 加载inc文件 module_load_include('inc', 'mymodule', 'mymodule.field'); 得到ROOT目录 getcwd() DRUPAL_ROOT 把URI(public://)地址转换为绝对地址 drupal_realpath('public://xxx.csv'); // 得到系统路径 file_create_url('public://xxx.csv'); // 得到URL 加载脚本&CSS drupal_add_js('misc/collapse.js'); drupal_add_js('misc/collapse.js', 'file'); drupal_add_js(drupal

使用Drupal 6 Views Module系列(一)

一曲冷凌霜 提交于 2020-03-07 04:41:48
百度文库: http://wenku.baidu.com/view/f209ac0216fc700abb68fc31.html 难得及少有的中文drupal view详细教程,转自http://www.cc.ntu.edu.tw/chinese/epaper/0008/20090320_8009.htm 作者:唐瑤瑤 / 臺灣大學計算機及資訊網路中心程式設計師 Drupal是一套內容管理系統,本系列文章將以View模組實際示 範網站建置,除展示其驚人的彈性之外,也希望能稍微降低其學習門檻,引領讀者們進入Drupal的世界。 前言 Drupal自2001年問世以來,廣泛應用於各式各樣的網站建置。不但用戶日益增多,不少志願開發者也紛紛加入,貢獻 了數量龐大的功能模組,使得Drupal功能更加強大,又吸引更多人加入,形成一個不斷高速正向回饋的系統。所以在2008年Packet出版社所舉辦的 網路票選中,Drupal被選為年度最佳內容管理系統 ,一點都不令人意外 (Packt Publishing Ltd , 2008)。可惜的是,其開發門檻之高也常令人半途而廢,甚至望而卻步。有鑑於此,本系列文章將以View模組實際示範網站建置,除展示其驚人的彈性之 外,也希望能稍微降低其學習門檻,引領讀者們進入Drupal的世界。 什麼是Drupal? Drupal 是一個基於GPL授權之Open

LAMP平台下用Drupal快速建站

流过昼夜 提交于 2020-03-01 02:30:51
昨晚的时间,我搭建好了LAMP平台,及Linux,Apache,Mysql,php/perl/python。并运用drupal建站,完成了我的第一个网站,首先我想分享下drupal建站的Ubuntu过程,(首先声明以下必须在LMAP平台下,继续操作) 1:下载Drupal6.6并解压,然后将所有文件移动到/var/www/blog.mytest.com &wget http://ftp.osuosl.org/pub/drupal/files/projects/drupal-6.6.tar.gz &tar xfvz drupal-6.6.tar.gz &sudo mv drupal-6.6/{*,.htaccess}/var/www/blog.mytest.com 2:通过phpmyadmin来创建Mysql数据库: &mysqladmin -uroot -p create drupal6 &mysql -uroot -p mysql>GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER,CREATE TEMPORARY TABLES,LOCK TABLES ON drupal6.* TO 'drupaluser' @localhost ' IDENTIFIED BY 'yourpassword';/

HowTo: Updating Drupal 6.x to newer minor version

不羁岁月 提交于 2020-03-01 02:30:36
The update process described in this HowTo is based on updating three Drupal sites to v6.10 — one from v6.8, and two from v6.9. You should encounter no problems updating several minor versions in one go — for example, from v6.5 straight to v6.11 — as the new version contains a file that will update the database and other settings, if needed, when you run update.php. The instructions found in UPGRADE.txt (in the Drupal Core archive), existing handbooks, and tutorials mainly focus on the issues involved in upgrading to a new major version, such as Drupal 5.x to 6.x. When you are performing a

Drupal Commerce 产品 URL 优化 SEO

五迷三道 提交于 2020-03-01 02:30:20
https://www.drupal.org/project/commerce_product_urls For each product it provides id parameter, for example: http://www.mycommercesite.com/node/1?id=1 http://www.mycommercesite.com/node/1?id=2 as well as sku parameter, for example: http://www.mycommercesite.com/node/1?sku=pr1 http://www.mycommercesite.com/node/1?sku=pr2 Sad Original URL = site.com/node/1?id=54 Happy URL :) = site.com/node/1/rueben-sandwich/ Use mod_rewrite in your .htaccess file to parse out the elements of the URL. Like this: RewriteEngine On //check that in drupal's .htaccess the rewrite engine is on by default RewriteRule /

SEO Drupal .htaccess 文件(适合multi-site)

浪子不回头ぞ 提交于 2020-03-01 01:48:59
如果要对基于 Drupal 建立的网站进行 SEO (Search Engine Optimization——搜索引擎自然结果优化),那么就一定要尽量避免网站内的重复页面。因为当搜索引擎的爬虫抓取到大量的重复页面时,搜索引擎就会降低对网站页面的打分,当然这种影响可能并不太容易被察觉。 当我们使用 Drupal 时通常会碰到这样的问题,例如:页面 http://www.mypetal.com/node/12 和页面 http://mypetal.com/node/12 显示的是相同的内容。或许您会认为这是大惊小怪,但事实上这是两个独立的页面,它们的内容重复,这一点对 SEO 不利。好在 Drupal 开发者早已为我们考虑到了这点,只要做个略施小计就能唤醒这个功能:) 注意: 本文只针对拥有一级域名的网站,二级域名的网站不存在这个问题。 默认安装下 Drupal .htaccess 配置 Drupal 默认的 .htaccess 为我们提供了两种解决方案: 把链接 http://mypetal.com 重定向到 http://www.mypetal.com 把链接 http://www.mypetal.com 重定向到 http://mypetal.com 这两种方案都是为了确保只有一种形式的链接,没有优劣之分。 第1种方案,查找下面代码: # RewriteCond %{HTTP

对html <base>标签有什么建议?

纵饮孤独 提交于 2020-02-27 03:09:21
我以前从未见过实际使用过的 <base> HTML标签 。 它的使用存在缺陷,这意味着我应该避免它吗? 事实上我从来没有注意到它在现代生产网站(或任何网站)上的使用让我对它持怀疑态度,尽管看起来它可能有用于简化我网站链接的有用应用程序。 编辑 使用基本标签几周后,我最终找到了使用基本标签的一些 主要问题 ,这使得它比最初出现时更不可取。 基本上,基本标记下的 href='#topic' 和 href='' 的更改与其默认行为 非常 不兼容,并且从默认行为的这种更改可能很容易使您控制之外的第三方库以 不正常 的方式 非常不可靠 ,因为它们在逻辑上取决于默认行为。 通常,这些更改是微妙的,并且在处理大型代码库时会导致不那么明显的问题。 我已经创建了一个回答,详细说明了我在下面遇到的问题。 因此,在您承诺广泛部署 <base> 之前,请自行测试链接结果,这是我的新建议! #1楼 Drupal最初依赖于 <base> 标记,后来由于HTTP爬虫和缓存问题而决定不使用。 我一般不喜欢发布链接。 但是这个真的值得分享,因为它可以使那些寻找 <base> 标签的真实体验细节的人受益: http://drupal.org/node/13148 #2楼 要记住一件事: 如果您开发要在​​iOS上的UIWebView中显示的网页,则必须使用BASE标记。 它根本不会起作用。 是JavaScript