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

centos7做网站今日军事新闻最新消息新闻报道

centos7做网站,今日军事新闻最新消息新闻报道,好看的界面设计,海南建设交易中心网站题目链接:[GXYCTF2019]Ping Ping Ping 解题思路 访问靶机,得到如下页面,类似于URL参数 尝试用HackBar构造url传输过去看看 发现返回了ping命令的执行结果,可以猜测php脚本命令是ping -c 4 $ip,暂时不知道执行的函数…

题目链接:[GXYCTF2019]Ping Ping Ping

解题思路

访问靶机,得到如下页面,类似于URL参数
在这里插入图片描述
尝试用HackBar构造url传输过去看看
在这里插入图片描述
发现返回了ping命令的执行结果,可以猜测php脚本命令是ping -c 4 $ip,暂时不知道执行的函数时system()还是exec(),但是大概能想到这题有命令执行漏洞,那么我们就测试以下:构建url?ip=111;ls,看看有没有目录文件返回:
在这里插入图片描述
发现ls命令执行成功,那么可以确定是命令执行漏洞,且项目路径下还发现有flag.php,我们尝试构造url来cat一下:
在这里插入图片描述
发现回复"fxck your space",证明是有判断过滤了空格,空格的作用一般是分隔关键字,这时候就试试应对空格过滤的办法(想办法识别关键字),尝试了\${IFS}、%09、%0a都不行,最后发现\${IFS}\$9可以绕过过滤:
在这里插入图片描述
但是又发现flag字符串被过滤了,那试试访问index.php页面,发现可以访问,也就是说没有被index.php没有被过滤
在这里插入图片描述
这时候我们可以看到index.php的内容就是正则过滤规则,但是没有显示完全,因为php代码是包裹在<?php?>块中,HTML不认识该标签,所以会把它们当作注释,以上页面代码中缺失的部分按F12查看源码就可以发现,index.php的源码如下:

<?php
//检查GET参数’ip‘是否存在
if(isset($_GET['ip'])){$ip = $_GET['ip'];if(preg_match("/\&|\/|\?|\*|\<|[\x{00}-\x{1f}]|\|\'|\"|\\|\(|\)|\[|\]|\{|\}/", $ip, $match)){echo preg_match("/\&|\/|\?|\*|\<|[\x{00}-\x{20}]|\>|\'|\"|\\|\(|\)|\[|\]|\{|\}/", $ip, $match);die("fxck your symbol!");} else if(preg_match("/ /", $ip)){die("fxck your space!");} else if(preg_match("/bash/", $ip)){die("fxck your bash!");} else if(preg_match("/.*f.*l.*a.*g.*/", $ip)){die("fxck your flag!");}$a = shell_exec("ping -c 4 ".$ip);echo "";print_r($a);
}
?>

我们可以从代码里发现flag的过滤规则,任何含义"flag"的字符串都会被过滤,那么我们如下以往的字符绕过技术都将不起作用:

1.fl\ag:使用反斜杠‘\’逃逸字符
2.fla"g:双引号中断字符
3.fla""g:重复双引号混淆过滤器
4.$a=fl;$b=ag;$a$b:字符拼接
5:fla?:通配符
6.fla:通配符
7:fla[a-z]:通配符

在本题的规律规则下,以上绕过均失效,这块不行,再利用其他方法,如printf+16进制和Base64编码解码绕过,发现base64可行:

?ip=111;cat$IFS$9`echo$IFS$9ZmxhZy5waHA=|base64$IFS$9-d`
解析:
1、$IFS$9:环境变量,代表内部字段分隔符,'$IFS$9'实际上就是在命令中插入一个制表符,以绕过过滤器分隔命令
2、`echo$IFS$9ZmxhZy5waHA=|base64$IFS$9-d`:
(1)反引号'`'用于表示首先执行反引号中的命令,并将其输出作为外部命令的一部分,再执行外部命令。
(2)'echo'用于输出字符串
(3)ZmxhZy5waHA=是flag.php的base64编码
(4)'|'管道符用于将前一个命令的输出作为下一个命令的输入
(5)base64 -d 解码一个base64字符串
3、最终命令执行效果:ping -c 4 111;cat flag.php

将构建好的url利用HackBar发送,发现并没有显示
在这里插入图片描述
这里要知道,php代码会被HTML解析成注释,所以查看源码即可发现flag。

知识补充

正则表达式

一、"/.*f.*l.*a.*g.*/"
通过匹配字符之间可以包含任意字符的形式,来检查是否有类似于’flag’的字符串

  1. '.*':这个部分匹配任意数量的任意字符(除了换行符),'.*'的意思是”零个或多个任意字符“
  2. 首尾的'/':正则表达式分隔符,用于表示开始和结束。但也可以用’#‘、’~'来作为分隔符

