@ -1,4 +1,4 @@
using System ;
using System ;
using System.Linq ;
using System.Net ;
using System.Text.RegularExpressions ;
@ -11,7 +11,7 @@ namespace NzbDrone.Common.Instrumentation
private static readonly Regex [ ] CleansingRules = new [ ]
{
// Url
new Regex ( @"(?<=[?&: ;])( apikey|(?:access[-_]?)?token|pass(?:key|wd)?|auth|authkey|user|u?id|api|[a-z_]*apikey|refresh_token|account|pwd)=(?<secret>[^&=]+?)(?= |& |$)", RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
new Regex ( @"(?<=[?&: ;])( (?:api|auth|pass)?key|(?:access[-_]?|refresh_)?token|auth|user|u?id|api|[a-z_]*apikey|account|passwd|pwd)=(?<secret>[^&=""]+?)(?=[ ""&=] |$)", RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
new Regex ( @"(?<=[?& ])[^=]*?(username|passwo?rd)=(?<secret>[^&=]+?)(?= |&|$)" , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
new Regex ( @"torrentleech\.org/(?!rss)(?<secret>[0-9a-z]+)" , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
new Regex ( @"torrentleech\.org/rss/download/[0-9]+/(?<secret>[0-9a-z]+)" , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
@ -19,6 +19,9 @@ namespace NzbDrone.Common.Instrumentation
new Regex ( @"/fetch/[a-z0-9]{32}/(?<secret>[a-z0-9]{32})" , RegexOptions . Compiled ) ,
new Regex ( @"getnzb.*?(?<=\?|&)(r)=(?<secret>[^&=]+?)(?= |&|$)" , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
// Trackers Announce Keys; Designed for Qbit Json; should work for all in theory
new Regex ( @"announce(\.php)?(/|%2f|%3fpasskey%3d)(?<secret>[a-z0-9]{16,})|(?<secret>[a-z0-9]{16,})(/|%2f)announce" ) ,
// Path
new Regex ( @"C:\\Users\\(?<secret>[^\""]+?)(\\|$)" , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
new Regex ( @"/home/(?<secret>[^/""]+?)(/|$)" , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
@ -48,6 +51,10 @@ namespace NzbDrone.Common.Instrumentation
// Plex
new Regex ( @"(?<=\?|&)(X-Plex-Client-Identifier|X-Plex-Token)=(?<secret>[^&=]+?)(?= |&|$)" , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
// Webhooks
// Notifiarr
new Regex ( @"api/v[0-9]/notification/sonarr/(?<secret>[\w-]+)" , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
// Indexer Responses
new Regex ( @"avistaz\.[a-z]{2,3}\\\/rss\\\/download\\\/(?<secret>[^&=]+?)\\\/(?<secret>[^&=]+?)\.torrent" , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,
new Regex ( @",""info_hash"":""(?<secret>[^&=]+?)""," , RegexOptions . Compiled | RegexOptions . IgnoreCase ) ,