-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy_check.ps1
More file actions
43 lines (34 loc) · 1.36 KB
/
Copy pathproxy_check.ps1
File metadata and controls
43 lines (34 loc) · 1.36 KB
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
$proxyList = Get-Content "proxies.txt"
$outputFile = "mxtoolbox_output.txt"
$customUserAgent = "YourCustomUserAgent/1.0"
$yourApiKey = "aaaaaaaaaaaaaaa"
$outputLines = @()
foreach ($proxy in $proxyList) {
try {
$curlCommand = "curl.exe --socks5 $proxy --max-time 10 -H 'User-Agent: $customUserAgent' 'https://api.ipify.org?format=json'"
$ipResponseJson = Invoke-Expression $curlCommand
if ($ipResponseJson) {
$ipResponse = $ipResponseJson | ConvertFrom-Json
$realIP = $ipResponse.ip
$outputLines += "$proxy -> IP: $realIP"
$headers = @{
"Authorization" = $yourApiKey
"Accept" = "application/json"
"User-Agent" = $customUserAgent
}
$mxtoolboxUri = "https://api.mxtoolbox.com/api/v1/Lookup/Blacklist/?argument=$realIP"
$mxtoolboxResult = Invoke-RestMethod -Uri $mxtoolboxUri -Headers $headers -Method Get
$failedCount = $mxtoolboxResult.Failed.Count
$warningCount = $mxtoolboxResult.Warnings.Count
$outputLines += " Failed: $failedCount, Warning: $warningCount"
}
else {
$outputLines += "$proxy - ipify Error"
}
}
catch {
$outputLines += "$proxy - unknown Error"
}
}
$outputLines | Out-File -Encoding UTF8 $outputFile
Write-Output "Writed: $outputFile"