Python + TOR [problem]

Ovo je dio skripte za kreiranje accounta i ta skripta radi

def create_account(username, password):
#set up profile for proxy
profile = webdriver.FirefoxProfile()
profile.set_preference("network.proxy.type", 1)
profile.set_preference("network.proxy.socks", '127.0.0.1')
profile.set_preference("network.proxy.socks_port", 9050)
profile.set_preference("network.proxy.socks_remote_dns", True)
profile.update_preferences()
browser = webdriver.Firefox(firefox_profile=profile)

def main():
os.system(‘clear’)
#run account generator for each user in list
created = open(createdUserNamePasswordFile, ‘a’)
creds = [cred.strip() for cred in open(userNamePasswordFile).readlines()]
for cred in creds:
username, password = cred.split(’:’)
print(’[+] creating account for %s with password %s’ % (username,password))
account_created = create_account(username, password)
print(’[+] restarting tor for a new ip address…’)
os.system(‘service tor restart’)
if account_created:
print(’[+] writing name:password to created names…’)
created.write(username + ‘:’ + password + ‘\n’)
print(’[+] deleting name:password from original file…’)
lines = [line.strip() for line in open(userNamePasswordFile).readlines()]
f = open(userNamePasswordFile, ‘w’)
for line in lines:
if (line != cred):
f.write(line + “\n”)
f.close()
else:
print(’[-] name not recorded due to captcha issue’)
time.sleep(2)
os.system(‘clear’)
created.close()

main()

Eh sad mene zanima kako bih mogao pokrenuti mozillu preko TORa kao iz prvog dijela skripte samo sto u ovom drugom .py fileu se ne radi o registraciji racuna.


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Profit Monkey