Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support UTF-8 #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions BappDescription.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<p>This extension adds a new tab to Burp's UI, for taking notes and organizing external files that are created during penetration
testing. You can create text documents and spreadsheets directly within Burp,
and send HTTP requests and responses directly to new or existing files.</p>
<p>Within the Notes tab, you can:</p>
<ul>
<li>Save Notes: Save any currently open documents to a file.</li>
<li>Load Notes: Load a previously saved set of notes from a file.</li>
<li>New Text: Add a tab with a new text document.</li>
<li>Import Text: Load the contents of a text document.</li>
<li>New Spreadsheet: Add a tab with a new spreadsheet.</li>
<li>Import Spreadsheet: Load the contents of a CSV document.</li>
<li>You can also export individual notes tabs to an external file.</li>
</ul>

<p>From anywhere within Burp, you can use the context menu to send selected
items directly to the Notes tab,
to either a new or existing document.</p>
12 changes: 12 additions & 0 deletions BappManifest.bmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Uuid: b150353ea3d54f61bdc482a4a8470356
ExtensionType: 1
Name: Notes
RepoName: notes
ScreenVersion: 1.0
SerialVersion: 1
MinPlatformVersion: 0
ProOnly: False
Author: Austin Lane
ShortDescription: Lets you take notes and manage external documents from within Burp.
EntryPoint: build/jar/BurpNotesExtension.jar
BuildCommand: rm -rf build/classes/* build/jar/* && ant jar
Binary file modified build/jar/BurpNotesExtension.jar
Binary file not shown.
35 changes: 18 additions & 17 deletions src/com/trustwave/burp/NotesExtensionOperations.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.FileInputStream;
import java.io.PrintWriter;
import java.io.OutputStreamWriter;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -138,12 +142,12 @@ public void SaveNotes(){
//callbacks.saveExtensionSettings(FILE_SAVE_SETTING, currentNotesFile.getPath()); //Update save location in extension settings
try{
//Create our various Writers
FileWriter fw = new FileWriter(f);
CSVWriter writer = new CSVWriter(fw);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), "UTF-8"));
CSVWriter writer = new CSVWriter(bw);
//Write out to file and close
writer.writeAll(data);
writer.close();
fw.close();
bw.close();
} catch(IOException exc){
errout.println(exc.getMessage());
}
Expand All @@ -164,7 +168,7 @@ public void LoadNotes(){
currentNotesFile = file; //Remember the file just opened for saving later
ArrayList<String[]> spreadData = new ArrayList<String[]>();
if(file.exists() && file.isFile() && file.canRead()){
CSVReader reader = new CSVReader(new FileReader(file));
CSVReader reader = new CSVReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
String[] nextLine;
while((nextLine = reader.readNext()) != null){
spreadData.add(nextLine);
Expand Down Expand Up @@ -456,8 +460,7 @@ public void promptUseTemplate(int templateType){
if((file = GetFileFromDialog(false, "TEMPLATE.txt")) != null){
textTemplateFile = "";
if(file.exists() && file.isFile() && file.canRead()){
FileReader input = new FileReader(file);
BufferedReader br = new BufferedReader(input);
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));
String strLine;
//Read File Line By Line
while ((strLine = br.readLine()) != null) {
Expand All @@ -472,7 +475,7 @@ public void promptUseTemplate(int templateType){
if((file = GetFileFromDialog(false, "TEMPLATE.csv")) != null){
spreadsheetTemplateFile = new ArrayList<String[]>();
if(file.exists() && file.isFile() && file.canRead()){
CSVReader reader = new CSVReader(new FileReader(file));
CSVReader reader = new CSVReader(new InputStreamReader(new FileInputStream(file), "UTF-8"));
String[] nextLine;
while((nextLine = reader.readNext()) != null){
spreadsheetTemplateFile.add(nextLine);
Expand Down Expand Up @@ -540,12 +543,11 @@ public void ExportTextTab(int index){
File f;
if((f = GetFileFromDialog(true, "TEMPLATE.txt")) != null){
try{
// Create file
FileWriter fstream = new FileWriter(f);
BufferedWriter out = new BufferedWriter(fstream);
out.write(data);
//Close the output stream
out.close();
PrintWriter pw = new PrintWriter(
new BufferedWriter(new OutputStreamWriter(
new FileOutputStream(f), "UTF-8")));
pw.print(data);
pw.close();
} catch (Exception exc){//Catch exception if any
errout.println(exc.getMessage());
}
Expand Down Expand Up @@ -579,13 +581,12 @@ public void ExportSpreadsheetTab(int index){
File f;
if((f = GetFileFromDialog(true, "TEMPLATE.csv")) != null){
try{
//Create our various Writers
FileWriter fw = new FileWriter(f);
CSVWriter writer = new CSVWriter(fw);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(f), "UTF-8"));
CSVWriter writer = new CSVWriter(bw);
//Write out to file and close
writer.writeAll(data);
writer.close();
fw.close();
bw.close();
} catch(IOException exc){
errout.println(exc.getMessage());
}
Expand Down