Nun zu meinem Problem, ich möchte ,dass nach jedem restart von dem tor-service die aktuelle IP angezeigt wird, mir wird aber nur die ursprüngliche IP präsentiert.
Code: Alles auswählen
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
def disable(self):
self.HEADER = ''
self.OKBLUE = ''
self.OKGREEN = ''
self.WARNING = ''
self.FAIL = ''
self.ENDC = ''
import os
import signal
import sys
import time
from json import load
from urllib2 import urlopen
my_ip = load(urlopen('https://api.ipify.org/?format=json'))['ip']
path = "/etc/init.d/tor"
patha = "/etc/init.d/anonsurf"
pathb = "/etc/proxychains.conf"
#ipaddr = os.system('wget http://ipinfo.io/ip -qO -')
print ""
print "####################################"
print "# TOR-Buddy(Python version) #"
print "####################################"
print "# Nilssen Ramanathan Techsoft Inc. #"
print "# code by Michael Cichosz #"
print "####################################"
print "credits: idea from Tor-Buddy by AfterBurn @ NetSecNow"
print "recode in python by Michael Cichosz"
print ""
print ""
print "checking for anonsurf..."
if os.path.exists(patha):
print(bcolors.OKGREEN + "%s exists!" % (patha) + bcolors.ENDC)
else:
print(bcolors.FAIL + "%s not found!" % (patha) + bcolors.ENDC)
os.system('anonsurf start')
print ""
print "checking for TOR..."
if os.path.exists(path):
print(bcolors.OKGREEN + "%s exists!" % (path) + bcolors.ENDC)
else:
print(bcolors.FAIL + "%s not found!" % (path) + bcolors.ENDC)
os.system('service tor start')
print ""
print "checking for proxychains"
if os.path.isfile(pathb):
print(bcolors.OKGREEN + "%s exists!" % (pathb) + bcolors.ENDC)
else:
print(bcolors.FAIL + "%s not found!" % (pathb)+ bcolors.ENDC)
print ""
x = input("Please enter how many seconds you want to grab a new IP: ")
print (x),"Seconds IP will be changed"
from twisted.internet import task
from twisted.internet import reactor
timeout = x # x seconds
def doWork():
os.system('service tor restart')
pass
l = task.LoopingCall(doWork)
l.start(timeout) # call every x seconds
time.sleep(5)
print "Your current public IP:",my_ip
reactor.run()
terminate = False
def signal_handling(signum,frame):
global terminate
terminate = True
signal.signal(signal.SIGINT,signal_handling)
x=1
while True:
print "Press Control+C to exit script"
time.sleep(5)
x+=1
if terminate:
os.system('anonsurf stop')
break
time.sleep(5)
print "Thanks for using my Script"
print "Your current public IP:",my_ip
https://sourceforge.net/projects/linuxs ... Tor-Buddy/
danke
gruss micha