2015-01-31 4 views
1

I 줄기를 이용하여 토르 세션에서 새로운 IP를 얻으려고하고 크게 this answer에 의해 '영감'는 다음과 같은 기능을 통해 파이썬 새로운 IP를 얻을 수 없습니다줄기 - 토르

def get_new_IP(): 
    socket.socket = old_socket 
    with Controller.from_port(port=SOCKS_PORT) as controller: 
     controller.authenticate() 
     controller.signal(Signal.NEWNYM) 
    socket.socket = socks.socksocket 

그러나 오류 'IncorrectSocketType : 제어 소켓을 사용할 수 없습니다'암호가 지정되지 않았거나 초기 연결이 설정되어 있기 때문에 약간의 손실이있는 controller.authenticate()에 의해 발생합니다.

tor 프로세스를 시작할 때 'CookieAuthentication': str(1), as suggested here을 구성 설정에 추가하려고 시도했지만 작동하지 않습니다.

어떻게 초기 연결이 작동하며 다시 연결하려고하면 인증을받을 수없는 이유는 무엇입니까?

답변

4

Controller.from_port()는 torrc에 정의 된대로 SocksPort가 아닌 ControlPort에 연결되어야합니다 (ControlPort는 Stem과 통신하며 SocksPort는 Firefox처럼 사용하는 응용 프로그램입니다). 자전거 IP를 네트워크에 부담을두고 있기 때문에 자제를 보여주십시오 대한 질문에서 설명하고있는 바와 같이

https://stem.torproject.org/tutorials/the_little_relay_that_could.html

...

https://stem.torproject.org/faq.html#how-do-i-request-a-new-identity-from-tor