public static IStrutsMappings calculateStrutsMapping(IWebXml webXml, IStrutsConfigXml strutsConfigXml) { var strutsMappings = new KStrutsMappings(); var servletsDictionary = ((KWebXml) webXml).getServletsDictionary(); foreach (var servletMapping in webXml.servletMappings) { if (servletsDictionary.ContainsKey(servletMapping.servletName)) { var servlet = servletsDictionary[servletMapping.servletName]; if ("org.apache.struts.action.ActionServlet" == servlet.servletClass) { strutsMappings.actionServlets.Add(calculateActionServlet(webXml, servletMapping, servlet, strutsConfigXml)); } else strutsMappings.otherServlets.Add( string.Format("{0} {1} {2}", servletMapping.servletName, servletMapping.urlPattern, servlet.servletClass)); } else DI.log.error("in calculateStrutsMapping, could not find servlet: {0}", servletMapping.servletName); } return strutsMappings; }
public static List<IO2Finding> test3(List<IO2Finding> baseO2Findings, KStrutsMappings strutsMappings) { var taintSources_SourceRegEx = @""; var taintSources_SinkRegEx = @""; var finalSinks_SourceRegEx = @""; var finalSinks_SinkRegEx = @""; var results = executeStrutsRule(baseO2Findings, strutsMappings, taintSources_SourceRegEx, taintSources_SinkRegEx, finalSinks_SourceRegEx, finalSinks_SinkRegEx); return results; }
public static List<IO2Finding> test2(List<IO2Finding> baseO2Findings, KStrutsMappings strutsMappings) { var taintSources_SourceRegEx = @""; var taintSources_SinkRegEx = @"setAttribute\(java.lang.String"; var finalSinks_SourceRegEx = @"getAttribute\(java.lang.String\)"; var finalSinks_SinkRegEx = @""; var results = executeStrutsRule(baseO2Findings, strutsMappings, taintSources_SourceRegEx, taintSources_SinkRegEx, finalSinks_SourceRegEx, finalSinks_SinkRegEx); return results; }