pcap loader, first login packet

This commit is contained in:
raphaeIl
2025-01-13 04:29:00 -05:00
parent c331b9b89a
commit aae2dc6b55
9 changed files with 659 additions and 29 deletions

View File

@@ -126,6 +126,7 @@ namespace Novaria.Common.Core
if (!success)
{
Log.Error("something went wrong when chacha20 decrypting the data");
throw new InvalidDataException("something went wrong when chacha20 decrypting the data");
}
byte[] decrypted_bytes = decrypt_result.ToArray();

View File

@@ -24,7 +24,15 @@ namespace Novaria.Common.Crypto
BigInteger clientPubKeyInt = new BigInteger(clientPubKey.Reverse().ToArray());
//Cpub**Spriv mod p
return BigInteger.ModPow(clientPubKeyInt, spriv, p).ToByteArray(true, true)[..32];
Console.WriteLine(clientPubKeyInt.ToString());
var result = BigInteger.ModPow(clientPubKeyInt, spriv, p);
if (result < 0)
{
result += p; // Make the result non-negative, causes error if -
}
return result.ToByteArray(true, true)[..32];
}
// this is for manual pcap parsing use only, officalServerPubKey is in the first IKE response, client priv will be in frida