/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package uk.co.pentest.psychoPATH;

import burp.IHttpRequestResponse;

import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.swing.JFileChooser;
import javax.swing.JList;
import javax.swing.ListModel;
import javax.swing.ListSelectionModel;
import javax.swing.JOptionPane;
//import IntruderPayloadGenerator;
/*
import javax.swing.JComboBox;
import java.awt.event.ItemEvent;
import burp.IScanIssue;
import burp.BinaryPayloadIssue;
import burp.BuildUnencodedRequest;
import burp.DirectScannerCheck;
*/
/**
 *
 * @author julian
 */
public class PsychoPanel2 extends javax.swing.JPanel {

    /**
     * Creates new form psychoPanel2
     */
    
    protected boolean addFilePrefix=false; // whether to include file:/// in front of the absolute paths    
    protected int defaultMaxTraversalsPerPayload=18; 
    protected int maxTraversalsPerPayload=18; // the number of maximum traversals in our payloads - used to pick the longest ones while optimizing - later we'll just calculate this value on the fly
    protected boolean optimizeDocroots=true; // whether to only prepend docroots with the longest versions of traversals
    protected boolean evasiveTechniques=true;
    protected boolean optimizeLFI=false; // whether to only prepend the filename with the longest versions of traversals when in LFI mode
    protected boolean LFImode=true; // whether we are in the LFI hunting mode - whether or not to use webroots at all
    protected boolean useAbsoluteWebroots=true; 
    public boolean scannerChecks=true;

    protected String byteGeneratorRange;
    
    protected String editorFormat="HEX";
    
    protected String proto="https";
    protected String hostname="example.org";
    protected ArrayList<String> genericSuffixes;    
    protected ArrayList<String> payloads; // used by save to file/copy to clipboard features
    protected String[] defaultBreakups = {"20"}; // by default the only {BREAK} string is a white space (20 asciihex)
    protected String[] nonRecurrentEvasiveTraversals =  {"....//", "...//", ".....///"};  
    protected String[] mixedSlashEvasiveTraversals = {"...\\./", ".../.\\"}; 
    protected String[] breakupHolderTraversals = {".{BREAK}.{BREAK}/","..{BREAK}/","{BREAK}../",".{BREAK}./","../{BREAK}"};     // currently the only break-up char is space; we'll make this customizable as well
    // other, yet not supported variants (might be added later)
    // break up holders mixed with non-recurrent filters
    // non-recurrent filter cases with mixed win-nix slashes
    // non-recurrent filter cases with mixed win-nix slashes mixed with break-up character    
    protected String slashesToUse="all"; // possible values: nix,win,all
    protected int[] encodingsEnabled={0};
    
    PrintWriter stdout;
    
    
    protected String[] universalDocroots = { "/var/www",
 "/usr/local/httpd", 
 "/usr/local/www",
 "/usr/local/httpd/{TARGET}", 
 "/usr/local/www/{TARGET}",
 "/srv/www", 
 "/var/www/html",
 "/var/www/{TARGET}",
 "/srv/www/{TARGET}", 
 "/var/www/html/{TARGET}",
 "/var/www/vhosts/{TARGET}", 
 "/var/www/virtual/{TARGET}", 
 "/var/www/clients/vhosts/{TARGET}", 
 "/var/www/clients/virtual/{TARGET}"};
    protected String[] nginxDocroots = {"/var/www/nginx-default"};
    protected String[] apacheDocroots = { "/usr/local/apache", 
 "/usr/local/apache2", 
  "/usr/local/apache/{TARGET}", 
 "/usr/local/apache2/{TARGET}", 
 "/usr/local/www/apache/{TARGET}", 
 "/usr/local/www/apache24/{TARGET}",
 "/usr/local/{TARGET}/apache/www/apache22/{TARGET}",
 "/usr/local/apache/www/apache22/{TARGET}",
 "/usr/local/{TARGET}/apache/www/apache22/{TARGET}"};
    protected String[] tomcatDocroots = { "/usr/local/tomcat/webapps/{TARGET}",
 "/usr/local/tomcat01/webapps/{TARGET}", 
 "/usr/local/tomcat02/webapps/{TARGET}",
 "/opt/tomcat5/{TARGET}",
 "/opt/tomcat6/{TARGET}",
 "/opt/tomcat7/{TARGET}",
 "/opt/tomcat8/{TARGET}",
 "/opt/tomcat5/webapps/{TARGET}",
 "/opt/tomcat6/webapps/{TARGET}",
 "/opt/tomcat7/webapps/{TARGET}",
 "/opt/tomcat8/webapps/{TARGET}",
 "/opt/tomcat5/webapps",
 "/opt/tomcat6/webapps",
 "/opt/tomcat7/webapps",
 "/opt/tomcat8/webapps",
 "/var/lib/tomcat7/webapps",
 "/var/lib/tomcat7/webapps/{TARGET}",
 "/var/lib/tomcat8/webapps",
 "/var/lib/tomcat8/webapps/{TARGET}"};
        
    protected String[] windowsDocroots = {       
    "C:/xampp", 
    "C:/Program Files/xampp", 
    "C:/wamp",
    "C:/Program Files/wampp",
    "C:/apache",
    "C:/Program Files/Apache Group/Apache",
    "C:/Program Files/Apache Group/Apache2",
    "C:/Program Files/Apache Group/Apache2.2",
    "C:/Program Files/Apache Group/Apache2.4", 
    "C:/Inetpub/wwwroot",
    "C:/Inetpub/vhosts/",
    "C:/Inetpub/wwwroot/{TARGET}",
    "C:/Inetpub/vhosts/{TARGET}",
    "C:/{TARGET}",  // these last four will require some additional sculpture to support alternative drive letters
     "\\\\.\\GLOBALROOT\\Device\\HArddiskVolume1\\",
     "\\\\?\\localhost\\c$\\",
     "\\\\127.0.0.1\\C$\\",
     "file:///c:\\\\"        
        };    
    
    
    public void updateScope(String proto, String hostname)
    {       
        this.proto=proto;
        this.hostname=hostname;
        // ok, now we update the targets
 
        ArrayList<String> newList = new ArrayList<String>();
        newList.add(hostname);
        // if hostname is not an IP address - but contains dots, it is a domain name
        String ipPattern = "^([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])\\.([01]?\\d\\d?|2[0-4]\\d|25[0-5])$";
               
        Pattern pattern = Pattern.compile(ipPattern);
        Matcher matcher = pattern.matcher(hostname);
       
        if(!matcher.matches())
        {
            // in such case split the string by dots, remove the tld
            // and propagate the list
            String[] parts = hostname.split(".");
            for(int i=0;i<parts.length-1;i++)
            {
                newList.add(parts[i]);
            }
        }
        // propagate the list to the interface
                
        String[] newListArr = new String[newList.size()]; // normal (String[])newList.toArray() stopped working, leading to unexpected results with no exceptions thrown
        for(int i=0;i<newListArr.length;i++)
        {
            newListArr[i]=newList.get(i);
            logOutput("New target "+newListArr[i]+" to be propagated.");
        }
        appendListData(targetsList,newListArr);
        targetsList.setListData(newListArr); // had to declare the arrary first to avoid the "undefined behavior" (mention in the manual) we were experiencing when passing the inline returned value directly
        
        // now is the time to update suffixes
        genericSuffixes.clear();
        IHttpRequestResponse[] items = PsychoPATH.callbacks.getSiteMap(proto+"://"+hostname);
                        
        for(int i=0;i<items.length;i++)
        {            
            if(items[i].getStatusCode()==404)
            {
                continue;
            } // skipping 404s might not be a good idea - some servers return 404s for existing directories when no deeper existing URI is requested            
	    String path=PsychoPATH.callbacks.getHelpers().analyzeRequest(items[i]).getUrl().getPath();
            
            path=path.substring(0,path.lastIndexOf("/"));            
            if(!genericSuffixes.contains(path)) 
            {                
                genericSuffixes.add(path);                
            }                        
        }        
        // we propagate the list to the GUI, so it can be adjusted before the attack
        
        String[] arr;
        arr = new String[genericSuffixes.size()];
        for(int i =0;i<genericSuffixes.size();i++)
        {
            arr[i]=genericSuffixes.get(i);
        }           
        appendListData(suffixesList,arr); // we cannot cast, we'll just merge                      
        // for some reason this no longer updates in the UI... still works, but it looks like it didn't...
        // the genericSuffixes list will, in turn, be used by the directory checker logic of the IntruderPayloadGenerator        
        if(hostname!="example.org") this.logOutput("Scope propagated.\n");
        
    }
    
