Implement enhanced support for SteamParental

- Detect if SteamParental is active
- Verify if the code supplied by user is valid
- If the code is not valid or not supplied, generate it automatically (through local bruteforcing, pending further speed enhancements)

It's really sad seeing how this is possible, Valve seriously, you couldn't dedicate one single request in the backend to verify that? You could easily implement rate-limiting on invalid attempts and make parental more secure, but with the current implementation it's a security joke.
This commit is contained in:
JustArchi
2019-07-20 00:22:50 +02:00
parent d5c3897b1f
commit 535ce04a47
4 changed files with 181 additions and 7 deletions

View File

@@ -2417,16 +2417,24 @@ namespace ArchiSteamFarm {
}
}
if (!string.IsNullOrEmpty(BotConfig.SteamParentalCode) && (BotConfig.SteamParentalCode.Length != 4)) {
string steamParentalCode = await Logging.GetUserInput(ASF.EUserInputType.SteamParentalCode, BotName).ConfigureAwait(false);
(bool isSteamParentalEnabled, string steamParentalCode)? steamParental = await ArchiHandler.ValidateSteamParental(BotConfig.SteamParentalCode).ConfigureAwait(false);
if (string.IsNullOrEmpty(steamParentalCode) || (steamParentalCode.Length != 4)) {
Stop();
if (steamParental?.isSteamParentalEnabled == true) {
if (!string.IsNullOrEmpty(steamParental.Value.steamParentalCode)) {
if (BotConfig.SteamParentalCode != steamParental.Value.steamParentalCode) {
SetUserInput(ASF.EUserInputType.SteamParentalCode, steamParental.Value.steamParentalCode);
}
} else {
string steamParentalCode = await Logging.GetUserInput(ASF.EUserInputType.SteamParentalCode, BotName).ConfigureAwait(false);
break;
if (string.IsNullOrEmpty(steamParentalCode) || (steamParentalCode.Length != 4)) {
Stop();
break;
}
SetUserInput(ASF.EUserInputType.SteamParentalCode, steamParentalCode);
}
SetUserInput(ASF.EUserInputType.SteamParentalCode, steamParentalCode);
}
ArchiWebHandler.OnVanityURLChanged(callback.VanityURL);