Skip to content

Commit

Permalink
some formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
am0o0 committed Dec 13, 2024
1 parent fa00fec commit 3f65b03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,6 @@ private boolean isServiceVulnerable(NetworkService networkService) {
.build();

Payload payload = payloadGenerator.generate(config);
// Check callback server is enabled
if (!payload.getPayloadAttributes().getUsesCallbackServer()) {
logger.atInfo().log(
"The Tsunami callback server is not setup for this environment, so we cannot confirm the"
+ " RCE callback");
return false;
}
String cmd = payload.getPayload();

HttpResponse response = null;
Expand All @@ -157,14 +150,11 @@ private boolean isServiceVulnerable(NetworkService networkService) {
if (response == null || response.bodyString().isEmpty()) {
return false;
}
// If there is an RCE, the execution isn't immediate
logger.atInfo().log("Waiting for RCE callback.");
Uninterruptibles.sleepUninterruptibly(Duration.ofSeconds(oobSleepDuration));
if (payload.checkIfExecuted(response.bodyString().get())) {
logger.atInfo().log("RCE payload executed!");
return true;
if (payload.getPayloadAttributes().getUsesCallbackServer()) {
logger.atInfo().log("Waiting for RCE callback.");
Uninterruptibles.sleepUninterruptibly(Duration.ofSeconds(oobSleepDuration));
}
return false;
return payload.checkIfExecuted(response.bodyString().get());
}

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

/** Unit tests for {@link Cve202231137Detector}. */
@RunWith(JUnit4.class)
public final class Cve202231137DetectorWithoutCallbackServerTest {
public final class Cve202231137DetectorTest {
private final FakeUtcClock fakeUtcClock =
FakeUtcClock.create().setNow(Instant.parse("2022-05-23T00:00:00.00Z"));
private MockWebServer mockWebServer;
Expand Down

0 comments on commit 3f65b03

Please sign in to comment.