├── .gitignore ├── Slack.png ├── pic.PNG ├── .idea ├── vcs.xml ├── .gitignore ├── modules.xml ├── artifacts │ └── burpex1_jar.xml ├── libraries │ ├── Maven__jdom_jdom_1_0.xml │ ├── Maven__asm_asm_2_2_3.xml │ ├── Maven__asm_asm_tree_2_2_3.xml │ ├── Maven__asm_asm_commons_2_2_3.xml │ ├── Maven__com_jgoodies_forms_1_0_7.xml │ ├── Maven__com_squareup_okio_okio_2_8_0.xml │ ├── Maven__com_intellij_forms_rt_6_0_5.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_30.xml │ ├── Maven__com_google_code_gson_gson_2_8_6.xml │ ├── Maven__com_squareup_okhttp3_okhttp_4_9_0.xml │ ├── Maven__org_jetbrains_annotations_13_0.xml │ ├── Maven__com_slack_api_slack_api_model_1_3_2.xml │ ├── Maven__com_slack_api_slack_api_client_1_3_2.xml │ ├── Maven__com_googlecode_json_simple_json_simple_1_1.xml │ ├── Maven__org_jetbrains_kotlin_kotlin_stdlib_1_4_10.xml │ ├── Maven__org_jetbrains_kotlin_kotlin_stdlib_common_1_4_0.xml │ └── Maven__net_portswigger_burp_extender_burp_extender_api_2_1.xml ├── misc.xml ├── compiler.xml ├── jarRepositories.xml └── uiDesigner.xml ├── src └── burp │ ├── BurpExtenderTab.java │ ├── LogRequestResponse.java │ ├── VariableManager.java │ ├── BurpExtender.java │ ├── ConfigComponent.form │ └── ConfigComponent.java ├── BappManifest.bmf ├── BappDescription.html ├── README.md ├── burpex1.iml └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Slack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/burp-2-slack/main/Slack.png -------------------------------------------------------------------------------- /pic.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PortSwigger/burp-2-slack/main/pic.PNG -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/burp/BurpExtenderTab.java: -------------------------------------------------------------------------------- 1 | package burp; 2 | 3 | public class BurpExtenderTab { 4 | 5 | static IBurpExtenderCallbacks callbacks; 6 | static String tabName = "Burp2Slack"; 7 | static ConfigComponent configcomp; 8 | 9 | 10 | 11 | 12 | } 13 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Datasource local storage ignored files 5 | /../../../../../../:\Users\bitwis3\IdeaProjects\burpex1\.idea/dataSources/ 6 | /dataSources.local.xml 7 | # Editor-based HTTP Client requests 8 | /httpRequests/ 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/artifacts/burpex1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/out/artifacts/burpex1_jar 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /BappManifest.bmf: -------------------------------------------------------------------------------- 1 | Uuid: 8934dd6be70a4242b39f4ac206cc12d5 2 | ExtensionType: 1 3 | Name: Burp2Slack 4 | RepoName: burp-2-slack 5 | ScreenVersion: 1.0 6 | SerialVersion: 2 7 | MinPlatformVersion: 0 8 | ProOnly: False 9 | Author: b1twis3 (Hamid Mahmoud) 10 | ShortDescription: Push notifications to Slack channel or to custom server based on BurpSuite response conditions. 11 | EntryPoint: target/Burp2Slack-1.0.0-jar-with-dependencies.jar 12 | BuildCommand: mvn clean install 13 | -------------------------------------------------------------------------------- /src/burp/LogRequestResponse.java: -------------------------------------------------------------------------------- 1 | package burp; 2 | 3 | public class LogRequestResponse { 4 | final int tool; 5 | final IHttpRequestResponsePersisted requestResponse; 6 | final boolean messageIsRequest; 7 | 8 | LogRequestResponse(int tool, IHttpRequestResponsePersisted requestResponse, boolean messageIsRequest) 9 | { 10 | this.tool = tool; 11 | this.requestResponse = requestResponse; 12 | this.messageIsRequest = messageIsRequest; 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__jdom_jdom_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__asm_asm_2_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__asm_asm_tree_2_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__asm_asm_commons_2_2_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_jgoodies_forms_1_0_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_squareup_okio_okio_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_intellij_forms_rt_6_0_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_30.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_code_gson_gson_2_8_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/burp/VariableManager.java: -------------------------------------------------------------------------------- 1 | package burp; 2 | 3 | public final class VariableManager { 4 | private static boolean isStart; 5 | private static boolean stopTimer; 6 | 7 | public static boolean getisStart(){ 8 | return isStart; 9 | } 10 | 11 | public static void setisStart(boolean isStart){ 12 | VariableManager.isStart = isStart; 13 | } 14 | 15 | public static boolean getstopTimer(){ 16 | return stopTimer; 17 | } 18 | 19 | public static void setstopTimer(boolean stopTimer){ 20 | VariableManager.stopTimer = stopTimer; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_squareup_okhttp3_okhttp_4_9_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jetbrains_annotations_13_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_slack_api_slack_api_model_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_slack_api_slack_api_client_1_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_googlecode_json_simple_json_simple_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_1_4_10.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jetbrains_kotlin_kotlin_stdlib_common_1_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_portswigger_burp_extender_burp_extender_api_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /BappDescription.html: -------------------------------------------------------------------------------- 1 |

Burp2Slack extension matches all BurpSuite traffics (Intruder, Repeater, Proxy and Scanner) based on "any" of the user input conditions such as:

2 | 8 |

When one of the above conditions met, then it pushes a notification to either a Slack channel or Custom server. The notification message is customized and can be edited/formatted by the user to get the met "condition/s" and/or the HTTP response body that includes the conditions.

9 | 10 |

Main Features:

11 | 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

Burp to Slack

3 | 4 |

5 | 6 | 7 |

8 | 9 |
10 | Push notifications to Slack channel or to custom server based on BurpSuite response conditions. 11 | 12 | ### Burp to Slack 13 | Burp2Slack extension matches all BurpSuite traffics (Intruder, Repeater, Proxy and Scanner) based on "any" of the user input conditions such as, 14 | - If the input string exists in the response body 15 | - If the input string exists in the response headers 16 | - If the response content-length is (equal, greater than, less than or doesn't equal) the user input content length 17 | - If the input status code matches the response one. 18 | 19 | When one of the above conditions met, then it pushes a notification to either a Slack channel or Custom server. The notification message is customized and can be edited/formatted by the user to get the met "condition/s" and/or the HTTP response body that includes the conditions. 20 | ### Main Features 21 | * Poll Notifications every X seconds. 22 | * Customize your notification using {{FOUND}} which is your input condition and {{BODY}} which returns response body. 23 | * Match response body, HTTP headers, content length and HTTP status code. 24 | * Use the logical operators !, =, < and > in the content length field. 25 | * Support both Slack webhook and custom HTTP listeners. 26 | * Match Burp proxy, Repeater, Intruder and Scanner/Spider. 27 | 28 | #### Build the Project 29 | Use the following command to build the Jar file. 30 | > mvn clean install 31 | 32 | #### TODO: 33 | - [ ] BurpCollaborator to Slack 34 | - [ ] Match more options 35 | 36 | 37 | #### Bugs / Feedback / PRs 38 | Any comment, issue or pull request will be highly appreciated :) 39 | 40 | #### Author 41 | b1twis3 - https://twitter.com/fasthm00 42 | -------------------------------------------------------------------------------- /burpex1.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 4 | 4.0.0 5 | Burp2Slack 6 | com.bitwis3.burp2slack 7 | 1.0.0 8 | Burp to Slack Extension 9 | 10 | src 11 | 12 | 13 | maven-compiler-plugin 14 | 3.8.0 15 | 16 | 1.8 17 | 1.8 18 | 19 | 20 | 21 | maven-assembly-plugin 22 | 2.2 23 | 24 | 25 | jar-with-dependencies 26 | 27 | 28 | 29 | 30 | make-assembly 31 | package 32 | 33 | single 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | net.portswigger.burp.extender 44 | burp-extender-api 45 | 2.1 46 | 47 | 48 | 49 | com.intellij 50 | forms_rt 51 | 6.0.5 52 | 53 | 54 | 55 | com.googlecode.json-simple 56 | json-simple 57 | 1.1 58 | 59 | 60 | 61 | com.google.code.gson 62 | gson 63 | 2.8.6 64 | 65 | 66 | 67 | com.slack.api 68 | slack-api-client 69 | 1.3.2 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 127 | -------------------------------------------------------------------------------- /src/burp/BurpExtender.java: -------------------------------------------------------------------------------- 1 | package burp; 2 | 3 | import com.slack.api.Slack; 4 | import com.slack.api.webhook.Payload; 5 | import com.slack.api.webhook.WebhookResponse; 6 | 7 | import java.awt.*; 8 | import java.io.IOException; 9 | import java.util.List; 10 | import java.util.*; 11 | 12 | public class BurpExtender implements IBurpExtender, ITab, IHttpListener { 13 | 14 | IBurpExtenderCallbacks callbacks; 15 | IHttpRequestResponsePersisted PerRequestResponse; 16 | 17 | protected String mPluginName = "Burp2Slack"; 18 | 19 | 20 | public String hostname; 21 | public int port = 443; 22 | String serverkindcheck; 23 | private final List log = new ArrayList(); 24 | public String getCurrentPayload; 25 | public static Timer timer; 26 | 27 | 28 | @Override 29 | public void registerExtenderCallbacks(IBurpExtenderCallbacks callbacks) { 30 | this.callbacks = callbacks; 31 | BurpExtenderTab.callbacks = callbacks; 32 | 33 | callbacks.setExtensionName("Burp2Slack Extension"); 34 | callbacks.printOutput("Burp2Slack 1.0 loaded"); 35 | 36 | BurpExtenderTab.configcomp = new ConfigComponent(callbacks); 37 | 38 | callbacks.registerHttpListener(this); 39 | callbacks.addSuiteTab(this); 40 | 41 | } 42 | 43 | 44 | @Override 45 | public String getTabCaption() { 46 | return BurpExtenderTab.tabName; 47 | } 48 | 49 | @Override 50 | public Component getUiComponent() { 51 | return BurpExtenderTab.configcomp.$$$getRootComponent$$$(); 52 | } 53 | 54 | public void pushMessage() { 55 | // Get Options 56 | serverkindcheck = BurpExtenderTab.configcomp.servertypecomobox.getSelectedItem().toString(); 57 | this.hostname = BurpExtenderTab.configcomp.slackURLtxtbox.getText().toString(); 58 | 59 | 60 | if (!serverkindcheck.equals("Slack")) { 61 | if (!BurpExtenderTab.configcomp.serverporttxtbox.getText().toString().equals("")) { 62 | this.port = Integer.parseInt(BurpExtenderTab.configcomp.serverporttxtbox.getText().toString()); 63 | } 64 | 65 | String requestGETTemplate = " HTTP/1.1\r\n" + 66 | "Host: " + this.hostname + ":" + port + "\r\n" + 67 | "User-Agent: Intruder2Slack/1.0\r\n" + 68 | "\r\n\r\n"; 69 | 70 | // Make the Request 71 | String request = "GET /?payload=" + callbacks.getHelpers().urlEncode(getCurrentPayload).toString() + " " + requestGETTemplate; 72 | byte[] requestBytes = callbacks.getHelpers().stringToBytes(request); 73 | byte[] responseBytes = callbacks.makeHttpRequest(this.hostname, port, false, requestBytes); 74 | 75 | 76 | } else { 77 | 78 | 79 | // Make the Request 80 | this.hostname = BurpExtenderTab.configcomp.slackURLtxtbox.getText().toString(); 81 | 82 | 83 | Slack slack = Slack.getInstance(); 84 | String webhookUrl = this.hostname; 85 | Payload payload = Payload.builder().text(getCurrentPayload).build(); 86 | 87 | try { 88 | WebhookResponse response = slack.send(webhookUrl, payload); 89 | 90 | 91 | } catch (IOException e) { 92 | this.callbacks.printOutput("webhook error: "+e); 93 | } 94 | 95 | } 96 | } 97 | 98 | @Override 99 | public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequestResponse messageInfo) { 100 | 101 | 102 | this.callbacks.saveBuffersToTempFiles(messageInfo); 103 | log.add(new LogRequestResponse(toolFlag, callbacks.saveBuffersToTempFiles(messageInfo), messageIsRequest)); 104 | int getPollSeconds = Integer.parseInt(BurpExtenderTab.configcomp.pollseconds.getText().toString()); 105 | 106 | if (VariableManager.getisStart()) { 107 | timer = new Timer("Timer"); 108 | TimerTask task = new TimerTask() { 109 | public void run() { 110 | 111 | Match2Slack(); 112 | 113 | } 114 | }; 115 | 116 | 117 | timer.schedule(task, 1000, getPollSeconds); 118 | VariableManager.setisStart(false); 119 | } 120 | 121 | 122 | } 123 | 124 | public void Match2Slack() { 125 | // Loop through the saved Requests/Responses 126 | if (log.size() > 0) { 127 | for (int i = 0; i < log.size(); i++) { 128 | 129 | if (!log.get(i).messageIsRequest) { 130 | 131 | IResponseInfo res = callbacks.getHelpers().analyzeResponse(log.get(i).requestResponse.getResponse()); 132 | // Parse Intruder Response 133 | int responseStatusCode = res.getStatusCode(); 134 | ArrayList responseHeaders = new ArrayList<>(res.getHeaders()); 135 | 136 | 137 | int bodyOffset = res.getBodyOffset(); 138 | byte[] byte_Request = log.get(i).requestResponse.getResponse(); 139 | byte[] byte_body = Arrays.copyOfRange(byte_Request, bodyOffset, byte_Request.length); 140 | 141 | String responseBody = callbacks.getHelpers().bytesToString(byte_body); 142 | responseBody = this.callbacks.getHelpers().urlEncode(responseBody).toString(); 143 | 144 | 145 | // Get response body textbox Index 146 | int checkbody = responseBody.indexOf(BurpExtenderTab.configcomp.responsebodycontainstxtbox.getText().toString()); 147 | String responseBodyInput = BurpExtenderTab.configcomp.responsebodycontainstxtbox.getText().toString().replace("\"", "\\\""); 148 | 149 | // Replace {{BODY}} with the following string. 100 chars before and after (to just focus on the matched payload). 150 | String getBody = ""; 151 | int margin = 100; 152 | if (checkbody != -1 ) { 153 | if (checkbody > margin) { 154 | if (checkbody + margin > responseBody.length()) { 155 | getBody = responseBody.substring(checkbody - margin, responseBody.length()); 156 | } else { 157 | getBody = responseBody.substring(checkbody - margin, checkbody + margin); 158 | } 159 | } else { 160 | if(checkbody - margin < 0 && responseBody.length() > margin){ 161 | getBody = responseBody.substring(0, checkbody + margin); 162 | }else{ 163 | getBody = responseBody.substring(0, responseBody.length()); 164 | } 165 | } 166 | 167 | } 168 | 169 | int responseContentLength = responseBody.length(); 170 | 171 | // Checking IF {body contains} 172 | if (BurpExtenderTab.configcomp.responsebodycontainstxtbox.getText().toString().length() > 0) { 173 | if (checkbody!=-1) { 174 | this.getCurrentPayload = BurpExtenderTab.configcomp.msgformattxtbox.getText().toString().replace("{{FOUND}}",responseBodyInput); 175 | this.getCurrentPayload = this.getCurrentPayload.replace("{{BODY}}", getBody); 176 | 177 | pushMessage(); 178 | 179 | } 180 | } 181 | 182 | // Check Status Code 183 | if (BurpExtenderTab.configcomp.httpstatuscodetxtbox.getText().toString().length() > 0) { 184 | if (responseStatusCode == Integer.parseInt(BurpExtenderTab.configcomp.httpstatuscodetxtbox.getText().toString()) 185 | 186 | ) { 187 | this.getCurrentPayload = BurpExtenderTab.configcomp.msgformattxtbox.getText().toString().replace("{{FOUND}}", 188 | " " + responseStatusCode); 189 | this.getCurrentPayload = this.getCurrentPayload.replace("{{BODY}}", getBody); 190 | 191 | pushMessage(); 192 | 193 | } 194 | } 195 | 196 | // Check Headers 197 | if (BurpExtenderTab.configcomp.responseheaderscontaintxtbox.getText().toString().length() > 0) { 198 | for (int ii = 0; ii < responseHeaders.size(); ii++) { 199 | 200 | if (responseHeaders.get(ii).toString().contains(BurpExtenderTab.configcomp.responseheaderscontaintxtbox.getText().toString()) 201 | ) { 202 | 203 | this.getCurrentPayload = BurpExtenderTab.configcomp.msgformattxtbox.getText().toString().replace("{{FOUND}}", 204 | responseHeaders.get(ii).toString().replace("\"", "\\\"")); 205 | this.getCurrentPayload = this.getCurrentPayload.replace("{{BODY}}", responseHeaders.get(ii).toString().replace("\"", "\\\"")); 206 | pushMessage(); 207 | ii = responseHeaders.size(); 208 | 209 | 210 | } 211 | 212 | } 213 | } 214 | 215 | // Check Response Length 216 | if (BurpExtenderTab.configcomp.contentlengthtxtbox.getText().toString().length() > 0) { 217 | String contentlength = BurpExtenderTab.configcomp.contentlengthtxtbox.getText().toString(); 218 | char operator = contentlength.charAt(0); 219 | int targetlength = Integer.parseInt(contentlength.substring(2, contentlength.length())); 220 | switch (operator) { 221 | case '>': { 222 | 223 | if (responseContentLength > targetlength) { 224 | this.getCurrentPayload = BurpExtenderTab.configcomp.msgformattxtbox.getText().toString().replace("{{FOUND}}", 225 | " > " + targetlength); 226 | this.getCurrentPayload = this.getCurrentPayload.replace("{{BODY}}", getBody); 227 | pushMessage(); 228 | } 229 | break; 230 | } 231 | case '<': { 232 | if (responseContentLength < targetlength) { 233 | this.getCurrentPayload = BurpExtenderTab.configcomp.msgformattxtbox.getText().toString().replace("{{FOUND}}", 234 | " < " + targetlength); 235 | this.getCurrentPayload = this.getCurrentPayload.replace("{{BODY}}", getBody); 236 | pushMessage(); 237 | } 238 | break; 239 | } 240 | case '=': { 241 | if (responseContentLength == targetlength) { 242 | this.getCurrentPayload = BurpExtenderTab.configcomp.msgformattxtbox.getText().toString().replace("{{FOUND}}", 243 | " == " + targetlength); 244 | this.getCurrentPayload = this.getCurrentPayload.replace("{{BODY}}", getBody); 245 | pushMessage(); 246 | } 247 | break; 248 | } 249 | case '!': { 250 | if (responseContentLength != targetlength) { 251 | this.getCurrentPayload = BurpExtenderTab.configcomp.msgformattxtbox.getText().toString().replace("{{FOUND}}", 252 | " != " + targetlength); 253 | this.getCurrentPayload = this.getCurrentPayload.replace("{{BODY}}", getBody); 254 | pushMessage(); 255 | } 256 | break; 257 | } 258 | 259 | } 260 | } 261 | 262 | } 263 | 264 | 265 | } 266 | 267 | 268 | 269 | //Clear 270 | log.clear(); 271 | } 272 | 273 | if (!VariableManager.getisStart() && VariableManager.getstopTimer()) { 274 | timer.cancel(); 275 | timer.purge(); 276 | } 277 | 278 | 279 | } 280 | } 281 | -------------------------------------------------------------------------------- /src/burp/ConfigComponent.form: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | -------------------------------------------------------------------------------- /src/burp/ConfigComponent.java: -------------------------------------------------------------------------------- 1 | package burp; 2 | 3 | import com.intellij.uiDesigner.core.GridConstraints; 4 | import com.intellij.uiDesigner.core.GridLayoutManager; 5 | import com.intellij.uiDesigner.core.Spacer; 6 | 7 | import javax.swing.*; 8 | import javax.swing.border.TitledBorder; 9 | import java.awt.*; 10 | import java.awt.event.ActionEvent; 11 | import java.awt.event.ActionListener; 12 | 13 | public class ConfigComponent { 14 | private JPanel panel1; 15 | public JTextField slackURLtxtbox; 16 | public JTextField msgformattxtbox; 17 | private JButton notificationstartbtn; 18 | public JTextField responsebodycontainstxtbox; 19 | public JTextField responseheaderscontaintxtbox; 20 | public JTextField responsetimetxtbox; 21 | public JTextField httpstatuscodetxtbox; 22 | private JButton clearButton; 23 | public JTextField contentlengthtxtbox; 24 | public JTextField serverporttxtbox; 25 | public JComboBox servertypecomobox; 26 | public JTextField pollseconds; 27 | private JButton notificationstopbtn; 28 | private JLabel title; 29 | 30 | public static String checktest = "hello"; 31 | public IBurpExtenderCallbacks callbacks; 32 | 33 | 34 | public ConfigComponent(IBurpExtenderCallbacks callbacks) { 35 | this.callbacks = callbacks; 36 | 37 | 38 | notificationstartbtn.addActionListener(new ActionListener() { 39 | @Override 40 | public void actionPerformed(ActionEvent e) { 41 | checktest = "hamidovovo"; 42 | } 43 | }); 44 | clearButton.addActionListener(new ActionListener() { 45 | @Override 46 | public void actionPerformed(ActionEvent e) { 47 | responsebodycontainstxtbox.setText(""); 48 | responseheaderscontaintxtbox.setText(""); 49 | httpstatuscodetxtbox.setText(""); 50 | contentlengthtxtbox.setText(""); 51 | responsetimetxtbox.setText(""); 52 | } 53 | }); 54 | 55 | servertypecomobox.addActionListener(new ActionListener() { 56 | @Override 57 | public void actionPerformed(ActionEvent e) { 58 | JComboBox combo = (JComboBox) e.getSource(); 59 | String selectedtype = (String) combo.getSelectedItem(); 60 | 61 | 62 | // IF not a Slack then disable to port text box 63 | if (servertypecomobox.getSelectedItem().toString().equals("Slack")) { 64 | serverporttxtbox.setEditable(false); 65 | } else { 66 | serverporttxtbox.setEditable(true); 67 | } 68 | } 69 | }); 70 | notificationstartbtn.addActionListener(new ActionListener() { 71 | @Override 72 | public void actionPerformed(ActionEvent e) { 73 | notificationstopbtn.setEnabled(true); 74 | notificationstartbtn.setEnabled(false); 75 | 76 | VariableManager.setisStart(true); 77 | VariableManager.setstopTimer(false); 78 | } 79 | }); 80 | notificationstopbtn.addActionListener(new ActionListener() { 81 | @Override 82 | public void actionPerformed(ActionEvent e) { 83 | notificationstartbtn.setEnabled(true); 84 | notificationstopbtn.setEnabled(false); 85 | 86 | VariableManager.setisStart(false); 87 | VariableManager.setstopTimer(true); 88 | } 89 | }); 90 | } 91 | 92 | { 93 | // GUI initializer generated by IntelliJ IDEA GUI Designer 94 | // >>> IMPORTANT!! <<< 95 | // DO NOT EDIT OR ADD ANY CODE HERE! 96 | $$$setupUI$$$(); 97 | } 98 | 99 | /** 100 | * Method generated by IntelliJ IDEA GUI Designer 101 | * >>> IMPORTANT!! <<< 102 | * DO NOT edit this method OR call it in your code! 103 | * 104 | * @noinspection ALL 105 | */ 106 | private void $$$setupUI$$$() { 107 | panel1 = new JPanel(); 108 | panel1.setLayout(new GridLayoutManager(20, 3, new Insets(5, 0, 0, 5), -1, -1)); 109 | Font panel1Font = this.$$$getFont$$$("Arial", Font.PLAIN, 14, panel1.getFont()); 110 | if (panel1Font != null) panel1.setFont(panel1Font); 111 | final JLabel label1 = new JLabel(); 112 | Font label1Font = this.$$$getFont$$$("Arial", Font.BOLD, 18, label1.getFont()); 113 | if (label1Font != null) label1.setFont(label1Font); 114 | label1.setForeground(new Color(-39373)); 115 | label1.setText("Burp to Slack Extension Settings"); 116 | panel1.add(label1, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 1, false)); 117 | final Spacer spacer1 = new Spacer(); 118 | panel1.add(spacer1, new GridConstraints(18, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false)); 119 | final JLabel label2 = new JLabel(); 120 | Font label2Font = this.$$$getFont$$$("Arial", Font.PLAIN, 14, label2.getFont()); 121 | if (label2Font != null) label2.setFont(label2Font); 122 | label2.setText("These settings let you control the Slack channel notifications that come from multiple Burp callbacks."); 123 | panel1.add(label2, new GridConstraints(1, 0, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 1, false)); 124 | final Spacer spacer2 = new Spacer(); 125 | panel1.add(spacer2, new GridConstraints(2, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, 1, null, null, null, 0, false)); 126 | final JPanel panel2 = new JPanel(); 127 | panel2.setLayout(new GridLayoutManager(6, 2, new Insets(5, 5, 5, 5), -1, -1)); 128 | panel2.setForeground(new Color(-6710124)); 129 | panel1.add(panel2, new GridConstraints(2, 0, 5, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 2, false)); 130 | panel2.setBorder(BorderFactory.createTitledBorder(null, "Channel Settings", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$("Arial", Font.BOLD, 14, panel2.getFont()), new Color(-39373))); 131 | final JLabel label3 = new JLabel(); 132 | Font label3Font = this.$$$getFont$$$(null, -1, -1, label3.getFont()); 133 | if (label3Font != null) label3.setFont(label3Font); 134 | label3.setText("Slack Channel/Server URL:"); 135 | panel2.add(label3, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 136 | final JLabel label4 = new JLabel(); 137 | label4.setText("Notification JSON Message:"); 138 | panel2.add(label4, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 139 | final JLabel label5 = new JLabel(); 140 | label5.setText("Customer Server Listener Port"); 141 | panel2.add(label5, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 142 | final JLabel label6 = new JLabel(); 143 | label6.setText("Listener Server:"); 144 | panel2.add(label6, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 145 | final JLabel label7 = new JLabel(); 146 | label7.setText("Poll every X seconds:"); 147 | panel2.add(label7, new GridConstraints(4, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 148 | pollseconds = new JTextField(); 149 | panel2.add(pollseconds, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); 150 | slackURLtxtbox = new JTextField(); 151 | panel2.add(slackURLtxtbox, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); 152 | servertypecomobox = new JComboBox(); 153 | final DefaultComboBoxModel defaultComboBoxModel1 = new DefaultComboBoxModel(); 154 | defaultComboBoxModel1.addElement("Slack"); 155 | defaultComboBoxModel1.addElement("Custom Server"); 156 | servertypecomobox.setModel(defaultComboBoxModel1); 157 | servertypecomobox.setToolTipText(""); 158 | panel2.add(servertypecomobox, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 159 | serverporttxtbox = new JTextField(); 160 | serverporttxtbox.setEditable(false); 161 | serverporttxtbox.setText(""); 162 | serverporttxtbox.setToolTipText(""); 163 | panel2.add(serverporttxtbox, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); 164 | msgformattxtbox = new JTextField(); 165 | msgformattxtbox.setText("Matched the condition: *{{FOUND}}* in Response: ```{{BODY}}```"); 166 | panel2.add(msgformattxtbox, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); 167 | final JPanel panel3 = new JPanel(); 168 | panel3.setLayout(new GridLayoutManager(1, 2, new Insets(0, 0, 0, 0), -1, -1)); 169 | panel2.add(panel3, new GridConstraints(5, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); 170 | notificationstopbtn = new JButton(); 171 | notificationstopbtn.setEnabled(false); 172 | notificationstopbtn.setText("Stop"); 173 | panel3.add(notificationstopbtn, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 174 | notificationstartbtn = new JButton(); 175 | notificationstartbtn.setText("Start"); 176 | panel3.add(notificationstartbtn, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 177 | final JLabel label8 = new JLabel(); 178 | Font label8Font = this.$$$getFont$$$("Arial", Font.PLAIN, 14, label8.getFont()); 179 | if (label8Font != null) label8.setFont(label8Font); 180 | label8.setText("Push a notification based on any of the following conditions:"); 181 | panel1.add(label8, new GridConstraints(8, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 2, false)); 182 | final JPanel panel4 = new JPanel(); 183 | panel4.setLayout(new GridLayoutManager(5, 3, new Insets(5, 5, 5, 5), -1, -1)); 184 | panel4.setForeground(new Color(-6710124)); 185 | panel1.add(panel4, new GridConstraints(9, 0, 8, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 2, false)); 186 | panel4.setBorder(BorderFactory.createTitledBorder(null, "Slack Notification Conditions", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, this.$$$getFont$$$("Arial", Font.BOLD, 14, panel4.getFont()), new Color(-39373))); 187 | final JLabel label9 = new JLabel(); 188 | label9.setText("Response Body Contains:"); 189 | panel4.add(label9, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 190 | responsebodycontainstxtbox = new JTextField(); 191 | panel4.add(responsebodycontainstxtbox, new GridConstraints(0, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); 192 | final JLabel label10 = new JLabel(); 193 | label10.setText("Response Headers Contain:"); 194 | panel4.add(label10, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 195 | responseheaderscontaintxtbox = new JTextField(); 196 | panel4.add(responseheaderscontaintxtbox, new GridConstraints(1, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); 197 | final JLabel label11 = new JLabel(); 198 | label11.setText("Content Length:"); 199 | panel4.add(label11, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 200 | final JLabel label12 = new JLabel(); 201 | label12.setText("HTTP Status Code:"); 202 | panel4.add(label12, new GridConstraints(3, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 203 | httpstatuscodetxtbox = new JTextField(); 204 | panel4.add(httpstatuscodetxtbox, new GridConstraints(3, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); 205 | clearButton = new JButton(); 206 | clearButton.setText("Clear"); 207 | panel4.add(clearButton, new GridConstraints(4, 2, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false)); 208 | final JPanel panel5 = new JPanel(); 209 | panel5.setLayout(new GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1)); 210 | panel4.add(panel5, new GridConstraints(4, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false)); 211 | contentlengthtxtbox = new JTextField(); 212 | contentlengthtxtbox.setText(""); 213 | panel4.add(contentlengthtxtbox, new GridConstraints(2, 1, 1, 2, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, new Dimension(150, -1), null, 0, false)); 214 | } 215 | 216 | /** 217 | * @noinspection ALL 218 | */ 219 | private Font $$$getFont$$$(String fontName, int style, int size, Font currentFont) { 220 | if (currentFont == null) return null; 221 | String resultName; 222 | if (fontName == null) { 223 | resultName = currentFont.getName(); 224 | } else { 225 | Font testFont = new Font(fontName, Font.PLAIN, 10); 226 | if (testFont.canDisplay('a') && testFont.canDisplay('1')) { 227 | resultName = fontName; 228 | } else { 229 | resultName = currentFont.getName(); 230 | } 231 | } 232 | return new Font(resultName, style >= 0 ? style : currentFont.getStyle(), size >= 0 ? size : currentFont.getSize()); 233 | } 234 | 235 | /** 236 | * @noinspection ALL 237 | */ 238 | public JComponent $$$getRootComponent$$$() { 239 | return panel1; 240 | } 241 | 242 | } 243 | --------------------------------------------------------------------------------