I need to send a HTTP POST request using TOR. Since TOR only supports SOCKS, I need POLIPO to redirect HTTP requests trough SOCKS in TOR.
So I'm using this piece of code in python, to send things through POLIPO
Code: Select all
conn = http.client.HTTPConnection("localhost",8123)
conn.set_tunnel("wikipedia.org", 80)
However, when I send some request with python, things get strange.
Here's my full code:
Code: Select all
import http.client, urllib.parse
import time
import sys
nome = "something..."
print("some text for my program \n \n")
numero_da_vitima = input("Number of requests: ")
total_de_ligacoes = int(input("Quantas ligações deseja fazer? "))
intervalo = int(input("Interval in seconds? "))
porta_tor = int(input("POLIPO PORT"))
headers = {"Content-type": "application/x-www-form-urlencoded",
"Accept": "text/plain"}
conn = http.client.HTTPConnection("localhost",porta_tor)
conn.set_tunnel("wikipedia.org", 80)
def ligar(telefone):
params = urllib.parse.urlencode({'Nome': nome, 'Telefone': telefone})
conn.request("POST", "", params, headers)
response = conn.getresponse()
print(response.read().decode('utf-8'))
conn.close()
def atazanar():
i = 0
while (i<total_de_ligacoes):
print("ligando para "+numero_da_vitima)
ligar(numero_da_vitima)
print("\n aguardando para próxima chamada\n")
time.sleep(intervalo)
i = i+1
atazanar()
Domain not configured
This domain points to a Wikimedia Foundation server, but is not configured on this server.
I know wikipedia.org shouldn't respond to POST but even when I try some website that accepts POST, like this example of ws3schools:
http://www.w3schools.com/tags/demo_form_method.asp
I get this:
Code: Select all
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a HREF="http://www.w3schools.com/tags/demo_form_method.asp">here</a></body>