diff --git a/src/main/java/burp/HelperPlus.java b/src/main/java/burp/HelperPlus.java index 08b94e7..82156cb 100644 --- a/src/main/java/burp/HelperPlus.java +++ b/src/main/java/burp/HelperPlus.java @@ -366,8 +366,11 @@ public byte[] UpdateBody(boolean isRequest,byte[] requestOrResponse,byte[] body) */ public static URL getShortURL(IHttpRequestResponse messageInfo){ if (null == messageInfo) return null; - String shortUrlString = messageInfo.getHttpService().toString();//http://www.baidu.com - shortUrlString = shortUrlString+"/"; + IHttpService service = messageInfo.getHttpService(); + //String shortUrlString = messageInfo.getHttpService().toString();//http://www.baidu.com + //新版本burp中,API发生了变化,返回结果是这种burp.Ze6r@7f06cf44/ + + String shortUrlString = getShortURL(service); try { return new URL(shortUrlString); } catch (MalformedURLException e) { @@ -375,6 +378,16 @@ public static URL getShortURL(IHttpRequestResponse messageInfo){ return null; } } + + public static String getShortURL(IHttpService service){ + //String shortUrlString = messageInfo.getHttpService().toString();//http://www.baidu.com + //新版本burp中,API发生了变化,返回结果是这种burp.Ze6r@7f06cf44/ + if (service ==null){ + return null; + } + String shortUrlString = service.getProtocol()+"://"+service.getHost()+":"+service.getPort()+"/"; + return shortUrlString; + } /** * return Type is URL,not String. @@ -390,7 +403,10 @@ public static URL getShortURL(IHttpRequestResponse messageInfo){ */ public static URL getShortURLWithDefaultPort(IHttpRequestResponse messageInfo){ if (null == messageInfo) return null; - String shortUrlString = messageInfo.getHttpService().toString();//http://www.baidu.com + IHttpService service = messageInfo.getHttpService(); + //String shortUrlString = messageInfo.getHttpService().toString();//http://www.baidu.com + //新版本burp中,API发生了变化,返回结果是这种burp.Ze6r@7f06cf44/ + String shortUrlString = getShortURL(service); shortUrlString = formateURLString(shortUrlString); try { return new URL(shortUrlString);