-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change adds new classes for user interface generation to be more understandable for developers.
- Loading branch information
Showing
14 changed files
with
313 additions
and
242 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -8,46 +8,40 @@ | |
|
||
/** | ||
* Contains all types of PoC's supported by this plugin. | ||
* | ||
* @author Joaquin R. Martinez <[email protected]> | ||
*/ | ||
public class Pocs { | ||
|
||
private static final Map<String, IPoc> POCS = new HashMap<>() ; | ||
private static Pocs poc = null; | ||
|
||
/** | ||
* Inaccesible constructor. | ||
*/ | ||
private Pocs() { | ||
Pocs.POCS.put("Ajax",new AjaxPoc()); | ||
Pocs.POCS.put("HTML",new HtmlPoc()); | ||
// Add more kind of PoC's | ||
} | ||
|
||
/** | ||
* Initializes the types of pocs supported. | ||
*/ | ||
public static void initialize(){ | ||
if(poc == null){ | ||
Pocs.poc = new Pocs(); | ||
} | ||
} | ||
|
||
/** | ||
* Get the {@link IPoc} object by its key. | ||
* @param key the key of the {@link IPoc}. | ||
* @return the {@link IPoc} object. | ||
*/ | ||
public static IPoc getPoc(String key) { | ||
return Pocs.POCS.get(key); | ||
} | ||
|
||
/** | ||
* Get the {@link IPoc} as a {@link Enumeration}. | ||
* @return an {@link Iterator} with the keys of all {@link IPoc} objects. | ||
*/ | ||
public static Iterator<String> getPocKeys(){ | ||
return Pocs.POCS.keySet().iterator(); | ||
} | ||
|
||
|
||
private static final Map<String, IPoc> POCS = new HashMap<>(); | ||
static Pocs poc = new Pocs(); | ||
|
||
/** | ||
* Inaccesible constructor. | ||
*/ | ||
private Pocs() { | ||
Pocs.POCS.put("Ajax", new AjaxPoc()); | ||
Pocs.POCS.put("HTML", new HtmlPoc()); | ||
// Add more kind of PoC's | ||
} | ||
|
||
/** | ||
* Get the {@link IPoc} object by its key. | ||
* | ||
* @param key the key of the {@link IPoc}. | ||
* @return the {@link IPoc} object. | ||
*/ | ||
public static IPoc getPoc(String key) { | ||
return Pocs.POCS.get(key); | ||
} | ||
|
||
/** | ||
* Get the {@link IPoc} as a {@link Enumeration}. | ||
* | ||
* @return an {@link Iterator} with the keys of all {@link IPoc} objects. | ||
*/ | ||
public static Iterator<String> getPocKeys() { | ||
return Pocs.POCS.keySet().iterator(); | ||
} | ||
|
||
} |
2 changes: 1 addition & 1 deletion
2
src/main/java/burp/burptab/CloseIcon.java → src/main/java/burp/tab/CloseIcon.java
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
package burp.burptab; | ||
package burp.tab; | ||
|
||
import java.awt.Color; | ||
import java.awt.Component; | ||
|
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,36 @@ | ||
package burp.tab; | ||
|
||
import burp.BurpExtender; | ||
import burp.IHttpRequestResponse; | ||
import burp.IHttpService; | ||
import burp.IHttpServiceImpl; | ||
import burp.IMessageEditor; | ||
import burp.IMessageEditorController; | ||
import burp.IRequestInfo; | ||
|
||
public class MessageEditorController implements IMessageEditorController { | ||
|
||
private IHttpRequestResponse request; | ||
private IMessageEditor messageEditor; | ||
|
||
public MessageEditorController(IHttpRequestResponse request, IMessageEditor messageEditor) { | ||
this.request = request; | ||
this.messageEditor = messageEditor; | ||
} | ||
|
||
@Override | ||
public IHttpService getHttpService() { | ||
IRequestInfo analyzeRequest = BurpExtender.getBurpExtenderCallbacks().getHelpers().analyzeRequest(this.request); | ||
return new IHttpServiceImpl(analyzeRequest); | ||
} | ||
|
||
@Override | ||
public byte[] getRequest() { | ||
return messageEditor.getMessage(); | ||
} | ||
|
||
@Override | ||
public byte[] getResponse() { | ||
return this.request.getResponse(); | ||
} | ||
} |
Oops, something went wrong.