# --- Configuration -----------------------------------------------------------
$ApiUrl = 'https://socradar.io/free-tools/api/fortibleed/search-fortibleed'
$InputFile = 'ftglist.txt'
$OutputFile = 'results.csv'
$BaseDelay = 10 # seconds between requests
$MaxExtraDelay = 5 # max additional random seconds added to BaseDelay
# Paste your browser cookie string here if you get 401/403 responses.
# Firefox: F12 -> Network -> trigger a check -> click the POST request ->
# Headers tab -> copy the full 'Cookie' request header value.
$Cookie = ''
# -----------------------------------------------------------------------------
$entries = Get-Content -Path $InputFile |
Where-Object { $_ -match '\S' } |
ForEach-Object {
if ($_ -match '^\d+\t(.+)$') { $Matches[1].Trim() } else { $_.Trim() }
}
if (-not $entries) {
Write-Warning "No entries found in $InputFile. Exiting."
exit 1
}
$results = [System.Collections.Generic.List[PSCustomObject]]::new()
for ($i = 0; $i -lt $entries.Count; $i++) {
$entry = $entries[$i]
Write-Host "[$($i + 1)/$($entries.Count)] Checking: $entry"
$requestParams = @{
Uri = $ApiUrl
Method = 'Post'
Body = (@{ query = $entry } | ConvertTo-Json -Compress)
ContentType = 'application/json'
Headers = @{
'Accept' = 'application/json'
'Referer' = 'https://socradar.io/free-tools/fortibleed'
'Origin' = 'https://socradar.io'
}
}
if ($Cookie) {
$requestParams.Headers['Cookie'] = $Cookie
}
$detected = 'error'
try {
$response = Invoke-RestMethod @requestParams
$detected = [string]$response.data.is_detected
} catch {
Write-Warning " Request failed: $_"
}
Write-Host " Detected: $detected"
$results.Add([PSCustomObject]@{
IPorURL = $entry
Detected = $detected
})
if ($i -lt $entries.Count - 1) {
$delay = $BaseDelay + (Get-Random -Minimum 0 -Maximum ($MaxExtraDelay + 1))
Write-Host " Waiting $delay seconds before next request...`n"
Start-Sleep -Seconds $delay
}
}
$results | Export-Csv -Path $OutputFile -NoTypeInformation -append
Write-Host "`nDone. Results saved to $OutputFile"