mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
feat: suitable for xxl-job < 2.2.0 #151
This commit is contained in:
@@ -6,6 +6,7 @@ import okhttp3.*;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Base64;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
@@ -78,6 +79,23 @@ public class VulTool {
|
||||
}
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static void xxlJobHessianExecutor(String url, String base64Bytes) {
|
||||
byte[] requestBytes = Base64.getDecoder().decode(base64Bytes);
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
RequestBody body = RequestBody.create(requestBytes, MediaType.parse("application/octet-stream"));
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.post(body)
|
||||
.addHeader("Connection", "close")
|
||||
.build();
|
||||
log.info("sending hessian2 xxl-rpc request to: {}", url);
|
||||
try (Response response = client.newCall(request).execute()) {
|
||||
log.info("xxl-rpc hessian2 response code: {}", response.code());
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static void xxlJobExecutor(String url, String data) {
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
|
||||
Reference in New Issue
Block a user