    protected void appendListData(JList list, String[] items)
    {
        ArrayList tmp = new ArrayList();
         for (int i=0; i < list.getModel().getSize(); i++) {
            String elem = (String) list.getModel().getElementAt(i);           
            tmp.add(elem);
        }
        for(String item: items)
        {
            if(!tmp.contains(item)) tmp.add(item);
        }        
        list.setListData(tmp.toArray());
        
    }
    private void removeFromListData(JList list, String item)
    {
        ArrayList tmp = new ArrayList();

         for (int i=0; i < list.getModel().getSize(); i++) {
            String elem = (String) list.getModel().getElementAt(i); 
            if(!elem.equals(item)) tmp.add(elem);
        }
        list.setListData(tmp.toArray());
    }
    private void initiateEvasiveList()
    {
        appendListData(evasiveList,this.nonRecurrentEvasiveTraversals);
        String n[]={this.breakupHolderTraversals[0]}; 
        appendListData(evasiveList,n);
        this.evasiveTechniques=true;
    }
    private void disableEvasiveTechniques()
    {
        String [] empty = {};
        evasiveList.setListData(empty); //for some weird reason removeAll did not want to work. 
        this.evasiveTechniques=false;
    }
    private void clearBreakups()
    {
        String [] empty={};
        breakupList.setListData(empty); // if breakup-list is empty, break-up payloads are ignored
        // additionally, we could search the list and remove elements with the {BREAK} holder
    }
    private void initiateBreakups()
    {
        appendListData(breakupList,this.defaultBreakups);
    }
    private void initiateEncodings() // same as clear, no encoding by default
    {
        //String empty[] = {"None"};
        //encodeList.setListData(empty);
    }
    private void clearDrives()
    {
        String [] empty={};
        drivesList.setListData(empty);
    }
    private void enableLFIMode()
    {
        LFImode=true;
        LFIOptimizeCheckBox.setEnabled(true); 
        LFIOptimizeCheckBox.setSelected(true);
        optimizeLFI=true;
        optimizeDocrootTraversalsBox.setEnabled(false);
        
        useAbsoluteWebrootsBox.setEnabled(false);
        //LFIModeCheckBox.setEnabled(true);
        LFIModeCheckBox.setSelected(true);
                
        drivesList.setEnabled(false);
        windowsDrivesToUse.setEnabled(false);
    }
    private void disableLFIMode()
    {
        LFImode=false;
        LFIOptimizeCheckBox.setEnabled(false);
        
        optimizeDocrootTraversalsBox.setEnabled(true);                

        useAbsoluteWebrootsBox.setEnabled(true);
        
        LFIModeCheckBox.setSelected(false);
        if(useAbsoluteWebroots)
        {
            drivesList.setEnabled(true);
            windowsDrivesToUse.setEnabled(true);
        }                    
    }
    public int payloadCount()
    {
        int cnt=0;
        
        
        return 0;
    }    
    public void logOutput(String msg)
    {
        //this.logOutput.append(msg);
        stdout.println(msg);
    }
    
    protected void enableScannerChecks()
    {
        scannerChecksCheckbox.setSelected(true);
        this.scannerChecks=true; 
    }
    protected void disableScannerChecks()
    {
        scannerChecksCheckbox.setSelected(false);
        this.scannerChecks=false; 
    }    
    public PsychoPanel2() {
        // auto-generated init:
        initComponents();
        
        // more custom init, default settings
        stdout = new PrintWriter(PsychoPATH.callbacks.getStdout(), true);
        genericSuffixes=new ArrayList<>();
        
        this.byteGeneratorRange="non-alpha";
        enableLFIMode();
        
        initiateEvasiveList(); // enable evasive techniques
        
        enableScannerChecks();
        evasiveList.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);        
        evasiveList.setLayoutOrientation(JList.VERTICAL);
        evasiveList.setVisibleRowCount(10);
        
        breakupHexFormat.setSelected(true);
        breakupASCIIFormat.setSelected(false);
        
        optimizeDocrootTraversalsBox.setSelected(true);
        
        useTerminatorsCheckBox.setSelected(true);
        
        mixEncodingsCheckBox.setSelected(true);
                
        encodingsEnabled=new int[6];  
        encodingsEnabled[0]=1; // RAW is always enabled
        rawEncodingCheckbox.setSelected(true);
        rawEncodingCheckbox.setEnabled(false);
        
        noLiteralNullbyte.setSelected(true);
        
        // these are configurable
        urlEncode.setSelected(true);
        encodingsEnabled[1]=1;
        
        doubleUrlEncode.setSelected(false);
        encodingsEnabled[2]=0;
        
        utfEncode.setSelected(false);
        encodingsEnabled[3]=0;
        
        overlong2.setSelected(false);
        encodingsEnabled[4]=0;
        
        overlong3.setSelected(false);
        encodingsEnabled[5]=0;      
        
        //maxTraversalsPerPayloadSpinner.
        maxTraversalsPerPayloadSpinner.setValue(this.defaultMaxTraversalsPerPayload);
        //maxTraversalsPerPayloadSpininer
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel7 = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        globalSettingsPanel = new javax.swing.JPanel();
        scannerChecksCheckbox = new javax.swing.JCheckBox();
        jScrollPane4 = new javax.swing.JScrollPane();
        fileNameField = new javax.swing.JTextPane();
        jLabel4 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jScrollPane12 = new javax.swing.JScrollPane();
        nixFileName = new javax.swing.JTextPane();
        jScrollPane13 = new javax.swing.JScrollPane();
        scannerMatchRules = new javax.swing.JList<>();
        jLabel18 = new javax.swing.JLabel();
        jScrollPane14 = new javax.swing.JScrollPane();
        winFileName = new javax.swing.JTextPane();
        jLabel19 = new javax.swing.JLabel();
        newMatchRule = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jLabel20 = new javax.swing.JLabel();
        targetOS = new javax.swing.JComboBox<>();
        webrootOptionsPanel = new javax.swing.JPanel();
        optimizeDocrootTraversalsBox = new javax.swing.JCheckBox();
        jTabbedPane2 = new javax.swing.JTabbedPane();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane7 = new javax.swing.JScrollPane();
        suffixesList = new javax.swing.JList<>();
        suffixPasteButton = new javax.swing.JButton();
        suffixLoadButton = new javax.swing.JButton();
        suffixRemoveButton = new javax.swing.JButton();
        suffixClearButton = new javax.swing.JButton();
        suffixAddButton = new javax.swing.JButton();
        jScrollPane8 = new javax.swing.JScrollPane();
        suffixAddField = new javax.swing.JTextPane();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        targetsList = new javax.swing.JList<>();
        targetPasteButton = new javax.swing.JButton();
        targetLoadButton = new javax.swing.JButton();
        targetRemoveButton = new javax.swing.JButton();
        targetClearButton = new javax.swing.JButton();
        targetAddButton = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        addTargetField = new javax.swing.JTextPane();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane9 = new javax.swing.JScrollPane();
        docrootsList = new javax.swing.JList<>();
        webrootPasteButton = new javax.swing.JButton();
        webrootLoadButton = new javax.swing.JButton();
        webrootRemoveButton = new javax.swing.JButton();
        webrootCLearButton = new javax.swing.JButton();
        webrootAddButton = new javax.swing.JButton();
        jScrollPane10 = new javax.swing.JScrollPane();
        webrootAddField = new javax.swing.JTextPane();
        docrootsAddLists = new javax.swing.JComboBox<>();
        windowsDrivesToUse = new javax.swing.JComboBox<>();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane11 = new javax.swing.JScrollPane();
        drivesList = new javax.swing.JList<>();
        jButton16 = new javax.swing.JButton();
        jButton17 = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        traversalOptionsPanel = new javax.swing.JPanel();
        slashesToUseCombo = new javax.swing.JComboBox<>();
        useAbsoluteWebrootsBox = new javax.swing.JCheckBox();
        LFIModeCheckBox = new javax.swing.JCheckBox();
        LFIOptimizeCheckBox = new javax.swing.JCheckBox();
        jLabel2 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        maxTraversalsPerPayloadSpinner = new javax.swing.JSpinner();
        evasiveTechniquesPanel = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        evasiveList = new javax.swing.JList<>();
        evasiveTechniquesSetToAdd = new javax.swing.JComboBox<>();
        jScrollPane3 = new javax.swing.JScrollPane();
        breakupList = new javax.swing.JList<>();
        mixEncodingsCheckBox = new javax.swing.JCheckBox();
        rawEncodingCheckbox = new javax.swing.JCheckBox();
        urlEncode = new javax.swing.JCheckBox();
        doubleUrlEncode = new javax.swing.JCheckBox();
        utfEncode = new javax.swing.JCheckBox();
        overlong3 = new javax.swing.JCheckBox();
        jLabel6 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        addBreakupField = new javax.swing.JTextField();
        addBreakupButton = new javax.swing.JButton();
        breakupASCIIFormat = new javax.swing.JRadioButton();
        breakupHexFormat = new javax.swing.JRadioButton();
        jLabel11 = new javax.swing.JLabel();
        useTerminatorsCheckBox = new javax.swing.JCheckBox();
        overlong2 = new javax.swing.JCheckBox();
        jLabel12 = new javax.swing.JLabel();
        removeSelectedEvasive = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        urlEncodeUtf = new javax.swing.JCheckBox();
        terminateAllBox = new javax.swing.JCheckBox();
        noLiteralNullbyte = new javax.swing.JCheckBox();
        savePayloadsPanel = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        saveToFileButton = new javax.swing.JButton();
        copyToClipboardButton = new javax.swing.JButton();
        byteGeneratorPanel = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        byteGeneratorRangeCombo = new javax.swing.JComboBox<>();

