<?php highlight_file(__FILE__); if (isset($_POST["curl_opt"]) && is_array($_POST["curl_opt"])){ $ch = curl_init(); foreach ($_POST["curl_opt"] as $key=>$value){ curl_setopt($ch, $key, $value); } $result = curl_exec($ch); curl_close($ch); echo $result; } ?>
payload http://localhost/;Evil 绕过 if (path.startsWith("/Evil"))
http://localhost/;Evil
if (path.startsWith("/Evil"))
@ResponseBody @RequestMapping({"/Evil"}) public String Evil(HttpServletRequest request, HttpServletResponse response) throws IOException, ClassNotFoundException { String path = request.getRequestURI(); if (path.startsWith("/Evil")) return "nonono!!!"; String base = request.getParameter("base"); EInputStream in = new EInputStream(new ByteArrayInputStream(Base64.getDecoder().decode(base))); Object a = in.readObject(); return "OK"; }
base 参数如何?进一步查看writeUp:
base