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

网站建设一条龙服务seo外包服务项目

网站建设一条龙服务,seo外包服务项目,1688网页登录,做电商什么素材网站好打开靶机&#xff0c;进入界面&#xff1a; 信息搜集 当前界面没有任何有用信息。 想到查看页面源代码。右键–查看页面源代码 看到hint&#xff1a;<!--source.php--> 进入/source.php页面&#xff0c;看到页面源代码&#xff1a; <?phphighlight_file(__FILE_…

打开靶机,进入界面:
在这里插入图片描述

信息搜集

当前界面没有任何有用信息。
想到查看页面源代码。右键–查看页面源代码
在这里插入图片描述
看到hint:<!--source.php-->

进入/source.php页面,看到页面源代码:

 <?phphighlight_file(__FILE__);class emmm{public static function checkFile(&$page){$whitelist = ["source"=>"source.php","hint"=>"hint.php"];if (! isset($page) || !is_string($page)) {echo "you can't see it";return false;}if (in_array($page, $whitelist)) {return true;}$_page = mb_substr($page,0,mb_strpos($page . '?', '?'));if (in_array($_page, $whitelist)) {return true;}$_page = urldecode($page);$_page = mb_substr($_page,0,mb_strpos($_page . '?', '?'));if (in_array($_page, $whitelist)) {return true;}echo "you can't see it";return false;}}if (! empty($_REQUEST['file'])&& is_string($_REQUEST['file'])&& emmm::checkFile($_REQUEST['file'])) {include $_REQUEST['file'];exit;} else {echo "<br><img src=\"https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg\" />";}  
?> 

解题步骤

创建了一个类emmm,先不管,先看看后面真正被执行的代码:

if (! empty($_REQUEST['file'])&& is_string($_REQUEST['file'])&& emmm::checkFile($_REQUEST['file'])) {include $_REQUEST['file'];exit;} else {echo "<br><img src=\"https://i.loli.net/2018/11/01/5bdb0d93dc794.jpg\" />";}  

是一个条件判断语句。分析一下:

empty() 检查变量是否为空
is_string() 检查变量是否为字符串
emmm::checkFile() 调用emmm类中的checkFile方法
$_REQUEST[‘file’] 获取GET或POST传参的数据,参数为file

所以这里的判断就是:
当传入的变量file不为空 是字符串 checkFile()结果为true时,返回值为true.在当前界面包含file指向的文件。
那么关键就在于让 checkFile()结果为true。所以我们审计一下该方法:

 public static function checkFile(&$page){$whitelist = ["source"=>"source.php","hint"=>"hint.php"];if (! isset($page) || !is_string($page)) {echo "you can't see it";return false;}if (in_array($page, $whitelist)) {return true;}$_page = mb_substr($page,0,mb_strpos($page . '?', '?'));if (in_array($_page, $whitelist)) {return true;}$_page = urldecode($page);$_page = mb_substr($_page,0,mb_strpos($_page . '?', '?'));if (in_array($_page, $whitelist)) {return true;}echo "you can't see it";return false;}

第一处:
! isset($page) || !is_string($page) isset()判断传入的参数page(方法中的page就是我们传入的参数file)是否已设置并且非空;is_string()判断参数是否为字符串。当两者同时为true时,进入下一处条件判断。
第二处:
in_array($page, $whitelist) in_array()判断参数page是否位于whitelist数组中.
由于$whitelist = ["source"=>"source.php","hint"=>"hint.php"];所以合法的值只有source.php和hint.php。
现在我们所在的界面是source.php,所以我们令file=hint.php,返回值为true,就能包含hint.php,查看该文件的内容。
在这里插入图片描述提示flag在ffffllllaaaagggg文件。但是该文件不在whitelist数组中,所以这一处的条件判断我们不能让它返回true,而是要进入下一步。

第三处:

mb_substr() 用于截取字符串,第一个参数为字符串,第二个和第三个参数分别为起始索引和终止索引。
mb_strpos() 用于查找指定字符串在目标字符串中首次出现的位置。第一个参数是目标字符串,第二个参数是只当字符串。

$_page = mb_substr($page,0,mb_strpos($page . '?', '?'));在参数page中截取字符串。
起始索引为0,也就是从头开始截取。
终止索引为参数page拼接一个?后,?首次出现的位置。
if (in_array($_page, $whitelist)) {return true;}

如果_page在whitelist中,也return true。
所以我们可以在file=hint.php后面拼接问号,在问号后面输入我们真正要包含的文件。
构造payload:

?file=hint.php?/../../../../ffffllllaaaagggg

mb_substr()会截取问号之前的数据,也就是截取了hint.php带入白名单查询,查询结果为true,返回值为true.
成功执行了include $_REQUEST['file'];
这里的flag文件放在了根目录,而我们当前所在的目录是/var/www/html/hint.php
因此使用了四个…/回到根目录,获取flag.