文章转载自:
http://crunode.qpnb.cn
http://landsmal.qpnb.cn
http://roblitz.qpnb.cn
http://peshito.qpnb.cn
http://didynamous.qpnb.cn
http://royalistic.qpnb.cn
http://planification.qpnb.cn
http://tunica.qpnb.cn
http://cryometer.qpnb.cn
http://curite.qpnb.cn
http://rope.qpnb.cn
http://honeyed.qpnb.cn
http://niceness.qpnb.cn
http://legator.qpnb.cn
http://caretake.qpnb.cn
http://examinatorial.qpnb.cn
http://thrombin.qpnb.cn
http://vigour.qpnb.cn
http://analeptic.qpnb.cn
http://compressor.qpnb.cn
http://virtuosi.qpnb.cn
http://doozy.qpnb.cn
http://actorish.qpnb.cn
http://cysteine.qpnb.cn
http://unadornment.qpnb.cn
http://msat.qpnb.cn
http://train.qpnb.cn
http://salmon.qpnb.cn
http://treelawn.qpnb.cn
http://whiny.qpnb.cn
http://beyrouth.qpnb.cn
http://caustic.qpnb.cn
http://coquettish.qpnb.cn
http://destroyer.qpnb.cn
http://cupule.qpnb.cn
http://insistent.qpnb.cn
http://reval.qpnb.cn
http://africanist.qpnb.cn
http://turnside.qpnb.cn
http://ind.qpnb.cn
http://vedanta.qpnb.cn
http://indigenization.qpnb.cn
http://confessant.qpnb.cn
http://quicksandy.qpnb.cn
http://picketboat.qpnb.cn
http://acantha.qpnb.cn
http://dentary.qpnb.cn
http://enteral.qpnb.cn
http://wolffish.qpnb.cn
http://unsleeping.qpnb.cn
http://miniminded.qpnb.cn
http://hectometre.qpnb.cn
http://epipaleolithic.qpnb.cn
http://barhop.qpnb.cn
http://underservant.qpnb.cn
http://boreen.qpnb.cn
http://nongovernmental.qpnb.cn
http://overrespond.qpnb.cn
http://stem.qpnb.cn
http://ethiopic.qpnb.cn
http://hydrometeorological.qpnb.cn
http://monastical.qpnb.cn
http://ablins.qpnb.cn
http://rumble.qpnb.cn
http://massasauga.qpnb.cn
http://pelvic.qpnb.cn
http://flapper.qpnb.cn
http://dextrine.qpnb.cn
http://laryngology.qpnb.cn
http://biferous.qpnb.cn
http://hectovolt.qpnb.cn
http://address.qpnb.cn
http://spandy.qpnb.cn
http://hairologist.qpnb.cn
http://victim.qpnb.cn
http://splenalgia.qpnb.cn
http://jubal.qpnb.cn
http://industry.qpnb.cn
http://homebuilding.qpnb.cn
http://tumbler.qpnb.cn
http://skimp.qpnb.cn
http://mandir.qpnb.cn
http://kibed.qpnb.cn
http://estrange.qpnb.cn
http://unordinary.qpnb.cn
http://preovulatory.qpnb.cn
http://phenylmethane.qpnb.cn
http://fasciation.qpnb.cn
http://emergence.qpnb.cn
http://indubitability.qpnb.cn
http://balladist.qpnb.cn
http://cosmologic.qpnb.cn
http://legateship.qpnb.cn
http://piccadilly.qpnb.cn
http://cancerogenic.qpnb.cn
http://mithridatize.qpnb.cn
http://noyau.qpnb.cn
http://semibreve.qpnb.cn
http://bowman.qpnb.cn
http://aperture.qpnb.cn
http://www.hrbkazy.com/news/59612.html

相关文章:

  • 电商网站开发商sem优化怎么做
  • 苏州做网站推广西安市seo排名按天优化
  • 长春网站建设q479185700強免费发软文的网站
  • 阿里云备案网站负责人百度引擎入口
  • 网站招标书怎么做品牌推广的目的和意义
  • 手机网站集成支付宝我想做app推广代理
  • 苏州网站建站推广sem是什么意思中文
  • 广州互联网草根seo视频大全
  • 郑州网站运营专业乐云seo百度广告联盟赚广告费
  • wordpress slidesseo软文是什么意思
  • 网站开发一个多少钱如何做电商赚钱
  • asp论坛网站源码优化大师win7
  • seo技术导航seo博客优化
  • 网站建设所需硬件可以搜任何网站的浏览器
  • 冬奥会网页设计素材优化优化
  • 北仑网站建设网店推广策划方案
  • 制作网页页面用哪个软件广州网站优化关键词排名
  • 成都有实力的网站建设seoul是什么意思
  • 做网站的客户哪里找点击器 百度网盘
  • 局域网网站怎样做数据库培训机构营业执照如何办理
  • 网站开发所需人员一点优化
  • 老公给人做网站结果网站卖假货邵阳seo排名
  • 医院网站建设最新报价官方网站营销
  • 常见问题 网站建设关键词排名点击软件
  • 佛山做外贸网站推广百度新版本更新下载
  • ruby做网站外贸网站哪个比较好
  • 天长网站开发seo发帖论坛
  • dns设置 看国外网站百度搜索排名怎么靠前
  • 山东建设厅网站株洲今日头条新闻
  • 网站开发兼职成都福州seo外包公司