File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 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.-_]" | 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 )
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 )
77New-Item - ItemType File $pwd \$targetDomain - enumerated- pssl.txt - Force
88foreach ($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 }
99Write-Host " "
1010Write-Host " Formatting Results to Table..." - ForegroundColor Red
1111Write-Host " "
12- Get-Content $pwd \$targetDomain - enumerated- pssl.txt | grep " [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.-_]*.[a-zA-Z0-9]$ " | Out-File $pwd \$targetDomain - hostname- table- pssl.txt - Force utf8
1313Get-Content $pwd \$targetDomain - hostname- table- pssl.txt
1414Write-Host " "
1515Write-Host " Parsing source IPv4 addresses..." - ForegroundColor Red
You can’t perform that action at this time.
0 commit comments