Log sign rewrite inputs and outputs
Some checks failed
Build and Release / build (push) Failing after 2m58s
Some checks failed
Build and Release / build (push) Failing after 2m58s
This commit is contained in:
@@ -76,34 +76,46 @@ public abstract class ClientConnectionMixin {
|
||||
return packet;
|
||||
}
|
||||
|
||||
ExploitState.CapturedSignData captured = ExploitState.SIGNS.get(pos);
|
||||
if (captured == null || !captured.isSuspicious()) {
|
||||
SignLeakShieldTraceLog.info(
|
||||
"Outgoing sign packet allowed: captured sign missing or not blacklisted pos=%s front=%s capturedPresent=%s",
|
||||
pos,
|
||||
ExploitState.CapturedSignData captured = ExploitState.SIGNS.get(pos);
|
||||
if (captured == null || !captured.isSuspicious()) {
|
||||
SignLeakShieldTraceLog.info(
|
||||
"Outgoing sign packet allowed: captured sign missing or not blacklisted pos=%s front=%s capturedPresent=%s",
|
||||
pos,
|
||||
signPacket.isFront(),
|
||||
captured != null
|
||||
);
|
||||
return packet;
|
||||
}
|
||||
|
||||
Text[] textLines;
|
||||
textLines = signPacket.isFront() ? captured.getFront() : captured.getBack();
|
||||
|
||||
String line1 = TextSanitizer.sanitize(textLines[0]);
|
||||
String line2 = TextSanitizer.sanitize(textLines[1]);
|
||||
String line3 = TextSanitizer.sanitize(textLines[2]);
|
||||
String line4 = TextSanitizer.sanitize(textLines[3]);
|
||||
|
||||
SignLeakShieldTraceLog.info(
|
||||
"Blocked forced sign translation event at %s front=%s: got=%s, returned=%s",
|
||||
pos,
|
||||
signPacket.isFront(),
|
||||
Arrays.toString(signPacket.getText()),
|
||||
Arrays.toString(new String[] { line1, line2, line3, line4 })
|
||||
);
|
||||
|
||||
ExploitState.clearForcedOpen();
|
||||
return new UpdateSignC2SPacket(pos, signPacket.isFront(), line1, line2, line3, line4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text[] textLines;
|
||||
textLines = signPacket.isFront() ? captured.getFront() : captured.getBack();
|
||||
String[] originalResponse = signPacket.getText();
|
||||
|
||||
String line1 = TextSanitizer.sanitize(textLines[0]);
|
||||
String line2 = TextSanitizer.sanitize(textLines[1]);
|
||||
String line3 = TextSanitizer.sanitize(textLines[2]);
|
||||
String line4 = TextSanitizer.sanitize(textLines[3]);
|
||||
String[] returnedResponse = new String[] { line1, line2, line3, line4 };
|
||||
|
||||
SignLeakShieldTraceLog.info(
|
||||
"Blocked forced sign translation event at %s front=%s: receivedSign=%s, unmodifiedResponse=%s, returned=%s",
|
||||
pos,
|
||||
signPacket.isFront(),
|
||||
describeTextLines(textLines),
|
||||
Arrays.toString(originalResponse),
|
||||
Arrays.toString(returnedResponse)
|
||||
);
|
||||
|
||||
ExploitState.clearForcedOpen();
|
||||
return new UpdateSignC2SPacket(pos, signPacket.isFront(), line1, line2, line3, line4);
|
||||
}
|
||||
|
||||
private static String describeTextLines(Text[] lines) {
|
||||
String[] values = new String[lines.length];
|
||||
for (int i = 0; i < lines.length; i++) {
|
||||
values[i] = lines[i] != null ? lines[i].getString() : "";
|
||||
}
|
||||
|
||||
return Arrays.toString(values);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user