Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Apr 20, 2024
1 parent ea4c231 commit a557958
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
6 changes: 3 additions & 3 deletions src/knife/AddHostToScopeMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public AddHostToScopeMenu(BurpExtender burp){

class AddHostToScope_Action implements ActionListener{
//scope matching is actually String matching!!
private IContextMenuInvocation invocation;
private final IContextMenuInvocation invocation;
public BurpExtender myburp;
public IExtensionHelpers helpers;
public PrintWriter stdout;
Expand All @@ -36,8 +36,8 @@ class AddHostToScope_Action implements ActionListener{
public AddHostToScope_Action(BurpExtender burp,IContextMenuInvocation invocation) {
this.invocation = invocation;
this.helpers = burp.helpers;
this.callbacks = burp.callbacks;
this.stderr = burp.stderr;
this.callbacks = BurpExtender.callbacks;
this.stderr = BurpExtender.stderr;
}


Expand Down
4 changes: 1 addition & 3 deletions src/knife/ChineseGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

public class ChineseGUI extends JFrame {

private JPanel contentPane;

/**
* Launch the application.
*/
Expand Down Expand Up @@ -51,7 +49,7 @@ public ChineseGUI(byte[] body) {

setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
JPanel contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
Expand Down
15 changes: 8 additions & 7 deletions src/knife/ChunkedEncodingMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import burp.IExtensionHelpers;
import burp.IHttpRequestResponse;
import burp.Methods;
import config.GUI;


public class ChunkedEncodingMenu extends JMenuItem {
Expand Down Expand Up @@ -47,20 +48,20 @@ public ChunkedEncodingMenu(BurpExtender burp){
}

class ChunkedEncoding_Action implements ActionListener{
private IContextMenuInvocation invocation;
private final IContextMenuInvocation invocation;
public IExtensionHelpers helpers;
public PrintWriter stdout;
public PrintWriter stderr;
public IBurpExtenderCallbacks callbacks;
private BurpExtender burp;
private final BurpExtender burp;

public ChunkedEncoding_Action(BurpExtender burp,IContextMenuInvocation invocation) {
this.burp = burp;
this.invocation = invocation;
this.helpers = burp.helpers;
this.callbacks = burp.callbacks;
this.stderr = burp.stderr;
this.stdout = burp.stdout;
this.callbacks = BurpExtender.callbacks;
this.stderr = BurpExtender.stderr;
this.stdout = BurpExtender.stdout;
}

@Override
Expand All @@ -85,10 +86,10 @@ public void actionPerformed(ActionEvent event) {

try {
boolean useComment =false;
if (burp.tableModel.getConfigValueByKey("Chunked-UseComment") != null) {
if (GUI.tableModel.getConfigValueByKey("Chunked-UseComment") != null) {
useComment = true;
}
String lenStr = burp.tableModel.getConfigValueByKey("Chunked-Length");
String lenStr = GUI.tableModel.getConfigValueByKey("Chunked-Length");
int len =10;
if (lenStr !=null) {
len = Integer.parseInt(lenStr);
Expand Down
7 changes: 6 additions & 1 deletion src/knife/CopyJsOfThisSite.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import burp.IHttpRequestResponse;
import burp.SystemUtils;
import burp.Utils;
import org.apache.commons.lang3.StringUtils;


public class CopyJsOfThisSite extends JMenuItem {
Expand Down Expand Up @@ -92,9 +93,12 @@ public String findUrls(IHttpRequestResponse message){
if (current_fullUrl != null) {
siteBaseUrl = Utils.getBaseUrl(current_referUrl);
}
if (siteBaseUrl == null) {
if (StringUtils.isEmpty(siteBaseUrl)) {
siteBaseUrl = Utils.getBaseUrl(current_fullUrl);
}
if (StringUtils.isEmpty(siteBaseUrl)){
return "";
}

IHttpRequestResponse[] messages = BurpExtender.getCallbacks().getSiteMap(null);
for (IHttpRequestResponse item:messages) {
Expand All @@ -107,6 +111,7 @@ public String findUrls(IHttpRequestResponse message){
if (!url.toString().toLowerCase().endsWith(".js") || !url.toString().toLowerCase().endsWith(".js.map")) {
continue;
}

if (referUrl.toLowerCase().startsWith(siteBaseUrl.toLowerCase()+"/")) {
byte[] respBody = getter.getBody(false, item);
String body = new String(respBody);
Expand Down
2 changes: 1 addition & 1 deletion src/knife/CustomPayloadForAllInsertpointMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public static String updateJSONValue(String JSONString, String payload) throws E
}

public static boolean isBooleanOrNumber(String input) {
if (input.toLowerCase().equals("true") || input.toLowerCase().equals("false")){
if (input.equalsIgnoreCase("true") || input.equalsIgnoreCase("false")){
return true;
}else{
return isNumeric(input);
Expand Down
10 changes: 5 additions & 5 deletions src/knife/UpdateHeaderMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@ public boolean containOneOfKeywords(String x,List<String> keywords,boolean isCas
}

class UpdateHeader_Action implements ActionListener{
private IContextMenuInvocation invocation;
private final IContextMenuInvocation invocation;
public IExtensionHelpers helpers;
public PrintWriter stdout;
public PrintWriter stderr;
public IBurpExtenderCallbacks callbacks;

private String headerName;
private final String headerName;

public UpdateHeader_Action(BurpExtender burp,IContextMenuInvocation invocation,String headerName) {
this.invocation = invocation;
this.helpers = burp.helpers;
this.callbacks = burp.callbacks;
this.stderr = burp.stderr;
this.stdout = burp.stdout;
this.callbacks = BurpExtender.callbacks;
this.stderr = BurpExtender.stderr;
this.stdout = BurpExtender.stdout;
this.headerName = headerName;
}

Expand Down

0 comments on commit a557958

Please sign in to comment.