Advertisement
Guest User

ProxySwitcher Windows 10

a guest
Jan 28th, 2021
721
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. ## Property of script kiddie kurkos1444
  2. import winreg as winreg
  3. import os
  4. import sched, time
  5. import random
  6. import ctypes
  7.  
  8. INTERNET_OPTION_REFRESH = 37
  9. INTERNET_OPTION_SETTINGS_CHANGED = 39
  10.  
  11. internet_set_option = ctypes.windll.Wininet.InternetSetOptionW
  12.  
  13. proxystr =[u"198.199.86.11:3128", ####### PROXIES GO HERE. When adding a proxy you must add a prefix u/"x.x.x.x.:8xxx"
  14. u"150.95.178.151:8888",
  15. u"198.50.163.192:3129",
  16. u"161.35.70.249:8080",
  17. u"103.134.254.18:80",
  18. u"142.93.38.73:8080"]
  19.  
  20.  
  21. s = sched.scheduler(time.time, time.sleep)
  22. os.chmod('tes.py', 0o777) ## ignore or remove this line if you get errors
  23. INTERNET_SETTINGS = winreg.OpenKey(winreg.HKEY_CURRENT_USER, r'SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings', 0, winreg.KEY_ALL_ACCESS)
  24.  
  25. def set_key(name, value):
  26. _, reg_type = winreg.QueryValueEx(INTERNET_SETTINGS, name)
  27. winreg.SetValueEx(INTERNET_SETTINGS, name, 0, reg_type, value)
  28.  
  29. set_key('ProxyEnable', 1)
  30.  
  31. def proxysw(sc):
  32. print ('PROXY SWITCHED!.... now refreshing')
  33. set_key('ProxyServer', random.choice(proxystr))
  34. internet_set_option(0, INTERNET_OPTION_SETTINGS_CHANGED, 0, 0)
  35. internet_set_option(0, INTERNET_OPTION_REFRESH, 0, 0)
  36. s.enter(200, 1, proxysw, (sc,)) ## change the 200 value to edit the interval 200 - 200 seconds
  37.  
  38. s.enter(200, 1, proxysw, (s,)) ## change this value aswell to change the interval
  39. s.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement