Skip to content

Commit

Permalink
SendToにてBurpのプロキシ利用時のバグ修正
Browse files Browse the repository at this point in the history
  • Loading branch information
isayan committed Jul 8, 2021
1 parent 1e83a9b commit 3a028c5
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
netbeans.org-netbeans-modules-javascript2-requirejs.enabled=true
release_version_major=2.2
release_version_minor=5.0
release_version_minor=6.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file modified release/YaguraExtender-v2.2.jar
Binary file not shown.
22 changes: 13 additions & 9 deletions src/main/java/extend/util/external/ThemeUI.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package extend.util.external;

import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rsyntaxtextarea.RSyntaxUtilities;
import org.fife.ui.rtextarea.Gutter;
import yagura.model.SendToMenu;

/**
*
Expand All @@ -25,15 +27,17 @@ public class ThemeUI {

public static void changeStyleTheme(RSyntaxTextArea textArea) {
try {
textArea.setForeground(UIManager.getColor("EditorPane.foreground"));
textArea.setBackground(UIManager.getColor("TextField.background"));
textArea.setSelectedTextColor(UIManager.getColor("TextArea.selectedForeground"));
textArea.setSelectionColor(UIManager.getColor("TextArea.selectedBackground"));
Gutter gutter = RSyntaxUtilities.getGutter(textArea);
if (gutter!=null) {
gutter.setBackground(UIManager.getColor("EditorPane.foreground"));
gutter.setLineNumberColor(UIManager.getColor("TextField.background"));
}
SwingUtilities.invokeLater(() -> {
textArea.setForeground(UIManager.getColor("EditorPane.foreground"));
textArea.setBackground(UIManager.getColor("TextField.background"));
textArea.setSelectedTextColor(UIManager.getColor("TextArea.selectedForeground"));
textArea.setSelectionColor(UIManager.getColor("TextArea.selectedBackground"));
Gutter gutter = RSyntaxUtilities.getGutter(textArea);
if (gutter!=null) {
gutter.setBackground(UIManager.getColor("TextField.background"));
gutter.setLineNumberColor(UIManager.getColor("TextField.background"));
}
});
} catch (NullPointerException ex) {
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/yagura/model/SendToServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import burp.IHttpService;
import extension.burp.HttpService;
import extension.helpers.ConvertUtil;
import extension.helpers.FileUtil;
import extension.helpers.HttpUtil;
import extension.helpers.StringUtil;
import java.awt.event.ActionEvent;
Expand Down Expand Up @@ -94,8 +95,8 @@ public void run() {
ostm.write(StringUtil.getBytesRaw(String.format("Content-Type: %s", "multipart/form-data;boundary=" + boundary) + StringUtil.NEW_LINE));
try (ByteArrayOutputStream bodyStream = new ByteArrayOutputStream()) {
outMultipart(boundary, bodyStream, messageInfo);
//ostm.write(StringUtil.getBytesRaw(String.format("Content-Length: %d", bodyStream.size()) + StringUtil.NEW_LINE));
//ostm.write(StringUtil.getBytesRaw("Connection: close" + StringUtil.NEW_LINE));
ostm.write(StringUtil.getBytesRaw(String.format("Content-Length: %d", bodyStream.size()) + StringUtil.NEW_LINE));
ostm.write(StringUtil.getBytesRaw("Connection: close" + StringUtil.NEW_LINE));
ostm.write(StringUtil.getBytesRaw(StringUtil.NEW_LINE));
ostm.write(bodyStream.toByteArray());
}
Expand Down Expand Up @@ -227,7 +228,7 @@ public void connectFailed(URI uri, SocketAddress sa, IOException ex) {

protected void outPostHeader(OutputStream out, URL tagetURL) throws IOException, Exception {
HttpService httpService = new HttpService(tagetURL);
out.write(StringUtil.getBytesRaw(String.format("POST %s HTTP/1.1", tagetURL.getFile()) + HttpUtil.LINE_TERMINATE));
out.write(StringUtil.getBytesRaw(String.format("POST %s HTTP/1.1", FileUtil.appendLastSeparator(tagetURL.getFile(), "/")) + HttpUtil.LINE_TERMINATE));
out.write(StringUtil.getBytesRaw(String.format("Host: %s", HttpUtil.buildHost(httpService.getHost(), httpService.getPort(), httpService.isHttps())) + HttpUtil.LINE_TERMINATE));
out.write(StringUtil.getBytesRaw(String.format("User-Agent: %s", "Java-http-client/BurpSuite") + StringUtil.NEW_LINE));
}
Expand Down

0 comments on commit 3a028c5

Please sign in to comment.