Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Download a list of Tor exit nodes
- Invoke-WebRequest -Uri "https://check.torproject.org/exit-addresses" -OutFile "$env:TEMP\tor-exit-nodes.txt"
- # Extract IP addresses from the file
- $torIPs = Get-Content "$env:TEMP\tor-exit-nodes.txt" | Select-String -Pattern "ExitAddress" | ForEach-Object { $_.ToString().Split(" ")[1] }
- # Create firewall rules to block Tor exit nodes
- foreach ($ip in $torIPs) {
- New-NetFirewallRule -DisplayName "Block Tor - $ip" -Direction Inbound -Action Block -RemoteAddress $ip
- New-NetFirewallRule -DisplayName "Block Tor - $ip" -Direction Outbound -Action Block -RemoteAddress $ip
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement