diff --git a/pom.xml b/pom.xml index 887e0e9..2b98119 100644 --- a/pom.xml +++ b/pom.xml @@ -98,6 +98,11 @@ protocol-attacker 2.1.0 + + de.rub.nds + terminal-utils + 1.0.0 + jakarta.xml.bind jakarta.xml.bind-api diff --git a/src/main/java/de/rub/nds/scanner/core/execution/Scanner.java b/src/main/java/de/rub/nds/scanner/core/execution/Scanner.java index 549a81d..6bce239 100644 --- a/src/main/java/de/rub/nds/scanner/core/execution/Scanner.java +++ b/src/main/java/de/rub/nds/scanner/core/execution/Scanner.java @@ -17,6 +17,7 @@ import de.rub.nds.scanner.core.report.ScanReport; import de.rub.nds.scanner.core.report.rating.ScoreReport; import de.rub.nds.scanner.core.report.rating.SiteReportRater; +import de.rub.nds.terminalutils.ProgressSpinner; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; @@ -152,7 +153,7 @@ public ReportT scan() { // Check Scan Prerequisites if (!checkScanPrerequisites(report)) { - LOGGER.debug("Scan cannot be performed due to prerequisites not being fulfilled"); + LOGGER.info("Scan cannot be performed due to prerequisites not being fulfilled"); return report; } @@ -165,15 +166,18 @@ public ReportT scan() { scanJob, executorConfig.getParallelProbes(), "ScannerProbeExecutor " + report.getRemoteName())) { + ProgressSpinner.startSpinnerTask("Executing:"); report.setScanStartTime(System.currentTimeMillis()); scanJobExecutor.execute(report); } catch (InterruptedException e) { LOGGER.warn("Scan execution interrupted"); report.setScanEndTime(System.currentTimeMillis()); Thread.currentThread().interrupt(); + ProgressSpinner.stopSpinner(); return report; } LOGGER.debug("Scan execution complete"); + ProgressSpinner.stopSpinner(); // Rating LOGGER.debug("Retrieving site report rater for score evaluation"); diff --git a/src/main/java/de/rub/nds/scanner/core/execution/ThreadedScanJobExecutor.java b/src/main/java/de/rub/nds/scanner/core/execution/ThreadedScanJobExecutor.java index 5a9c80c..a27e2fa 100644 --- a/src/main/java/de/rub/nds/scanner/core/execution/ThreadedScanJobExecutor.java +++ b/src/main/java/de/rub/nds/scanner/core/execution/ThreadedScanJobExecutor.java @@ -147,8 +147,8 @@ private void executeProbesTillNoneCanBeExecuted(ReportT report) throws Interrupt probeResult = result.get(); LOGGER.info( "[{}/{}] {} probe executed", - currentFinishedProbes, - probeCount, + String.format("%2d", currentFinishedProbes), + String.format("%2d", probeCount), probeResult.getType().getName()); } catch (ExecutionException e) { LOGGER.error("Some probe execution failed", e); diff --git a/src/main/java/de/rub/nds/scanner/core/probe/ScannerProbe.java b/src/main/java/de/rub/nds/scanner/core/probe/ScannerProbe.java index 606c3e9..0369c0a 100644 --- a/src/main/java/de/rub/nds/scanner/core/probe/ScannerProbe.java +++ b/src/main/java/de/rub/nds/scanner/core/probe/ScannerProbe.java @@ -13,6 +13,7 @@ import de.rub.nds.scanner.core.probe.result.*; import de.rub.nds.scanner.core.report.PerformanceData; import de.rub.nds.scanner.core.report.ScanReport; +import de.rub.nds.terminalutils.ProgressSpinner; import java.math.BigInteger; import java.util.HashMap; import java.util.List; @@ -41,8 +42,10 @@ public ScannerProbe(ProbeType type) { @Override public ScannerProbe call() { LOGGER.debug("Executing: {}", getProbeName()); + ProgressSpinner.startSpinnerTask(getProbeName() + " probe"); this.startTime = System.currentTimeMillis(); executeTest(); + ProgressSpinner.stopSpinnerTask(getProbeName() + " probe"); this.stopTime = System.currentTimeMillis(); LOGGER.debug("Finished {} - Took {}s", getProbeName(), (stopTime - startTime) / 1000);