This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$FileList = (Get-ChildItem 'C:\Users\Dern\Desktop\DNSSCAN\Batchtest').fullname | |
$c1 = 0 | |
$lineamount = | |
$m = Get-Content -Path $FileList | Measure-Object -line | |
@($m).lines | |
$myOutput = @() # Declare empty array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
$domainname = ( | |
"testmappe.dk", | |
"testmappe2.dk" | |
), | |
$fullremotepathdelete = $remotepathsdelete, | |
$fileNameDelete = "*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
$localPath = "C:\Users\Dern\Desktop\WINSCP PS DOWNLOAD\", | |
$remotePath = ("jonatantest/","jonatantest2/"), | |
$fileName = "wp-config-sample.php" | |
) | |
try | |
{ | |
# Load WinSCP .NET assembly | |
Add-Type -Path "C:\Users\Dern\Desktop\WINSCP PS\WinSCPnet.dll" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
$localPath = "C:\Users\Dern\Desktop\WINSCP PS DOWNLOAD\", | |
$remotePath = ("jonatantest/","jonatantest2/"), | |
$fileName = "wp-config-sample.php" | |
) | |
try | |
{ | |
# Load WinSCP .NET assembly | |
Add-Type -Path "C:\Users\Dern\Desktop\WINSCP PS\WinSCPnet.dll" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
$localPath = "C:\Users\Dern\Desktop\WINSCP PS DOWNLOAD\", | |
$remotePath = "jonatantest/", | |
$fileName = "wp-config-sample.php" | |
) | |
try | |
{ | |
# Load WinSCP .NET assembly | |
Add-Type -Path "C:\Users\Dern\Desktop\WINSCP PS\WinSCPnet.dll" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$FileList = (Get-ChildItem 'C:\Users\Dern\Desktop\Searchtarget\searchtargetlist.txt').fullname | |
foreach ($FileName in $FileList) { | |
try | |
{ | |
# Load WinSCP .NET assembly | |
Add-Type -Path "C:\Users\Dern\Desktop\WINSCP PS\WinSCPnet.dll" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
# Load WinSCP .NET assembly | |
Add-Type -Path "C:\Users\Dern\Desktop\WINSCP PS\WinSCPnet.dll" | |
# Setup session options | |
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{ | |
Protocol = [WinSCP.Protocol]::ftp | |
HostName = "xxx" | |
UserName = "xx.dk" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
# Load WinSCP .NET assembly | |
Add-Type -Path "C:\Users\Dern\Desktop\WINSCP PS\WinSCPnet.dll" | |
# Setup session options | |
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{ | |
Protocol = [WinSCP.Protocol]::ftp | |
HostName = "xxxxxxxxxxxxx.com" | |
UserName = "xxx.dk" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$FileList = (Get-ChildItem 'C:\Users\jonat\Desktop\DNS PROCCESSING\Batchtest\*.txt').fullname | |
$myOutput = @() # Declare empty array | |
foreach ($FileName in $FileList) { | |
$myOutput += foreach ($DomainName in (Get-Content $FileName)) { | |
try { | |
$NSRecords = Resolve-DnsName $DomainName -Type NS -EA 1 | Where-Object { $_.QueryType -eq 'NS' } | |
$DomainFinal = (Invoke-WebRequest -Uri $DomainName -UseBasicParsing).BaseResponse.ResponseUri.AbsoluteUri -replace "https://" -replace "http://" -replace "www." -replace ".dk/", ".dk" -replace ".com/", ".com" | |
[PSCustomObject]@{ | |
Resolved = $true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$FileList = (Get-ChildItem 'C:\Users\jonat\Desktop\DNS PROCCESSING\Batchtest\*.txt').fullname | |
$myOutput = @() # Declare empty array | |
foreach ($FileName in $FileList) { | |
$myOutput += foreach ($DomainName in (Get-Content $FileName)) { | |
try { | |
$NSRecords = Resolve-DnsName $DomainName -Type NS -EA 1 | Where-Object { $_.QueryType -eq 'NS' } | |
[PSCustomObject]@{ | |
Resolved = $true | |
Rmatch = $DomainName -match $Domainfinal |
NewerOlder