Skip to content

Commit c57604e

Browse files
author
source
committed
Filter support is Hide items without responses
1 parent 22614e8 commit c57604e

File tree

11 files changed

+87
-11
lines changed

11 files changed

+87
-11
lines changed

release/YaguraExtender.jar

793 Bytes
Binary file not shown.

src/burp/BurpExtender.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import java.io.FileOutputStream;
3232
import java.io.IOException;
3333
import java.io.InputStream;
34+
import java.net.MalformedURLException;
3435
import java.net.URL;
3536
import java.text.ParseException;
3637
import java.text.SimpleDateFormat;
@@ -929,17 +930,21 @@ public void sendToJTransCoder(String text) {
929930
public void sendToMessageInfoCopy(IContextMenuInvocation contextMenu, IHttpRequestResponse[] messageInfoList) {
930931
StringBuilder buff = new StringBuilder();
931932
try {
932-
buff.append("url\tstatus\tlength\r\n");
933+
buff.append("url\tquery\tmethod\tstatus\tlength\r\n");
933934
for (IHttpRequestResponse messageInfo : messageInfoList) {
934935
IRequestInfo reqInfo = BurpExtender.getHelpers().analyzeRequest(messageInfo);
935936
URL url = reqInfo.getUrl();
936937
buff.append(HttpUtil.toURL(url.getProtocol(), url.getHost(), url.getPort(), url.getPath()).toString());
938+
buff.append("\t");
939+
buff.append(url.getQuery());
940+
buff.append("\t");
941+
buff.append(reqInfo.getMethod());
937942
if (messageInfo.getResponse() != null) {
938943
HttpResponse httpResponse = HttpResponse.parseHttpResponse(messageInfo.getResponse());
939944
buff.append("\t");
940945
buff.append(httpResponse.getStatusCode());
941946
buff.append("\t");
942-
buff.append(httpResponse.getContentLength());
947+
buff.append(messageInfo.getResponse().length);
943948
}
944949
buff.append("\r\n");
945950
}
@@ -948,5 +953,24 @@ public void sendToMessageInfoCopy(IContextMenuInvocation contextMenu, IHttpReque
948953
}
949954
SwingUtil.systemClipboardCopy(buff.toString());
950955
}
956+
957+
/**
958+
* ***********************************************************************
959+
* Add Host To Scope
960+
* ***********************************************************************
961+
*/
962+
963+
public void sendToAddHostToScope(IContextMenuInvocation contextMenu, IHttpRequestResponse[] messageInfoList) {
964+
try {
965+
for (IHttpRequestResponse messageInfo : messageInfoList) {
966+
IRequestInfo reqInfo = BurpExtender.getHelpers().analyzeRequest(messageInfo);
967+
URL url = reqInfo.getUrl();
968+
BurpExtender.getCallbacks().includeInScope(new URL(HttpUtil.toURL(url.getProtocol(), url.getHost(), url.getPort())));
969+
}
970+
} catch (MalformedURLException ex) {
971+
Logger.getLogger(BurpExtender.class.getName()).log(Level.SEVERE, null, ex);
972+
}
973+
}
974+
951975

952976
}

src/burp/release.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# YaguraExtender build xml properties
22

33
# version
4-
version=1.7.24.0
4+
version=1.7.25.0
55

66
#lib
77
asciidoctor-version=1.5.5

src/yagura/Config.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ protected static void loadFromXml(IniProp prop, OptionProperty option) throws IO
288288

289289
FilterProperty filter = new FilterProperty();
290290
filter.setShowOnlyScopeItems(prop.readEntryBool("jsearch", "showOnlyScopeItems", false));
291+
filter.setHideItemsWithoutResponses(prop.readEntryBool("jsearch", "hideItemsWithoutResponsess", false));
291292
filter.setShowOnly(prop.readEntryBool("jsearch", "showOnly", false));
292293
filter.setShowOnlyExtension(prop.readEntry("jsearch", "showOnlyExtension", "asp,aspx,jsp,php"));
293294
filter.setHide(prop.readEntryBool("jsearch", "hide", false));
@@ -467,6 +468,7 @@ protected static void saveToXML(IniProp prop, OptionProperty option) throws IOEx
467468

468469
FilterProperty filter = jsearch.getFilterProperty();
469470
prop.writeEntryBool("jsearch", "showOnlyScopeItems", filter.getShowOnlyScopeItems());
471+
prop.writeEntryBool("jsearch", "hideItemsWithoutResponsess", filter.isHideItemsWithoutResponses());
470472
prop.writeEntryBool("jsearch", "showOnly", filter.getShowOnly());
471473
prop.writeEntry("jsearch", "showOnlyExtension", filter.getShowOnlyExtension());
472474
prop.writeEntryBool("jsearch", "hide", filter.getHide());

src/yagura/model/FilterProperty.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ public void setShowOnlyScopeItems(boolean value) {
2323
this.showOnlyScopeItems = value;
2424
}
2525

26+
private boolean hideItemsWithoutResponses = false;
27+
28+
/**
29+
* @return the hideItemsWithoutResponses
30+
*/
31+
public boolean isHideItemsWithoutResponses() {
32+
return hideItemsWithoutResponses;
33+
}
34+
35+
/**
36+
* @param hideItemsWithoutResponses the hideItemsWithoutResponses to set
37+
*/
38+
public void setHideItemsWithoutResponses(boolean hideItemsWithoutResponses) {
39+
this.hideItemsWithoutResponses = hideItemsWithoutResponses;
40+
}
41+
42+
2643
private boolean showOnly = false;
2744

2845
public boolean getShowOnly() {

src/yagura/model/HttpMessageItem.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,13 @@ public void setResponse(byte[] response) {
152152

153153
public short getStatusCode() throws Exception {
154154
if (this.httpItem != null) {
155-
IResponseInfo resInfo = BurpExtender.getHelpers().analyzeResponse(this.httpItem.getResponse());
156-
return resInfo.getStatusCode();
155+
if (this.httpItem.getResponse() != null) {
156+
IResponseInfo resInfo = BurpExtender.getHelpers().analyzeResponse(this.httpItem.getResponse());
157+
return resInfo.getStatusCode();
158+
}
159+
else {
160+
return 0;
161+
}
157162
} else {
158163
return this.statuscode;
159164
}

src/yagura/model/ResultViewModel.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ public Object getValueAt(int row, int col) {
6565
value = String.valueOf(msg.getUrl());
6666
break;
6767
case 5: // status code
68-
value = String.valueOf((int) msg.getStatusCode());
68+
value = 0;
69+
if (msg.getResponse() != null) {
70+
value = String.valueOf((int) msg.getStatusCode());
71+
}
6972
break;
7073
case 6: // length
7174
value = 0;

src/yagura/model/SendToExtend.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ public void sendToEvent(IHttpRequestResponse[] messageInfo) {
6565
BurpExtender.getInstance().sendToMessageInfoCopy(this.contextMenu, messageInfo);
6666
break;
6767
}
68+
case ADD_HOST_TO_SCOPE: {
69+
BurpExtender.getInstance().sendToAddHostToScope(this.contextMenu, messageInfo);
70+
break;
71+
}
6872
default:
6973
// ここには現状こない
7074
break;

src/yagura/model/SendToItem.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ public enum ExtendType {
2727
REQUEST_AND_RESPONSE_TO_FILE,
2828
SEND_TO_JTRANSCODER,
2929
PASTE_FROM_JTRANSCODER,
30-
MESSAGE_INFO_COPY;
30+
MESSAGE_INFO_COPY,
31+
ADD_HOST_TO_SCOPE;
3132

32-
@Override
33+
@Override
3334
public String toString() {
3435
String value = name().toLowerCase();
3536
return value.replace('_', ' ');

src/yagura/view/ResultFilterPopup.form

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,20 @@
161161
</Property>
162162
</Properties>
163163

164-
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
164+
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout">
165+
<Property name="axis" type="int" value="3"/>
166+
</Layout>
165167
<SubComponents>
166168
<Component class="javax.swing.JCheckBox" name="chkShowOnlyinscopeItem">
167169
<Properties>
168170
<Property name="text" type="java.lang.String" value="Show only in-scope items"/>
169171
</Properties>
170172
</Component>
173+
<Component class="javax.swing.JCheckBox" name="chkHideItemsWithoutResponses">
174+
<Properties>
175+
<Property name="text" type="java.lang.String" value="Hide items without responses"/>
176+
</Properties>
177+
</Component>
171178
</SubComponents>
172179
</Container>
173180
<Container class="javax.swing.JPanel" name="pnlExtension">

0 commit comments

Comments
 (0)