forked from bit4woo/knife
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1、配置插件优化UI线程安全加载 2、移植knife-plus部分功能 在Auto_Load_Project_Config为True的情况下: 支持每次插件启动时进行加载项目配置文件 支持右键菜单手动保存项目配置文件 支持右键菜单手动加载项目配置文件 支持右键增加scope include域名 (正则) 支持右键增加scope exclude域名 (正则) 支持右键清空scope 所有范围 支持通过配置Add_Hosts_Exclude_Scope添加默认需要排除scope exclude域名 (域名正则格式) 3、用中文描述了部分内置属性
- Loading branch information
Showing
13 changed files
with
1,247 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package plus; | ||
|
||
import burp.*; | ||
import config.GUI; | ||
|
||
import javax.swing.*; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
import java.io.PrintWriter; | ||
import java.util.HashSet; | ||
|
||
public class AddHostToExScopeAdvMenu extends JMenuItem {//JMenuItem vs. JMenu | ||
|
||
public AddHostToExScopeAdvMenu(BurpExtender burp){ | ||
this.setText("^_^ Add Host To ExScope Adv"); | ||
this.addActionListener(new AddHostToExScopeAdv_Action(burp,burp.invocation)); | ||
} | ||
} | ||
|
||
|
||
|
||
class AddHostToExScopeAdv_Action implements ActionListener{ | ||
//scope matching is actually String matching!! | ||
private IContextMenuInvocation invocation; | ||
public BurpExtender myburp; | ||
public IExtensionHelpers helpers; | ||
public PrintWriter stdout; | ||
public PrintWriter stderr; | ||
public IBurpExtenderCallbacks callbacks; | ||
//callbacks.printOutput(Integer.toString(invocation.getToolFlag()));//issue tab of target map is 16 | ||
public AddHostToExScopeAdv_Action(BurpExtender burp, IContextMenuInvocation invocation) { | ||
this.invocation = invocation; | ||
this.helpers = burp.helpers; | ||
this.callbacks = burp.callbacks; | ||
this.stderr = burp.stderr; | ||
} | ||
|
||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) | ||
{ | ||
try{ | ||
String wildcardSet = GUI.getConfigTableModel().getConfigValueByKey("Scope_Base_On_SubDomain"); | ||
HashSet<String> hostHashSet = new HashSet<>(); | ||
IHttpRequestResponse[] messages = invocation.getSelectedMessages(); | ||
for(IHttpRequestResponse message:messages) { | ||
String host = message.getHttpService().getHost(); | ||
if(wildcardSet!=null){ | ||
host = UtilsPlus.hostToWildcardHostWithDotEscape(host); | ||
}else { | ||
host = UtilsPlus.dotToEscapeDot(host); | ||
} | ||
hostHashSet.add(host); | ||
} | ||
AdvScopeUtils.addHostToExScopeAdv(callbacks, hostHashSet); | ||
} | ||
catch (Exception e1) | ||
{ | ||
e1.printStackTrace(stderr); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package plus; | ||
|
||
import burp.*; | ||
|
||
import javax.swing.*; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
import java.io.PrintWriter; | ||
|
||
public class AddHostToExScopeMenu extends JMenuItem {//JMenuItem vs. JMenu | ||
|
||
public AddHostToExScopeMenu(BurpExtender burp){ | ||
this.setText("^_^ Add Host To ExScope"); | ||
this.addActionListener(new AddHostToExScope_Action(burp,burp.invocation)); | ||
} | ||
} | ||
|
||
|
||
|
||
class AddHostToExScope_Action implements ActionListener{ | ||
//scope matching is actually String matching!! | ||
private IContextMenuInvocation invocation; | ||
public BurpExtender myburp; | ||
public IExtensionHelpers helpers; | ||
public PrintWriter stdout; | ||
public PrintWriter stderr; | ||
public IBurpExtenderCallbacks callbacks; | ||
//callbacks.printOutput(Integer.toString(invocation.getToolFlag()));//issue tab of target map is 16 | ||
public AddHostToExScope_Action(BurpExtender burp, IContextMenuInvocation invocation) { | ||
this.invocation = invocation; | ||
this.helpers = burp.helpers; | ||
this.callbacks = burp.callbacks; | ||
this.stderr = burp.stderr; | ||
this.stdout = burp.stdout; | ||
} | ||
|
||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) | ||
{ | ||
IHttpRequestResponse[] messages = invocation.getSelectedMessages(); | ||
|
||
if (AdvScopeUtils.isAdvScopeMode(callbacks)){ | ||
//高级模式 | ||
AdvScopeUtils.addHostToExScopeAdv(callbacks, UtilsPlus.getHostSetFromMessages(messages)); | ||
} else { | ||
//普通模式 | ||
UtilsPlus.addHostToExScope(callbacks, UtilsPlus.getUrlSetFromMessages(messages)); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package plus; | ||
|
||
import burp.*; | ||
import config.GUI; | ||
|
||
import javax.swing.*; | ||
import java.awt.event.ActionEvent; | ||
import java.awt.event.ActionListener; | ||
import java.io.PrintWriter; | ||
import java.util.HashSet; | ||
|
||
public class AddHostToInScopeAdvMenu extends JMenuItem {//JMenuItem vs. JMenu | ||
|
||
public AddHostToInScopeAdvMenu(BurpExtender burp){ | ||
this.setText("^_^ Add Host To InScope Adv"); | ||
this.addActionListener(new AddHostToInScopeAdv_Action(burp,burp.invocation)); | ||
} | ||
} | ||
|
||
|
||
|
||
class AddHostToInScopeAdv_Action implements ActionListener{ | ||
//scope matching is actually String matching!! | ||
private IContextMenuInvocation invocation; | ||
public BurpExtender myburp; | ||
public IExtensionHelpers helpers; | ||
public PrintWriter stdout; | ||
public PrintWriter stderr; | ||
public IBurpExtenderCallbacks callbacks; | ||
//callbacks.printOutput(Integer.toString(invocation.getToolFlag()));//issue tab of target map is 16 | ||
public AddHostToInScopeAdv_Action(BurpExtender burp, IContextMenuInvocation invocation) { | ||
this.invocation = invocation; | ||
this.helpers = burp.helpers; | ||
this.callbacks = burp.callbacks; | ||
this.stderr = burp.stderr; | ||
} | ||
|
||
|
||
@Override | ||
public void actionPerformed(ActionEvent e) | ||
{ | ||
try{ | ||
String wildcardSet = GUI.getConfigTableModel().getConfigValueByKey("Scope_Base_On_SubDomain"); | ||
HashSet<String> hostHashSet = new HashSet<>(); | ||
IHttpRequestResponse[] messages = invocation.getSelectedMessages(); | ||
for(IHttpRequestResponse message:messages) { | ||
String host = message.getHttpService().getHost(); | ||
if(wildcardSet!=null){ | ||
host = UtilsPlus.hostToWildcardHostWithDotEscape(host); | ||
}else { | ||
host = UtilsPlus.dotToEscapeDot(host); | ||
} | ||
hostHashSet.add(host); | ||
} | ||
AdvScopeUtils.addHostToInScopeAdv(callbacks,hostHashSet); | ||
} | ||
catch (Exception e1) | ||
{ | ||
e1.printStackTrace(stderr); | ||
} | ||
} | ||
} |
Oops, something went wrong.