Skip to content

Commit 72c475a

Browse files
committed
Fix public suffix caching & add banner
1 parent 78121d6 commit 72c475a

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

Subdominator/Program.cs

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using CsvHelper;
88
using CsvHelper.Configuration;
99
using Nager.PublicSuffix.RuleProviders;
10-
using System.Net.Http;
1110
using Nager.PublicSuffix.RuleProviders.CacheProviders;
1211
using Microsoft.Extensions.Configuration;
1312

@@ -17,6 +16,7 @@ public class Program
1716
{
1817
private static readonly object _fileLock = new();
1918
private static StreamWriter? _outputFileWriter = null;
19+
private static readonly string _version = "v1.71";
2020

2121
public static async Task Main(string[] args = null)
2222
{
@@ -32,8 +32,8 @@ public static async Task Main(string[] args = null)
3232
new Option<int>(["-t", "--threads"], () => 50, "Number of domains to check at once"),
3333
new Option<bool>(["-v", "--verbose"], "Print extra information"),
3434
new Option<bool>(["-q", "--quiet"], "Quiet mode: Only print found results"),
35-
new Option<bool>(["-eu", "--exclude-unlikely"], "Exclude unlikely (edge-case) fingerprints"),
3635
new Option<string>(["-c", "--csv"], "Heading or column index to parse for CSV file. Forces -l to read as CSV instead of line-delimited") { Name = "CsvHeading" },
36+
new Option<bool>(["-eu", "--exclude-unlikely"], "Exclude unlikely (edge-case) fingerprints"),
3737
new Option<bool>(["--validate"], "Validate the takeovers are exploitable (where possible)")
3838
};
3939

@@ -48,6 +48,21 @@ public static async Task Main(string[] args = null)
4848

4949
public static async Task RunSubdominator(Options o)
5050
{
51+
// Print banner!
52+
if (!o.Quiet)
53+
{
54+
Console.WriteLine(@$"
55+
56+
_____ _ _ _ _
57+
/ ___| | | | | (_) | |
58+
\ `--. _ _| |__ __| | ___ _ __ ___ _ _ __ __ _| |_ ___ _ __
59+
`--. \ | | | '_ \ / _` |/ _ \| '_ ` _ \| | '_ \ / _` | __/ _ \| '__|
60+
/\__/ / |_| | |_) | (_| | (_) | | | | | | | | | | (_| | || (_) | |
61+
\____/ \__,_|_.__/ \__,_|\___/|_| |_| |_|_|_| |_|\__,_|\__\___/|_|
62+
{_version} | stratussecurity.com
63+
");
64+
}
65+
5166
// Get domain(s) from the options
5267
var rawDomains = new List<string>();
5368
if (!string.IsNullOrEmpty(o.DomainsFile))
@@ -199,10 +214,9 @@ static async Task<IEnumerable<string>> FilterAndNormalizeDomains(List<string> do
199214
])
200215
.Build();
201216
var cacheProvider = new LocalFileSystemCacheProvider();
202-
var ruleProvider = new CachedHttpRuleProvider(cacheProvider, new HttpClient());
203-
204-
await ruleProvider.BuildAsync();
217+
var ruleProvider = new CachedHttpRuleProvider(cacheProvider, new HttpClient(), configuration);
205218
var domainParser = new DomainParser(ruleProvider);
219+
await ruleProvider.BuildAsync();
206220

207221
// Normalize domains and check validity
208222
var normalizedDomains = domains

Subdominator/SubdomainHijack.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ public SubdomainHijack(int httpTimeout = 5)
145145
])
146146
.Build();
147147
var cacheProvider = new LocalFileSystemCacheProvider();
148-
var ruleProvider = new CachedHttpRuleProvider(cacheProvider, new HttpClient());
149-
ruleProvider.BuildAsync().GetAwaiter().GetResult();
148+
var ruleProvider = new CachedHttpRuleProvider(cacheProvider, new HttpClient(), configuration);
150149
_domainParser = new DomainParser(ruleProvider);
150+
ruleProvider.BuildAsync().GetAwaiter().GetResult();
151151
}
152152

153153
public async Task<IEnumerable<Fingerprint>> GetFingerprintsAsync(bool excludeUnlikely, bool update = false)

0 commit comments

Comments
 (0)