@@ -3,7 +3,7 @@ function Get-SSLCertInfo-CTFR
3
3
<#
4
4
Script: Get-SSLCertInfo-CTFR
5
5
6
- Version: 2.3
6
+ Version: 2.4
7
7
8
8
Description
9
9
This script can be used to download domain name information
@@ -141,7 +141,11 @@ function Get-SSLCertInfo-CTFR
141
141
142
142
}
143
143
144
- # For return a list of Resolved IPs
144
+ # For tracking domain list
145
+ $DomainsTbl = New-Object System.Data.DataTable
146
+ $DomainsTbl.Columns.Add (" Domain" ) | Out-Null
147
+
148
+ # For returning a list of Resolved IPs
145
149
$DomainsFound = New-Object System.Data.DataTable
146
150
$DomainsFound.Columns.Add (" Domain" ) | Out-Null
147
151
$DomainsFound.Columns.Add (" CertDomain" ) | Out-Null
@@ -168,7 +172,11 @@ function Get-SSLCertInfo-CTFR
168
172
if ((Test-Path $domainList )){
169
173
170
174
$ProvidedDomains = gc $domainList
171
- $DomainCount = $ProvidedDomains.count
175
+ $ProvidedDomains |
176
+ ForEach-Object {
177
+ $DomainsTbl.Rows.Add ($_ ) | Out-Null
178
+ }
179
+ $DomainCount = $DomainsTbl.Rows.Count
172
180
Write-Verbose " Imported $DomainCount domain/keyword targets from the provided file."
173
181
}else {
174
182
Write-Verbose " Couldn't find $domainList , aborting."
@@ -178,7 +186,7 @@ function Get-SSLCertInfo-CTFR
178
186
179
187
# Append domains to list of
180
188
if ($domain ){
181
- $ProvidedDomains += " $domain "
189
+ $DomainsTbl .Rows.Add ( " $domain " ) | Out-Null
182
190
Write-Verbose " Imported 1 domain/keyword targets from command line."
183
191
}
184
192
}
@@ -187,16 +195,20 @@ function Get-SSLCertInfo-CTFR
187
195
{
188
196
# Append pipline domains to list of
189
197
if ($_ ){
190
- $ProvidedDomains += " $_ "
191
- Write-Verbose " Imported 1 domain targets from pipeline."
198
+ $DomainsTbl.Rows.Add (" $domain " ) | Out-Null
192
199
}
193
200
201
+
202
+ }
203
+
204
+ End
205
+ {
194
206
# Check for list of targets
195
- if (-not $ProvidedDomains ){
207
+ if ($DomainsTbl .Rows.Count -eq 0 ){
196
208
Write-Verbose " No targets have been provided, aborting."
197
209
# break
198
210
}else {
199
- $ProvidedDomains = $ProvidedDomains | Select - Unique
211
+ $ProvidedDomains = $DomainsTbl | Select Domain - ExpandProperty Domain - Unique
200
212
$DomainCount = $ProvidedDomains.count
201
213
Write-Verbose " Targeting $DomainCount unique domains/keywords."
202
214
}
@@ -467,11 +479,7 @@ function Get-SSLCertInfo-CTFR
467
479
$doc | Out-File $outfileName
468
480
}
469
481
470
- }
471
- }
472
-
473
- End
474
- {
482
+ }
475
483
# Check for potential ad domains
476
484
if ($ShowAdDomains ){
477
485
0 commit comments