[GXYCTF2019]BabyUpload

本文详细介绍了在阿帕奇服务器中利用.htaccess文件上传漏洞的过程,包括如何绕过jpg格式限制,使用png格式上传并成功利用蚁剑连接服务器。此外,还分享了一种通过show_source()函数获取flag的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在这里插入图片描述
我上传了图片马过去,发现可行,这边其实过滤了ph,然后我访问他竟然不行
在这里插入图片描述
直接连蚁剑也不行,
看到报错的内容,服务器是阿帕奇的,百度了一下阿帕奇服务器上传漏洞

在这里插入图片描述
.htaccess上传漏洞

和之前的那个.user,ini一样
先上传.htaccess文件,注意抓包,要修改TYPE,不然无法上传

注意他这里不能上传jpg格式的文件,png可以。
记得改TYPE值为jpeg

在这里插入图片描述
访问/upload/dfa7cdb4f10ac314acdff5a6cb724756/3.png
在这里插入图片描述
成功进入,蚁剑连接
在这里插入图片描述
emmm,过滤了指令,我就直接找算了,反正我现在黑进服务器了
在这里插入图片描述
在根目录下看见flag了
在这里插入图片描述

另外一种方法:

看大哥秀操作

show_source() 函数对文件进行语法高亮显示。

show_source('/flag');

得到flag

### GXYCTF2019 BabySQli SQL Injection Challenge Solution In addressing the specific challenge named BabySQli from GXYCTF2019, understanding how to manipulate queries through injection techniques is crucial. The initial approach involves identifying a vulnerable point within an application's input handling mechanism where unfiltered user inputs can alter backend database commands. For this particular case, consider that the original query structure might resemble something similar to: ```sql SELECT id FROM products WHERE name = 'abcd' ``` An attacker could exploit such a scenario by injecting additional SQL code after `'abcd'`, effectively changing the logic and potentially revealing unintended data or bypassing authentication mechanisms[^1]. A crafted payload aiming at exploiting this vulnerability would look like: ```sql "' AND 1=2 UNION SELECT ... ``` This payload attempts to terminate the existing condition with `AND 1=2` ensuring it evaluates as false while introducing a new selection statement via `UNION`. This technique allows attackers to append their own select statements which may expose sensitive information depending on what columns are selected and tables involved. However, when dealing specifically with challenges designed around CTFs (Capture The Flag), there often exist constraints not present in real-world scenarios—such as limited table names or column counts—that must be considered during exploitation efforts. For instance, knowing whether certain keywords need encoding due to filters applied by developers before processing user-supplied parameters becomes essential knowledge for successfully completing these types of exercises. Moreover, regarding session-based functionalities mentioned elsewhere, altering another user’s records directly isn’t feasible since usernames derive from sessions rather than direct URL manipulations or form submissions[^2]. To mitigate risks associated with SQL injections across all applications including those found within competitive environments like CTF competitions, implementing robust validation checks alongside prepared statements significantly reduces attack surfaces[^3]: - Utilize parameterized queries instead of string concatenation. - Employ ORM frameworks whenever possible. - Regularly update dependencies and apply patches promptly.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值