3131import java .io .FileOutputStream ;
3232import java .io .IOException ;
3333import java .io .InputStream ;
34+ import java .net .MalformedURLException ;
3435import java .net .URL ;
3536import java .text .ParseException ;
3637import 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\t status\t length\r \n " );
933+ buff .append ("url\t query \t method \ t status\t length\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}
0 commit comments