Skip to content

Commit

Permalink
Update HelperPlus.java
Browse files Browse the repository at this point in the history
  • Loading branch information
bit4woo committed Dec 20, 2023
1 parent 832423e commit d612319
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions src/main/java/burp/HelperPlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,28 @@ 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) {
e.printStackTrace();
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.
Expand All @@ -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);
Expand Down

0 comments on commit d612319

Please sign in to comment.