connect to tor from windows

0

I have raised tor in a virtual machine in centos, I am using python in a program from windows, I want my python program to connect to the tor instance of the server but I can not make it work:

program.py

proxy = {
            'http': 'socks5h://192.168.1.200:9050',
            'https': 'socks5h://192.168.1.200:9050'
}

url = requests.get(urls, verify=True, headers=headers, proxies=proxy)

It returns the following error:

Traceback (most recent call last):
  File "C:\Users\Administrador\AppData\Local\Programs\Python37-32\lib\site-packages\socks.py", line 787, in connect
    super(socksocket, self).connect(proxy_addr)
ConnectionRefusedError: [WinError 10061] No se puede establecer una conexión ya que el equipo de destino denegó expresamente dicha conexión

I have a firewall down and selinux down,someone knows what's up

user1054109

Posted 2019-09-09T15:38:56.883

Reputation:

Answers

1

Socket error 10061 means it tries to connect and eventually times out. Usually this means that it can't find the network.

Given that you are using a Virtual Machine, it is likely that the VM uses NAT translation in order to shield itself from your network. If that is indeed the case, you either need to allow port 9050 from the host to the guest, or you need to change the Virtual Networkcard settings to not use NAT translation, but set it in bridged mode, so the virtual machine joins your network. Do note that the last one is much easier to accomplish, but also means that the machine is as vulnerable as the rest of your pc's in your network, and if someone hacks your VM, they can access everything in your network too.

This is especially bad if you use your VM to test out stuff and consider it a shielded environment and thus are not afraid for viruses, because suddenly they can access your network and for example with encryption viruses, encrypt all your files.

EDIT: Because you did not specify what VM solution you are using, I am assuming you will be able to figure out how to change this, and I won't write a comprehensive guide for every single VM solution out there, hoping yours is included.

LPChip

Posted 2019-09-09T15:38:56.883

Reputation: 42 190