Update FileAnalysis.cs
This commit is contained in:
parent
3039ce555d
commit
6ec25656f2
@ -159,12 +159,12 @@ namespace winPEAS.Checks
|
|||||||
// Use "IsMatch" because it supports timeout, if exception is thrown exit the func to avoid ReDoS in "rgx.Matches"
|
// Use "IsMatch" because it supports timeout, if exception is thrown exit the func to avoid ReDoS in "rgx.Matches"
|
||||||
if (caseinsensitive)
|
if (caseinsensitive)
|
||||||
{
|
{
|
||||||
_ = Regex.IsMatch(text, regex_str.Trim(), RegexOptions.IgnoreCase, TimeSpan.FromMilliseconds(5000));
|
_ = Regex.IsMatch(text, regex_str.Trim(), RegexOptions.IgnoreCase, TimeSpan.FromSeconds(60));
|
||||||
rgx = new Regex(regex_str.Trim(), RegexOptions.IgnoreCase);
|
rgx = new Regex(regex_str.Trim(), RegexOptions.IgnoreCase);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_ = Regex.IsMatch(text, regex_str.Trim(), RegexOptions.None, TimeSpan.FromMilliseconds(5000));
|
_ = Regex.IsMatch(text, regex_str.Trim(), RegexOptions.None, TimeSpan.FromSeconds(60));
|
||||||
rgx = new Regex(regex_str.Trim());
|
rgx = new Regex(regex_str.Trim());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -367,7 +367,7 @@ namespace winPEAS.Checks
|
|||||||
timer.Stop();
|
timer.Stop();
|
||||||
|
|
||||||
TimeSpan timeTaken = timer.Elapsed;
|
TimeSpan timeTaken = timer.Elapsed;
|
||||||
if (timeTaken.TotalMilliseconds > 5000)
|
if (timeTaken.TotalMilliseconds > 20000)
|
||||||
Beaprint.PrintDebugLine($"\nThe regex {regex.regex} took {timeTaken.TotalMilliseconds}s in {f.FullPath}");
|
Beaprint.PrintDebugLine($"\nThe regex {regex.regex} took {timeTaken.TotalMilliseconds}s in {f.FullPath}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user