// Path: src/main/java/burp/j2ee/CustomScanIssue.java
// public class CustomScanIssue implements IScanIssue {
// 
//     private IHttpService httpService;
//     private URL url;
//     private IHttpRequestResponse httpMessages;
//     private String name;
//     private String detail;
//     private Risk severity;
//     private String remedy;
//     private Confidence confidence = Confidence.Certain;
//     
//     public CustomScanIssue(
//             IHttpService httpService,
//             URL url,
//             IHttpRequestResponse httpMessages,
//             String name,
//             String detail,
//             String remedy,
//             Risk severity,
//             Confidence confidence) {
//         this.httpService = httpService;
//         this.url = url;
//         this.httpMessages = httpMessages;
//         this.name = "J2EEScan - " + name;
//         this.detail = detail;
//         this.remedy = remedy;
//         this.severity = severity;
//         this.confidence = confidence;
//     }      
//     
// 
//     @Override
//     public URL getUrl() {
//         return url;
//     }
// 
//     @Override
//     public String getIssueName() {
//         return name;
//     }
// 
//     @Override
//     public int getIssueType() {
//         return 0;
//     }
// 
//     @Override
//     public String getSeverity() {
//         return severity.toString();
//     }
// 
//     @Override
//     // "Certain", "Firm" or "Tentative"
//     public String getConfidence() {
//         return confidence.toString();
//     }
// 
//     @Override
//     public String getIssueBackground() {
//         return null;
//     }
// 
//     @Override
//     public String getRemediationBackground() {
//         return null;
//     }
// 
//     @Override
//     public String getIssueDetail() {
//         return detail;
//     }
// 
//     @Override
//     public String getRemediationDetail() {
//         return remedy;
//     }
// 
//     @Override
//     public IHttpRequestResponse[] getHttpMessages() {
//         return new IHttpRequestResponse[]{httpMessages};
//     }
// 
//     @Override
//     public IHttpService getHttpService() {
//         return httpService;
//     }
// 
// }


import burp.j2ee.Confidence;
import burp.j2ee.CustomScanIssue;
import burp.j2ee.Risk;
import java.util.Arrays;
import java.util.List;
    package burp;



/**
 * Knowledge Base to push vulnerabilities based on the remote version detected
 * 
 * 
 */
public class SoftwareVersions {

    public static void getIssues(
            String software,
            String release,
            IBurpExtenderCallbacks callbacks,
            IHttpRequestResponse baseRequestResponse) {

        IExtensionHelpers helpers = callbacks.getHelpers();
        IRequestInfo requestInfo = helpers.analyzeRequest(baseRequestResponse);

        
        /**
         * Apache Tomcat
         */
        if (software.equalsIgnoreCase("Apache Tomcat")) {

            /**
             * End of Life - Apache Tomcat
             * Apache Tomcat 5.x
             *   - http://tomcat.apache.org/tomcat-55-eol.html
             * Apache Tomcat 6.x
             *  - http://tomcat.apache.org/tomcat-60-eol.html
             * Apache Tomcat 7.x 
             *  - http://tomcat.apache.org/tomcat-70-eol.html
             * Apache Tomcat 8.0
             *  - http://tomcat.apache.org/tomcat-80-eol.html   
             *  . 
             */
            List<Integer> vulnerableTomcatReleases;
            vulnerableTomcatReleases = Arrays.asList(4, 5, 6, 8);
            
            // TODO replace with regexp
            if ( vulnerableTomcatReleases.contains(Integer.parseInt(release.substring(0, 1))) && !release.startsWith("8.5") ) {

// Path: src/main/java/burp/j2ee/CustomScanIssue.java
// public class CustomScanIssue implements IScanIssue {
// 
//     private IHttpService httpService;
//     private URL url;
//     private IHttpRequestResponse httpMessages;
//     private String name;
//     private String detail;
//     private Risk severity;
//     private String remedy;
//     private Confidence confidence = Confidence.Certain;
//     
//     public CustomScanIssue(
//             IHttpService httpService,
//             URL url,
//             IHttpRequestResponse httpMessages,
//             String name,
//             String detail,
//             String remedy,
//             Risk severity,
//             Confidence confidence) {
//         this.httpService = httpService;
//         this.url = url;
//         this.httpMessages = httpMessages;
//         this.name = "J2EEScan - " + name;
//         this.detail = detail;
//         this.remedy = remedy;
//         this.severity = severity;
//         this.confidence = confidence;
//     }      
//     
// 
//     @Override
//     public URL getUrl() {
//         return url;
//     }
// 
//     @Override
//     public String getIssueName() {
//         return name;
//     }
// 
//     @Override
//     public int getIssueType() {
//         return 0;
//     }
// 
//     @Override
//     public String getSeverity() {
//         return severity.toString();
//     }
// 
//     @Override
//     // "Certain", "Firm" or "Tentative"
//     public String getConfidence() {
//         return confidence.toString();
//     }
// 
//     @Override
//     public String getIssueBackground() {
//         return null;
//     }
// 
//     @Override
//     public String getRemediationBackground() {
//         return null;
//     }
// 
//     @Override
//     public String getIssueDetail() {
//         return detail;
//     }
// 
//     @Override
//     public String getRemediationDetail() {
//         return remedy;
//     }
// 
//     @Override
//     public IHttpRequestResponse[] getHttpMessages() {
//         return new IHttpRequestResponse[]{httpMessages};
//     }
// 
//     @Override
//     public IHttpService getHttpService() {
//         return httpService;
//     }
// 
// }


// Path: src/main/java/burp/SoftwareVersions.java
import burp.j2ee.Confidence;
import burp.j2ee.CustomScanIssue;
import burp.j2ee.Risk;
import java.util.Arrays;
import java.util.List;

    package burp;



/**
 * Knowledge Base to push vulnerabilities based on the remote version detected
 * 
 * 
 */
public class SoftwareVersions {

    public static void getIssues(
            String software,
            String release,
            IBurpExtenderCallbacks callbacks,
            IHttpRequestResponse baseRequestResponse) {

        IExtensionHelpers helpers = callbacks.getHelpers();
        IRequestInfo requestInfo = helpers.analyzeRequest(baseRequestResponse);

        
        /**
         * Apache Tomcat
         */
        if (software.equalsIgnoreCase("Apache Tomcat")) {

            /**
             * End of Life - Apache Tomcat
             * Apache Tomcat 5.x
             *   - http://tomcat.apache.org/tomcat-55-eol.html
             * Apache Tomcat 6.x
             *  - http://tomcat.apache.org/tomcat-60-eol.html
             * Apache Tomcat 7.x 
             *  - http://tomcat.apache.org/tomcat-70-eol.html
             * Apache Tomcat 8.0
             *  - http://tomcat.apache.org/tomcat-80-eol.html   
             *  . 
             */
            List<Integer> vulnerableTomcatReleases;
            vulnerableTomcatReleases = Arrays.asList(4, 5, 6, 8);
            
            // TODO replace with regexp
            if ( vulnerableTomcatReleases.contains(Integer.parseInt(release.substring(0, 1))) && !release.startsWith("8.5") ) {

                callbacks.addScanIssue(new CustomScanIssue(