-
Notifications
You must be signed in to change notification settings - Fork 33
/
Search-Crtsh.ps1
45 lines (37 loc) · 1.15 KB
/
Search-Crtsh.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<#
.SYNOPSIS
Gather Open-Source Intelligence using PowerShell.
.DESCRIPTION
Gather Open-Source Intelligence from Certificate Search using PowerShell.
.EXAMPLE
Search-Crtsh -Query jotugaedorm.com -Wildcard | Format-List
issuer_ca_id : 12922
issuer_name : C=US, ST=TX, L=Houston, O="cPanel, Inc.", CN="cPanel, Inc. Certification Authority"
name_value : cpanel.jotugaedorm.com
min_cert_id : 1179646010
min_entry_timestamp : 2/6/19 9:46:22 PM
not_before : 2/6/19 12:00:00 AM
not_after : 5/7/19 11:59:59 PM
...
.LINK
https://github.com/ecstatic-nobel/pOSINT/
#>
function Search-Crtsh {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$Query,
[Parameter(Mandatory=$false)]
[switch]$Wildcard
)
Begin {
Set-SslDefaults
Set-ModuleDefaults
if ($Wildcard) {
$Query = "%25.$Query"
}
$Uri = "https://crt.sh/`?q=$Query&output=json".ToLower()
}
Process {Search-Api}
End {Reset-SslDefaults; Write-Verbose "Complete"}
}