Skip to content

Commit 3df23c6

Browse files
committed
Update pSSL.ps1
1 parent 19516be commit 3df23c6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pSSL.ps1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
$targetDomain = Read-Host "Enter the target domain name"
22
$pwd = Get-Location
33
(Invoke-WebRequest -Uri "https://crt.sh/?q=%.$targetDomain&output=json" -Method Get -UserAgent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0').Content | Out-File $pwd\$targetDomain-ct-log.json -Encoding utf8 -Force
4-
get-content $pwd\$targetDomain-ct-log.json | ConvertFrom-Json | Sort-Object -Unique | Sort-Object -Property name_value -Descending | Format-Table -Wrap -AutoSize -Property name_value | grep -o -P "^[a-zA-Z0-9.-_]*.[a-zA-Z0-9]$" | Sort-Object -Unique | Out-String -Stream
5-
get-content $pwd\$targetDomain-ct-log.json | ConvertFrom-Json | Sort-Object -Unique | Sort-Object -Property name_value -Descending | Format-Table -Wrap -AutoSize -Property name_value | grep -o -P "^[a-zA-Z0-9.-_]*.[a-zA-Z0-9]$"| Sort-Object -Unique | Out-String -Stream | more
6-
$domainNames = ( get-content $pwd\$targetDomain-ct-log.json | ConvertFrom-Json | Sort-Object -Unique | Sort-Object -Property name_value -Descending | Format-Table -Wrap -AutoSize -Property name_value | grep -o -P "^[a-zA-Z0-9.-_]*.[a-zA-Z0-9]$" | Sort-Object -Unique | Out-String -Stream )
4+
get-content $pwd\$targetDomain-ct-log.json | ConvertFrom-Json | Sort-Object -Unique | Sort-Object -Property name_value -Descending | Format-Table -Wrap -AutoSize -Property name_value | grep -o -P "^[a-zA-Z0-9].*" | Sort-Object -Unique | Out-String -Stream
5+
get-content $pwd\$targetDomain-ct-log.json | ConvertFrom-Json | Sort-Object -Unique | Sort-Object -Property name_value -Descending | Format-Table -Wrap -AutoSize -Property name_value | grep -o -P "^[a-zA-Z0-9].*" | Sort-Object -Unique | Out-String -Stream | more
6+
$domainNames = ( get-content $pwd\$targetDomain-ct-log.json | ConvertFrom-Json | Sort-Object -Unique | Sort-Object -Property name_value -Descending | Format-Table -Wrap -AutoSize -Property name_value | grep -o -P "^[a-zA-Z0-9].*" | Sort-Object -Unique | Out-String -Stream )
77
New-Item -ItemType File $pwd\$targetDomain-enumerated-pssl.txt -Force
88
foreach ($domainName in $domainNames){ Invoke-RestMethod -ErrorAction Ignore -Method Get https://dns.google/resolve?name=$domainName | Select-Object -ExpandProperty Answer -ErrorAction Ignore | Format-Table -Wrap -AutoSize -Property "name","data" -HideTableHeaders | Tee-Object $pwd\$targetDomain-enumerated-pssl.txt -Append -ErrorAction Ignore }
99
Write-Host " "
1010
Write-Host "Formatting Results to Table..." -ForegroundColor Red
1111
Write-Host " "
12-
Get-Content $pwd\$targetDomain-enumerated-pssl.txt | grep "^[a-zA-Z0-9.-_]*.[a-zA-Z0-9]$" | Out-File $pwd\$targetDomain-hostname-table-pssl.txt -Force utf8
12+
Get-Content $pwd\$targetDomain-enumerated-pssl.txt | grep "[a-zA-Z0-9]" | Out-File $pwd\$targetDomain-hostname-table-pssl.txt -Force utf8
1313
Get-Content $pwd\$targetDomain-hostname-table-pssl.txt
1414
Write-Host " "
1515
Write-Host "Parsing source IPv4 addresses..." -ForegroundColor Red
1616
Write-Host " "
17-
Get-Content $pwd\$targetDomain-hostname-table-pssl.txt | awk -F ' ' '{ print $2 }' | grep -o -P "^[0-9].*[.].*" | Sort-Object -Unique | Out-File $pwd\$targetDomain-enumeration-list-ipv4-addrs.txt utf8 -Force
18-
Get-Content $pwd\$targetDomain-hostname-table-pssl.txt | awk -F ' ' '{ print $2 }' | grep -o -P "^[0-9].*[.].*" | Sort-Object -Unique | awk -F ' ' '{ print }{++cnt} END { print cnt }'
17+
Get-Content $pwd\$targetDomain-hostname-table-pssl.txt | awk -F ' ' '{ print $2 }' | grep -o -P "^[0-9].*" | Sort-Object -Unique | Out-File $pwd\$targetDomain-enumeration-list-ipv4-addrs.txt utf8 -Force
18+
Get-Content $pwd\$targetDomain-hostname-table-pssl.txt | awk -F ' ' '{ print $2 }' | grep -o -P "^[0-9].*" | Sort-Object -Unique | awk -F ' ' '{ print }{++cnt} END { print cnt }'
1919
Write-Host " "
2020
Write-Host "Results saved to the following locations: " -ForegroundColor Red
2121
Write-Host "$pwd\$targetDomain-ct-log.json"

0 commit comments

Comments
 (0)