        jLabel7.setText("jLabel7");

        scannerChecksCheckbox.setText("Enable Scanner checks");
        scannerChecksCheckbox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                scannerChecksCheckboxActionPerformed(evt);
            }
        });

        fileNameField.setText("etc/passwd");
        jScrollPane4.setViewportView(fileNameField);

        jLabel4.setText("File name (win):");

        jLabel14.setText("Intruder ");
        jLabel14.setToolTipText("");

        jLabel15.setText("Scanner");

        jLabel16.setText("File name:");

        nixFileName.setText("etc/passwd");
        jScrollPane12.setViewportView(nixFileName);

        scannerMatchRules.setModel(new javax.swing.AbstractListModel<String>() {
            String[] strings = { "root:x:", "root:$", "[mci extensions]" };
            public int getSize() { return strings.length; }
            public String getElementAt(int i) { return strings[i]; }
        });
        jScrollPane13.setViewportView(scannerMatchRules);

        jLabel18.setText("Scanner literal match rules:");

        winFileName.setText("win.ini");
        jScrollPane14.setViewportView(winFileName);

        jLabel19.setText("File name (nix):");

        jButton2.setText("Add");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jButton3.setText("Remove selected");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jLabel20.setText("Target OS:");

        targetOS.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "all", "win", "nix" }));

        javax.swing.GroupLayout globalSettingsPanelLayout = new javax.swing.GroupLayout(globalSettingsPanel);
        globalSettingsPanel.setLayout(globalSettingsPanelLayout);
        globalSettingsPanelLayout.setHorizontalGroup(
            globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                        .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 454, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(31, 31, 31)
                        .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(newMatchRule)
                            .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE))
                        .addGap(640, 640, 640))
                    .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                        .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel18, javax.swing.GroupLayout.PREFERRED_SIZE, 454, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(scannerChecksCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 553, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 1030, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                                .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 254, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 198, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 194, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, 444, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 444, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(targetOS, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                        .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 1030, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                                .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 446, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );
        globalSettingsPanelLayout.setVerticalGroup(
            globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel16, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(28, 28, 28)
                .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(scannerChecksCheckbox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(targetOS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                        .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                        .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGroup(globalSettingsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                        .addGap(44, 44, 44)
                        .addComponent(newMatchRule, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(12, 12, 12)
                        .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(globalSettingsPanelLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane13, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(400, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Global settings", globalSettingsPanel);

        optimizeDocrootTraversalsBox.setText("Optimize webroot payloads");
        optimizeDocrootTraversalsBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                optimizeDocrootTraversalsBoxActionPerformed(evt);
            }
        });

        jScrollPane7.setViewportView(suffixesList);

        suffixPasteButton.setText("Paste");
        suffixPasteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                suffixPasteButtonActionPerformed(evt);
            }
        });

        suffixLoadButton.setText("Load");
        suffixLoadButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                suffixLoadButtonActionPerformed(evt);
            }
        });

        suffixRemoveButton.setText("Remove");
        suffixRemoveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                suffixRemoveButtonActionPerformed(evt);
            }
        });

        suffixClearButton.setText("Clear");
        suffixClearButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                suffixClearButtonActionPerformed(evt);
            }
        });

        suffixAddButton.setText("Add");
        suffixAddButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                suffixAddButtonActionPerformed(evt);
            }
        });

        jScrollPane8.setViewportView(suffixAddField);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel6Layout.createSequentialGroup()
                            .addComponent(suffixPasteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(54, 54, 54)
                            .addComponent(suffixLoadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(suffixRemoveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 128, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(27, 27, 27)
                            .addComponent(suffixClearButton, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 619, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(suffixAddButton, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, 527, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(suffixPasteButton)
                    .addComponent(suffixLoadButton)
                    .addComponent(suffixRemoveButton)
                    .addComponent(suffixClearButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane7, javax.swing.GroupLayout.PREFERRED_SIZE, 299, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(suffixAddButton)
                    .addComponent(jScrollPane8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Relative directories (\"suffixes\")", jPanel6);

        targetsList.setModel(new javax.swing.AbstractListModel<String>() {
            String[] strings = { "example.org" };
            public int getSize() { return strings.length; }
            public String getElementAt(int i) { return strings[i]; }
        });
        jScrollPane5.setViewportView(targetsList);
        targetsList.getAccessibleContext().setAccessibleName("targetsList");

        targetPasteButton.setText("Paste");
        targetPasteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                targetPasteButtonActionPerformed(evt);
            }
        });

        targetLoadButton.setText("Load");
        targetLoadButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                targetLoadButtonActionPerformed(evt);
            }
        });

        targetRemoveButton.setText("Remove");
        targetRemoveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                targetRemoveButtonActionPerformed(evt);
            }
        });

        targetClearButton.setText("Clear");
        targetClearButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                targetClearButtonActionPerformed(evt);
            }
        });

        targetAddButton.setText("Add");
        targetAddButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                targetAddButtonActionPerformed(evt);
            }
        });

        jScrollPane6.setViewportView(addTargetField);

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel7Layout.createSequentialGroup()
                            .addComponent(targetPasteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 119, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(41, 41, 41)
                            .addComponent(targetLoadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(targetRemoveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(targetClearButton, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 608, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(targetAddButton, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(7, 7, 7)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(targetPasteButton)
                    .addComponent(targetLoadButton)
                    .addComponent(targetRemoveButton)
                    .addComponent(targetClearButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 292, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(targetAddButton)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Targets", jPanel7);

        docrootsList.setModel(new javax.swing.AbstractListModel<String>() {
            String[] strings = { "/var/www", "/usr/local/httpd", "/usr/local/www", "/usr/local/httpd/{TARGET}", "/usr/local/www/{TARGET}", "/srv/www", "/var/www/html", "/var/www/{TARGET}", "/srv/www/{TARGET}", "/var/www/html/{TARGET}", "/var/www/vhosts/{TARGET}", "/var/www/virtual/{TARGET}", "/var/www/clients/vhosts/{TARGET}", "/var/www/clients/virtual/{TARGET}", "/usr/local/apache", "/usr/local/apache2", "/usr/local/apache/{TARGET}", "/usr/local/apache2/{TARGET}", "/usr/local/www/apache/{TARGET}", "/usr/local/www/apache24/{TARGET}", "/usr/local/{TARGET}/apache/www/apache22/{TARGET}", "/usr/local/apache/www/apache22/{TARGET}" };
            public int getSize() { return strings.length; }
            public String getElementAt(int i) { return strings[i]; }
        });
        jScrollPane9.setViewportView(docrootsList);

        webrootPasteButton.setText("Paste");
        webrootPasteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                webrootPasteButtonActionPerformed(evt);
            }
        });

        webrootLoadButton.setText("Load");
        webrootLoadButton.setToolTipText("");
        webrootLoadButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                webrootLoadButtonActionPerformed(evt);
            }
        });

        webrootRemoveButton.setText("Remove");
        webrootRemoveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                webrootRemoveButtonActionPerformed(evt);
            }
        });

        webrootCLearButton.setText("Clear");
        webrootCLearButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                webrootCLearButtonActionPerformed(evt);
            }
        });

        webrootAddButton.setText("Add");
        webrootAddButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                webrootAddButtonActionPerformed(evt);
            }
        });

        jScrollPane10.setViewportView(webrootAddField);

        docrootsAddLists.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Universal", "Nginx", "Apache", "Tomcat", "Windows", "All" }));
        docrootsAddLists.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                docrootsAddListsActionPerformed(evt);
            }
        });

        windowsDrivesToUse.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "C", "D", "E", "F", "G", "H", "I", "J", "All except A,B", "All" }));
        windowsDrivesToUse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                windowsDrivesToUseActionPerformed(evt);
            }
        });

        jLabel1.setText("Windows drives to use:");

        drivesList.setModel(new javax.swing.AbstractListModel<String>() {
            String[] strings = { "C" };
            public int getSize() { return strings.length; }
            public String getElementAt(int i) { return strings[i]; }
        });
        jScrollPane11.setViewportView(drivesList);

        jButton16.setText("Remove");

        jButton17.setText("Clear");

        jLabel9.setText("Add from the built-in list below:");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane9, javax.swing.GroupLayout.PREFERRED_SIZE, 719, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jButton16, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton17, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(docrootsAddLists, javax.swing.GroupLayout.PREFERRED_SIZE, 364, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 411, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel5Layout.createSequentialGroup()
                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(webrootCLearButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(webrootAddButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(webrootRemoveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(webrootLoadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(webrootPasteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(18, 18, 18)
                            .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 306, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(windowsDrivesToUse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane11))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(webrootPasteButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(webrootLoadButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(webrootRemoveButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(webrootCLearButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(webrootAddButton)
                            .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel9)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(docrootsAddLists, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(windowsDrivesToUse, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton16)
                    .addComponent(jButton17))
                .addContainerGap(330, Short.MAX_VALUE))
        );

        jTabbedPane2.addTab("Known webroot patterns", jPanel5);

        javax.swing.GroupLayout webrootOptionsPanelLayout = new javax.swing.GroupLayout(webrootOptionsPanel);
        webrootOptionsPanel.setLayout(webrootOptionsPanelLayout);
        webrootOptionsPanelLayout.setHorizontalGroup(
            webrootOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(webrootOptionsPanelLayout.createSequentialGroup()
                .addGroup(webrootOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(webrootOptionsPanelLayout.createSequentialGroup()
                        .addGap(23, 23, 23)
                        .addComponent(optimizeDocrootTraversalsBox, javax.swing.GroupLayout.PREFERRED_SIZE, 527, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(webrootOptionsPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 1284, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(56, Short.MAX_VALUE))
        );
        webrootOptionsPanelLayout.setVerticalGroup(
            webrootOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(webrootOptionsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(optimizeDocrootTraversalsBox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(27, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Webroot options", webrootOptionsPanel);

        slashesToUseCombo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "All (default &  recommended)", "Win \\", "Nix /" }));
            slashesToUseCombo.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    slashesToUseComboActionPerformed(evt);
                }
            });

            useAbsoluteWebrootsBox.setText("Include absolute webroots");

            LFIModeCheckBox.setText("LFI mode (don't use webroots)");
            LFIModeCheckBox.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    LFIModeCheckBoxActionPerformed(evt);
                }
            });

            LFIOptimizeCheckBox.setText("Longest traversal only");
            LFIOptimizeCheckBox.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    LFIOptimizeCheckBoxActionPerformed(evt);
                }
            });

            jLabel2.setText("Directory separator to use:");

            jLabel10.setText("MAX traversals:");

            javax.swing.GroupLayout traversalOptionsPanelLayout = new javax.swing.GroupLayout(traversalOptionsPanel);
            traversalOptionsPanel.setLayout(traversalOptionsPanelLayout);
            traversalOptionsPanelLayout.setHorizontalGroup(
                traversalOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(traversalOptionsPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(traversalOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(LFIOptimizeCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 380, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(traversalOptionsPanelLayout.createSequentialGroup()
                            .addGroup(traversalOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(traversalOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(traversalOptionsPanelLayout.createSequentialGroup()
                                        .addGap(8, 8, 8)
                                        .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 340, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(52, 52, 52))
                                    .addGroup(traversalOptionsPanelLayout.createSequentialGroup()
                                        .addComponent(LFIModeCheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addGap(20, 20, 20)))
                                .addGroup(traversalOptionsPanelLayout.createSequentialGroup()
                                    .addGap(12, 12, 12)
                                    .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(138, 138, 138)))
                            .addGroup(traversalOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(slashesToUseCombo, 0, 435, Short.MAX_VALUE)
                                .addComponent(useAbsoluteWebrootsBox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(maxTraversalsPerPayloadSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap(481, Short.MAX_VALUE))
            );
            traversalOptionsPanelLayout.setVerticalGroup(
                traversalOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(traversalOptionsPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(traversalOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(slashesToUseCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(traversalOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(useAbsoluteWebrootsBox)
                        .addComponent(LFIModeCheckBox))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(LFIOptimizeCheckBox)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(traversalOptionsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel10, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(maxTraversalsPerPayloadSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(656, 656, 656))
            );

            jTabbedPane1.addTab("Traversal options", traversalOptionsPanel);

            evasiveList.setModel(new javax.swing.AbstractListModel<String>() {
                String[] strings = { "....//", "...//", ".....///", ".{BREAK}.{BREAK}/" };
                public int getSize() { return strings.length; }
                public String getElementAt(int i) { return strings[i]; }
            });
            jScrollPane2.setViewportView(evasiveList);

            evasiveTechniquesSetToAdd.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Basic (default)", "Anti-non-recurrent filters", "Breakup string", "All", "None" }));
            evasiveTechniquesSetToAdd.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    evasiveTechniquesSetToAddActionPerformed(evt);
                }
            });

            breakupList.setModel(new javax.swing.AbstractListModel<String>() {
                String[] strings = { "20" };
                public int getSize() { return strings.length; }
                public String getElementAt(int i) { return strings[i]; }
            });
            jScrollPane3.setViewportView(breakupList);

            mixEncodingsCheckBox.setText("Use mixed encodings");

            rawEncodingCheckbox.setText("RAW");

            urlEncode.setText("URL");
            urlEncode.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    urlEncodeActionPerformed(evt);
                }
            });

            doubleUrlEncode.setText("Double URL");
            doubleUrlEncode.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    doubleUrlEncodeActionPerformed(evt);
                }
            });

            utfEncode.setText("UTF %u00xx codes");
            utfEncode.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    utfEncodeActionPerformed(evt);
                }
            });

            overlong3.setText("Overlong UTF 3-byte");
            overlong3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    overlong3ActionPerformed(evt);
                }
            });

            jLabel6.setText("Encodings to use:");

            jLabel8.setText("Breakup strings to replace {BREAK} holder:");

            addBreakupButton.setText("Add");
            addBreakupButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    addBreakupButtonActionPerformed(evt);
                }
            });

            breakupASCIIFormat.setText("ASCII");
            breakupASCIIFormat.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    breakupASCIIFormatActionPerformed(evt);
                }
            });

            breakupHexFormat.setText("HEX");
            breakupHexFormat.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    breakupHexFormatActionPerformed(evt);
                }
            });

            jLabel11.setText("List editor display & input format:");

            useTerminatorsCheckBox.setText("Inlcude NULLBYTE-ended payloads");
            useTerminatorsCheckBox.setActionCommand("");
            useTerminatorsCheckBox.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    useTerminatorsCheckBoxActionPerformed(evt);
                }
            });

            overlong2.setText("Overlong UTF 2-byte");
            overlong2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    overlong2ActionPerformed(evt);
                }
            });

            jLabel12.setText("More options");

            removeSelectedEvasive.setText("Remove selected");
            removeSelectedEvasive.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    removeSelectedEvasiveActionPerformed(evt);
                }
            });

            jButton1.setText("Remove selected");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
                }
            });

            urlEncodeUtf.setText("URL-encode UTF sequences");

            terminateAllBox.setText("Terminate ALL payloads with a NULLBYTE");
            terminateAllBox.setActionCommand("Terminate all payloads with a NULLBYTE");

            noLiteralNullbyte.setText("Don't terminate strings with literal NULLBYTE ");
            noLiteralNullbyte.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    noLiteralNullbyteActionPerformed(evt);
                }
            });

            javax.swing.GroupLayout evasiveTechniquesPanelLayout = new javax.swing.GroupLayout(evasiveTechniquesPanel);
            evasiveTechniquesPanel.setLayout(evasiveTechniquesPanelLayout);
            evasiveTechniquesPanelLayout.setHorizontalGroup(
                evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(evasiveTechniquesPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(evasiveTechniquesPanelLayout.createSequentialGroup()
                                .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                        .addComponent(evasiveTechniquesSetToAdd, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 357, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 357, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE)
                                        .addGroup(evasiveTechniquesPanelLayout.createSequentialGroup()
                                            .addComponent(addBreakupButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                            .addComponent(addBreakupField, javax.swing.GroupLayout.PREFERRED_SIZE, 276, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addComponent(removeSelectedEvasive, javax.swing.GroupLayout.PREFERRED_SIZE, 357, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(103, 103, 103))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, evasiveTechniquesPanelLayout.createSequentialGroup()
                                .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 457, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                        .addGroup(evasiveTechniquesPanelLayout.createSequentialGroup()
                            .addComponent(breakupASCIIFormat)
                            .addGap(22, 22, 22)
                            .addComponent(breakupHexFormat)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                    .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(doubleUrlEncode, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(urlEncode)
                            .addComponent(rawEncodingCheckbox, javax.swing.GroupLayout.PREFERRED_SIZE, 280, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 266, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(mixEncodingsCheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, 692, Short.MAX_VALUE)
                            .addComponent(utfEncode, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(overlong2, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(overlong3, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(useTerminatorsCheckBox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(urlEncodeUtf, javax.swing.GroupLayout.PREFERRED_SIZE, 541, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(terminateAllBox, javax.swing.GroupLayout.DEFAULT_SIZE, 692, Short.MAX_VALUE))
                        .addComponent(noLiteralNullbyte, javax.swing.GroupLayout.PREFERRED_SIZE, 805, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(42, Short.MAX_VALUE))
            );
            evasiveTechniquesPanelLayout.setVerticalGroup(
                evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(evasiveTechniquesPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(evasiveTechniquesSetToAdd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel6))
                    .addGap(6, 6, 6)
                    .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(evasiveTechniquesPanelLayout.createSequentialGroup()
                            .addComponent(rawEncodingCheckbox)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(urlEncode)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(doubleUrlEncode)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(utfEncode)
                            .addGap(5, 5, 5)
                            .addComponent(overlong2)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(overlong3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jLabel12)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(mixEncodingsCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(useTerminatorsCheckBox, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(terminateAllBox)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(noLiteralNullbyte)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(urlEncodeUtf))
                        .addGroup(evasiveTechniquesPanelLayout.createSequentialGroup()
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(removeSelectedEvasive)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel8)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(addBreakupButton)
                                .addComponent(addBreakupField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel11)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(evasiveTechniquesPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(breakupASCIIFormat)
                                .addComponent(breakupHexFormat))))
                    .addContainerGap(364, Short.MAX_VALUE))
            );

            jTabbedPane1.addTab("Evasive techniques", evasiveTechniquesPanel);

            jLabel13.setText("Instead of feeding the tools, save the result payload set:");

            saveToFileButton.setText("to file");
            saveToFileButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    saveToFileButtonActionPerformed(evt);
                }
            });

            copyToClipboardButton.setText("to clipboard");
            copyToClipboardButton.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    copyToClipboardButtonActionPerformed(evt);
                }
            });

            javax.swing.GroupLayout savePayloadsPanelLayout = new javax.swing.GroupLayout(savePayloadsPanel);
            savePayloadsPanel.setLayout(savePayloadsPanelLayout);
            savePayloadsPanelLayout.setHorizontalGroup(
                savePayloadsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(savePayloadsPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(savePayloadsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 899, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(savePayloadsPanelLayout.createSequentialGroup()
                            .addComponent(saveToFileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 400, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(29, 29, 29)
                            .addComponent(copyToClipboardButton, javax.swing.GroupLayout.PREFERRED_SIZE, 424, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(441, Short.MAX_VALUE))
            );
            savePayloadsPanelLayout.setVerticalGroup(
                savePayloadsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(savePayloadsPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(savePayloadsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(saveToFileButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(copyToClipboardButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap(744, Short.MAX_VALUE))
            );

            jTabbedPane1.addTab("Save the payloads", savePayloadsPanel);

            jLabel5.setText("Byte range:");
            jLabel5.setToolTipText("");

            byteGeneratorRangeCombo.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Non-alphanumeric", "Alphanumeric", "Non-alphanumeric printable", "Non-alphanumeric non-printable", "Non-alphanumeric non-printable < 128", "All" }));
            byteGeneratorRangeCombo.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    byteGeneratorRangeComboActionPerformed(evt);
                }
            });

            javax.swing.GroupLayout byteGeneratorPanelLayout = new javax.swing.GroupLayout(byteGeneratorPanel);
            byteGeneratorPanel.setLayout(byteGeneratorPanelLayout);
            byteGeneratorPanelLayout.setHorizontalGroup(
                byteGeneratorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(byteGeneratorPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(byteGeneratorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 908, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(byteGeneratorRangeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 444, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(432, Short.MAX_VALUE))
            );
            byteGeneratorPanelLayout.setVerticalGroup(
                byteGeneratorPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(byteGeneratorPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(byteGeneratorRangeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(753, Short.MAX_VALUE))
            );

            jLabel5.getAccessibleContext().setAccessibleName("");

            jTabbedPane1.addTab("Byte generator", byteGeneratorPanel);

            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
            this.setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1336, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(71, Short.MAX_VALUE))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jTabbedPane1)
            );

            jTabbedPane1.getAccessibleContext().setAccessibleName("Webroot options");
            jTabbedPane1.getAccessibleContext().setAccessibleDescription("");
        }// </editor-fold>//GEN-END:initComponents


    
    private void scannerChecksCheckboxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scannerChecksCheckboxActionPerformed
        // TODO add your handling code here:
            if(scannerChecksCheckbox.isSelected())
            {
                enableScannerChecks();
            }
            else
            {
                disableScannerChecks();
            }
    }//GEN-LAST:event_scannerChecksCheckboxActionPerformed

    private void targetPasteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_targetPasteButtonActionPerformed
        // TODO add your handling code here:        
	Toolkit toolkit = Toolkit.getDefaultToolkit();
	Clipboard clipboard = toolkit.getSystemClipboard();
	String result = "";
        try {
            result = (String) clipboard.getData(DataFlavor.stringFlavor);
        } 
        catch (UnsupportedFlavorException ex) {
            Logger.getLogger(PsychoPanel2.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
        Logger.getLogger(PsychoPanel2.class.getName()).log(Level.SEVERE, null, ex);
        }
        targetsList.setListData(result.split("\\r*\\n"));
    }//GEN-LAST:event_targetPasteButtonActionPerformed

    private void slashesToUseComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_slashesToUseComboActionPerformed
        // this.slashesToUse="all";
        switch(slashesToUseCombo.getSelectedIndex())
        { 
            case 0 : { this.slashesToUse="all"; break;}
            case 1 : { this.slashesToUse="win"; break;}
            case 2 : { this.slashesToUse="nix"; break;}
        }
    }//GEN-LAST:event_slashesToUseComboActionPerformed

    private void optimizeDocrootTraversalsBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_optimizeDocrootTraversalsBoxActionPerformed
        // TODO add your handling code here:
        // change the state
        if(optimizeDocroots==true)
        {
            optimizeDocroots=false;
        }
        else
        {
            optimizeDocroots=true;
        }
    }//GEN-LAST:event_optimizeDocrootTraversalsBoxActionPerformed

    private void byteGeneratorRangeComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_byteGeneratorRangeComboActionPerformed
        // TODO add your handling code here:
             switch (byteGeneratorRangeCombo.getSelectedIndex()) {
                case 0:
                {
                    this.byteGeneratorRange = "non-alpha";
                    break;
                }
                case 1:
                {
                    this.byteGeneratorRange = "alpha";           
                    break;
                }
                case 2:
                {
                    this.byteGeneratorRange = "non-alpha-print";
                    break;
                }
                case 3:
                {
                    this.byteGeneratorRange = "non-alpha-non-print";
                    break;
                }
                case 4:
                {
                    this.byteGeneratorRange = "non-alpha-non-print-low";
                    break;
                }
                case 5:
                {
                    this.byteGeneratorRange = "all";
                    break;
                }
            }
    }//GEN-LAST:event_byteGeneratorRangeComboActionPerformed

    private void jCheckBox10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBox10ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jCheckBox10ActionPerformed

    private void evasiveTechniquesSetToAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_evasiveTechniquesSetToAddActionPerformed
        // TODO add your handling code here:           
        // this is the map:
        
        // Basic (default)
        // Anti-non-recurrent filters
        // Breakup string
        // Mixed encoding
        // All
        // None
            switch(evasiveTechniquesSetToAdd.getSelectedIndex())
            { 
                case 0 : { 
                    this.initiateEvasiveList();
                    break;
                }
                case 1 : { appendListData(evasiveList,this.nonRecurrentEvasiveTraversals); this.evasiveTechniques=true; break;}
                case 2 : { appendListData(evasiveList,this.breakupHolderTraversals); this.evasiveTechniques=true; break;}
                case 3 : {
                    appendListData(evasiveList,this.nonRecurrentEvasiveTraversals); 
                    appendListData(evasiveList,this.breakupHolderTraversals);
                    this.evasiveTechniques=true;
                    break;                    
                }               
                case 4 : {        
                        this.disableEvasiveTechniques();
                        break;
               }
            }
    }//GEN-LAST:event_evasiveTechniquesSetToAddActionPerformed

    private void suffixClearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_suffixClearButtonActionPerformed

        String [] empty = {};
        suffixesList.setListData(empty); //for some weird reason removeAll did not want to work.
        //suffixesList.Clear();
    }//GEN-LAST:event_suffixClearButtonActionPerformed

    private void suffixRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_suffixRemoveButtonActionPerformed
        // TODO add your handling code here:

        if(suffixesList.getSelectedIndex()!=-1)
        {
            ArrayList<String> toRemove = new ArrayList<>();
            int indices[]=suffixesList.getSelectedIndices();
                for(int i=0;i<indices.length;i++)
                {
                        toRemove.add((String)suffixesList.getModel().getElementAt(indices[i]));
                }
                for(int i=0;i<toRemove.size();i++)
                {
                   removeFromListData(suffixesList,toRemove.get(i));
                }
            }     
        // remove
    }//GEN-LAST:event_suffixRemoveButtonActionPerformed

    private void suffixAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_suffixAddButtonActionPerformed

        // TODO add your handling code here:
        String [] tmp = {suffixAddField.getText()};
        appendListData(suffixesList,tmp);
    }//GEN-LAST:event_suffixAddButtonActionPerformed

    private void windowsDrivesToUseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_windowsDrivesToUseActionPerformed
        // TODO add your handling code here:
        // drivesList
        switch(windowsDrivesToUse.getSelectedIndex())
        { 
            case 0 : { 
                String n[]={"C"};
                appendListData(drivesList,n);
                break;
           }
           case 1 : { String n[]={"D"}; appendListData(drivesList,n); break;}
           case 2 : { String n[]={"E"}; appendListData(drivesList,n); break;}
           case 3 : { String n[]={"F"}; appendListData(drivesList,n); break;}
           case 4 : { String n[]={"G"}; appendListData(drivesList,n); break;}
           case 5 : { String n[]={"H"}; appendListData(drivesList,n); break;}
           case 6 : { String n[]={"I"}; appendListData(drivesList,n); break;}                
           case 7 : { String n[]={"J"}; appendListData(drivesList,n); break;}
           case 8 : { 
                String n[]={"C","D","E","F","G","H","I","J","K","L","M","N","O","P","R","S","T","U","W","V","X","Y","Z"};
                appendListData(drivesList,n); 
                break;
           }
           case 9 : { 
               String n[]={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","R","S","T","U","W","V","X","Y","Z"};
               appendListData(drivesList,n);
               break;
           }
       }
    }//GEN-LAST:event_windowsDrivesToUseActionPerformed

    private void suffixLoadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_suffixLoadButtonActionPerformed
        // TODO add your handling code here:
       JFileChooser fc = new JFileChooser();
       int returnVal = fc.showOpenDialog(PsychoPanel2.this);
       if (returnVal == JFileChooser.APPROVE_OPTION) 
       {
            Scanner inFile1;
            try {
               inFile1 = new Scanner(fc.getSelectedFile()).useDelimiter("\\r*\\n");
            } catch (FileNotFoundException ex) {
               Logger.getLogger(PsychoPanel2.class.getName()).log(Level.SEVERE, null, ex);
               return;
            }
            List<String> temps = new ArrayList<>();
            
            while (inFile1.hasNext()) 
            {
                String line = inFile1.next();
                temps.add(line);                
            }
            inFile1.close();
            //suffixesList.setListData((String[])temps.toArray());
            // for some reason casting (String[]) on toArray() does not work as expected (empty data list)
            String[] empty={};
            suffixesList.setListData(empty);
            String[] newArr = new String[temps.size()];
            for(int i=0;i<temps.size();i++)
            {
                newArr[i]=temps.get(i);
            }
            appendListData(suffixesList,newArr);
            
            
        }          
    }//GEN-LAST:event_suffixLoadButtonActionPerformed

    private void breakupASCIIFormatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_breakupASCIIFormatActionPerformed

        if(editorFormat=="ASCII") return;
            
        breakupHexFormat.setSelected(false);
        breakupASCIIFormat.setSelected(true);
        
        editorFormat="ASCII";
                
        // now, we have to go through the list and convert each element
        //
        // also, in such case we want to make sure this toggle is only activated once
        // breakupList 
        // iterate and convert from hex to ascii
        // convert all from ASCII to HEX
        
        ListModel breakupListModel = breakupList.getModel();
        String newValues[] = new String[breakupListModel.getSize()];        
        for(int i=0;i<breakupListModel.getSize();i++)
        {
            String hex=breakupListModel.getElementAt(i).toString();
            StringBuilder output = new StringBuilder();
            for (int j = 0; j < hex.length(); j+=2) 
            {
                String str = hex.substring(j, j+2);
                output.append((char)Integer.parseInt(str, 16));
            }   
            newValues[i]=output.toString();
            // now, we convert it from ASCII to HEX
            //brutDocrootSuffixes.add(suffix);
        }                
        breakupList.setListData(newValues);          
        /*
        String hex;
  
        */
        
    }//GEN-LAST:event_breakupASCIIFormatActionPerformed

    private void breakupHexFormatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_breakupHexFormatActionPerformed
        if(editorFormat=="HEX") return;
                
        breakupHexFormat.setSelected(true);                
        breakupASCIIFormat.setSelected(false);        
                        
        editorFormat="HEX";
        
        // convert all from ASCII to HEX
        ListModel breakupListModel = breakupList.getModel();
        String newValues[] = new String[breakupListModel.getSize()];        
        for(int i=0;i<breakupListModel.getSize();i++)
        {
            String currval=breakupListModel.getElementAt(i).toString();
            String newVal="";
            for(int j=0;j<currval.length();j++)
            {
                char currChar = currval.charAt(j);
                String hex = Integer.toHexString(currChar);
                newVal+=hex;
            }
            newValues[i]=newVal;
            // now, we convert it from ASCII to HEX
            //brutDocrootSuffixes.add(suffix);
        }                
        breakupList.setListData(newValues);        
    }//GEN-LAST:event_breakupHexFormatActionPerformed

    private void LFIModeCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LFIModeCheckBoxActionPerformed
        // TODO add your handling code here:
        if(LFIModeCheckBox.isSelected()==true)
        {
            enableLFIMode();
        }
        else
        {
            disableLFIMode();
        }
    }//GEN-LAST:event_LFIModeCheckBoxActionPerformed

    private void targetLoadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_targetLoadButtonActionPerformed

       JFileChooser fc = new JFileChooser();
       int returnVal = fc.showOpenDialog(PsychoPanel2.this);
       if (returnVal == JFileChooser.APPROVE_OPTION) 
       {
            Scanner inFile1;
            try {
               inFile1 = new Scanner(fc.getSelectedFile()).useDelimiter("\\r*\\n");
            } catch (FileNotFoundException ex) {
               Logger.getLogger(PsychoPanel2.class.getName()).log(Level.SEVERE, null, ex);
               return;
            }
            List<String> temps = new ArrayList<>();            
            while (inFile1.hasNext()) 
            {
                String line = inFile1.next();
                temps.add(line);
            }
            inFile1.close();
            //suffixesList.setListData((String[])temps.toArray());
            // for some reason casting (String[]) on toArray() does not work as expected (empty data list)            
            String[] empty={};
            targetsList.setListData(empty);
            String[] newArr = new String[temps.size()];
            for(int i=0;i<temps.size();i++)
            {
                newArr[i]=temps.get(i);
            }
            appendListData(targetsList,newArr);                        
        }                  
    }//GEN-LAST:event_targetLoadButtonActionPerformed

    private void webrootCLearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webrootCLearButtonActionPerformed
        // TODO add your handling code here:
        String[] empty={};
        docrootsList.setListData(empty);
    }//GEN-LAST:event_webrootCLearButtonActionPerformed

    private void webrootLoadButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webrootLoadButtonActionPerformed
       JFileChooser fc = new JFileChooser();
       int returnVal = fc.showOpenDialog(PsychoPanel2.this);
       if (returnVal == JFileChooser.APPROVE_OPTION) 
       {
            Scanner inFile1;
            try {
               inFile1 = new Scanner(fc.getSelectedFile()).useDelimiter("\\r*\\n");
            } catch (FileNotFoundException ex) {
               Logger.getLogger(PsychoPanel2.class.getName()).log(Level.SEVERE, null, ex);
               return;
            }
            List<String> temps = new ArrayList<>();            
            while (inFile1.hasNext()) 
            {
                String line = inFile1.next();
                temps.add(line);
            }
            inFile1.close();
            //suffixesList.setListData((String[])temps.toArray());
            // for some reason casting (String[]) on toArray() does not work as expected (empty data list)            
            //String[] empty={};
            //docrootsList.setListData(empty);
            String[] newArr = new String[temps.size()];
            for(int i=0;i<temps.size();i++)
            {
                newArr[i]=temps.get(i);
            }
            docrootsList.setListData(newArr);
            //appendListData(docrootsList,newArr);                        
        }  
    }//GEN-LAST:event_webrootLoadButtonActionPerformed

    private void targetClearButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_targetClearButtonActionPerformed
        // TODO add your handling code here:
        String[] empty={};
        targetsList.setListData(empty);
    }//GEN-LAST:event_targetClearButtonActionPerformed

    private void targetRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_targetRemoveButtonActionPerformed
        // TODO add your handling code here:
                        // button callback
                if(targetsList.getSelectedIndex()!=-1)
                {
                    ArrayList<String> toRemove = new ArrayList<>();
                    int indices[]=targetsList.getSelectedIndices();
                    for(int i=0;i<indices.length;i++)
                    {
                        toRemove.add((String)targetsList.getModel().getElementAt(indices[i]));
                    }
                    for(int i=0;i<toRemove.size();i++)
                    {
                        removeFromListData(targetsList,toRemove.get(i));
                    }
                }        
    }//GEN-LAST:event_targetRemoveButtonActionPerformed

    private void webrootRemoveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webrootRemoveButtonActionPerformed

                if(docrootsList.getSelectedIndex()!=-1)
                {
                    ArrayList<String> toRemove = new ArrayList<>();
                    int indices[]=docrootsList.getSelectedIndices();
                    for(int i=0;i<indices.length;i++)
                    {
                        toRemove.add((String)docrootsList.getModel().getElementAt(indices[i]));
                    }
                    for(int i=0;i<toRemove.size();i++)
                    {
                        removeFromListData(docrootsList,toRemove.get(i));
                    }
                }   
    }//GEN-LAST:event_webrootRemoveButtonActionPerformed

    private void webrootAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webrootAddButtonActionPerformed
     
        String [] tmp = {webrootAddField.getText()};
        appendListData(docrootsList,tmp);
    }//GEN-LAST:event_webrootAddButtonActionPerformed

    private void targetAddButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_targetAddButtonActionPerformed
        // TODO add your handling code here:
        String [] tmp = {addTargetField.getText()};
        appendListData(targetsList,tmp);
    }//GEN-LAST:event_targetAddButtonActionPerformed

    private void suffixPasteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_suffixPasteButtonActionPerformed
        // TODO add your handling code here:
        Toolkit toolkit = Toolkit.getDefaultToolkit();
	Clipboard clipboard = toolkit.getSystemClipboard();
	String result = "";
        try {
            result = (String) clipboard.getData(DataFlavor.stringFlavor);
        } 
        catch (UnsupportedFlavorException ex) {
            Logger.getLogger(PsychoPanel2.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
        Logger.getLogger(PsychoPanel2.class.getName()).log(Level.SEVERE, null, ex);
        }
        suffixesList.setListData(result.split("\\r*\\n"));
    }//GEN-LAST:event_suffixPasteButtonActionPerformed

    private void webrootPasteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webrootPasteButtonActionPerformed
        // TODO add your handling code here:
        Toolkit toolkit = Toolkit.getDefaultToolkit();
	Clipboard clipboard = toolkit.getSystemClipboard();
	String result = "";
        try {
            result = (String) clipboard.getData(DataFlavor.stringFlavor);
        } 
        catch (UnsupportedFlavorException ex) {
            Logger.getLogger(PsychoPanel2.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException ex) {
        Logger.getLogger(PsychoPanel2.class.getName()).log(Level.SEVERE, null, ex);
        }        
        docrootsList.setListData(result.split("\\r*\\n"));
    }//GEN-LAST:event_webrootPasteButtonActionPerformed

    private void docrootsAddListsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_docrootsAddListsActionPerformed
        // TODO add your handling code here:
        switch(docrootsAddLists.getSelectedIndex())
            { 
                case 0 : { appendListData(docrootsList,universalDocroots); break;}
                case 1 : { appendListData(docrootsList,nginxDocroots); break;}
                case 2 : { appendListData(docrootsList,apacheDocroots); break;}
                case 3 : { appendListData(docrootsList,tomcatDocroots); break;}
                case 4 : { appendListData(docrootsList,windowsDocroots); break; }
                case 5 : { // "All"
                    
                    appendListData(docrootsList,universalDocroots); 
                    appendListData(docrootsList,nginxDocroots); 
                    appendListData(docrootsList,apacheDocroots);
                    appendListData(docrootsList,tomcatDocroots);
                    appendListData(docrootsList,windowsDocroots);
                    break;
                }
            }
    }//GEN-LAST:event_docrootsAddListsActionPerformed

    private void useTerminatorsCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_useTerminatorsCheckBoxActionPerformed
        // TODO add your handling code here:
        if(useTerminatorsCheckBox.isSelected()==true)
        {
            terminateAllBox.setEnabled(true);
            noLiteralNullbyte.setEnabled(true);
        }
        else
        {
            terminateAllBox.setEnabled(false);
            noLiteralNullbyte.setEnabled(false);
        }
     
    }//GEN-LAST:event_useTerminatorsCheckBoxActionPerformed

    private void overlong3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_overlong3ActionPerformed
        // TODO add your handling code here:
        if(overlong3.isSelected()==true)
        {
           //urlEncode.setSelected(true);
            encodingsEnabled[5]=1;
        }
        else
        {
            encodingsEnabled[5]=0;
        }
    }//GEN-LAST:event_overlong3ActionPerformed

    private void overlong2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_overlong2ActionPerformed
        // TODO add your handling code here:
        if(overlong2.isSelected()==true)
        {
           //urlEncode.setSelected(true);
            encodingsEnabled[4]=1;
        }
        else
        {
            encodingsEnabled[4]=0;
        }
    }//GEN-LAST:event_overlong2ActionPerformed

    private void removeSelectedEvasiveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeSelectedEvasiveActionPerformed

                if(evasiveList.getSelectedIndex()!=-1)
                {
                    ArrayList<String> toRemove = new ArrayList<>();
                    int indices[]=evasiveList.getSelectedIndices();
                    for(int i=0;i<indices.length;i++)
                    {
                        toRemove.add((String)evasiveList.getModel().getElementAt(indices[i]));
                    }
                    for(int i=0;i<toRemove.size();i++)
                    {
                        removeFromListData(evasiveList,toRemove.get(i));
                    }
                }   
                // TODO add your handling code here:
    }//GEN-LAST:event_removeSelectedEvasiveActionPerformed

    private void addBreakupButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addBreakupButtonActionPerformed
        // TODO add your handling code here:
        String val = addBreakupField.getText();
        if(editorFormat=="HEX")
        {
            val=val.replaceAll("[^\\da-f]","");
                
            // make sure the number of characters is even
            int len=val.length();
            if(len%2==0)
            {
                // add the string to the list
                String n[]={val};
                appendListData(breakupList,n);
                addBreakupField.setText("");
            }
        }
        else
        {
                String n[]={val};
                appendListData(breakupList,n);
                addBreakupField.setText("");            
        }
    }//GEN-LAST:event_addBreakupButtonActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        if(breakupList.getSelectedIndex()!=-1)
        {
            ArrayList<String> toRemove = new ArrayList<>();
            int indices[]=breakupList.getSelectedIndices();
            for(int i=0;i<indices.length;i++)
            {
                toRemove.add((String)breakupList.getModel().getElementAt(indices[i]));
            }
            for(int i=0;i<toRemove.size();i++)
            {
                removeFromListData(breakupList,toRemove.get(i));
            }
        }   
    }//GEN-LAST:event_jButton1ActionPerformed

    private void urlEncodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_urlEncodeActionPerformed
        // TODO add your handling code here:
        if(urlEncode.isSelected()==true)
        {
           //urlEncode.setSelected(true);
            encodingsEnabled[1]=1;
        }
        else
        {
            encodingsEnabled[1]=0;
        }
    }//GEN-LAST:event_urlEncodeActionPerformed

    private void doubleUrlEncodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_doubleUrlEncodeActionPerformed
        // TODO add your handling code here:
        if(doubleUrlEncode.isSelected()==true)
        {
           //urlEncode.setSelected(true);
            encodingsEnabled[2]=1;
        }
        else
        {
            encodingsEnabled[2]=0;
        }
    }//GEN-LAST:event_doubleUrlEncodeActionPerformed

    private void utfEncodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_utfEncodeActionPerformed
        // TODO add your handling code here:
        if(utfEncode.isSelected()==true)
        {
           //urlEncode.setSelected(true);
            encodingsEnabled[3]=1;
        }
        else
        {
            encodingsEnabled[3]=0;
        }
    }//GEN-LAST:event_utfEncodeActionPerformed

    // this method simply runs a new payload generator, runs it and fills this.payloads with its results
    // used by save to file/copy to clipboard features
    protected void generatePayloads()
    {
        // now, for some reason this instance creation hangs burp
        IntruderPayloadGenerator generator = new IntruderPayloadGenerator("path", PsychoPATH.PsychoTab, true);               
              
        payloads = new ArrayList();                
        while(generator.hasMorePayloads())
        {
            byte[] empty={};
            byte[] payload = generator.getNextPayload(empty); 
            // there is no insertion point for this option; the insertion point is the file/clipboard
            // hence the argument is empty, but could be the file name as well                  
            if(payload.length==1) 
            { //payload generation failed, move onto next command
		logOutput("Payload generation failed!");			                        
            }                                        
            payloads.add(PsychoPATH.callbacks.getHelpers().bytesToString(payload));
            // bytesToString                    
        } 
        
    }
    private void saveToFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveToFileButtonActionPerformed
        // TODO add your handling code here:               
        // save payloads to file
        JFileChooser fileChooser = new JFileChooser();
                     
        if (fileChooser.showSaveDialog(this) == JFileChooser.APPROVE_OPTION) 
        {
            // new generator
            File file = fileChooser.getSelectedFile();
            logOutput("File chosen:"+file.getAbsolutePath());   
            
            this.generatePayloads();
            jTabbedPane1.setTitleAt(4,"Save "+payloads.size()+" payloads");

            logOutput("Generated "+payloads.size()+" payloads, saving..."); 
           
            BufferedWriter writer = null;
            try
            {
                writer = new BufferedWriter( new FileWriter(file.getAbsolutePath()));
                for(int i=0;i<payloads.size();i++)
                {
                    writer.write(payloads.get(i)+"\n"); // payloads with literals like newline characters will break this format, obviously (no such payloads in the set by default)
                }
            }
            catch (IOException e)
            {
                this.logOutput("IOException occurred while trying to open the file: "+file.getAbsolutePath());
            }
            finally
            {
                try
                {
                    if ( writer != null)
                    writer.close( );
                }
                catch ( IOException e)
                {
                    this.logOutput("IOException occurred while writing to the file: "+file.getAbsolutePath());
                }
            }           
        }

    }//GEN-LAST:event_saveToFileButtonActionPerformed

    private void copyToClipboardButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copyToClipboardButtonActionPerformed
        // TODO add your handling code here:
        // if null terminators are in use, issue a warning
        // PsychoPATH.callbacks.printError(proto);
        // PsychoPATH.callbacks.issueAlert();
        if(this.useTerminatorsCheckBox.isSelected()==true)
        {
            JOptionPane.showMessageDialog(null, "Literal NULLBYTE terminators are enabled and this will most likely break the contents copied into the clipboard. To avoid this issue, save into a file instead or disable NULLBYTE terminators in evasive techniques.", "Payload set contains NULL bytes", JOptionPane.INFORMATION_MESSAGE);            
        }
        
        this.generatePayloads();
        jTabbedPane1.setTitleAt(4,"Save "+payloads.size()+" payloads");
        
        String clipboardS="";
        for(int i=0;i<payloads.size();i++)
        {
            clipboardS+=payloads.get(i)+"\n"; // payloads with literals like newline characters will break this format, obviously (no such payloads in the set by default)
        };
        
        StringSelection selection;
        selection = new StringSelection(clipboardS);
                
        Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
        clipboard.setContents(selection, selection);
    }//GEN-LAST:event_copyToClipboardButtonActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed

        if(newMatchRule.getText()=="") return; // don't want an empty string
        // if we add (after validation and duplicate check)
        //         
        ListModel scanChecksModel = scannerMatchRules.getModel();
        
        // make sure the string is not already on the list
        for(int i=0;i<scanChecksModel.getSize();i++)
        {                        
            if(scanChecksModel.getElementAt(i).equals(newMatchRule.getText()))
            {
                        // avoid duplicates
                        return;
            }
        }         
        
        // rewrite the entire model into an array        
        String newValues[] = new String[scanChecksModel.getSize()+1];                             
        for(int i=0;i<scanChecksModel.getSize();i++)
        {            
            newValues[i]=scanChecksModel.getElementAt(i).toString();                       
        }                        
        
        // and add the new rule
        newValues[scanChecksModel.getSize()]=newMatchRule.getText();
        
        // set the new data model
        scannerMatchRules.setListData(newValues);                
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        if(scannerMatchRules.getSelectedIndex()!=-1)
        {
            ArrayList<String> toRemove = new ArrayList<>();
            int indices[]=scannerMatchRules.getSelectedIndices();
                for(int i=0;i<indices.length;i++)
                {
                        toRemove.add((String)scannerMatchRules.getModel().getElementAt(indices[i]));
                }
                for(int i=0;i<toRemove.size();i++)
                {
                   removeFromListData(scannerMatchRules,toRemove.get(i));
                }
            }                    
    }//GEN-LAST:event_jButton3ActionPerformed

    private void noLiteralNullbyteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_noLiteralNullbyteActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_noLiteralNullbyteActionPerformed

    private void LFIOptimizeCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_LFIOptimizeCheckBoxActionPerformed
        // TODO add your handling code here:
        if(LFIOptimizeCheckBox.isSelected()==true)
        {
            optimizeLFI=true;
        }
        else
        {
            optimizeLFI=false;
        }
    }//GEN-LAST:event_LFIOptimizeCheckBoxActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    protected javax.swing.JCheckBox LFIModeCheckBox;
    protected javax.swing.JCheckBox LFIOptimizeCheckBox;
    private javax.swing.JButton addBreakupButton;
    private javax.swing.JTextField addBreakupField;
    private javax.swing.JTextPane addTargetField;
    private javax.swing.JRadioButton breakupASCIIFormat;
    private javax.swing.JRadioButton breakupHexFormat;
    protected javax.swing.JList<String> breakupList;
    private javax.swing.JPanel byteGeneratorPanel;
    private javax.swing.JComboBox<String> byteGeneratorRangeCombo;
    private javax.swing.JButton copyToClipboardButton;
    private javax.swing.JComboBox<String> docrootsAddLists;
    protected javax.swing.JList<String> docrootsList;
    protected javax.swing.JCheckBox doubleUrlEncode;
    protected javax.swing.JList<String> drivesList;
    protected javax.swing.JList<String> evasiveList;
    protected javax.swing.JPanel evasiveTechniquesPanel;
    protected javax.swing.JComboBox<String> evasiveTechniquesSetToAdd;
    protected javax.swing.JTextPane fileNameField;
    private javax.swing.JPanel globalSettingsPanel;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton16;
    private javax.swing.JButton jButton17;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane13;
    private javax.swing.JScrollPane jScrollPane14;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JScrollPane jScrollPane7;
    private javax.swing.JScrollPane jScrollPane8;
    private javax.swing.JScrollPane jScrollPane9;
    protected javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTabbedPane jTabbedPane2;
    protected javax.swing.JSpinner maxTraversalsPerPayloadSpinner;
    protected javax.swing.JCheckBox mixEncodingsCheckBox;
    private javax.swing.JTextField newMatchRule;
    protected javax.swing.JTextPane nixFileName;
    protected javax.swing.JCheckBox noLiteralNullbyte;
    protected javax.swing.JCheckBox optimizeDocrootTraversalsBox;
    private javax.swing.JCheckBox overlong2;
    private javax.swing.JCheckBox overlong3;
    protected javax.swing.JCheckBox rawEncodingCheckbox;
    private javax.swing.JButton removeSelectedEvasive;
    public javax.swing.JPanel savePayloadsPanel;
    private javax.swing.JButton saveToFileButton;
    public javax.swing.JCheckBox scannerChecksCheckbox;
    public javax.swing.JList<String> scannerMatchRules;
    protected javax.swing.JComboBox<String> slashesToUseCombo;
    private javax.swing.JButton suffixAddButton;
    private javax.swing.JTextPane suffixAddField;
    private javax.swing.JButton suffixClearButton;
    private javax.swing.JButton suffixLoadButton;
    private javax.swing.JButton suffixPasteButton;
    private javax.swing.JButton suffixRemoveButton;
    protected javax.swing.JList<String> suffixesList;
    private javax.swing.JButton targetAddButton;
    private javax.swing.JButton targetClearButton;
    private javax.swing.JButton targetLoadButton;
    public javax.swing.JComboBox<String> targetOS;
    private javax.swing.JButton targetPasteButton;
    private javax.swing.JButton targetRemoveButton;
    protected javax.swing.JList<String> targetsList;
    protected javax.swing.JCheckBox terminateAllBox;
    private javax.swing.JPanel traversalOptionsPanel;
    protected javax.swing.JCheckBox urlEncode;
    protected javax.swing.JCheckBox urlEncodeUtf;
    private javax.swing.JCheckBox useAbsoluteWebrootsBox;
    protected javax.swing.JCheckBox useTerminatorsCheckBox;
    private javax.swing.JCheckBox utfEncode;
    private javax.swing.JButton webrootAddButton;
    private javax.swing.JTextPane webrootAddField;
    private javax.swing.JButton webrootCLearButton;
    private javax.swing.JButton webrootLoadButton;
    private javax.swing.JPanel webrootOptionsPanel;
    private javax.swing.JButton webrootPasteButton;
    private javax.swing.JButton webrootRemoveButton;
    protected javax.swing.JTextPane winFileName;
    private javax.swing.JComboBox<String> windowsDrivesToUse;
    // End of variables declaration//GEN-END:variables
}