diff --git a/src/main/java/org/t246osslab/easybuggy4sb/vulnerabilities/UnintendedFileDisclosureController.java b/src/main/java/org/t246osslab/easybuggy4sb/vulnerabilities/UnintendedFileDisclosureController.java index f30e220..8e77c18 100644 --- a/src/main/java/org/t246osslab/easybuggy4sb/vulnerabilities/UnintendedFileDisclosureController.java +++ b/src/main/java/org/t246osslab/easybuggy4sb/vulnerabilities/UnintendedFileDisclosureController.java @@ -1,76 +1,33 @@ package org.t246osslab.easybuggy4sb.vulnerabilities; -import java.io.IOException; import java.util.Locale; -import java.util.Properties; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.MessageSource; -import org.springframework.context.NoSuchMessageException; -import org.springframework.core.io.ClassPathResource; -import org.springframework.core.io.Resource; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.ModelAndView; @Controller public class UnintendedFileDisclosureController { - private static final Logger log = LoggerFactory.getLogger(UnintendedFileDisclosureController.class); - @Autowired MessageSource msg; @RequestMapping(value = "/clientinfo") - public void clientinfo(HttpServletResponse res, Locale locale) throws IOException { - Resource resource = new ClassPathResource("/templates/clientinfo.html"); - String htmlString = IOUtils.toString(resource.getInputStream()); - htmlString = repacLocalizedString(htmlString, locale); - res.getWriter().write(htmlString); + public ModelAndView process(ModelAndView mav, Locale locale) { + mav.setViewName("clientinfo"); + mav.addObject("title", msg.getMessage("section.client.info", null, locale)); + return mav; } - + @RequestMapping(value = "/serverinfo") - public void serverinfo(HttpSession ses, HttpServletResponse res, Locale locale) throws IOException { - StringBuilder sb = new StringBuilder(); - Properties properties = System.getProperties(); - for (Object key : properties.keySet()) { - Object value = properties.get(key); - sb.append("