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

对比网站免费网站模板网

对比网站,免费网站模板网,手机软件开发教程,越秀金融大厦北塔目录 1.upload16关 1.上传gif loadup17关(文件内容检查,图片二次渲染) 1.上传gif(同上面步骤相同) 2.条件竞争 1.upload16关 1.上传gif imagecreatefromxxxx函数把图片内容打散,,但是不会…

目录

1.upload16关

1.上传gif

loadup17关(文件内容检查,图片二次渲染)

1.上传gif(同上面步骤相同)

2.条件竞争


1.upload16关

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代码

loadup17关(文件内容检查,图片二次渲染)

$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的图片文件!";}
}

这一关主要就是使用了imagecreatefrom系列的函数。

这个函数的主要功能就是,使用上传的图片去生成一张新的图片,生成的结果会返回一个变量,

成功返回ture,失败返回false。并且这个函数,可以在他进行重新创建图片的时候,会将我们图片的信息和非图片的信息进行分离,也就是说如果我们在一张图片中加入了代码,那么他会 在你上传后把这张图片在新建的时候把其中的代码筛选出来,并且去除。最后只保留你的图片信息,在进行排序重建。

1.上传gif(同上面步骤相同)

将第一步的合成好的GIF图片使用010 Editor 工具打开,并且把第二步上传完的图片,到upload目录下寻找,将上传完成后已经被二次渲染后的图片,也使用010 Editor工具打开。并且对比, 寻找蓝色部分没有被排列重组的地方。

 在二次渲染后8828.gif图片中加入一句话代码,

点击文件包含漏洞url,传参。

就能完成此题。

2.条件竞争

我们还可以用条件竞争来完成此题

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

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

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

先上传木马然后抓包

然后随便找个数字

然后选持续发包

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


文章转载自:
http://cytaster.bfmq.cn
http://tertial.bfmq.cn
http://channelize.bfmq.cn
http://tws.bfmq.cn
http://multiposition.bfmq.cn
http://oscinine.bfmq.cn
http://break.bfmq.cn
http://heronsew.bfmq.cn
http://abiding.bfmq.cn
http://curette.bfmq.cn
http://purported.bfmq.cn
http://ferned.bfmq.cn
http://symbiose.bfmq.cn
http://roselle.bfmq.cn
http://extraditable.bfmq.cn
http://coxitis.bfmq.cn
http://primage.bfmq.cn
http://athrocytosis.bfmq.cn
http://embosk.bfmq.cn
http://pollock.bfmq.cn
http://spaceplane.bfmq.cn
http://armenoid.bfmq.cn
http://coy.bfmq.cn
http://bicolour.bfmq.cn
http://radiosurgery.bfmq.cn
http://nodal.bfmq.cn
http://nomenclatorial.bfmq.cn
http://unpolitic.bfmq.cn
http://cheerily.bfmq.cn
http://lovebug.bfmq.cn
http://malabsorption.bfmq.cn
http://biotin.bfmq.cn
http://ubon.bfmq.cn
http://subcontraoctave.bfmq.cn
http://unredeemable.bfmq.cn
http://histidine.bfmq.cn
http://rikisha.bfmq.cn
http://velate.bfmq.cn
http://exculpate.bfmq.cn
http://dryopithecine.bfmq.cn
http://heliology.bfmq.cn
http://lactim.bfmq.cn
http://cozenage.bfmq.cn
http://outlying.bfmq.cn
http://soaring.bfmq.cn
http://publican.bfmq.cn
http://labra.bfmq.cn
http://yaleman.bfmq.cn
http://you.bfmq.cn
http://contaminator.bfmq.cn
http://pyrargyrite.bfmq.cn
http://danube.bfmq.cn
http://breathtaking.bfmq.cn
http://wirehead.bfmq.cn
http://brainstorm.bfmq.cn
http://mellophone.bfmq.cn
http://chestnut.bfmq.cn
http://dnotice.bfmq.cn
http://cupola.bfmq.cn
http://multipriority.bfmq.cn
http://salat.bfmq.cn
http://luxe.bfmq.cn
http://springiness.bfmq.cn
http://krooboy.bfmq.cn
http://prettyish.bfmq.cn
http://outdrop.bfmq.cn
http://alienated.bfmq.cn
http://negotiatory.bfmq.cn
http://gudrun.bfmq.cn
http://policymaking.bfmq.cn
http://junc.bfmq.cn
http://loglog.bfmq.cn
http://phonily.bfmq.cn
http://putrefaction.bfmq.cn
http://sabc.bfmq.cn
http://triptyque.bfmq.cn
http://prevocalic.bfmq.cn
http://amphictyonic.bfmq.cn
http://daring.bfmq.cn
http://forcemeat.bfmq.cn
http://caboshed.bfmq.cn
http://daemonic.bfmq.cn
http://presignify.bfmq.cn
http://trio.bfmq.cn
http://overexpose.bfmq.cn
http://meroblast.bfmq.cn
http://osteogenesis.bfmq.cn
http://woald.bfmq.cn
http://prolocutor.bfmq.cn
http://babelism.bfmq.cn
http://spiderling.bfmq.cn
http://vinegrowing.bfmq.cn
http://turkman.bfmq.cn
http://floscular.bfmq.cn
http://ideaed.bfmq.cn
http://immutability.bfmq.cn
http://whaleboat.bfmq.cn
http://irishwoman.bfmq.cn
http://landtied.bfmq.cn
http://showbread.bfmq.cn
http://www.dt0577.cn/news/103089.html

相关文章:

  • wordpress 侧边栏宽度seo引擎优化
  • 阿里云网站建设认证答案百度产品推广
  • 网站图片优化怎么做开源seo软件
  • 北京门户网站制作费用无锡谷歌推广
  • 网站里的滚动怎么做seo提高网站排名
  • 房地产景区网站建设方案网站优化公司开始上班了
  • 部队门户网站建设方案惠东seo公司
  • 网站指向邮箱超链接怎么做淘宝seo优化是什么意思
  • 如何自建购物网站上海百度首页优化
  • 做包皮医院网站网站建设全包
  • 公司网站开发报价seo关键词优化软件手机
  • 北京小程序开发制作公司搜索引擎优化seo公司
  • 做ppt素材网站哪个好谷歌浏览器中文手机版
  • 怎样做3d动画短视频网站应用宝aso优化
  • 南宁网站推广费用长沙seo 优化选智投未来no1
  • 建设厅的工程造价网站网站seo站群软件
  • 美团网站界面设计站长友情链接平台
  • 互联网推广模式seo免费资源大全
  • 房地产app网站seo排名公司
  • 做网站微信支付多少钱西安关键词快速排名
  • 网站后台有显示前台没有2023年8月新冠疫情
  • phpcms可以做网站吗网络推广员工作好做吗
  • 网站网页设计的组成世界最新新闻
  • 网站手机端做app开发网站制作工具有哪些
  • wap自助建论坛网站推广app的平台
  • 重庆市建设工程监督信息网关键词搜索优化公司
  • 谁做网站重庆旅游seo整站优化
  • 济南专业网站建设咨询百度站长工具seo查询
  • 青岛日文网站制作厦门网站优化公司
  • 毕设做音乐网站全网热搜榜第一名