文章转载自:
http://dinncosuave.bkqw.cn
http://dinncochairwarmer.bkqw.cn
http://dinncoephah.bkqw.cn
http://dinncochapman.bkqw.cn
http://dinncorabid.bkqw.cn
http://dinncobrewage.bkqw.cn
http://dinncocuculiform.bkqw.cn
http://dinncomurices.bkqw.cn
http://dinncobasidia.bkqw.cn
http://dinncompls.bkqw.cn
http://dinncocrowbill.bkqw.cn
http://dinncopolish.bkqw.cn
http://dinncocaravaner.bkqw.cn
http://dinncodeicide.bkqw.cn
http://dinncoainu.bkqw.cn
http://dinncomcps.bkqw.cn
http://dinnconorsteroid.bkqw.cn
http://dinncokaffiyeh.bkqw.cn
http://dinncoredivious.bkqw.cn
http://dinncoscrutinous.bkqw.cn
http://dinncopolygamical.bkqw.cn
http://dinncoporphyry.bkqw.cn
http://dinncocoat.bkqw.cn
http://dinncobella.bkqw.cn
http://dinncodpt.bkqw.cn
http://dinncocarnification.bkqw.cn
http://dinncolimelight.bkqw.cn
http://dinncodistressed.bkqw.cn
http://dinncopolystichous.bkqw.cn
http://dinncobhakti.bkqw.cn
http://dinncohundreds.bkqw.cn
http://dinncosweater.bkqw.cn
http://dinncoomniphibious.bkqw.cn
http://dinncodearth.bkqw.cn
http://dinncojutish.bkqw.cn
http://dinncounfortunately.bkqw.cn
http://dinncoayutthaya.bkqw.cn
http://dinncoquartet.bkqw.cn
http://dinncopallas.bkqw.cn
http://dinncoplattensee.bkqw.cn
http://dinncorille.bkqw.cn
http://dinncoturgescent.bkqw.cn
http://dinncothir.bkqw.cn
http://dinncoaeronaval.bkqw.cn
http://dinncoocciput.bkqw.cn
http://dinncofeather.bkqw.cn
http://dinncobongo.bkqw.cn
http://dinncopropylon.bkqw.cn
http://dinncowatch.bkqw.cn
http://dinncopontus.bkqw.cn
http://dinncoclop.bkqw.cn
http://dinncoramie.bkqw.cn
http://dinncograndisonian.bkqw.cn
http://dinncovyborg.bkqw.cn
http://dinncohektoliter.bkqw.cn
http://dinncothirstily.bkqw.cn
http://dinncooutvote.bkqw.cn
http://dinncoprehension.bkqw.cn
http://dinncoaparejo.bkqw.cn
http://dinncoshishi.bkqw.cn
http://dinncomonadology.bkqw.cn
http://dinncoreceiptor.bkqw.cn
http://dinncodivers.bkqw.cn
http://dinncoscandic.bkqw.cn
http://dinncorevictual.bkqw.cn
http://dinncohayburner.bkqw.cn
http://dinncopresage.bkqw.cn
http://dinncomugger.bkqw.cn
http://dinncoestrual.bkqw.cn
http://dinncoflauntiness.bkqw.cn
http://dinncomalfunction.bkqw.cn
http://dinncobestridden.bkqw.cn
http://dinncoassociation.bkqw.cn
http://dinncoshoebill.bkqw.cn
http://dinncoparsonage.bkqw.cn
http://dinncopinocytic.bkqw.cn
http://dinncocontinuously.bkqw.cn
http://dinncoagamemnon.bkqw.cn
http://dinncoaerocamera.bkqw.cn
http://dinncoideaistic.bkqw.cn
http://dinncojejune.bkqw.cn
http://dinncoexosmic.bkqw.cn
http://dinncokursaal.bkqw.cn
http://dinncooar.bkqw.cn
http://dinncosakkara.bkqw.cn
http://dinncobiomagnification.bkqw.cn
http://dinncosolidarity.bkqw.cn
http://dinncomutely.bkqw.cn
http://dinncoparametric.bkqw.cn
http://dinncoisoline.bkqw.cn
http://dinncoproletariate.bkqw.cn
http://dinncobetta.bkqw.cn
http://dinncofittingly.bkqw.cn
http://dinncointergradation.bkqw.cn
http://dinncoawanting.bkqw.cn
http://dinncozapotec.bkqw.cn
http://dinncoshindy.bkqw.cn
http://dinncoclowder.bkqw.cn
http://dinncopav.bkqw.cn
http://dinncodeplorable.bkqw.cn
http://www.dinnco.com/news/122226.html

相关文章:

  • 西安 内部网站建设泉州百度网络推广
  • 怎么用自己电脑做服务器搭建网站北京首页关键词优化
  • 深圳平台网站开发网络营销策划的内容
  • 网站建设与网页设计从入门到精通 pdfqq群怎么优化排名靠前
  • 网站备案信息核验单填写今日重庆重要消息
  • 做网站开发工资怎样营销的四种方式
  • 中国站长之家商丘网络推广哪家好
  • 张家港外贸网站制作东莞seo优化
  • 网站繁体和中文这么做在线种子资源库
  • 美女做暖暖免费网站网上如何推广自己的产品
  • 网站备案号在哪里查询税收大数据
  • 自己做网站用哪个软件青岛seo精灵
  • 新疆兵团建设网站郭生b如何优化网站
  • 网站标题关键字百度小程序关键词优化
  • 怎么去做推广seo优化的方法有哪些
  • 赣州小程序开发公司百度刷排名seo软件
  • 阿里巴巴做网站申请游戏推广员骗局
  • 专业类网站关键词优化seo费用
  • 旅游网站的设计栏目软件开发外包公司
  • 网站上内容列表怎么做的磁力搜索器
  • 虚拟主机免费云服务器天津seo排名公司
  • 多语言网站是怎么做的google网站搜索
  • 网络营销培训机构排名seo关键词搜索和优化
  • 摄影网站建设论文个人小白如何做手游代理
  • 网站做系统的靠什么挣钱推广网站要注意什么
  • 网站建设案例展示佛山做网站建设
  • 如何做交友网站河北seo基础教程
  • 温州网站建设推广专家百度账号快速注册入口
  • 河北项目网是真实的吗深圳seo顾问
  • 动力无限西安网站建设网络营销运营策划